.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.ScrollEvent:

==========================================================================================================================================
|phoenix_title|  **wx.ScrollEvent**
==========================================================================================================================================

A scroll event holds information about events sent from stand-alone scrollbars (see :ref:`wx.ScrollBar`) and sliders (see :ref:`wx.Slider`).          

Note that scrolled windows send the :ref:`wx.ScrollWinEvent`  which does not derive from :ref:`wx.CommandEvent`, but from :ref:`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. 



|phoenix_title| The difference between ``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 :ref:`Widgets Sample <widgets sample>`  ("Slider" page) to see the difference between ``EVT_SCROLL_THUMBRELEASE`` and ``EVT_SCROLL_CHANGED`` in action. 
^^  



.. _ScrollEvent-events:

|events| Events Emitted by this Class
=====================================

Handlers bound for the following event types will receive one of the :ref:`wx.ScrollEvent` Event macros: 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. parameters.

- 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:`wx.ScrollEvent.GetOrientation` , since horizontal and vertical scroll events are processed using the same event handler.  







.. seealso:: :ref:`wx.ScrollBar`, :ref:`wx.Slider`, :ref:`wx.SpinButton`, :ref:`wx.ScrollWinEvent`, :ref:`Events and Event Handling <events and event handling>`    







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>ScrollEvent</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.ScrollEvent_inheritance.png" alt="Inheritance diagram of ScrollEvent" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.ScrollEvent.html" title="wx.ScrollEvent" alt="" coords="21,237,139,267"/> <area shape="rect" id="node2" href="wx.CommandEvent.html" title="wx.CommandEvent" alt="" coords="5,160,155,189"/> <area shape="rect" id="node3" href="wx.Event.html" title="wx.Event" alt="" coords="39,83,121,112"/> <area shape="rect" id="node4" href="wx.Object.html" title="wx.Object" alt="" coords="37,5,123,35"/> </map> 
   </p>
   </div>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.ScrollEvent.__init__`                                                 Constructor.
:meth:`~wx.ScrollEvent.GetOrientation`                                           Returns ``wx.HORIZONTAL`` or ``wx.VERTICAL``, depending on the orientation of the scrollbar.
:meth:`~wx.ScrollEvent.GetPosition`                                              Returns the position of the scrollbar.
:meth:`~wx.ScrollEvent.SetOrientation`                                           
:meth:`~wx.ScrollEvent.SetPosition`                                              
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.ScrollEvent.Orientation`                                              See :meth:`~wx.ScrollEvent.GetOrientation` and :meth:`~wx.ScrollEvent.SetOrientation`
:attr:`~wx.ScrollEvent.Position`                                                 See :meth:`~wx.ScrollEvent.GetPosition` and :meth:`~wx.ScrollEvent.SetPosition`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: 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).



   .. method:: __init__(self, commandType=wxEVT_NULL, id=0, pos=0, orientation=0)

      Constructor.                  


      :param `commandType`: 
      :type `commandType`: wx.EventType
      :param `id`: 
      :type `id`: int
      :param `pos`: 
      :type `pos`: int
      :param `orientation`: 
      :type `orientation`: int







   .. method:: GetOrientation(self)

      Returns ``wx.HORIZONTAL`` or ``wx.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:`~wx.ScrollEvent.GetOrientation` and :meth:`~wx.ScrollEvent.SetOrientation`


   .. attribute:: Position

      See :meth:`~wx.ScrollEvent.GetPosition` and :meth:`~wx.ScrollEvent.SetPosition`

