]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/spinctrl.tex
sorting support for generic version (patch 1765087 from Bo)
[wxWidgets.git] / docs / latex / wx / spinctrl.tex
CommitLineData
71155438
VS
1%
2% automatically generated by HelpGen from
3% spinctrl.h at 11/Mar/00 00:22:05
4%
5
71155438
VS
6\section{\class{wxSpinCtrl}}\label{wxspinctrl}
7
8wxSpinCtrl combines \helpref{wxTextCtrl}{wxtextctrl} and
9\helpref{wxSpinButton}{wxspinbutton} in one control.
10
11\wxheading{Derived from}
12
13\helpref{wxControl}{wxcontrol}\\
14\helpref{wxWindow}{wxwindow}\\
15\helpref{wxEvtHandler}{wxevthandler}\\
16\helpref{wxObject}{wxobject}
17
18\wxheading{Include files}
19
20<wx/spinctrl.h>
21
a7af285d
VZ
22\wxheading{Library}
23
24\helpref{wxCore}{librarieslist}
25
71155438
VS
26\wxheading{Window styles}
27
28\twocolwidtha{5cm}
29\begin{twocollist}\itemsep=0pt
01a01d10 30\twocolitem{\windowstyle{wxSP\_ARROW\_KEYS}}{The user can use arrow keys to change the value.}
71155438
VS
31\twocolitem{\windowstyle{wxSP\_WRAP}}{The value wraps at the minimum and maximum.}
32\end{twocollist}
33
34\wxheading{Event handling}
35
36To process input from a spin button, use one of these event handler macros to direct input to member
f6bcfd97 37functions that take a \helpref{wxSpinEvent}{wxspinevent} argument:
71155438
VS
38
39\twocolwidtha{7cm}
c0bcc480 40\begin{twocollist}\itemsep=0pt
73c62f54
VZ
41\twocolitem{{\bf EVT\_SPINCTRL(id, func)}}{Generated whenever the numeric value
42of the spinctrl is updated}
71155438
VS
43\end{twocollist}%
44
73c62f54
VZ
45You may also use the \helpref{wxSpinButton}{wxspinbutton} event macros, however
46the corresponding events will not be generated under all platforms. Finally, if
47the user modifies the text in the edit part of the spin control directly, the
48{\tt EVT\_TEXT} is generated, like for the \helpref{wxTextCtrl}{wxtextctrl}.
49
1e8dba5e
RR
50When the use enters text into the text area, the text is not
51validated until the control loses focus (e.g. by using the TAB
52key). The value is then adjusted to the range and a
53\helpref{wxSpinEvent}{wxspinevent} sent then if the value
54is different from the last value sent.
55
71155438
VS
56\wxheading{See also}
57
58\helpref{Event handling overview}{eventhandlingoverview},
59\helpref{wxSpinButton}{wxspinbutton},
60\helpref{wxControl}{wxcontrol}
61
71155438
VS
62\latexignore{\rtfignore{\wxheading{Members}}}
63
71155438
VS
64\membersection{wxSpinCtrl::wxSpinCtrl}\label{wxspinctrlwxspinctrl}
65
66\func{}{wxSpinCtrl}{\void}
67
68Default constructor.
69
71155438
VS
70\func{}{wxSpinCtrl}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = -1}, \param{const wxString\& }{value = wxEmptyString}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = wxSP\_ARROW\_KEYS}, \param{int }{min = 0}, \param{int }{max = 100}, \param{int }{initial = 0}, \param{const wxString\& }{name = \_T("wxSpinCtrl")}}
71
72Constructor, creating and showing a spin control.
73
74\wxheading{Parameters}
75
76\docparam{parent}{Parent window. Must not be NULL.}
77
78\docparam{value}{Default value.}
79
80\docparam{id}{Window identifier. A value of -1 indicates a default value.}
81
82\docparam{pos}{Window position. If the position (-1, -1) is specified then a default position is chosen.}
83
84\docparam{size}{Window size. If the default size (-1, -1) is specified then a default size is chosen.}
85
86\docparam{style}{Window style. See \helpref{wxSpinButton}{wxspinbutton}.}
87
88\docparam{min}{Minimal value.}
89
90\docparam{max}{Maximal value.}
91
92\docparam{initial}{Initial value.}
93
94\docparam{name}{Window name.}
95
96\wxheading{See also}
97
98\helpref{wxSpinCtrl::Create}{wxspinctrlcreate}
99
71155438
VS
100\membersection{wxSpinCtrl::Create}\label{wxspinctrlcreate}
101
102\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = -1}, \param{const wxString\& }{value = wxEmptyString}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = wxSP\_ARROW\_KEYS}, \param{int }{min = 0}, \param{int }{max = 100}, \param{int }{initial = 0}, \param{const wxString\& }{name = \_T("wxSpinCtrl")}}
103
104Creation function called by the spin control constructor.
71155438 105
c0bcc480 106See \helpref{wxSpinCtrl::wxSpinCtrl}{wxspinctrlwxspinctrl} for details.
71155438
VS
107
108\membersection{wxSpinCtrl::SetValue}\label{wxspinctrlsetvalue}
109
110\func{void}{SetValue}{\param{const wxString\& }{text}}
111
112\func{void}{SetValue}{\param{int }{value}}
113
114Sets the value of the spin control.
115
116\membersection{wxSpinCtrl::GetValue}\label{wxspinctrlgetvalue}
117
118\constfunc{int}{GetValue}{\void}
119
120Gets the value of the spin control.
121
122\membersection{wxSpinCtrl::SetRange}\label{wxspinctrlsetrange}
123
124\func{void}{SetRange}{\param{int }{minVal}, \param{int }{maxVal}}
125
126Sets range of allowable values.
127
9487bf17
VZ
128\membersection{wxSpinCtrl::SetSelection}\label{wxspinctrlsetselection}
129
130\func{void}{SetSelection}{\param{long }{from}, \param{long }{to}}
131
132Select the text in the text part of the control between positions
133{\it from} (inclusive) and {\it to} (exclusive). This is similar to
134\helpref{wxTextCtrl::SetSelection}{wxtextctrlsetselection}.
135
136{\bf NB:} this is currently only implemented for Windows and generic versions
137of the control.
138
71155438
VS
139\membersection{wxSpinCtrl::GetMin}\label{wxspinctrlgetmin}
140
141\constfunc{int}{GetMin}{\void}
142
143Gets minimal allowable value.
144
145\membersection{wxSpinCtrl::GetMax}\label{wxspinctrlgetmax}
146
147\constfunc{int}{GetMax}{\void}
148
149Gets maximal allowable value.
150