wxscrolleventa scroll event holds information about events sent from stand-alone scrollbars and sliders. note that starting from wxwidgets 2.1, scrolled windows send the wxscrollwinevent which does not derive from wxcommandevent, but from wxevent directly - don't confuse these two kinds of events and use the event table macros mentioned below only for the scrollbar-like controls. derived from
wxcommandevent include files <wx/event.h> event table macros to process a scroll event, use these event handler macros to direct input to member functions that take a wxscrollevent argument. you can use evt_command_scroll... macros with window ids for when intercepting scroll events from controls, or evt_scroll... macros without window ids for intercepting scroll events from the receiving window -- except for this, the macros behave exactly the same.
the difference between evt_scroll_thumbrelease and evt_scroll_changed the evt_scroll_thumbrelease event is only emitted when actually dragging the thumb using the mouse and releasing it (this evt_scroll_thumbrelease event is also followed by an evt_scroll_changed event). the evt_scroll_changed event also occurs when using the keyboard to change the thumb position, and when clicking next to the thumb (in all these cases the evt_scroll_thumbrelease event does not happen). in short, the evt_scroll_changed event is triggered when scrolling/ moving has finished independently of the way it had started. please see the widgets sample ("slider" page) to see the difference between evt_scroll_thumbrelease and evt_scroll_changed in action. remarks note that unless specifying a scroll control identifier, you will need to test for scrollbar orientation with wxscrollevent::getorientation, since horizontal and vertical scroll events are processed using the same event handler. see also
wxscrollbar, wxslider, wxspinbutton, members
wxscrollevent::wxscrollevent
wxscrollevent::wxscrolleventwxscrollevent(wxtype commandtype = 0, int id = 0, int pos = 0, int orientation = 0) constructor.
wxscrollevent::getorientationint getorientation() const returns wxhorizontal or wxvertical, depending on the orientation of the scrollbar.
wxscrollevent::getpositionint getposition() const returns the position of the scrollbar.
|