## wxScrollEvent

A scroll event holds information about events sent from stand-alone scrollbars, spin-buttons and sliders - starting from wxWindows 2.1, scrolled windows send the wxScrollWinEvent which does not derive from wxCommandEvent, but from wxEvent directly.

Derived from

wxCommandEvent
wxEvent
wxObject

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.

EVT_SCROLL(func) | Process all scroll events.
EVT_SCROLL_TOP(func) | Process wxEVT_SCROLL_TOP scroll-to-top events.
EVT_SCROLL_BOTTOM(func) | Process wxEVT_SCROLL_TOP scroll-to-bottom events.
EVT_SCROLL_LINEUP(func) | Process wxEVT_SCROLL_LINEUP line up events.
EVT_SCROLL_LINEDOWN(func) | Process wxEVT_SCROLL_LINEDOWN line down events.
EVT_SCROLL_PAGEUP(func) | Process wxEVT_SCROLL_PAGEUP page up events.
EVT_SCROLL_PAGEDOWN(func) | Process wxEVT_SCROLL_PAGEDOWN page down events.
EVT_SCROLL_THUMBTRACK(func) | Process wxEVT_SCROLL_THUMBTRACK thumbtrack events (frequent events sent as the user drags the thumtrack).
EVT_SCROLL_THUMBRELEASE(func) | Process wxEVT_SCROLL_THUMBRELEASE thumb release events.
EVT_COMMAND_SCROLL(id, func) | Process all scroll events.
EVT_COMMAND_SCROLL_TOP(id, func) | Process wxEVT_SCROLL_TOP scroll-to-top events.
EVT_COMMAND_SCROLL_BOTTOM(id, func) | Process wxEVT_SCROLL_TOP scroll-to-bottom events.
EVT_COMMAND_SCROLL_LINEUP(id, func) | Process wxEVT_SCROLL_LINEUP line up events.
EVT_COMMAND_SCROLL_LINEDOWN(id, func) | Process wxEVT_SCROLL_LINEDOWN line down events.
EVT_COMMAND_SCROLL_PAGEUP(id, func) | Process wxEVT_SCROLL_PAGEUP page up events.
EVT_COMMAND_SCROLL_PAGEDOWN(id, func) | Process wxEVT_SCROLL_PAGEDOWN page down events.
EVT_COMMAND_SCROLL_THUMBTRACK(id, func) | Process wxEVT_SCROLL_THUMBTRACK thumbtrack events (frequent events sent as the user drags the thumtrack).

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,
wxScrollWinEvent, Event handling overview

Members

wxScrollEvent::wxScrollEvent
wxScrollEvent::GetOrientation
wxScrollEvent::GetPosition

### wxScrollEvent::wxScrollEvent

wxScrollEvent(WXTYPE commandType = 0, int id = 0, int pos = 0, int orientation = 0)

Constructor.

### wxScrollEvent::GetOrientation

int GetOrientation() const

Returns wxHORIZONTAL or wxVERTICAL, depending on the orientation of the scrollbar.

### wxScrollEvent::GetPosition

int GetPosition() const

Returns the position of the scrollbar.