h1(#wxradiobox). Wx::RadioBox
A radio box item is used to select one of number of mutually exclusive
choices. It is displayed as a vertical column or horizontal row of
labelled buttons.
h2. Derived from
"Control":control.html
"Window":window.html
"EvtHandler":evthandler.html
"Object":object.html
h2. Window styles
|@RA_SPECIFY_ROWS@|The major dimension parameter refers to themaximum number of rows.|
|@RA_SPECIFY_COLS@|The major dimension parameter refers to themaximum number of columns.|
|@RA_USE_CHECKBOX@|Use of the checkbox controls instead of radiobuttons (currently supported only on PalmOS)|
See also "window styles overview":windowstyles.html.
h2. Event handling
|*evt_radiobox(id) { | event | ... }*|Process a EVT_COMMAND_RADIOBOX_SELECTED event,when a radiobutton is clicked.|
h2. See also
"Event handling overview":eventhandlingoverview.html, "RadioButton":radiobutton.html, "CheckBox":checkbox.html
h2. Methods
* "RadioBox.new":#RadioBox_new
* "RadioBox#create":#RadioBox_create
* "RadioBox#enable":#RadioBox_enable
* "RadioBox#find_string":#RadioBox_findstring
* "RadioBox#get_count":#RadioBox_getcount
* "RadioBox#get_label":#RadioBox_getlabel
* "RadioBox#get_selection":#RadioBox_getselection
* "RadioBox#get_string_selection":#RadioBox_getstringselection
* "RadioBox#get_string":#RadioBox_getstring
* "RadioBox#number":#RadioBox_number
* "RadioBox#set_label":#RadioBox_setlabel
* "RadioBox#set_selection":#RadioBox_setselection
* "RadioBox#set_string_selection":#RadioBox_setstringselection
* "RadioBox#show":#RadioBox_show
h3(#RadioBox_new). RadioBox.new
*RadioBox.new*(%(arg-type)"Window":window.html% parent, %(arg-type)Integer% id, %(arg-type)String% label,
%(arg-type)"Point":point.html% point = DEFAULT_POSITION,
%(arg-type)"Size":size.html% size = DEFAULT_SIZE,
%(arg-type)Integer% n = 0,
%(arg-type)String% choices[] = nil,
%(arg-type)Integer% majorDimension = 0,
%(arg-type)Integer% style = RA_SPECIFY_COLS,
%(arg-type)"Validator":validator.html% validator = DEFAULT_VALIDATOR,
%(arg-type)String% name = "radioBox")
*RadioBox.new*(%(arg-type)"Window":window.html% parent, %(arg-type)Integer% id, %(arg-type)String% label,
%(arg-type)"Point":point.html% point,
%(arg-type)"Size":size.html% size,
%(arg-type)"ArrayString":arraystring.html% choices,
%(arg-type)Integer% majorDimension = 0,
%(arg-type)Integer% style = RA_SPECIFY_COLS,
%(arg-type)"Validator":validator.html% validator = DEFAULT_VALIDATOR,
%(arg-type)String% name = "radioBox")
Constructor, creating and showing a radiobox.
h4. Parameters
* _parent_ Parent window. Must not be NULL.
* _id_ Window identifier. A value of -1 indicates a default value.
* _label_ Label for the static box surrounding the radio buttons.
* _pos_ Window position. If the position (-1, -1) is specified then a default position is chosen.
* _size_ Window size. If the default size (-1, -1) is specified then a default size is chosen.
* _n_ Number of choices with which to initialize the radiobox.
* _choices_ An array of choices with which to initialize the radiobox.
* _majorDimension_ Specifies the maximum number of rows (if style contains RA_SPECIFY_ROWS) or columns (if style contains RA_SPECIFY_COLS) for a two-dimensional
radiobox.
* _style_ Window style. See "RadioBox":radiobox.html.
* _validator_ Window validator.
* _name_ Window name.
h4. See also
"RadioBox#create":radiobox.html#RadioBox_create, "Validator":validator.html
*destructor*()
Destructor, destroying the radiobox item.
h3(#RadioBox_create). RadioBox#create
Boolean *create*(%(arg-type)"Window":window.html% parent, %(arg-type)Integer% id, %(arg-type)String% label,
%(arg-type)"Point":point.html% point = DEFAULT_POSITION,
%(arg-type)"Size":size.html% size = DEFAULT_SIZE,
%(arg-type)Integer% n = 0,
%(arg-type)String% choices[] = nil,
%(arg-type)Integer% majorDimension = 0,
%(arg-type)Integer% style = RA_SPECIFY_COLS,
%(arg-type)"Validator":validator.html% validator = DEFAULT_VALIDATOR,
%(arg-type)String% name = "radioBox")
Boolean *create*(%(arg-type)"Window":window.html% parent, %(arg-type)Integer% id, %(arg-type)String% label,
%(arg-type)"Point":point.html% point,
%(arg-type)"Size":size.html% size,
%(arg-type)"ArrayString":arraystring.html% choices,
%(arg-type)Integer% majorDimension = 0,
%(arg-type)Integer% style = RA_SPECIFY_COLS,
%(arg-type)"Validator":validator.html% validator = DEFAULT_VALIDATOR,
%(arg-type)String% name = "radioBox")
Creates the radiobox for two-step construction. See "RadioBox.new":radiobox.html#RadioBox_new for further details.
h3(#RadioBox_enable). RadioBox#enable
Boolean *enable*(%(arg-type)Boolean% enable = @true@)
Enables or disables the entire radiobox.
Boolean *enable*(%(arg-type)Integer% n, %(arg-type)Boolean% enable = @true@)
Enables or disables an individual button in the radiobox.
h4. Parameters
* _enable_ true to enable, false to disable.
* _n_ The zero-based button to enable or disable.
h4. See also
"Window#enable":window.html#Window_enable
h3(#RadioBox_findstring). RadioBox#find_string
Integer *find_string*(%(arg-type)String% string)
Finds a button matching the given string, returning the position if found, or
-1 if not found.
h4. Parameters
* _string_ The string to find.
h3(#RadioBox_getcount). RadioBox#get_count
Integer *get_count*()
Returns the number of items in the radiobox.
h3(#RadioBox_getlabel). RadioBox#get_label
String *get_label*()
Returns the radiobox label.
h4. Parameters
* _n_ The zero-based button index.
h4. See also
"RadioBox#set_label":radiobox.html#RadioBox_setlabel
h3(#RadioBox_getselection). RadioBox#get_selection
Integer *get_selection*()
Returns the zero-based position of the selected button.
h3(#RadioBox_getstringselection). RadioBox#get_string_selection
String *get_string_selection*()
Returns the selected string.
h3(#RadioBox_getstring). RadioBox#get_string
String *get_string*(%(arg-type)Integer% n)
Returns the label for the button at the given position.
h4. Parameters
* _n_ The zero-based button position.
h3(#RadioBox_number). RadioBox#number
Integer *number*()
*Obsolescence note:* This method is obsolete and was replaced with
"get_count":#RadioBox_getcount, please use the new method in the new
code. This method is only available if Widgets was compiled with
@WXWIN_COMPATIBILITY_2_2@ defined and will disappear completely in
future versions.
Returns the number of buttons in the radiobox.
h3(#RadioBox_setlabel). RadioBox#set_label
*set_label*(%(arg-type)String% label)
Sets the radiobox label.
h4. Parameters
* _label_ The label to set.
* _n_ The zero-based button index.
h3(#RadioBox_setselection). RadioBox#set_selection
*set_selection*(%(arg-type)Integer% n)
Sets a button by passing the desired string position. This does not cause
a EVT_COMMAND_RADIOBOX_SELECTED event to get emitted.
h4. Parameters
* _n_ The zero-based button position.
h3(#RadioBox_setstringselection). RadioBox#set_string_selection
*set_string_selection*(%(arg-type)String% string)
Sets the selection to a button by passing the desired string. This does not cause
a EVT_COMMAND_RADIOBOX_SELECTED event to get emitted.
h4. Parameters
* _string_ The label of the button to select.
h3(#RadioBox_show). RadioBox#show
Boolean *show*(%(arg-type)Boolean% show = @true@)
Shows or hides the entire radiobox.
Boolean *show*(%(arg-type)Integer% item, %(arg-type)Boolean% show = @true@)
Shows or hides individual buttons.
h4. Parameters
* _show_ true to show, false to hide.
* _item_ The zero-based position of the button to show or hide.
h4. Return value
@true@ if the box or item has been shown or hidden or @false@ if nothing was
done because it already was in the requested state.
h4. See also
"Window#show":window.html#Window_show