]>
Commit | Line | Data |
---|---|---|
1 | \section{\class{wxSpinButton}}\label{wxspinbutton} | |
2 | ||
3 | A wxSpinButton has two small up and down (or left and right) arrow buttons. It is often | |
4 | used next to a text control for increment and decrementing a value. | |
5 | ||
6 | \wxheading{Derived from} | |
7 | ||
8 | \helpref{wxControl}{wxcontrol}\\ | |
9 | \helpref{wxWindow}{wxwindow}\\ | |
10 | \helpref{wxEvtHandler}{wxevthandler}\\ | |
11 | \helpref{wxObject}{wxobject} | |
12 | ||
13 | \wxheading{Include files} | |
14 | ||
15 | <wx/spinbutt.h> | |
16 | ||
17 | \wxheading{Window styles} | |
18 | ||
19 | \twocolwidtha{5cm} | |
20 | \begin{twocollist}\itemsep=0pt | |
21 | \twocolitem{\windowstyle{wxSP\_HORIZONTAL}}{Specifies a horizontal spin button.} | |
22 | \twocolitem{\windowstyle{wxSP\_VERTICAL}}{Specifies a vertical spin button.} | |
23 | \twocolitem{\windowstyle{wxSP\_ARROW\_KEYS}}{The user can use arrow keys.} | |
24 | \twocolitem{\windowstyle{wxSP\_WRAP}}{The value wraps at the minimum and maximum.} | |
25 | \end{twocollist} | |
26 | ||
27 | See also \helpref{window styles overview}{windowstyles}. | |
28 | ||
29 | \wxheading{Event handling} | |
30 | ||
31 | To process input from a spin button, use one of these event handler macros to direct input to member | |
32 | functions that take a \helpref{wxScrollEvent}{wxscrollevent} argument: | |
33 | ||
34 | \twocolwidtha{7cm} | |
35 | \begin{twocollist} | |
36 | \twocolitem{{\bf EVT\_SPIN(id, func)}}{Catch all scroll commands.} | |
37 | \twocolitem{{\bf EVT\_SPIN\_UP(id, func)}}{Catch up (or left) commands. Win32 only. } | |
38 | \twocolitem{{\bf EVT\_SPIN\_DOWN(id, func)}}{Catch down (or right) commands. Win32 only. } | |
39 | \twocolitem{{\bf EVT\_COMMAND\_TOP(id, func)}}{Catch a command to put the scroll thumb at the maximum position.} | |
40 | \twocolitem{{\bf EVT\_COMMAND\_SCROLL(id, func)}}{Catch all scroll commands.} | |
41 | \twocolitem{{\bf EVT\_COMMAND\_TOP(id, func)}}{Catch a command to put the scroll thumb at the maximum position.} | |
42 | \twocolitem{{\bf EVT\_COMMAND\_BOTTOM(id, func)}}{Catch a command to put the scroll thumb at the maximum position.} | |
43 | \twocolitem{{\bf EVT\_COMMAND\_LINEUP(id, func)}}{Catch a line up command.} | |
44 | \twocolitem{{\bf EVT\_COMMAND\_LINEDOWN(id, func)}}{Catch a line down command.} | |
45 | \twocolitem{{\bf EVT\_COMMAND\_PAGEUP(id, func)}}{Catch a page up command.} | |
46 | \twocolitem{{\bf EVT\_COMMAND\_PAGEDOWN(id, func)}}{Catch a page down command.} | |
47 | \twocolitem{{\bf EVT\_COMMAND\_THUMBTRACK(id, func)}}{Catch a thumbtrack command (continuous movement of the scroll thumb).} | |
48 | \end{twocollist}% | |
49 | ||
50 | \wxheading{See also} | |
51 | ||
52 | \helpref{Event handling overview}{eventhandlingoverview} | |
53 | ||
54 | \latexignore{\rtfignore{\wxheading{Members}}} | |
55 | ||
56 | \membersection{wxSpinButton::wxSpinButton}\label{wxspinbuttonconstr} | |
57 | ||
58 | \func{}{wxSpinButton}{\void} | |
59 | ||
60 | Default constructor. | |
61 | ||
62 | \func{}{wxSpinButton}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id},\rtfsp | |
63 | \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp | |
64 | \param{long}{ style = wxSP\_HORIZONTAL}, \param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp | |
65 | \param{const wxString\& }{name = ``spinButton"}} | |
66 | ||
67 | Constructor, creating and showing a spin button. | |
68 | ||
69 | \wxheading{Parameters} | |
70 | ||
71 | \docparam{parent}{Parent window. Must not be NULL.} | |
72 | ||
73 | \docparam{id}{Window identifier. A value of -1 indicates a default value.} | |
74 | ||
75 | \docparam{pos}{Window position. If the position (-1, -1) is specified then a default position is chosen.} | |
76 | ||
77 | \docparam{size}{Window size. If the default size (-1, -1) is specified then a default size is chosen.} | |
78 | ||
79 | \docparam{style}{Window style. See \helpref{wxSpinButton}{wxspinbutton}.} | |
80 | ||
81 | \docparam{validator}{Window validator.} | |
82 | ||
83 | \docparam{name}{Window name.} | |
84 | ||
85 | \wxheading{See also} | |
86 | ||
87 | \helpref{wxSpinButton::Create}{wxspinbuttoncreate}, \helpref{wxValidator}{wxvalidator} | |
88 | ||
89 | \membersection{wxSpinButton::\destruct{wxSpinButton}} | |
90 | ||
91 | \func{void}{\destruct{wxSpinButton}}{\void} | |
92 | ||
93 | Destructor, destroying the spin button. | |
94 | ||
95 | \membersection{wxSpinButton::Create}\label{wxspinbuttoncreate} | |
96 | ||
97 | \func{bool}{Create}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id},\rtfsp | |
98 | \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp | |
99 | \param{long}{ style = wxSP\_HORIZONTAL}, \param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp | |
100 | \param{const wxString\& }{name = ``spinButton"}} | |
101 | ||
102 | Scrollbar creation function called by the spin button constructor. | |
103 | See \helpref{wxSpinButton::wxSpinButton}{wxspinbuttonconstr} for details. | |
104 | ||
105 | \membersection{wxSpinButton::GetMax}\label{wxspinbuttongetmax} | |
106 | ||
107 | \constfunc{int}{GetMax}{\void} | |
108 | ||
109 | Returns the maximum permissable value. | |
110 | ||
111 | \wxheading{See also} | |
112 | ||
113 | \helpref{wxSpinButton::SetRange}{wxspinbuttonsetrange} | |
114 | ||
115 | \membersection{wxSpinButton::GetMin}\label{wxspinbuttongetmin} | |
116 | ||
117 | \constfunc{int}{GetMin}{\void} | |
118 | ||
119 | Returns the minimum permissable value. | |
120 | ||
121 | \wxheading{See also} | |
122 | ||
123 | \helpref{wxSpinButton::SetRange}{wxspinbuttonsetrange} | |
124 | ||
125 | \membersection{wxSpinButton::GetValue}\label{wxspinbuttongetvalue} | |
126 | ||
127 | \constfunc{int}{GetValue}{\void} | |
128 | ||
129 | Returns the current spin button value. | |
130 | ||
131 | \wxheading{See also} | |
132 | ||
133 | \helpref{wxSpinButton::SetValue}{wxspinbuttonsetvalue} | |
134 | ||
135 | \membersection{wxSpinButton::SetRange}\label{wxspinbuttonsetrange} | |
136 | ||
137 | \func{void}{SetRange}{\param{int}{ min}, \param{int}{ max}} | |
138 | ||
139 | Sets the range of the spin button. | |
140 | ||
141 | \wxheading{Parameters} | |
142 | ||
143 | \docparam{min}{The minimum value for the spin button.} | |
144 | ||
145 | \docparam{max}{The maximum value for the spin button.} | |
146 | ||
147 | \wxheading{See also} | |
148 | ||
149 | \helpref{wxSpinButton::GetMin}{wxspinbuttongetmin}, \helpref{wxSpinButton::GetMax}{wxspinbuttongetmax} | |
150 | ||
151 | \membersection{wxSpinButton::SetValue}\label{wxspinbuttonsetvalue} | |
152 | ||
153 | \func{void}{SetValue}{\param{int}{ value}} | |
154 | ||
155 | Sets the value of the spin button. | |
156 | ||
157 | \wxheading{Parameters} | |
158 | ||
159 | \docparam{value}{The value for the spin button.} | |
160 | ||
161 | \wxheading{See also} | |
162 | ||
163 | \helpref{wxSpinButton::GetValue}{wxspinbuttongetvalue} | |
164 |