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