Contents Up Previous Next

wxRadioBox

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

wxControlWithItems
wxControl
wxWindow
wxEvtHandler
wxObject

Include files

<wx/radiobox.h>

Window styles

wxRA_SPECIFY_ROWS The major dimension parameter refers to the maximum number of rows.
wxRA_SPECIFY_COLS The major dimension parameter refers to the maximum number of columns.
wxRA_USE_CHECKBOX Use of the checkbox controls instead of radio buttons (currently supported only on PalmOS)

See also window styles overview.

Event handling

EVT_RADIOBOX(id, func) Process a wxEVT_COMMAND_RADIOBOX_SELECTED event, when a radiobutton is clicked.

See also

Event handling overview, wxRadioButton, wxCheckBox

Members

wxRadioBox::wxRadioBox
wxRadioBox::~wxRadioBox
wxRadioBox::Create
wxRadioBox::Enable
wxRadioBox::FindString
wxRadioBox::GetColumnCount
wxRadioBox::GetItemHelpText
wxRadioBox::GetItemToolTip
wxRadioBox::GetItemFromPoint
wxRadioBox::GetLabel
wxRadioBox::GetRowCount
wxRadioBox::GetSelection
wxRadioBox::GetStringSelection
wxRadioBox::GetString
wxRadioBox::IsItemEnabled
wxRadioBox::IsItemShown
wxRadioBox::SetItemHelpText
wxRadioBox::SetLabel
wxRadioBox::SetSelection
wxRadioBox::SetStringSelection
wxRadioBox::SetItemToolTip
wxRadioBox::Show


wxRadioBox::wxRadioBox

wxRadioBox()

Default constructor.

wxRadioBox(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& point = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = NULL, int majorDimension = 0, long style = wxRA_SPECIFY_COLS, const wxValidator& validator = wxDefaultValidator, const wxString& name = "radioBox")

wxRadioBox(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& point, const wxSize& size, const wxArrayString& choices, int majorDimension = 0, long style = wxRA_SPECIFY_COLS, const wxValidator& validator = wxDefaultValidator, const wxString& name = "radioBox")

Constructor, creating and showing a radiobox.

Parameters

parent

id

label

pos

size

n

choices

majorDimension

style

validator

name

See also

wxRadioBox::Create, wxValidator

wxPython note: The wxRadioBox constructor in wxPython reduces the n and choices arguments are to a single argument, which is a list of strings.


wxRadioBox::~wxRadioBox

~wxRadioBox()

Destructor, destroying the radiobox item.


wxRadioBox::Create

bool Create(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& point = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = NULL, int majorDimension = 0, long style = wxRA_SPECIFY_COLS, const wxValidator& validator = wxDefaultValidator, const wxString& name = "radioBox")

bool Create(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& point, const wxSize& size, const wxArrayString& choices, int majorDimension = 0, long style = wxRA_SPECIFY_COLS, const wxValidator& validator = wxDefaultValidator, const wxString& name = "radioBox")

Creates the radiobox for two-step construction. See wxRadioBox::wxRadioBox for further details.


wxRadioBox::Enable

virtual bool Enable(bool enable = true)

Enables or disables the entire radiobox.

virtual bool Enable(unsigned int n, bool enable = true)

Enables or disables an individual button in the radiobox.

Parameters

enable

n

wxPython note: In place of a single overloaded method name, wxPython implements the following methods:

See also

wxWindow::Enable


wxRadioBox::FindString

int FindString(const wxString& string) const

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

Parameters

string


wxRadioBox::GetColumnCount

unsigned int GetColumnCount() const

Returns the number of columns in the radiobox.


wxRadioBox::GetItemHelpText

wxString GetItemHelpText(unsigned int item) const

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

Parameters

item

See also

SetItemHelpText


wxRadioBox::GetItemToolTip

wxToolTip * GetItemToolTip(unsigned int item) const

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

See also

SetItemToolTip,
wxWindow::GetToolTip


wxRadioBox::GetItemFromPoint

int GetItemFromPoint(const wxPoint pt) const

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

pt


wxRadioBox::GetLabel

wxString GetLabel() const

Returns the radiobox label.

Parameters

n

See also

wxRadioBox::SetLabel

wxPython note: In place of a single overloaded method name, wxPython implements the following methods:


wxRadioBox::GetRowCount

unsigned int GetRowCount() const

Returns the number of rows in the radiobox.


wxRadioBox::GetSelection

int GetSelection() const

Returns the zero-based position of the selected button.


wxRadioBox::GetStringSelection

wxString GetStringSelection() const

Returns the selected string.


wxRadioBox::GetString

wxString GetString(unsigned int n) const

Returns the label for the button at the given position.

Parameters

n


wxRadioBox::IsItemEnabled

bool IsItemEnabled(unsigned int n) const

Returns true if the item is enabled or false if it was disabled using Enable(n, false).

Platform note: Currently only implemented in wxMSW, wxGTK and wxUniversal and always returns true in the other ports.

Parameters

n


wxRadioBox::IsItemShown

bool IsItemShown(unsigned int n) const

Returns true if the item is currently shown or false if it was hidden using Show(n, false).

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

Platform note: Currently only implemented in wxMSW, wxGTK and wxUniversal and always returns true in the other ports.

Parameters

n


wxRadioBox::SetItemHelpText

void SetItemHelpText(unsigned int item, const wxString& helptext)

Sets the helptext for an item. Empty string erases any existing helptext.

Parameters

item

helptext

See also

GetItemHelpText


wxRadioBox::SetLabel

void SetLabel(const wxString& label)

Sets the radiobox label.

Parameters

label

n

wxPython note: In place of a single overloaded method name, wxPython implements the following methods:


wxRadioBox::SetSelection

void SetSelection(int n)

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

Parameters

n


wxRadioBox::SetStringSelection

void SetStringSelection(const wxString& string)

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

Parameters

string


wxRadioBox::SetItemToolTip

void SetItemToolTip(unsigned int item, const wxString& text)

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

Platform note: Currently only implemented in wxMSW and wxGTK2 and does nothing in the other ports.

Parameters

item

text

See also

GetItemToolTip,
wxWindow::SetToolTip


wxRadioBox::Show

virtual bool Show(const bool show = true)

Shows or hides the entire radiobox.

virtual bool Show(unsigned int item, const bool show = true)

Shows or hides individual buttons.

Parameters

show

item

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

wxWindow::Show

wxPython note: In place of a single overloaded method name, wxPython implements the following methods: