Search documentation of wx

# View Source wxRadioBox (wx v2.4.2)

Functions for wxRadioBox class

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.

Styles

This class supports the following styles:

See: Overview events, `wxRadioButton`, `wxCheckBox`

This class is derived (and can use functions) from: `wxControl` `wxWindow` `wxEvtHandler`

wxWidgets docs: wxRadioBox

## Events

Event types emitted from this class: `command_radiobox_selected`

# Summary

## Types

wxRadioBox()

## Functions

create(This, Parent, Id, Label, Pos, Size, Choices)
create/8

Creates the radiobox for two-step construction.

destroy(This)

Destructor, destroying the radiobox item.

enable(This)
enable/2

Enables or disables the radiobox.

enable/3

Enables or disables an individual button in the radiobox.

getColumnCount(This)

Returns the number of columns in the radiobox.

getItemFromPoint(This, Pt)

Returns a radio box item under the point, a zero-based item index, or `wxNOT_FOUND` if no item is under the point.

getItemHelpText(This, Item)

Returns the helptext associated with the specified `item` if any or `wxEmptyString`.

getItemToolTip(This, Item)

Returns the tooltip associated with the specified `item` if any or NULL.

getRowCount(This)

Returns the number of rows in the radiobox.

getSelection(This)

Returns the index of the selected item or `wxNOT_FOUND` if no item is selected.

getString(This, N)

Returns the label of the item with the given index.

isItemEnabled(This, N)

Returns true if the item is enabled or false if it was disabled using `enable/3`.

isItemShown(This, N)

Returns true if the item is currently shown or false if it was hidden using `show/3`.

new(Parent, Id, Label, Pos, Size, Choices)
new/7

Constructor, creating and showing a radiobox.

setItemHelpText(This, Item, Helptext)

Sets the helptext for an item.

setItemToolTip(This, Item, Text)

Sets the tooltip text for the specified item in the radio group.

setSelection(This, N)

Sets the selection to the given item.

show(This, Item)
show/3

Shows or hides individual buttons.

# Types

Link to this type

# wxRadioBox()

View Source

    -type wxRadioBox() :: wx:wx_object().

# Functions

Link to this function

# create(This, Parent, Id, Label, Pos, Size, Choices)

View Source

    -spec create(This, Parent, Id, Label, Pos, Size, Choices) -> boolean()
                    when
                        This :: wxRadioBox(),
                        Parent :: wxWindow:wxWindow(),
                        Id :: integer(),
                        Label :: unicode:chardata(),
                        Pos :: {X :: integer(), Y :: integer()},
                        Size :: {W :: integer(), H :: integer()},
                        Choices :: [unicode:chardata()].

Link to this function

# create/8

View Source

    -spec create(This, Parent, Id, Label, Pos, Size, Choices, [Option]) -> boolean()
                    when
                        This :: wxRadioBox(),
                        Parent :: wxWindow:wxWindow(),
                        Id :: integer(),
                        Label :: unicode:chardata(),
                        Pos :: {X :: integer(), Y :: integer()},
                        Size :: {W :: integer(), H :: integer()},
                        Choices :: [unicode:chardata()],
                        Option :: {majorDim, integer()} | {style, integer()} | {val, wx:wx_object()}.

Creates the radiobox for two-step construction.

See `new/7` for further details.

Link to this function

# destroy(This)

View Source

    -spec destroy(This :: wxRadioBox()) -> ok.

Destructor, destroying the radiobox item.

Link to this function

# enable(This)

View Source

    -spec enable(This) -> boolean() when This :: wxRadioBox().

Link to this function

# enable/2

View Source

    -spec enable(This, N) -> boolean() when This :: wxRadioBox(), N :: integer();
                (This, [Option]) -> boolean() when This :: wxRadioBox(), Option :: {enable, boolean()}.

Enables or disables the radiobox.

See: `wxWindow:enable/2`

Link to this function

# enable/3

View Source

    -spec enable(This, N, [Option]) -> boolean()
                    when This :: wxRadioBox(), N :: integer(), Option :: {enable, boolean()}.

Enables or disables an individual button in the radiobox.

See: `wxWindow:enable/2`

Link to this function

# getColumnCount(This)

View Source

    -spec getColumnCount(This) -> integer() when This :: wxRadioBox().

Returns the number of columns in the radiobox.

Link to this function

# getItemFromPoint(This, Pt)

View Source

    -spec getItemFromPoint(This, Pt) -> integer()
                              when This :: wxRadioBox(), Pt :: {X :: integer(), Y :: integer()}.

Returns a radio box item under the point, a zero-based item index, or `wxNOT_FOUND` if no item is under the point.

Link to this function

# getItemHelpText(This, Item)

View Source

    -spec getItemHelpText(This, Item) -> unicode:charlist() when This :: wxRadioBox(), Item :: integer().

