Hi
I would like to decompose the user's mouse action on a wxSlider in 3 phases :
- Action start : The user left click on the thumb of the wxSlider
- Action process : The user drag the thumb of the wxSlider
- Action end : The user release the mouse button
It is actually posssible to catch the "Action process" and "Action end" using the provided event handlers, but I don't see how to do the "Action start".
I can derive the wxSlider class if needed.
Many thanks
Rémi
Decomposing mouse action on a wxSlider Topic is solved
Re: Decomposing mouse action on a wxSlider
Isn't the first wxEVT_SCROLL_THUMBTRACK enough? At least under Windows, the underlying native control does not send an event as soon as the mouse button is pressed down. Only when the user starts dragging.
If you want that behaviour, you probably have to re-implement a whole slider from scratch.
If you want that behaviour, you probably have to re-implement a whole slider from scratch.
Use the source, Luke!
Re: Decomposing mouse action on a wxSlider
Yes but how to know that it is the first one ? One solution maybe would be to add a "state flag" that could be reseted at "release" event.
Is there some ways to store such a data (user data) inside a built-in wxSlider ? Or should I derive the class and add a member in it ?
Thanks
Is there some ways to store such a data (user data) inside a built-in wxSlider ? Or should I derive the class and add a member in it ?
Thanks
Re: Decomposing mouse action on a wxSlider
Yes, you'll need a flag somewhere. For a clean solution you can subclass wxSlider and handle it there. For most purposes it's probably sufficient to handle that in the parent frame (or wherever you handle he slider events).
Use the source, Luke!