]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/choice.tex
Corrected some problems I introduced, added tabevent.tex.
[wxWidgets.git] / docs / latex / wx / choice.tex
CommitLineData
a660d684
KB
1\section{\class{wxChoice}}\label{wxchoice}
2
3A choice item is used to select one of a list of strings. Unlike a
4listbox, only the selection is visible until the user pulls down the
5menu of choices.
6
7\wxheading{Derived from}
8
9\helpref{wxControl}{wxcontrol}\\
10\helpref{wxWindow}{wxwindow}\\
11\helpref{wxEvtHandler}{wxevthandler}\\
12\helpref{wxObject}{wxobject}
13
14\wxheading{Window styles}
15
16There are no special styles for wxChoice.
17
18See also \helpref{window styles overview}{windowstyles}.
19
20\wxheading{See also}
21
22\helpref{wxListBox}{wxlistbox}
23
24\latexignore{\rtfignore{\wxheading{Members}}}
25
26\membersection{wxChoice::wxChoice}\label{wxchoiceconstr}
27
28\func{}{wxChoice}{\void}
29
30Default constructor.
31
eaaa6a06 32\func{}{wxChoice}{\param{wxWindow *}{parent}, \param{wxWindowID}{ id},\rtfsp
a660d684 33\param{const wxPoint\& }{pos}, \param{const wxSize\&}{ size},\rtfsp
eaaa6a06
JS
34\param{int}{ n}, \param{const wxString }{choices[]},\rtfsp
35\param{long}{ style = 0}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = ``choice"}}
a660d684
KB
36
37Constructor, creating and showing a choice.
38
39\wxheading{Parameters}
40
41\docparam{parent}{Parent window. Must not be NULL.}
42
43\docparam{id}{Window identifier. A value of -1 indicates a default value.}
44
45\docparam{pos}{Window position.}
46
47\docparam{size}{Window size. If the default size (-1, -1) is specified then the choice is sized
48appropriately.}
49
50\docparam{n}{Number of strings with which to initialise the choice control.}
51
52\docparam{choices}{An array of strings with which to initialise the choice control.}
53
54\docparam{style}{Window style. See \helpref{wxChoice}{wxchoice}.}
55
56\docparam{validator}{Window validator.}
57
58\docparam{name}{Window name.}
59
60\wxheading{See also}
61
62\helpref{wxChoice::Create}{wxchoicecreate}, \helpref{wxValidator}{wxvalidator}
63
64\membersection{wxChoice::\destruct{wxChoice}}
65
66\func{}{\destruct{wxChoice}}{\void}
67
68Destructor, destroying the choice item.
69
70\membersection{wxChoice::Append}\label{wxchoiceappend}
71
72\func{void}{Append}{\param{const wxString\& }{ item}}
73
74Adds the item to the end of the choice control.
75
76\wxheading{Parameters}
77
78\docparam{item}{String to add.}
79
80\membersection{wxChoice::Clear}\label{wxchoiceclear}
81
82\func{void}{Clear}{\void}
83
84Clears the strings from the choice item.
85
86\membersection{wxChoice::Create}\label{wxchoicecreate}
87
eaaa6a06 88\func{bool}{Create}{\param{wxWindow *}{parent}, \param{wxWindowID}{ id},\rtfsp
a660d684 89\param{const wxPoint\& }{pos}, \param{const wxSize\&}{ size},\rtfsp
eaaa6a06
JS
90\param{int}{ n}, \param{const wxString }{choices[]},\rtfsp
91\param{long}{ style = 0}, \param{const wxString\& }{name = ``choice"}}
a660d684
KB
92
93Creates the choice for two-step construction. See \helpref{wxChoice::wxChoice}{wxchoiceconstr}.
94
95\membersection{wxChoice::FindString}\label{wxchoicefindstring}
96
97\constfunc{int}{FindString}{\param{const wxString\& }{string}}
98
99Finds a choice matching the given string.
100
101\wxheading{Parameters}
102
103\docparam{string}{String to find.}
104
105\wxheading{Return value}
106
107Returns the position if found, or -1 if not found.
108
109\membersection{wxChoice::GetColumns}\label{wxchoicegetcolumns}
110
111\constfunc{int}{GetColumns}{\void}
112
113Gets the number of columns in this choice item.
114
115\wxheading{Remarks}
116
117This is implemented for Motif only.
118
119\membersection{wxChoice::GetSelection}\label{wxchoicegetselection}
120
121\constfunc{int}{GetSelection}{\void}
122
123Gets the id (position) of the selected string, or -1 if there is no selection.
124
125\membersection{wxChoice::GetString}\label{wxchoicegetstring}
126
eaaa6a06 127\constfunc{wxString}{GetString}{\param{int}{ n}}
a660d684
KB
128
129Returns the string at the given position.
130
131\wxheading{Parameters}
132
133\docparam{n}{The zero-based position.}
134
135\wxheading{Return value}
136
137The string at the given position, or the empty string if {\it n} is invalid.
138
139\membersection{wxChoice::GetStringSelection}\label{wxchoicegetstringselection}
140
141\constfunc{wxString}{GetStringSelection}{\void}
142
143Gets the selected string, or the empty string if no string is selected.
144
145\membersection{wxChoice::Number}\label{wxchoicenumber}
146
147\constfunc{int}{Number}{\void}
148
149Returns the number of strings in the choice control.
150
151\membersection{wxChoice::SetColumns}\label{wxchoicesetcolumns}
152
eaaa6a06 153\func{void}{SetColumns}{\param{int}{ n = 1}}
a660d684
KB
154
155Sets the number of columns in this choice item.
156
157\wxheading{Parameters}
158
159\docparam{n}{Number of columns.}
160
161\wxheading{Remarks}
162
163This is implemented for Motif only.
164
165\membersection{wxChoice::SetSelection}\label{wxchoicesetselection}
166
eaaa6a06 167\func{void}{SetSelection}{\param{int}{ n}}
a660d684
KB
168
169Sets the choice by passing the desired string position.
170
171\wxheading{Parameters}
172
173\docparam{n}{The string position to select, starting from zero.}
174
175\wxheading{See also}
176
177\helpref{wxChoice::SetStringSelection}{wxchoicesetstringselection}
178
179\membersection{wxChoice::SetStringSelection}\label{wxchoicesetstringselection}
180
181\func{void}{SetStringSelection}{\param{const wxString\& }{ string}}
182
183Sets the choice by passing the desired string.
184
185\wxheading{Parameters}
186
187\docparam{string}{The string to select.}
188
189\wxheading{See also}
190
191\helpref{wxChoice::SetSelection}{wxchoicesetselection}
192
193