Slider controls

Started by honkinberry, December 01, 2016, 01:29:43 PM

Previous topic - Next topic

honkinberry

I'm having some difficulty with the Slider controls.
Most imperatively -- the keyboard arrow keys are firing the Scroll event, which means that ReleasedCapture is not fired.
Where this is an issue, is that when operating with a mouse, the Scroll event is firing for every change, which results in a LOT of code fires.  When this is calling a complex operation that has multiple function levels, relying on global variables and recursion, it just wipes it out, as there will inevitably be a moment where apparently multiple instances of the same Lisp functions are running.  Or something like that.
So for Mouse operation, it's easy enough, to have the Scroll event only update the dialog box captions, and then wait for ReleaseCapture to run the primary code.
Which then becomes an issue, if the user would prefer to use the arrow keys, then ReleaseCapture is never fired.

I suppose my preference would be for arrow keys to only fire ReleaseCapture, leaving PageUp/PageDown to only fire Scroll.  But I do see how that is almost certainly not an option for what code it would affect.

In a code-only fix, I suppose I could do something with MouseMove, to tell the difference between a mouse-fired Scroll, and a keyboard-fired Scroll?  As in assuming that any Scroll event that occurs after a MouseMove ButtonUp, must be a Keyboard Scroll.  Does anyone have any similar experience/pointers in that regard?

Many thanks for any ideas!

--J

Fred Tomke

Hi, honkinberry, as a result of my own experiences I can recommend that the code behind ReleaseCapture should be as short as possible and should not cause any changes in the drawing.
For keyboard-based value changes I recommend to build a custom slider using picture control.
See here for some samples:
http://www.opendcl.com/forum/index.php?topic=994.0
http://www.opendcl.com/forum/index.php?topic=995.0

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]