# WoopsiUI::CheckBox Class Reference

`#include <checkbox.h>`

Inheritance diagram for WoopsiUI::CheckBox:

List of all members.

## Public Types
enum | CheckBoxState { CHECK_BOX_STATE_OFF = 0, CHECK_BOX_STATE_ON = 1, CHECK_BOX_STATE_MU = 2 }
## Public Member Functions
| CheckBox (s16 x, s16 y, u16 width, u16 height, GadgetStyle *style=NULL)
virtual const CheckBoxState | getState () const
virtual void | setState (CheckBoxState state)
## Protected Member Functions
virtual void | drawContents (GraphicsPort *port)
virtual void | drawBorder (GraphicsPort *port)
virtual void | onClick (s16 x, s16 y)
virtual | ~CheckBox ()
| CheckBox (const CheckBox &checkBox)
## Protected Attributes
CheckBoxState | _state

## Detailed Description

Class representing a radio button. Like radio buttons, checkboxes 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::CheckBox::CheckBoxState

Enum listing all possible checkbox states.

Enumerator:

  CHECK_BOX_STATE_OFF | Checkbox is unticked
  CHECK_BOX_STATE_ON | Checkbox is ticked
  CHECK_BOX_STATE_MU | Checkbox is in the third state

## Constructor & Destructor Documentation

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

Constructor.

Parameters:

  | x | The x co-ordinate of the checkbox, relative to its parent.
  | y | The y co-ordinate of the checkbox, relative to its parent.
  | width | The width of the checkbox.
  | height | The height of the checkbox.
  | 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::CheckBox::~CheckBox | ( |  | ) | `[inline, protected, virtual]`

Destructor.

WoopsiUI::CheckBox::CheckBox | ( | const CheckBox & | checkBox | ) | `[inline, protected]`

Copy constructor is protected to prevent usage.

## Member Function Documentation

virtual void WoopsiUI::CheckBox::drawBorder | ( | 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 void WoopsiUI::CheckBox::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 const CheckBoxState WoopsiUI::CheckBox::getState | ( |  | ) | const`[inline, virtual]`

Get the current state of the checkbox.

Returns:
  The state of the checkbox.

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

Toggles the state of the checkbox.

Parameters:

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

Reimplemented from WoopsiUI::Button.

virtual void WoopsiUI::CheckBox::setState | ( | CheckBoxState | state | ) | `[virtual]`

Set the state of the checkbox.

Parameters:

  | state | The new checkbox state.

## Member Data Documentation

CheckBoxState WoopsiUI::CheckBox::_state`[protected]`

The state of the checkbox

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

- checkbox.h