]>
Commit | Line | Data |
---|---|---|
a660d684 KB |
1 | \section{\class{wxScrollEvent}}\label{wxscrollevent} |
2 | ||
fd128b0c RR |
3 | A scroll event holds information about events sent from stand-alone scrollbars, |
4 | spin-buttons and sliders - starting from wxWindows 2.1, scrolled windows send the | |
5 | \helpref{wxScrollWinEvent}{wxscrollwinevent} which does not derive from | |
6 | wxCommandEvent, but from wxEvent directly. | |
a660d684 KB |
7 | |
8 | \wxheading{Derived from} | |
9 | ||
10 | \helpref{wxCommandEvent}{wxcommandevent}\\ | |
11 | \helpref{wxEvent}{wxevent}\\ | |
12 | \helpref{wxObject}{wxobject} | |
13 | ||
954b8ae6 JS |
14 | \wxheading{Include files} |
15 | ||
16 | <wx/event.h> | |
17 | ||
a660d684 KB |
18 | \wxheading{Event table macros} |
19 | ||
20 | To process a scroll event, use these event handler macros to direct input to member | |
21 | functions that take a wxScrollEvent argument. You can use EVT\_COMMAND\_SCROLL... macros | |
22 | with window IDs for when intercepting scroll events from controls, or EVT\_SCROLL... macros | |
23 | without window IDs for intercepting scroll events from the receiving window. | |
24 | ||
25 | \twocolwidtha{7cm} | |
26 | \begin{twocollist}\itemsep=0pt | |
27 | \twocolitem{{\bf EVT\_SCROLL(func)}}{Process all scroll events.} | |
28 | \twocolitem{{\bf EVT\_SCROLL\_TOP(func)}}{Process wxEVT\_SCROLL\_TOP scroll-to-top events.} | |
29 | \twocolitem{{\bf EVT\_SCROLL\_BOTTOM(func)}}{Process wxEVT\_SCROLL\_TOP scroll-to-bottom events.} | |
30 | \twocolitem{{\bf EVT\_SCROLL\_LINEUP(func)}}{Process wxEVT\_SCROLL\_LINEUP line up events.} | |
31 | \twocolitem{{\bf EVT\_SCROLL\_LINEDOWN(func)}}{Process wxEVT\_SCROLL\_LINEDOWN line down events.} | |
32 | \twocolitem{{\bf EVT\_SCROLL\_PAGEUP(func)}}{Process wxEVT\_SCROLL\_PAGEUP page up events.} | |
33 | \twocolitem{{\bf EVT\_SCROLL\_PAGEDOWN(func)}}{Process wxEVT\_SCROLL\_PAGEDOWN page down events.} | |
34 | \twocolitem{{\bf EVT\_SCROLL\_THUMBTRACK(func)}}{Process wxEVT\_SCROLL\_THUMBTRACK thumbtrack events (frequent events | |
35 | sent as the user drags the thumtrack).} | |
36 | \twocolitem{{\bf EVT\_COMMAND\_SCROLL(id, func)}}{Process all scroll events.} | |
37 | \twocolitem{{\bf EVT\_COMMAND\_SCROLL\_TOP(id, func)}}{Process wxEVT\_SCROLL\_TOP scroll-to-top events.} | |
38 | \twocolitem{{\bf EVT\_COMMAND\_SCROLL\_BOTTOM(id, func)}}{Process wxEVT\_SCROLL\_TOP scroll-to-bottom events.} | |
39 | \twocolitem{{\bf EVT\_COMMAND\_SCROLL\_LINEUP(id, func)}}{Process wxEVT\_SCROLL\_LINEUP line up events.} | |
40 | \twocolitem{{\bf EVT\_COMMAND\_SCROLL\_LINEDOWN(id, func)}}{Process wxEVT\_SCROLL\_LINEDOWN line down events.} | |
41 | \twocolitem{{\bf EVT\_COMMAND\_SCROLL\_PAGEUP(id, func)}}{Process wxEVT\_SCROLL\_PAGEUP page up events.} | |
42 | \twocolitem{{\bf EVT\_COMMAND\_SCROLL\_PAGEDOWN(id, func)}}{Process wxEVT\_SCROLL\_PAGEDOWN page down events.} | |
43 | \twocolitem{{\bf EVT\_COMMAND\_SCROLL\_THUMBTRACK(id, func)}}{Process wxEVT\_SCROLL\_THUMBTRACK thumbtrack events (frequent events | |
44 | sent as the user drags the thumtrack).} | |
45 | \end{twocollist}% | |
46 | ||
47 | \wxheading{Remarks} | |
48 | ||
49 | Note that unless specifying a scroll control identifier, you will need to test for scrollbar | |
50 | orientation with \helpref{wxScrollEvent::GetOrientation}{wxscrolleventgetorientation}, since | |
51 | horizontal and vertical scroll events are processed using the same event handler. | |
52 | ||
53 | \wxheading{See also} | |
54 | ||
fd128b0c RR |
55 | \helpref{wxScrollBar}{wxscrollbar}, \helpref{wxSlider}{wxslider}, \helpref{wxSpinButton}{wxspinbutton}, \\ |
56 | \helpref{wxScrollWinEvent}{wxscrollwinevent}, \helpref{Event handling overview}{eventhandlingoverview} | |
a660d684 KB |
57 | |
58 | \latexignore{\rtfignore{\wxheading{Members}}} | |
59 | ||
60 | \membersection{wxScrollEvent::wxScrollEvent} | |
61 | ||
62 | \func{}{wxScrollEvent}{\param{WXTYPE }{commandType = 0}, \param{int }{id = 0}, \param{int}{ pos = 0}, | |
63 | \rtfsp\param{int}{ orientation = 0}} | |
64 | ||
65 | Constructor. | |
66 | ||
67 | \membersection{wxScrollEvent::GetOrientation}\label{wxscrolleventgetorientation} | |
68 | ||
69 | \constfunc{int}{GetOrientation}{\void} | |
70 | ||
71 | Returns wxHORIZONTAL or wxVERTICAL, depending on the orientation of the scrollbar. | |
72 | ||
73 | \membersection{wxScrollEvent::GetPosition}\label{wxscrolleventgetposition} | |
74 | ||
75 | \constfunc{int}{GetPosition}{\void} | |
76 | ||
77 | Returns the position of the scrollbar. | |
78 |