wxRuby Documentation Home

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.

Derived from

Control

Window

EvtHandler

Object

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.

Event handling

evt_radiobox(id) { | event | ... } Process a EVT_COMMAND_RADIOBOX_SELECTED event,when a radiobutton is clicked.

See also

Event handling overview, RadioButton, CheckBox

Methods

RadioBox.new

RadioBox.new(Window parent,  Integer id,  String label, 
             Point point = DEFAULT_POSITION, 
             Size size = DEFAULT_SIZE, 
             Integer n = 0, 
             String choices[] = nil, 
             Integer majorDimension = 0, 
             Integer style = RA_SPECIFY_COLS, 
             Validator validator = DEFAULT_VALIDATOR, 
             String name = "radioBox")
RadioBox.new(Window parent,  Integer id,  String label, 
             Point point, 
             Size size, 
             ArrayString choices, 
             Integer majorDimension = 0, 
             Integer style = RA_SPECIFY_COLS, 
             Validator validator = DEFAULT_VALIDATOR, 
             String name = "radioBox")

Constructor, creating and showing a radiobox.

Parameters

See also

RadioBox#create, Validator

destructor()

Destructor, destroying the radiobox item.

RadioBox#create

Boolean create(Window parent,  Integer id,  String label, 
               Point point = DEFAULT_POSITION, 
               Size size = DEFAULT_SIZE, 
               Integer n = 0, 
               String choices[] = nil, 
               Integer majorDimension = 0, 
               Integer style = RA_SPECIFY_COLS, 
               Validator validator = DEFAULT_VALIDATOR, 
               String name = "radioBox")
Boolean create(Window parent,  Integer id,  String label, 
               Point point, 
               Size size, 
               ArrayString choices, 
               Integer majorDimension = 0, 
               Integer style = RA_SPECIFY_COLS, 
               Validator validator = DEFAULT_VALIDATOR, 
               String name = "radioBox")

Creates the radiobox for two-step construction. See RadioBox.new for further details.

RadioBox#enable

Boolean enable(Boolean enable = true)

Enables or disables the entire radiobox.

Boolean enable(Integer n,  Boolean enable = true)

Enables or disables an individual button in the radiobox.

Parameters

See also

Window#enable

RadioBox#find_string

Integer find_string(String string)

Finds a button matching the given string, returning the position if found, or -1 if not found.

Parameters

RadioBox#get_count

Integer get_count()

Returns the number of items in the radiobox.

RadioBox#get_label

String get_label()

Returns the radiobox label.

Parameters

See also

RadioBox#set_label

RadioBox#get_selection

Integer get_selection()

Returns the zero-based position of the selected button.

RadioBox#get_string_selection

String get_string_selection()

Returns the selected string.

RadioBox#get_string

String get_string(Integer n)

Returns the label for the button at the given position.

Parameters

RadioBox#number

Integer number()

Obsolescence note: This method is obsolete and was replaced with get_count, 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.

RadioBox#set_label

set_label(String label)

Sets the radiobox label.

Parameters

RadioBox#set_selection

set_selection(Integer n)

Sets a button by passing the desired string position. This does not cause a EVT_COMMAND_RADIOBOX_SELECTED event to get emitted.

Parameters

RadioBox#set_string_selection

set_string_selection(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.

Parameters

RadioBox#show

Boolean show(Boolean show = true)

Shows or hides the entire radiobox.

Boolean show(Integer item,  Boolean show = true)

Shows or hides individual buttons.

Parameters

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.

See also

Window#show

[This page automatically generated from the Textile source at Thu May 01 00:50:42 +0100 2008]