Scroller is not visible in original emWin example SCROLLER_Usage_DefaultWidgets.c

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Scroller is not visible in original emWin example SCROLLER_Usage_DefaultWidgets.c

      Hello to all,

      I need to scroll a Listview by swiping. I use emWin 6.32.
      So I tried this example:
      SCROLLER_Usage_DefaultWidgets.c kb.segger.com/SCROLLER_-_Usage_DefaultWidgets_(Sample)

      Because my resolution is 800*480 I extended the dummy text for the Listview, so defintely not all the lines fit on the screen.
      Thus a scrollbar IS NECESSARY.
      Swiping directly on the listview workes fine, but the attached Scroller is not displayed.
      The example code is 1:1 copied!
      In order to find the reason I modified the code and tried to create a scrollbar manually with SCROLLER_CreateUser(). This scroller is displayed.
      But as soon as a use SCROLLER_AttachToWindow() with the handle of the scroller (manually created), the scroller disapears.
      Why is the scroller in this context not capable to work together with a Listview?

      Thanks a lot for help
      Andreas

      The post was edited 1 time, last by Andy_AN2 ().

    • Hello,

      I found a similar example: kb.segger.com/SCROLLER_-_Custom_(Sample)
      which is identical, but has an OwnerDraw routine for the scroller.
      Thus I wanted to find out with a breakpoint in the routine why the scroller is not drawn.

      The ownerdraw function is called twice.
      first:
      command: 0x05 WIDGET_ITEM_DRAW_BACKGROUND
      Itemindex: 0x01 SCROLLER_CI_INACTIVE


      second:
      command: 0x01 WIDGET_ITEM_DRAW
      Itemindex: 0x01 SCROLLER_CI_INACTIVE

      I added these functions:

      SCROLLER_SetBkColor(hScroller,SCROLLER_CI_INACTIVE,GUI_RED);
      SCROLLER_SetBkColor(hScroller,SCROLLER_CI_ACTIVE,GUI_RED);

      But still the scroller is not drawn.


      Very irritating...


      Please help

      Andreas
    • The coordinates of pInfo Rectangle are:
      pInfo->x0 84
      pInfo->y0 -12 (0xFFFFFFF4)
      pInfo->x1 404
      pInfo->y1 4

      These numbers do not change if I change the dimensions of the parent Window (ListView).
      So they are not related to the parent at all, even though the scroller should be attached to the right edge...
      If these numbers are supposed to be positive only that would be an explanation why the rectangle can not be drawn...
    • New

      Hi Andreas,

      Please excuse the inconvenience, there was a bug in emWin V6.32 regarding the sizing and hiding of the SCROLLERs. The behavior you were experiencing was fixed with emWin V6.34.

      I would encourage you to update your emWin version to at least this version, but preferrably to the latest version 6.48.

      Best regards,
      Florian
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.