Contents Up Previous Next

wxRadioButton: wxItem

A radio button item is a button which usually denotes one of several mutually exclusive options. It can be created as a standard button with a label, or as a bitmap button.

Please note that this is an experimental panel item, and is implemented for Windows and Motif only. Compilation of this functionality is controlled by the USE_RADIOBUTTON symbol.

wxRadioButton::wxRadioButton
wxRadioButton::~wxRadioButton
wxRadioButton::Create
wxRadioButton::GetValue
wxRadioButton::SetValue


wxRadioButton::wxRadioButton

void wxRadioButton(void)

Constructor, for use by derived classes.

void wxRadioButton(wxPanel *parent, wxFunction func, char *label, Bool value,
int x = -1, int y = -1, int width = -1, int height = -1,
long style = 0, char *name = "radioButton")

void wxRadioButton(wxPanel *parent, wxFunction func, wxBitmap *bitmap, Bool value,
int x = -1, int y = -1, int width = -1, int height = -1,
long style = 0, char *name = "radioButton")

Constructor, creating and showing a radio button.

func may be NULL; otherwise it is used as the callback for the radio box. Note that the cast (wxFunction) must be used when passing your callback function name, or the compiler may complain that the function does not match the constructor declaration.

If label is non-NULL, it will be used to label the radio button.

bitmap can be used to give the radio button a custom bitmap instead of a standard appearance and label.

value determines the initial value of the radio button.

The parameters x and y are used to specify an absolute position, or a position after the previous panel item if omitted or default.

If width or height are omitted (or are less than zero), an appropriate size will be used for the radio button.

style specifies a bitwise-or list of styles. The wxRB_GROUP style can be used to start or end a group of buttons in Windows.

The name parameter is used to associate a name with the item, allowing the application user to set Motif resource values for individual radio buttons.


wxRadioButton::~wxRadioButton

void ~wxRadioButton(void)

Destructor, destroying the radio button item.


wxRadioButton::Create

Bool Create(wxPanel *parent, wxFunction func, char *label, Bool value,
int x = -1, int y = -1, int width = -1, int height = -1,
long style = 0, char *name = "radioButton")

Bool Create(wxPanel *parent, wxFunction func, wxBitmap *bitmap, Bool value,
int x = -1, int y = -1, int width = -1, int height = -1,
long style = 0, char *name = "radioButton")

Creates the choice for two-step construction. Derived classes should call or replace this function. See wxRadioButton::wxRadioButton for further details.


wxRadioButton::GetValue

Bool GetValue(void)

Returns TRUE if the radio button is depressed, FALSE otherwise.


wxRadioButton::SetValue

void SetValue(Bool value)

Sets the radio button to selected or unselected status.