.. include:: headings.inc .. _ScrollEvent: ========================================================================================================================================== |phoenix_title| **ScrollEvent** ========================================================================================================================================== A scroll event holds information about events sent from stand-alone scrollbars (see :ref:`ScrollBar`) and sliders (see :ref:`Slider`). Note that scrolled windows send the :ref:`ScrollWinEvent` which does not derive from :ref:`CommandEvent`, but from :ref:`Event` directly - don't confuse these two kinds of events and use the event table macros mentioned below only for the scrollbar-like controls. |phoenix_title| The difference between ``EVT_SCROLL_THUMBRELEASE`` and ``EVT_SCROLL_CHANGED`` ============================================================================================= .. _ScrollEvent-events: |events| Events Emitted by this Class ===================================== Handlers bound for the following event types will receive a :ref:`ScrollEvent` parameter. - EVT_SCROLL: Process all scroll events. - EVT_SCROLL_TOP: Process ``wxEVT_SCROLL_TOP`` scroll-to-top events (minimum position). - EVT_SCROLL_BOTTOM: Process ``wxEVT_SCROLL_BOTTOM`` scroll-to-bottom events (maximum position). - EVT_SCROLL_LINEUP: Process ``wxEVT_SCROLL_LINEUP`` line up events. - EVT_SCROLL_LINEDOWN: Process ``wxEVT_SCROLL_LINEDOWN`` line down events. - EVT_SCROLL_PAGEUP: Process ``wxEVT_SCROLL_PAGEUP`` page up events. - EVT_SCROLL_PAGEDOWN: Process ``wxEVT_SCROLL_PAGEDOWN`` page down events. - EVT_SCROLL_THUMBTRACK: Process ``wxEVT_SCROLL_THUMBTRACK`` thumbtrack events (frequent events sent as the user drags the thumbtrack). - EVT_SCROLL_THUMBRELEASE: Process ``wxEVT_SCROLL_THUMBRELEASE`` thumb release events. - EVT_SCROLL_CHANGED: Process ``wxEVT_SCROLL_CHANGED`` end of scrolling events (MSW only). - EVT_COMMAND_SCROLL: Process all scroll events. - EVT_COMMAND_SCROLL_TOP: Process ``wxEVT_SCROLL_TOP`` scroll-to-top events (minimum position). - EVT_COMMAND_SCROLL_BOTTOM: Process ``wxEVT_SCROLL_BOTTOM`` scroll-to-bottom events (maximum position). - EVT_COMMAND_SCROLL_LINEUP: Process ``wxEVT_SCROLL_LINEUP`` line up events. - EVT_COMMAND_SCROLL_LINEDOWN: Process ``wxEVT_SCROLL_LINEDOWN`` line down events. - EVT_COMMAND_SCROLL_PAGEUP: Process ``wxEVT_SCROLL_PAGEUP`` page up events. - EVT_COMMAND_SCROLL_PAGEDOWN: Process ``wxEVT_SCROLL_PAGEDOWN`` page down events. - EVT_COMMAND_SCROLL_THUMBTRACK: Process ``wxEVT_SCROLL_THUMBTRACK`` thumbtrack events (frequent events sent as the user drags the thumbtrack). - EVT_COMMAND_SCROLL_THUMBRELEASE: Process ``wxEVT_SCROLL_THUMBRELEASE`` thumb release events. - EVT_COMMAND_SCROLL_CHANGED: Process ``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 :meth:`ScrollEvent.GetOrientation` , since horizontal and vertical scroll events are processed using the same event handler. .. seealso:: :ref:`ScrollBar`, :ref:`Slider`, :ref:`SpinButton`, :ref:`ScrollWinEvent`, :ref:`Events and Event Handling ` | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for class **ScrollEvent** .. raw:: html

Inheritance diagram of ScrollEvent

| |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~ScrollEvent.__init__` Constructor. :meth:`~ScrollEvent.GetOrientation` Returns ``HORIZONTAL`` or ``VERTICAL``, depending on the orientation of the scrollbar. :meth:`~ScrollEvent.GetPosition` Returns the position of the scrollbar. :meth:`~ScrollEvent.SetOrientation` :meth:`~ScrollEvent.SetPosition` ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~ScrollEvent.Orientation` See :meth:`~ScrollEvent.GetOrientation` and :meth:`~ScrollEvent.SetOrientation` :attr:`~ScrollEvent.Position` See :meth:`~ScrollEvent.GetPosition` and :meth:`~ScrollEvent.SetPosition` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: ScrollEvent(CommandEvent) A scroll event holds information about events sent from stand-alone scrollbars (see ScrollBar) and sliders (see Slider). **Possible constructors**:: ScrollEvent(commandType=wxEVT_NULL, id=0, pos=0, orientation=0) .. method:: __init__(self, commandType=wxEVT_NULL, id=0, pos=0, orientation=0) Constructor. :param `commandType`: :type `commandType`: EventType :param `id`: :type `id`: int :param `pos`: :type `pos`: int :param `orientation`: :type `orientation`: int .. method:: GetOrientation(self) Returns ``HORIZONTAL`` or ``VERTICAL``, depending on the orientation of the scrollbar. :rtype: `int` .. method:: GetPosition(self) Returns the position of the scrollbar. :rtype: `int` .. method:: SetOrientation(self, orient) :param `orient`: :type `orient`: int .. method:: SetPosition(self, pos) :param `pos`: :type `pos`: int .. attribute:: Orientation See :meth:`~ScrollEvent.GetOrientation` and :meth:`~ScrollEvent.SetOrientation` .. attribute:: Position See :meth:`~ScrollEvent.GetPosition` and :meth:`~ScrollEvent.SetPosition`