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{Window styles
}
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.
}
22 See also
\helpref{window styles overview
}{windowstyles
}.
26 \helpref{Event handling overview
}{eventhandlingoverview
},
\helpref{wxRadioButton
}{wxradiobutton
},
\rtfsp
27 \helpref{wxCheckBox
}{wxcheckbox
}
29 \latexignore{\rtfignore{\wxheading{Members
}}}
31 \membersection{wxRadioBox::wxRadioBox
}\label{wxradioboxconstr
}
33 \func{}{wxRadioBox
}{\void}
37 \func{}{wxRadioBox
}{\param{wxWindow*
}{parent
},
\param{const wxWindowID
}{id
},
\param{const wxString\&
}{label
},
\rtfsp
38 \param{const wxPoint\&
}{point = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
39 \param{const int
}{ n =
0},
\param{const wxString
}{ choices
[] = NULL
},
\rtfsp
40 \param{const int
}{ majorDimension =
0},
\param{const long
}{ style = wxRA
\_HORIZONTAL},
\rtfsp
41 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
42 \param{const wxString\&
}{name = ``radioBox"
}}
44 Constructor, creating and showing a radiobox.
46 \wxheading{Parameters
}
48 \docparam{parent
}{Parent window. Must not be NULL.
}
50 \docparam{id
}{Window identifier. A value of -
1 indicates a default value.
}
52 \docparam{label
}{Label for the static box surrounding the radio buttons.
}
54 \docparam{pos
}{Window position. If the position (-
1, -
1) is specified then a default position is chosen.
}
56 \docparam{size
}{Window size. If the default size (-
1, -
1) is specified then a default size is chosen.
}
58 \docparam{n
}{Number of choices with which to initialize the radiobox.
}
60 \docparam{choices
}{An array of choices with which to initialize the radiobox.
}
62 \docparam{majorDimension
}{Specifies the number of rows (if style is wxRA
\_VERTICAL) or columns (if style is wxRA
\_HORIZONTAL) for a two-dimensional
65 \docparam{style
}{Window style. See
\helpref{wxRadioBox
}{wxradiobox
}.
}
67 \docparam{validator
}{Window validator.
}
69 \docparam{name
}{Window name.
}
73 \helpref{wxRadioBox::Create
}{wxradioboxcreate
},
\helpref{wxValidator
}{wxvalidator
}
75 \membersection{wxRadioBox::
\destruct{wxRadioBox
}}
77 \func{}{\destruct{wxRadioBox
}}{\void}
79 Destructor, destroying the radiobox item.
81 \membersection{wxRadioBox::Create
}\label{wxradioboxcreate
}
83 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{const wxWindowID
}{id
},
\param{const wxString\&
}{label
},
\rtfsp
84 \param{const wxPoint\&
}{point = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
85 \param{const int
}{ n =
0},
\param{const wxString
}{ choices
[] = NULL
},
\rtfsp
86 \param{const int
}{ majorDimension =
0},
\param{const long
}{ style = wxRA
\_HORIZONTAL},
\rtfsp
87 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
88 \param{const wxString\&
}{name = ``radioBox"
}}
90 Creates the radiobox for two-step construction. See
\helpref{wxRadioBox::wxRadioBox
}{wxradioboxconstr
}\rtfsp
93 \membersection{wxRadioBox::Enable
}\label{wxradioboxenable
}
95 \func{void
}{Enable
}{\param{const bool
}{ enable
}}
97 Enables or disables the entire radiobox.
99 \func{void
}{Enable
}{\param{const int
}{ n
},
\param{const bool
}{ enable
}}
101 Enables or disables an individual button in the radiobox.
103 \wxheading{Parameters
}
105 \docparam{enable
}{TRUE to enable, FALSE to disable.
}
107 \docparam{n
}{The zero-based button to enable or disable.
}
109 \membersection{wxRadioBox::FindString
}\label{wxradioboxfindstring
}
111 \constfunc{int
}{FindString
}{\param{const wxString\&
}{string
}}
113 Finds a button matching the given string, returning the position if found, or
116 \wxheading{Parameters
}
118 \docparam{string
}{The string to find.
}
120 \membersection{wxRadioBox::GetLabel
}\label{wxradioboxgetlabel
}
122 \constfunc{wxString
}{GetLabel
}{\void}
124 Returns the radiobox label.
126 \constfunc{wxString
}{GetLabel
}{\param{const int
}{n
}}
128 Returns the label for the given button.
130 \wxheading{Parameters
}
132 \docparam{n
}{The zero-based button index.
}
136 \helpref{wxRadioBox::SetLabel
}{wxradioboxsetlabel
}
138 \membersection{wxRadioBox::GetSelection
}\label{wxradioboxgetselection
}
140 \constfunc{int
}{GetSelection
}{\void}
142 Returns the zero-based position of the selected button.
144 \membersection{wxRadioBox::GetStringSelection
}\label{wxradioboxgetstringselection
}
146 \constfunc{wxString
}{GetStringSelection
}{\void}
148 Returns the selected string.
150 \membersection{wxRadioBox::Number
}\label{wxradioboxnumber
}
152 \constfunc{int
}{Number
}{\void}
154 Returns the number of buttons in the radiobox.
156 \membersection{wxRadioBox::SetLabel
}\label{wxradioboxsetlabel
}
158 \func{void
}{SetLabel
}{\param{const wxString\&
}{ label
}}
160 Sets the radiobox label.
162 \func{void
}{SetLabel
}{\param{const int
}{n
},
\param{const wxString\&
}{ label
}}
164 Sets a label for a radio button.
166 \wxheading{Parameters
}
168 \docparam{label
}{The label to set.
}
170 \docparam{n
}{The zero-based button index.
}
172 \membersection{wxRadioBox::SetSelection
}\label{wxradioboxsetselection
}
174 \func{void
}{SetSelection
}{\param{const int
}{ n
}}
176 Sets a button by passing the desired string position.
178 \wxheading{Parameters
}
180 \docparam{n
}{The zero-based button position.
}
182 \membersection{wxRadioBox::SetStringSelection
}\label{wxradioboxsetstringselection
}
184 \func{void
}{SetStringSelection
}{\param{const wxString\&
}{string
}}
186 Sets a button by passing the desired string.
188 \wxheading{Parameters
}
190 \docparam{string
}{The label of the button to select.
}
192 \membersection{wxRadioBox::Show
}\label{wxradioboxshow
}
194 \func{void
}{Show
}{\param{const bool
}{ show
}}
196 Shows or hides the entire radiobox.
198 \func{void
}{Show
}{\param{const int
}{item
},
\param{const bool
}{ show
}}
200 Shows or hides individual buttons.
202 \wxheading{Parameters
}
204 \docparam{show
}{TRUE to show, FALSE to hide.
}
206 \docparam{item
}{The zero-based position of the button to show or hide.
}
208 \membersection{wxRadioBox::GetString
}\label{wxradioboxgetstring
}
210 \constfunc{wxString
}{GetString
}{\param{const int
}{ n
}}
212 Returns the label for the button at the given position.
214 \wxheading{Parameters
}
216 \docparam{n
}{The zero-based button position.
}