EMWin Scrollbar problem

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

    • EMWin Scrollbar problem

      I am using the scrollbars across my app instead of sliders. They work very well. BUT.. occasionally, the scrollbars will not track your finger but will instead, start heading in the direction of the touch , in single increments and will block until they reach their destination on their own, very slowly. There is no way to stop it.

      Any ideas or suggestions?

      The post was edited 2 times, last by jona: I'd like to add that it exhibits this when you press on either side of the thumb and slide towards the buttons on either side. i've tried to mitigate it but maybe it is a feature. It might be helpful in another project but since it blocks for a long time, it interrupts use of this real time system. As well, it occurs if you press a button on either end and hold it for only a second or so. When you lift off, the slider is still moving. ().

    • More...

      When I invalidate other items on the dialog in the WM_NOTIFICATION_VALUE_CHANGED for the scrollbar, that is when the scrollbarcontinues to get INC or DEC messages from the WM.

      I have two rows of 8 buttons on the top of the window. The selected button is the only one that should get updated when the scrollbaris moved. Somehow, they all get invalidated and re-drawn, even if I only specify one of them. It seems that it is during that cycle that the scrollbar continually gets the message to move in the direction of whichever button is initially pressed.

      This only occurs if I hold the scrollbar button down for about a second. If it is a quick press and release, that doesn't occur.

      I have the numPages for the scrollbar set to the range of the particular parameter I am adjusting with the scrollbar.
    • UPDATE:

      Calling GUI_Exec() in the WM_NOTIFICATION_VALUE_CHANGED handler after invalidating a single button above solved the problem with the slider going off into no-man's land. BUT, the WM insists on invalidating much more than that single button. Giving up on that for now since I haven't any way to debug what emWin thinks the Invalidate size should be.

      The post was edited 1 time, last by jona: Can anyone explain why it was necessary to call GUI_Exec() to stop the scrollbar from blocking and running away? ().

    • Hi jona,

      this behavior sounds like when pressing and holding the left/right arrow keys of a scrollbar. I'm wondering, why are you using scrollbars instead of slider widgets? Slider widgets don't have left/right arrow keys on the edges, so the thumb would not be accidentally moved.

      Note that when calling WM_InvalidateWindow(), the window and all its child windows are redrawn, if the window is transparent. But the invalidation of your widgets could have a lot of reasons, I can't really tell without taking a look at the application.

      Calling GUI_Exec() isn't normally necessary since it's called automatically.

      Best regards,

    • Thank you for your response Florian.

      I use the scrollbars because it removes the necessity to add buttons on the left and right of a slider to increment or decrement the slider. As well, the scrollbar has an auto repeat feature built into it. I skinned the scrollbar appropriately and I am able to print values inside of the thumb. For the most part, they work very well. Though I did have that problem, which appears to be solved by adding the GUI_Exec().

      Yeah.. probably not the best approach but I was working with sliders for months and decided this was a better look and the extra functionality of the scrollbar added to the product.