# WoopsiUI::RadioButton Class Reference

`#include <radiobutton.h>`

Inheritance diagram for WoopsiUI::RadioButton:

List of all members.

## Public Types
enum | RadioButtonState { RADIO_BUTTON_STATE_OFF = 0, RADIO_BUTTON_STATE_ON = 1, RADIO_BUTTON_STATE_MU = 2 }
## Public Member Functions
| RadioButton (s16 x, s16 y, u16 width, u16 height, GadgetStyle *style=NULL)
virtual RadioButtonState | getState ()
virtual void | setState (RadioButtonState state)
## Protected Member Functions
virtual void | drawContents (GraphicsPort *port)
virtual void | onClick (s16 x, s16 y)
virtual | ~RadioButton ()
| RadioButton (const RadioButton &radioButton)
## Protected Attributes
RadioButtonState | _state

## Detailed Description

Represents a radio button. Radio buttons can only exist as part of a RadioButtonGroup class, and should not be instantiated individually. Radio buttons are tri-state - off, on and "mu". The mu state cannot be enabled by a user - it can only be set by the developer.

## Member Enumeration Documentation

enum WoopsiUI::RadioButton::RadioButtonState

Enum listing all possible radio button states.

Enumerator:

  RADIO_BUTTON_STATE_OFF | Radio button is off
  RADIO_BUTTON_STATE_ON | Radio button is on
  RADIO_BUTTON_STATE_MU | Radio button is in the third state

## Constructor & Destructor Documentation

WoopsiUI::RadioButton::RadioButton | ( | s16 | x,
|  | s16 | y,
|  | u16 | width,
|  | u16 | height,
|  | GadgetStyle * | style = `NULL` |
| ) |  |  |

Constructor.

Parameters:

  | x | The x co-ordinate of the radio button, relative to its parent.
  | y | The y co-ordinate of the radio button, relative to its parent.
  | width | The width of the radio button.
  | height | The height of the radio button.
  | style | The style that the gadget should use. If this is not specified, the gadget will use the values stored in the global defaultGadgetStyle object. The gadget will copy the properties of the style into its own internal style object.

virtual WoopsiUI::RadioButton::~RadioButton | ( |  | ) | `[inline, protected, virtual]`

Destructor.

WoopsiUI::RadioButton::RadioButton | ( | const RadioButton & | radioButton | ) | `[inline, protected]`

Copy constructor is protected to prevent usage.

## Member Function Documentation

virtual void WoopsiUI::RadioButton::drawContents | ( | GraphicsPort * | port | ) | `[protected, virtual]`

Draw the area of this gadget that falls within the clipping region. Called by the redraw() function to draw all visible regions.

Parameters:

  | port | The GraphicsPort to draw to.

See also:
  redraw()

Reimplemented from WoopsiUI::Button.

virtual RadioButtonState WoopsiUI::RadioButton::getState | ( |  | ) | `[inline, virtual]`

Get the current state of the radio button.

Returns:
  The state of the radio button.

virtual void WoopsiUI::RadioButton::onClick | ( | s16 | x,
|  | s16 | y |
| ) |  |  | `[protected, virtual]`

Sets the radiobutton's state to "on".

Parameters:

  | x | The x co-ordinate of the click.
  | y | The y co-ordinate of the click.

Reimplemented from WoopsiUI::Button.

virtual void WoopsiUI::RadioButton::setState | ( | RadioButtonState | state | ) | `[virtual]`

Set the state of the radio button.

Parameters:

  | state | The new radio button state.

## Member Data Documentation

RadioButtonState WoopsiUI::RadioButton::_state`[protected]`

The state of the radio button

The documentation for this class was generated from the following file:

- radiobutton.h