wxradioboxa 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 include files <wx/radiobox.h> window styles
see also window styles overview. event handling
see also event handling overview, wxradiobutton, wxcheckbox members
wxradiobox::wxradiobox
wxradiobox::wxradioboxwxradiobox() 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. wxperl note: in wxperl there is just an array reference in place of n and choices.
wxradiobox::~wxradiobox~wxradiobox() destructor, destroying the radiobox item.
wxradiobox::createbool 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::enablevirtual 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
wxradiobox::findstringint 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::getcolumncountunsigned int getcolumncount() const returns the number of columns in the radiobox.
wxradiobox::getitemhelptextwxstring getitemhelptext(unsigned int item) const returns the helptext associated with the specified item if any or wxemptystring. parameters item
see also
wxradiobox::getitemtooltipwxtooltip * getitemtooltip(unsigned int item) const returns the tooltip associated with the specified item if any or null. see also
setitemtooltip,
wxradiobox::getitemfrompointint 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::getlabelwxstring getlabel() const returns the radiobox label. parameters n
see also wxpython note: in place of a single overloaded method name, wxpython implements the following methods:
wxradiobox::getrowcountunsigned int getrowcount() const returns the number of rows in the radiobox.
wxradiobox::getselectionint getselection() const returns the zero-based position of the selected button.
wxradiobox::getstringselectionwxstring getstringselection() const returns the selected string.
wxradiobox::getstringwxstring getstring(unsigned int n) const returns the label for the button at the given position. parameters n
wxradiobox::isitemenabledbool 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::isitemshownbool 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::setitemhelptextvoid setitemhelptext(unsigned int item, const wxstring& helptext) sets the helptext for an item. empty string erases any existing helptext. parameters item
helptext
see also
wxradiobox::setlabelvoid 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::setselectionvoid 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::setstringselectionvoid 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::setitemtooltipvoid 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,
wxradiobox::showvirtual 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 wxpython note: in place of a single overloaded method name, wxpython implements the following methods:
|