wx.ScrollEvent

Inheritance diagram for wx.ScrollEvent:



Description

A scroll event holds information about events sent from stand-alone scrollbars and sliders.

Note

Note that starting from wxWidgets 2.1, 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.

Remarks

Note that unless specifying a scroll control identifier, you will need to test for scrollbar orientation with GetOrientation, since horizontal and vertical scroll events are processed using the same event handler.

Event Handling

To process a scroll event, use these event handler macros to direct input to member functions that take a wx.ScrollEvent 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.

Event Name Description
wx.EVT_SCROLL(func) Process all scroll events.
wx.EVT_SCROLL_TOP(func) Process wx.wxEVT_SCROLL_TOP scroll-to-top events (minimum position).
wx.EVT_SCROLL_BOTTOM(func) Process wx.wxEVT_SCROLL_BOTTOM scroll-to-bottom events (maximum position).
wx.EVT_SCROLL_LINEUP(func) Process wx.wxEVT_SCROLL_LINEUP line up events.
wx.EVT_SCROLL_LINEDOWN(func) Process wx.wxEVT_SCROLL_LINEDOWN line down events.
wx.EVT_SCROLL_PAGEUP(func) Process wx.wxEVT_SCROLL_PAGEUP page up events.
wx.EVT_SCROLL_PAGEDOWN(func) Process wx.wxEVT_SCROLL_PAGEDOWN page down events.
wx.EVT_SCROLL_THUMBTRACK(func) Process wx.wxEVT_SCROLL_THUMBTRACK thumbtrack events (frequent events sent as the user drags the thumbtrack).
wx.EVT_SCROLL_THUMBRELEASE(func) Process wx.wxEVT_SCROLL_THUMBRELEASE thumb release events.
wx.EVT_SCROLL_CHANGED(func) Process wx.wxEVT_SCROLL_CHANGED end of scrolling events (MSW only).
wx.EVT_COMMAND_SCROLL(id, func) Process all scroll events.
wx.EVT_COMMAND_SCROLL_TOP(id, func) Process wx.wxEVT_SCROLL_TOP scroll-to-top events (minimum position).
wx.EVT_COMMAND_SCROLL_BOTTOM(id, func) Process wx.wxEVT_SCROLL_BOTTOM scroll-to-bottom events (maximum position).
wx.EVT_COMMAND_SCROLL_LINEUP(id, func) Process wx.wxEVT_SCROLL_LINEUP line up events.
wx.EVT_COMMAND_SCROLL_LINEDOWN(id, func) Process wx.wxEVT_SCROLL_LINEDOWN line down events.
wx.EVT_COMMAND_SCROLL_PAGEUP(id, func) Process wx.wxEVT_SCROLL_PAGEUP page up events.
wx.EVT_COMMAND_SCROLL_PAGEDOWN(id, func) Process wx.wxEVT_SCROLL_PAGEDOWN page down events.
wx.EVT_COMMAND_SCROLL_THUMBTRACK(id, func) Process wx.wxEVT_SCROLL_THUMBTRACK thumbtrack events (frequent events sent as the user drags the thumbtrack).
wx.EVT_COMMAND_SCROLL_THUMBRELEASE(func) Process wx.wxEVT_SCROLL_THUMBRELEASE thumb release events.
wx.EVT_COMMAND_SCROLL_CHANGED(func) Process wx.wxEVT_SCROLL_CHANGED end of scrolling events (MSW only).

Properties Summary

Class API

Methods

__init__(commandType=wx.wxEVT_NULL, winid=0, pos=0, orient=0)

Constructor.

Parameters:

  • commandType (eventtype)
  • winid (int)
  • pos (int)
  • orient (int)

Returns:

wx.ScrollEvent


GetOrientation()

Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of the scrollbar.


Returns:

int


GetPosition()

Returns the position of the scrollbar.


Returns:

int


SetOrientation(orient)

Parameters:

  • orient (int)

SetPosition(pos)

Parameters:

  • pos (int)

Properties

Orientation
See GetOrientation and SetOrientation
Position
See GetPosition and SetPosition