#include </home/zeitlin/src/wx/github/interface/wx/event.h>
A scroll event holds information about events sent from stand-alone scrollbars (see wxScrollBar) and sliders (see wxSlider).
Note that 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.
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.
The following event handler macros redirect the events to member function handlers 'func' with prototypes like:
Event macros:
wxEVT_SCROLL_TOP
scroll-to-top events (minimum position). wxEVT_SCROLL_BOTTOM
scroll-to-bottom events (maximum position). wxEVT_SCROLL_LINEUP
line up events. wxEVT_SCROLL_LINEDOWN
line down events. wxEVT_SCROLL_PAGEUP
page up events. wxEVT_SCROLL_PAGEDOWN
page down events. wxEVT_SCROLL_THUMBTRACK
thumbtrack events (frequent events sent as the user drags the thumbtrack). wxEVT_SCROLL_THUMBRELEASE
thumb release events. wxEVT_SCROLL_CHANGED
end of scrolling events (MSW only). wxEVT_SCROLL_TOP
scroll-to-top events (minimum position). wxEVT_SCROLL_BOTTOM
scroll-to-bottom events (maximum position). wxEVT_SCROLL_LINEUP
line up events. wxEVT_SCROLL_LINEDOWN
line down events. wxEVT_SCROLL_PAGEUP
page up events. wxEVT_SCROLL_PAGEDOWN
page down events. wxEVT_SCROLL_THUMBTRACK
thumbtrack events (frequent events sent as the user drags the thumbtrack). wxEVT_SCROLL_THUMBRELEASE
thumb release events. wxEVT_SCROLL_CHANGED
end of scrolling events (MSW only). Public Member Functions | |
wxScrollEvent (wxEventType commandType=wxEVT_NULL, int id=0, int pos=0, int orientation=0) | |
Constructor. | |
int | GetOrientation () const |
Returns wxHORIZONTAL or wxVERTICAL, depending on the orientation of the scrollbar. | |
int | GetPosition () const |
Returns the position of the scrollbar. | |
void | SetOrientation (int orient) |
void | SetPosition (int pos) |
wxScrollEvent::wxScrollEvent | ( | wxEventType | commandType = wxEVT_NULL , |
int | id = 0 , |
||
int | pos = 0 , |
||
int | orientation = 0 |
||
) |
Constructor.
int wxScrollEvent::GetOrientation | ( | ) | const |
Returns wxHORIZONTAL or wxVERTICAL, depending on the orientation of the scrollbar.
int wxScrollEvent::GetPosition | ( | ) | const |
Returns the position of the scrollbar.
void wxScrollEvent::SetOrientation | ( | int | orient | ) |
void wxScrollEvent::SetPosition | ( | int | pos | ) |