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 Constructor, creating and showing a radiobox.
60 \wxheading{Parameters
}
62 \docparam{parent
}{Parent window. Must not be NULL.
}
64 \docparam{id
}{Window identifier. A value of -
1 indicates a default value.
}
66 \docparam{label
}{Label for the static box surrounding the radio buttons.
}
68 \docparam{pos
}{Window position. If the position (-
1, -
1) is specified then a default position is chosen.
}
70 \docparam{size
}{Window size. If the default size (-
1, -
1) is specified then a default size is chosen.
}
72 \docparam{n
}{Number of choices with which to initialize the radiobox.
}
74 \docparam{choices
}{An array of choices with which to initialize the radiobox.
}
76 \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
79 \docparam{style
}{Window style. See
\helpref{wxRadioBox
}{wxradiobox
}.
}
81 \docparam{validator
}{Window validator.
}
83 \docparam{name
}{Window name.
}
87 \helpref{wxRadioBox::Create
}{wxradioboxcreate
},
\helpref{wxValidator
}{wxvalidator
}
89 \membersection{wxRadioBox::
\destruct{wxRadioBox
}}
91 \func{}{\destruct{wxRadioBox
}}{\void}
93 Destructor, destroying the radiobox item.
95 \membersection{wxRadioBox::Create
}\label{wxradioboxcreate
}
97 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\param{const wxString\&
}{label
},
\rtfsp
98 \param{const wxPoint\&
}{point = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
99 \param{int
}{ n =
0},
\param{const wxString
}{ choices
[] = NULL
},
\rtfsp
100 \param{int
}{ majorDimension =
0},
\param{long
}{ style = wxRA
\_SPECIFY\_COLS},
\rtfsp
101 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
102 \param{const wxString\&
}{name = ``radioBox"
}}
104 Creates the radiobox for two-step construction. See
\helpref{wxRadioBox::wxRadioBox
}{wxradioboxconstr
}\rtfsp
107 \membersection{wxRadioBox::Enable
}\label{wxradioboxenable
}
109 \func{void
}{Enable
}{\param{const bool
}{ enable
}}
111 Enables or disables the entire radiobox.
113 \func{void
}{Enable
}{\param{int
}{ n
},
\param{const bool
}{ enable
}}
115 Enables or disables an individual button in the radiobox.
117 \wxheading{Parameters
}
119 \docparam{enable
}{TRUE to enable, FALSE to disable.
}
121 \docparam{n
}{The zero-based button to enable or disable.
}
123 \membersection{wxRadioBox::FindString
}\label{wxradioboxfindstring
}
125 \constfunc{int
}{FindString
}{\param{const wxString\&
}{string
}}
127 Finds a button matching the given string, returning the position if found, or
130 \wxheading{Parameters
}
132 \docparam{string
}{The string to find.
}
134 \membersection{wxRadioBox::GetLabel
}\label{wxradioboxgetlabel
}
136 \constfunc{wxString
}{GetLabel
}{\void}
138 Returns the radiobox label.
140 \constfunc{wxString
}{GetLabel
}{\param{int
}{n
}}
142 Returns the label for the given button.
144 \wxheading{Parameters
}
146 \docparam{n
}{The zero-based button index.
}
150 \helpref{wxRadioBox::SetLabel
}{wxradioboxsetlabel
}
152 \membersection{wxRadioBox::GetSelection
}\label{wxradioboxgetselection
}
154 \constfunc{int
}{GetSelection
}{\void}
156 Returns the zero-based position of the selected button.
158 \membersection{wxRadioBox::GetStringSelection
}\label{wxradioboxgetstringselection
}
160 \constfunc{wxString
}{GetStringSelection
}{\void}
162 Returns the selected string.
164 \membersection{wxRadioBox::Number
}\label{wxradioboxnumber
}
166 \constfunc{int
}{Number
}{\void}
168 Returns the number of buttons in the radiobox.
170 \membersection{wxRadioBox::SetLabel
}\label{wxradioboxsetlabel
}
172 \func{void
}{SetLabel
}{\param{const wxString\&
}{ label
}}
174 Sets the radiobox label.
176 \func{void
}{SetLabel
}{\param{int
}{n
},
\param{const wxString\&
}{ label
}}
178 Sets a label for a radio button.
180 \wxheading{Parameters
}
182 \docparam{label
}{The label to set.
}
184 \docparam{n
}{The zero-based button index.
}
186 \membersection{wxRadioBox::SetSelection
}\label{wxradioboxsetselection
}
188 \func{void
}{SetSelection
}{\param{int
}{ n
}}
190 Sets a button by passing the desired string position.
192 \wxheading{Parameters
}
194 \docparam{n
}{The zero-based button position.
}
196 \membersection{wxRadioBox::SetStringSelection
}\label{wxradioboxsetstringselection
}
198 \func{void
}{SetStringSelection
}{\param{const wxString\&
}{string
}}
200 Sets a button by passing the desired string.
202 \wxheading{Parameters
}
204 \docparam{string
}{The label of the button to select.
}
206 \membersection{wxRadioBox::Show
}\label{wxradioboxshow
}
208 \func{void
}{Show
}{\param{const bool
}{ show
}}
210 Shows or hides the entire radiobox.
212 \func{void
}{Show
}{\param{int
}{item
},
\param{const bool
}{ show
}}
214 Shows or hides individual buttons.
216 \wxheading{Parameters
}
218 \docparam{show
}{TRUE to show, FALSE to hide.
}
220 \docparam{item
}{The zero-based position of the button to show or hide.
}
222 \membersection{wxRadioBox::GetString
}\label{wxradioboxgetstring
}
224 \constfunc{wxString
}{GetString
}{\param{int
}{ n
}}
226 Returns the label for the button at the given position.
228 \wxheading{Parameters
}
230 \docparam{n
}{The zero-based button position.
}