# CEGUI::RadioButton Class Reference

Base class to provide the logic for Radio Button widgets. More...

Inheritance diagram for CEGUI::RadioButton:

[legend]
Collaboration diagram for CEGUI::RadioButton:

[legend]
List of all members.

## Public Member Functions

bool | isSelected (void) const
| return true if the radio button is selected (has the checkmark)
ulong | getGroupID (void) const
| return the groupID assigned to this radio button
RadioButton * | getSelectedButtonInGroup (void) const
| Return a pointer to the RadioButton object within the same group as this RadioButton, that is currently selected.
void | setSelected (bool select)
| set whether the radio button is selected or not
void | setGroupID (ulong group)
| set the groupID for this radio button
| RadioButton (const String &type, const String &name)

## Static Public Attributes

static const String | EventNamespace
| Namespace for global events.
static const String | EventSelectStateChanged
| The selected state of the widget has changed.

## Protected Member Functions

void | addRadioButtonEvents (void)
| Add radio button specific events.
void | deselectOtherButtonsInGroup (void) const
| Deselect any selected radio buttons attached to the same parent within the same group (but not do not deselect 'this').
virtual bool | testClassName_impl (const String &class_name) const
| Return whether this window was inherited from the given class name at some point in the inheritance heirarchy.
virtual void | onSelectStateChanged (WindowEventArgs &e)
| event triggered internally when the select state of the button changes.
virtual void | onMouseButtonUp (MouseEventArgs &e)
| Handler called when a mouse button has been released within this window's area.

## Protected Attributes

bool | d_selected
ulong | d_groupID

## Detailed Description

Base class to provide the logic for Radio Button widgets.

## Member Function Documentation

ulong CEGUI::RadioButton::getGroupID | ( | void |  | ) | const`[inline]`

return the groupID assigned to this radio button

Returns:
  ulong value that identifies the Radio Button group this widget belongs to.

RadioButton * CEGUI::RadioButton::getSelectedButtonInGroup | ( | void |  | ) | const

Return a pointer to the RadioButton object within the same group as this RadioButton, that is currently selected.

Returns:
  Pointer to the RadioButton object that is the RadioButton within the same group as this RadioButton, and is attached to the same parent window as this RadioButton, that is currently selected. Returns NULL if no button within the group is selected, or if 'this' is not attached to a parent window.

bool CEGUI::RadioButton::isSelected | ( | void |  | ) | const`[inline]`

return true if the radio button is selected (has the checkmark)

Returns:
  true if this widget is selected, false if the widget is not selected.

void CEGUI::RadioButton::onMouseButtonUp | ( | MouseEventArgs & | e | ) | `[protected, virtual]`

Handler called when a mouse button has been released within this window's area.

Parameters:

  | e | MouseEventArgs object. All fields are valid.

Reimplemented from CEGUI::ButtonBase.

void CEGUI::RadioButton::setGroupID | ( | ulong | group | ) |

set the groupID for this radio button

Parameters:

  | group | ulong value specifying the radio button group that this widget belongs to.

Returns:
  Nothing.

void CEGUI::RadioButton::setSelected | ( | bool | select | ) |

set whether the radio button is selected or not

Parameters:

  | select | true to put the radio button in the selected state, false to put the radio button in the deselected state. If changing to the selected state, any previously selected radio button within the same group is automatically deselected.

Returns:
  Nothing.

virtual bool CEGUI::RadioButton::testClassName_impl | ( | const String & | class_name | ) | const`[inline, protected, virtual]`

Return whether this window was inherited from the given class name at some point in the inheritance heirarchy.

Parameters:

  | class_name | The class name that is to be checked.

Returns:
  true if this window was inherited from class_name. false if not.

Reimplemented from CEGUI::ButtonBase.