1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231
|
.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2018 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 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 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>
</div>
<script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
<map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.Event.html" title="wx.Event" alt="" coords="38,83,116,112"/> <area shape="rect" id="node3" href="wx.CommandEvent.html" title="wx.CommandEvent" alt="" coords="5,160,149,189"/> <area shape="rect" id="node2" href="wx.Object.html" title="wx.Object" alt="" coords="36,5,117,35"/> <area shape="rect" id="node4" href="wx.ScrollEvent.html" title="wx.ScrollEvent" alt="" coords="21,237,133,267"/> </map>
</p>
|
|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`
|