1 \section{\class{wxRadioBox
}}\label{wxradiobox
}
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
7 \wxheading{Derived from
}
9 \helpref{wxControl
}{wxcontrol
}\\
10 \helpref{wxWindow
}{wxwindow
}\\
11 \helpref{wxEvtHandler
}{wxevthandler
}\\
12 \helpref{wxObject
}{wxobject
}
14 \wxheading{Include files
}
18 \wxheading{Window styles
}
21 \begin{twocollist
}\itemsep=
0pt
22 \twocolitem{\windowstyle{wxRA
\_SPECIFY\_ROWS}}{The major dimension parameter refers to the
23 maximum number of rows.
}
24 \twocolitem{\windowstyle{wxRA
\_SPECIFY\_COLS}}{The major dimension parameter refers to the
25 maximum number of columns.
}
28 See also
\helpref{window styles overview
}{windowstyles
}.
30 \wxheading{Event handling
}
33 \begin{twocollist
}\itemsep=
0pt
34 \twocolitem{{\bf EVT
\_RADIOBOX(id, func)
}}{Process a wxEVT
\_COMMAND\_RADIOBOX\_SELECTED event,
35 when a radiobutton is clicked.
}
40 \helpref{Event handling overview
}{eventhandlingoverview
},
\helpref{wxRadioButton
}{wxradiobutton
},
\rtfsp
41 \helpref{wxCheckBox
}{wxcheckbox
}
43 \latexignore{\rtfignore{\wxheading{Members
}}}
45 \membersection{wxRadioBox::wxRadioBox
}\label{wxradioboxconstr
}
47 \func{}{wxRadioBox
}{\void}
51 \func{}{wxRadioBox
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\param{const wxString\&
}{label
},
\rtfsp
52 \param{const wxPoint\&
}{point = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
53 \param{int
}{ n =
0},
\param{const wxString
}{ choices
[] = NULL
},
\rtfsp
54 \param{int
}{ majorDimension =
0},
\param{long
}{ style = wxRA
\_SPECIFY\_COLS},
\rtfsp
55 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
56 \param{const wxString\&
}{name = ``radioBox"
}}
58 \func{}{wxRadioBox
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\param{const wxString\&
}{label
},
\rtfsp
59 \param{const wxPoint\&
}{point
},
\param{const wxSize\&
}{size
},
\rtfsp
60 \param{const wxArrayString\&
}{ choices
},
\rtfsp
61 \param{int
}{ majorDimension =
0},
\param{long
}{ style = wxRA
\_SPECIFY\_COLS},
\rtfsp
62 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
63 \param{const wxString\&
}{name = ``radioBox"
}}
65 Constructor, creating and showing a radiobox.
67 \wxheading{Parameters
}
69 \docparam{parent
}{Parent window. Must not be NULL.
}
71 \docparam{id
}{Window identifier. A value of -
1 indicates a default value.
}
73 \docparam{label
}{Label for the static box surrounding the radio buttons.
}
75 \docparam{pos
}{Window position. If the position (-
1, -
1) is specified then a default position is chosen.
}
77 \docparam{size
}{Window size. If the default size (-
1, -
1) is specified then a default size is chosen.
}
79 \docparam{n
}{Number of choices with which to initialize the radiobox.
}
81 \docparam{choices
}{An array of choices with which to initialize the radiobox.
}
83 \docparam{majorDimension
}{Specifies the maximum number of rows (if style contains wxRA
\_SPECIFY\_ROWS) or columns (if style contains wxRA
\_SPECIFY\_COLS) for a two-dimensional
86 \docparam{style
}{Window style. See
\helpref{wxRadioBox
}{wxradiobox
}.
}
88 \docparam{validator
}{Window validator.
}
90 \docparam{name
}{Window name.
}
94 \helpref{wxRadioBox::Create
}{wxradioboxcreate
},
\helpref{wxValidator
}{wxvalidator
}
96 \pythonnote{The wxRadioBox constructor in wxPython reduces the
{\tt n
}
97 and
{\tt choices
} arguments are to a single argument, which is
100 \perlnote{In wxPerl there is just an array reference in place of
{\tt n
}
103 \membersection{wxRadioBox::
\destruct{wxRadioBox
}}
105 \func{}{\destruct{wxRadioBox
}}{\void}
107 Destructor, destroying the radiobox item.
109 \membersection{wxRadioBox::Create
}\label{wxradioboxcreate
}
111 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\param{const wxString\&
}{label
},
\rtfsp
112 \param{const wxPoint\&
}{point = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
113 \param{int
}{ n =
0},
\param{const wxString
}{ choices
[] = NULL
},
\rtfsp
114 \param{int
}{ majorDimension =
0},
\param{long
}{ style = wxRA
\_SPECIFY\_COLS},
\rtfsp
115 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
116 \param{const wxString\&
}{name = ``radioBox"
}}
118 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\param{const wxString\&
}{label
},
\rtfsp
119 \param{const wxPoint\&
}{point
},
\param{const wxSize\&
}{size
},
\rtfsp
120 \param{const wxArrayString\&
}{ choices
},
\rtfsp
121 \param{int
}{ majorDimension =
0},
\param{long
}{ style = wxRA
\_SPECIFY\_COLS},
\rtfsp
122 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
123 \param{const wxString\&
}{name = ``radioBox"
}}
125 Creates the radiobox for two-step construction. See
\helpref{wxRadioBox::wxRadioBox
}{wxradioboxconstr
}\rtfsp
128 \membersection{wxRadioBox::Enable
}\label{wxradioboxenable
}
130 \func{void
}{Enable
}{\param{bool
}{ enable =
{\tt true
}}}
132 Enables or disables the entire radiobox.
134 \func{void
}{Enable
}{\param{int
}{ n
},
\param{bool
}{ enable =
{\tt true
}}}
136 Enables or disables an individual button in the radiobox.
138 \wxheading{Parameters
}
140 \docparam{enable
}{true to enable, false to disable.
}
142 \docparam{n
}{The zero-based button to enable or disable.
}
144 \pythonnote{In place of a single overloaded method name, wxPython
145 implements the following methods:
\par
146 \indented{2cm
}{\begin{twocollist
}
147 \twocolitem{{\bf Enable(flag)
}}{Enables or disables the entire radiobox.
}
148 \twocolitem{{\bf EnableItem(n, flag)
}}{Enables or disables an
149 individual button in the radiobox.
}
154 \membersection{wxRadioBox::FindString
}\label{wxradioboxfindstring
}
156 \constfunc{int
}{FindString
}{\param{const wxString\&
}{string
}}
158 Finds a button matching the given string, returning the position if found, or
161 \wxheading{Parameters
}
163 \docparam{string
}{The string to find.
}
165 \membersection{wxRadioBox::GetCount
}\label{wxradioboxgetcount
}
167 \constfunc{int
}{GetCount
}{\void}
169 Returns the number of items in the radiobox.
171 \membersection{wxRadioBox::GetLabel
}\label{wxradioboxgetlabel
}
173 \constfunc{wxString
}{GetLabel
}{\void}
175 Returns the radiobox label.
177 \constfunc{wxString
}{GetLabel
}{\param{int
}{n
}}
179 Returns the label for the given button.
181 \wxheading{Parameters
}
183 \docparam{n
}{The zero-based button index.
}
187 \helpref{wxRadioBox::SetLabel
}{wxradioboxsetlabel
}
189 \pythonnote{In place of a single overloaded method name, wxPython
190 implements the following methods:
\par
191 \indented{2cm
}{\begin{twocollist
}
192 \twocolitem{{\bf GetLabel()
}}{Returns the radiobox label.
}
193 \twocolitem{{\bf GetItemLabel(n)
}}{Returns the label for the given button.
}
198 \membersection{wxRadioBox::GetSelection
}\label{wxradioboxgetselection
}
200 \constfunc{int
}{GetSelection
}{\void}
202 Returns the zero-based position of the selected button.
204 \membersection{wxRadioBox::GetStringSelection
}\label{wxradioboxgetstringselection
}
206 \constfunc{wxString
}{GetStringSelection
}{\void}
208 Returns the selected string.
210 \membersection{wxRadioBox::Number
}\label{wxradioboxnumber
}
212 \constfunc{int
}{Number
}{\void}
214 {\bf Obsolescence note:
} This method is obsolete and was replaced with
215 \helpref{GetCount
}{wxradioboxgetcount
}, please use the new method in the new
216 code. This method is only available if wxWindows was compiled with
217 {\tt WXWIN
\_COMPATIBILITY\_2\_2} defined and will disappear completely in
220 Returns the number of buttons in the radiobox.
222 \membersection{wxRadioBox::SetLabel
}\label{wxradioboxsetlabel
}
224 \func{void
}{SetLabel
}{\param{const wxString\&
}{ label
}}
226 Sets the radiobox label.
228 \func{void
}{SetLabel
}{\param{int
}{n
},
\param{const wxString\&
}{ label
}}
230 Sets a label for a radio button.
232 \wxheading{Parameters
}
234 \docparam{label
}{The label to set.
}
236 \docparam{n
}{The zero-based button index.
}
238 \pythonnote{In place of a single overloaded method name, wxPython
239 implements the following methods:
\par
240 \indented{2cm
}{\begin{twocollist
}
241 \twocolitem{{\bf SetLabel(string)
}}{Sets the radiobox label.
}
242 \twocolitem{{\bf SetItemLabel(n, string)
}}{Sets a label for a radio button.
}
246 \membersection{wxRadioBox::SetSelection
}\label{wxradioboxsetselection
}
248 \func{void
}{SetSelection
}{\param{int
}{ n
}}
250 Sets a button by passing the desired string position. This does not cause
251 a wxEVT
\_COMMAND\_RADIOBOX\_SELECTED event to get emitted.
253 \wxheading{Parameters
}
255 \docparam{n
}{The zero-based button position.
}
257 \membersection{wxRadioBox::SetStringSelection
}\label{wxradioboxsetstringselection
}
259 \func{void
}{SetStringSelection
}{\param{const wxString\&
}{string
}}
261 Sets the selection to a button by passing the desired string. This does not cause
262 a wxEVT
\_COMMAND\_RADIOBOX\_SELECTED event to get emitted.
264 \wxheading{Parameters
}
266 \docparam{string
}{The label of the button to select.
}
268 \membersection{wxRadioBox::Show
}\label{wxradioboxshow
}
270 \func{void
}{Show
}{\param{const bool
}{ show
}}
272 Shows or hides the entire radiobox.
274 \func{void
}{Show
}{\param{int
}{item
},
\param{const bool
}{ show
}}
276 Shows or hides individual buttons.
278 \wxheading{Parameters
}
280 \docparam{show
}{true to show, false to hide.
}
282 \docparam{item
}{The zero-based position of the button to show or hide.
}
284 \pythonnote{In place of a single overloaded method name, wxPython
285 implements the following methods:
\par
286 \indented{2cm
}{\begin{twocollist
}
287 \twocolitem{{\bf Show(flag)
}}{Shows or hides the entire radiobox.
}
288 \twocolitem{{\bf ShowItem(n, flag)
}}{Shows or hides individual buttons.
}
292 \membersection{wxRadioBox::GetString
}\label{wxradioboxgetstring
}
294 \constfunc{wxString
}{GetString
}{\param{int
}{ n
}}
296 Returns the label for the button at the given position.
298 \wxheading{Parameters
}
300 \docparam{n
}{The zero-based button position.
}