Returns the helptext associated with the specified `item` if any or `wxEmptyString`.

See: `setItemHelpText/3`

Link to this function

# getItemToolTip(This, Item)

View Source

    -spec getItemToolTip(This, Item) -> wxToolTip:wxToolTip() when This :: wxRadioBox(), Item :: integer().

Returns the tooltip associated with the specified `item` if any or NULL.

See: `setItemToolTip/3`, `wxWindow:getToolTip/1`

Link to this function

# getRowCount(This)

View Source

    -spec getRowCount(This) -> integer() when This :: wxRadioBox().

Returns the number of rows in the radiobox.

Link to this function

# getSelection(This)

View Source

    -spec getSelection(This) -> integer() when This :: wxRadioBox().

Returns the index of the selected item or `wxNOT_FOUND` if no item is selected.

Return: The position of the current selection.

Remark: This method can be used with single selection list boxes only, you should use `wxListBox:getSelections/1` for the list boxes with wxLB_MULTIPLE style.

See: `setSelection/2`, `wxControlWithItems:getStringSelection/1`

Link to this function

# getString(This, N)

View Source

    -spec getString(This, N) -> unicode:charlist() when This :: wxRadioBox(), N :: integer().

Returns the label of the item with the given index.

Return: The label of the item or an empty string if the position was invalid.

Link to this function

# isItemEnabled(This, N)

View Source

    -spec isItemEnabled(This, N) -> boolean() when This :: wxRadioBox(), N :: integer().

Returns true if the item is enabled or false if it was disabled using `enable/3`.

This function is currently only implemented in wxMSW, wxGTK, wxQT and wxUniversal and always returns true in the other ports.

Link to this function

# isItemShown(This, N)

View Source

    -spec isItemShown(This, N) -> boolean() when This :: wxRadioBox(), N :: integer().

Returns true if the item is currently shown or false if it was hidden using `show/3`.

Note that this function returns true for an item which hadn't been hidden even if the entire radiobox is not currently shown.

This function is currently only implemented in wxMSW, wxGTK, wxQT and wxUniversal and always returns true in the other ports.

Link to this function

# new(Parent, Id, Label, Pos, Size, Choices)

View Source

    -spec new(Parent, Id, Label, Pos, Size, Choices) -> wxRadioBox()
                 when
                     Parent :: wxWindow:wxWindow(),
                     Id :: integer(),
                     Label :: unicode:chardata(),
                     Pos :: {X :: integer(), Y :: integer()},
                     Size :: {W :: integer(), H :: integer()},
                     Choices :: [unicode:chardata()].

Link to this function

# new/7

View Source

    -spec new(Parent, Id, Label, Pos, Size, Choices, [Option]) -> wxRadioBox()
                 when
                     Parent :: wxWindow:wxWindow(),
                     Id :: integer(),
                     Label :: unicode:chardata(),
                     Pos :: {X :: integer(), Y :: integer()},
                     Size :: {W :: integer(), H :: integer()},
                     Choices :: [unicode:chardata()],
                     Option :: {majorDim, integer()} | {style, integer()} | {val, wx:wx_object()}.

Constructor, creating and showing a radiobox.

See: `create/8`, `wxValidator` (not implemented in wx)

Link to this function

# setItemHelpText(This, Item, Helptext)

View Source

    -spec setItemHelpText(This, Item, Helptext) -> ok
                             when This :: wxRadioBox(), Item :: integer(), Helptext :: unicode:chardata().

Sets the helptext for an item.

Empty string erases any existing helptext.

See: `getItemHelpText/2`

Link to this function

# setItemToolTip(This, Item, Text)

View Source

    -spec setItemToolTip(This, Item, Text) -> ok
                            when This :: wxRadioBox(), Item :: integer(), Text :: unicode:chardata().

Sets the tooltip text for the specified item in the radio group.

This function is currently only implemented in wxMSW and wxGTK2 and does nothing in the other ports.

See: `getItemToolTip/2`, `wxWindow:setToolTip/2`

Link to this function

# setSelection(This, N)

View Source

    -spec setSelection(This, N) -> ok when This :: wxRadioBox(), N :: integer().

Sets the selection to the given item.

Notice that a radio box always has selection, so `n` must be valid here and passing `wxNOT_FOUND` is not allowed.

Link to this function

# show(This, Item)

View Source

    -spec show(This, Item) -> boolean() when This :: wxRadioBox(), Item :: integer().

Link to this function

# show/3

View Source

    -spec show(This, Item, [Option]) -> boolean()
                  when This :: wxRadioBox(), Item :: integer(), Option :: {show, boolean()}.

Shows or hides individual buttons.

Return: true if the item has been shown or hidden or false if nothing was done because it already was in the requested state.

See: `show/3`