A scroll event holds information about events sent from stand-alone scrollbars (see wx.ScrollBar) and sliders (see wx.Slider).
Note that scrolled windows send the wx.ScrollWinEvent which does not derive from wx.CommandEvent, but from wx.Event directly - don’t confuse these two kinds of events and use the event table macros mentioned below only for the scrollbar-like controls.
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.
Handlers bound for the following event types will receive one of the wx.ScrollEvent 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 parameters.
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).Note
Note that unless specifying a scroll control identifier, you will need to test for scrollbar orientation with wx.ScrollEvent.GetOrientation
, since horizontal and vertical scroll events are processed using the same event handler.
__init__ |
Constructor. |
GetOrientation |
Returns wx.HORIZONTAL or wx.VERTICAL , depending on the orientation of the scrollbar. |
GetPosition |
Returns the position of the scrollbar. |
SetOrientation |
|
SetPosition |
Orientation |
See GetOrientation and SetOrientation |
Position |
See GetPosition and SetPosition |
wx.
ScrollEvent
(CommandEvent)¶Possible constructors:
ScrollEvent(commandType=wxEVT_NULL, id=0, pos=0, orientation=0)
A scroll event holds information about events sent from stand-alone scrollbars (see ScrollBar) and sliders (see Slider).
__init__
(self, commandType=wxEVT_NULL, id=0, pos=0, orientation=0)¶Constructor.
Parameters: |
|
---|
GetOrientation
(self)¶Returns wx.HORIZONTAL
or wx.VERTICAL
, depending on the orientation of the scrollbar.
Return type: | int |
---|
GetPosition
(self)¶Returns the position of the scrollbar.
Return type: | int |
---|
SetOrientation
(self, orient)¶Parameters: | orient (int) – |
---|
SetPosition
(self, pos)¶Parameters: | pos (int) – |
---|
Orientation
¶See GetOrientation
and SetOrientation
Position
¶See GetPosition
and SetPosition