]>
Commit | Line | Data |
---|---|---|
1 | \section{\class{wxRadioBox}}\label{wxradiobox} | |
2 | ||
3 | A radio box item is used to select one of number of mutually exclusive | |
4 | choices. It is displayed as a vertical column or horizontal row of | |
5 | labelled buttons. | |
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 | ||
16 | \twocolwidtha{5cm} | |
17 | \begin{twocollist}\itemsep=0pt | |
18 | \twocolitem{\windowstyle{wxRA\_HORIZONTAL}}{Lays the radiobox out in rows.} | |
19 | \twocolitem{\windowstyle{wxRA\_VERTICAL}}{Lays the radiobox out in columns.} | |
20 | \end{twocollist} | |
21 | ||
22 | See also \helpref{window styles overview}{windowstyles}. | |
23 | ||
24 | \wxheading{Event handling} | |
25 | ||
26 | \twocolwidtha{7cm} | |
27 | \begin{twocollist}\itemsep=0pt | |
28 | \twocolitem{{\bf EVT\_RADIOBOX(id, func)}}{Process a wxEVT\_COMMAND\_RADIOBOX\_SELECTED event, | |
29 | when a radiobutton is clicked.} | |
30 | \end{twocollist} | |
31 | ||
32 | \wxheading{See also} | |
33 | ||
34 | \helpref{Event handling overview}{eventhandlingoverview}, \helpref{wxRadioButton}{wxradiobutton},\rtfsp | |
35 | \helpref{wxCheckBox}{wxcheckbox} | |
36 | ||
37 | \latexignore{\rtfignore{\wxheading{Members}}} | |
38 | ||
39 | \membersection{wxRadioBox::wxRadioBox}\label{wxradioboxconstr} | |
40 | ||
41 | \func{}{wxRadioBox}{\void} | |
42 | ||
43 | Default constructor. | |
44 | ||
45 | \func{}{wxRadioBox}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxString\& }{label},\rtfsp | |
46 | \param{const wxPoint\& }{point = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp | |
47 | \param{int}{ n = 0}, \param{const wxString}{ choices[] = NULL},\rtfsp | |
48 | \param{int}{ majorDimension = 0}, \param{long}{ style = wxRA\_HORIZONTAL},\rtfsp | |
49 | \param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp | |
50 | \param{const wxString\& }{name = ``radioBox"}} | |
51 | ||
52 | Constructor, creating and showing a radiobox. | |
53 | ||
54 | \wxheading{Parameters} | |
55 | ||
56 | \docparam{parent}{Parent window. Must not be NULL.} | |
57 | ||
58 | \docparam{id}{Window identifier. A value of -1 indicates a default value.} | |
59 | ||
60 | \docparam{label}{Label for the static box surrounding the radio buttons.} | |
61 | ||
62 | \docparam{pos}{Window position. If the position (-1, -1) is specified then a default position is chosen.} | |
63 | ||
64 | \docparam{size}{Window size. If the default size (-1, -1) is specified then a default size is chosen.} | |
65 | ||
66 | \docparam{n}{Number of choices with which to initialize the radiobox.} | |
67 | ||
68 | \docparam{choices}{An array of choices with which to initialize the radiobox.} | |
69 | ||
70 | \docparam{majorDimension}{Specifies the number of rows (if style is wxRA\_VERTICAL) or columns (if style is wxRA\_HORIZONTAL) for a two-dimensional | |
71 | radiobox.} | |
72 | ||
73 | \docparam{style}{Window style. See \helpref{wxRadioBox}{wxradiobox}.} | |
74 | ||
75 | \docparam{validator}{Window validator.} | |
76 | ||
77 | \docparam{name}{Window name.} | |
78 | ||
79 | \wxheading{See also} | |
80 | ||
81 | \helpref{wxRadioBox::Create}{wxradioboxcreate}, \helpref{wxValidator}{wxvalidator} | |
82 | ||
83 | \membersection{wxRadioBox::\destruct{wxRadioBox}} | |
84 | ||
85 | \func{}{\destruct{wxRadioBox}}{\void} | |
86 | ||
87 | Destructor, destroying the radiobox item. | |
88 | ||
89 | \membersection{wxRadioBox::Create}\label{wxradioboxcreate} | |
90 | ||
91 | \func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxString\& }{label},\rtfsp | |
92 | \param{const wxPoint\& }{point = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp | |
93 | \param{int}{ n = 0}, \param{const wxString}{ choices[] = NULL},\rtfsp | |
94 | \param{int}{ majorDimension = 0}, \param{long}{ style = wxRA\_HORIZONTAL},\rtfsp | |
95 | \param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp | |
96 | \param{const wxString\& }{name = ``radioBox"}} | |
97 | ||
98 | Creates the radiobox for two-step construction. See \helpref{wxRadioBox::wxRadioBox}{wxradioboxconstr}\rtfsp | |
99 | for further details. | |
100 | ||
101 | \membersection{wxRadioBox::Enable}\label{wxradioboxenable} | |
102 | ||
103 | \func{void}{Enable}{\param{const bool}{ enable}} | |
104 | ||
105 | Enables or disables the entire radiobox. | |
106 | ||
107 | \func{void}{Enable}{\param{int}{ n}, \param{const bool}{ enable}} | |
108 | ||
109 | Enables or disables an individual button in the radiobox. | |
110 | ||
111 | \wxheading{Parameters} | |
112 | ||
113 | \docparam{enable}{TRUE to enable, FALSE to disable.} | |
114 | ||
115 | \docparam{n}{The zero-based button to enable or disable.} | |
116 | ||
117 | \membersection{wxRadioBox::FindString}\label{wxradioboxfindstring} | |
118 | ||
119 | \constfunc{int}{FindString}{\param{const wxString\& }{string}} | |
120 | ||
121 | Finds a button matching the given string, returning the position if found, or | |
122 | -1 if not found. | |
123 | ||
124 | \wxheading{Parameters} | |
125 | ||
126 | \docparam{string}{The string to find.} | |
127 | ||
128 | \membersection{wxRadioBox::GetLabel}\label{wxradioboxgetlabel} | |
129 | ||
130 | \constfunc{wxString}{GetLabel}{\void} | |
131 | ||
132 | Returns the radiobox label. | |
133 | ||
134 | \constfunc{wxString}{GetLabel}{\param{int }{n}} | |
135 | ||
136 | Returns the label for the given button. | |
137 | ||
138 | \wxheading{Parameters} | |
139 | ||
140 | \docparam{n}{The zero-based button index.} | |
141 | ||
142 | \wxheading{See also} | |
143 | ||
144 | \helpref{wxRadioBox::SetLabel}{wxradioboxsetlabel} | |
145 | ||
146 | \membersection{wxRadioBox::GetSelection}\label{wxradioboxgetselection} | |
147 | ||
148 | \constfunc{int}{GetSelection}{\void} | |
149 | ||
150 | Returns the zero-based position of the selected button. | |
151 | ||
152 | \membersection{wxRadioBox::GetStringSelection}\label{wxradioboxgetstringselection} | |
153 | ||
154 | \constfunc{wxString}{GetStringSelection}{\void} | |
155 | ||
156 | Returns the selected string. | |
157 | ||
158 | \membersection{wxRadioBox::Number}\label{wxradioboxnumber} | |
159 | ||
160 | \constfunc{int}{Number}{\void} | |
161 | ||
162 | Returns the number of buttons in the radiobox. | |
163 | ||
164 | \membersection{wxRadioBox::SetLabel}\label{wxradioboxsetlabel} | |
165 | ||
166 | \func{void}{SetLabel}{\param{const wxString\&}{ label}} | |
167 | ||
168 | Sets the radiobox label. | |
169 | ||
170 | \func{void}{SetLabel}{\param{int }{n}, \param{const wxString\&}{ label}} | |
171 | ||
172 | Sets a label for a radio button. | |
173 | ||
174 | \wxheading{Parameters} | |
175 | ||
176 | \docparam{label}{The label to set.} | |
177 | ||
178 | \docparam{n}{The zero-based button index.} | |
179 | ||
180 | \membersection{wxRadioBox::SetSelection}\label{wxradioboxsetselection} | |
181 | ||
182 | \func{void}{SetSelection}{\param{int}{ n}} | |
183 | ||
184 | Sets a button by passing the desired string position. | |
185 | ||
186 | \wxheading{Parameters} | |
187 | ||
188 | \docparam{n}{The zero-based button position.} | |
189 | ||
190 | \membersection{wxRadioBox::SetStringSelection}\label{wxradioboxsetstringselection} | |
191 | ||
192 | \func{void}{SetStringSelection}{\param{const wxString\& }{string}} | |
193 | ||
194 | Sets a button by passing the desired string. | |
195 | ||
196 | \wxheading{Parameters} | |
197 | ||
198 | \docparam{string}{The label of the button to select.} | |
199 | ||
200 | \membersection{wxRadioBox::Show}\label{wxradioboxshow} | |
201 | ||
202 | \func{void}{Show}{\param{const bool}{ show}} | |
203 | ||
204 | Shows or hides the entire radiobox. | |
205 | ||
206 | \func{void}{Show}{\param{int }{item}, \param{const bool}{ show}} | |
207 | ||
208 | Shows or hides individual buttons. | |
209 | ||
210 | \wxheading{Parameters} | |
211 | ||
212 | \docparam{show}{TRUE to show, FALSE to hide.} | |
213 | ||
214 | \docparam{item}{The zero-based position of the button to show or hide.} | |
215 | ||
216 | \membersection{wxRadioBox::GetString}\label{wxradioboxgetstring} | |
217 | ||
218 | \constfunc{wxString}{GetString}{\param{int}{ n}} | |
219 | ||
220 | Returns the label for the button at the given position. | |
221 | ||
222 | \wxheading{Parameters} | |
223 | ||
224 | \docparam{n}{The zero-based button position.} | |
225 | ||
226 |