# CEGUI::ButtonBase Class Reference

Base class for all the 'button' type widgets (push button, radio button, check-box, etc). More...

Inheritance diagram for CEGUI::ButtonBase:

[legend]
Collaboration diagram for CEGUI::ButtonBase:

[legend]
List of all members.

## Public Member Functions

bool | isHovering (void) const
| return true if user is hovering over this widget (or it's pushed and user is not over it for highlight)
bool | isPushed (void) const
| Return true if the button widget is in the pushed state.
colour | getNormalTextColour (void) const
| return text label colour used for normal rendering
colour | getHoverTextColour (void) const
| return text label colour used for hover / highlight rendering
colour | getPushedTextColour (void) const
| return text label colour used for pushed rendering
colour | getDisabledTextColour (void) const
| return text label colour used for disabled rendering
void | setNormalTextColour (const colour &colour)
| Set the colour to use for the label text when rendering in the normal state.
void | setHoverTextColour (const colour &colour)
| Set the colour to use for the label text when rendering in the hover / highlighted states.
void | setPushedTextColour (const colour &colour)
| Set the colour to use for the label text when rendering in the pushed state.
void | setDisabledTextColour (const colour &colour)
| Set the colour to use for the label text when rendering in the disabled state.
| ButtonBase (const String &type, const String &name)
| Constructor for ButtonBase objects.
virtual | ~ButtonBase (void)
| Destructor for ButtonBase objects.

## Static Public Attributes

static const colour | DefaultNormalLabelColour = 0xFFFFFFFF
| Default colour used when rendering label text in normal state.
static const colour | DefaultHoverLabelColour = 0xFFFFFFFF
| Default colour used when rendering label text in hover / highlight state.
static const colour | DefaultPushedLabelColour = 0xFFFFFFFF
| Default colour used when rendering label text in pushed state.
static const colour | DefaultDisabledLabelColour = 0xFF7F7F7F
| Default colour used when rendering label text in disabled state.

## Protected Member Functions

virtual void | onMouseMove (MouseEventArgs &e)
| Handler called when the mouse cursor has been moved within this window's area.
virtual void | onMouseButtonDown (MouseEventArgs &e)
| Handler called when a mouse button has been depressed within this window's area.
virtual void | onMouseButtonUp (MouseEventArgs &e)
| Handler called when a mouse button has been released within this window's area.
virtual void | onCaptureLost (WindowEventArgs &e)
| Handler called when this window loses capture of mouse inputs.
virtual void | onMouseLeaves (MouseEventArgs &e)
| Handler called when the mouse cursor has left this window's area.
void | updateInternalState (const Point &mouse_pos)
| Update the internal state of the widget with the mouse at the given position.
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 | drawSelf (float z)
| Perform the rendering for this widget.
virtual void | drawNormal (float z)=0
| Render the button-type widget in it's 'normal' state.
virtual void | drawHover (float z)
| Render the button-type widget in it's 'hover' (highlighted) state.
virtual void | drawPushed (float z)
| Render the button-type widget in it's 'pushed' state.
virtual void | drawDisabled (float z)
| Render the button-type widget in it's 'disabled' state.

## Protected Attributes

bool | d_pushed
| true when widget is pushed
bool | d_hovering
| true when the button is in 'hover' state and requires the hover rendering.
colour | d_normalColour
| Colour used for label text when rendering in normal state.
colour | d_hoverColour
| Colour used for label text when rendering in highlighted state.
colour | d_pushedColour
| Colour used for label text when rendering in pushed state.
colour | d_disabledColour
| Colour used for label text when rendering in disabled state.

## Detailed Description

Base class for all the 'button' type widgets (push button, radio button, check-box, etc).

## Member Function Documentation

virtual void CEGUI::ButtonBase::drawDisabled | ( | float | z | ) | `[inline, protected, virtual]`

Render the button-type widget in it's 'disabled' state.

Parameters:

  | z | float value specifying the base Z co-ordinate that should be used when rendering

Returns:
  Nothing

virtual void CEGUI::ButtonBase::drawHover | ( | float | z | ) | `[inline, protected, virtual]`

Render the button-type widget in it's 'hover' (highlighted) state.

Parameters:

  | z | float value specifying the base Z co-ordinate that should be used when rendering

Returns:
  Nothing

virtual void CEGUI::ButtonBase::drawNormal | ( | float | z | ) | `[protected, pure virtual]`

Render the button-type widget in it's 'normal' state.

Parameters:

  | z | float value specifying the base Z co-ordinate that should be used when rendering

Returns:
  Nothing

virtual void CEGUI::ButtonBase::drawPushed | ( | float | z | ) | `[inline, protected, virtual]`

Render the button-type widget in it's 'pushed' state.

Parameters:

  | z | float value specifying the base Z co-ordinate that should be used when rendering

Returns:
  Nothing

void CEGUI::ButtonBase::drawSelf | ( | float | z | ) | `[protected, virtual]`

Perform the rendering for this widget.

Parameters:

  | z | float value specifying the base Z co-ordinate that should be used when rendering

Returns:
  Nothing

Reimplemented from CEGUI::Window.

Reimplemented in CEGUI::TabButton.

colour CEGUI::ButtonBase::getDisabledTextColour | ( | void |  | ) | const`[inline]`

return text label colour used for disabled rendering

Returns:
  colour value that is used for the label text when rendering in the disabled state.

colour CEGUI::ButtonBase::getHoverTextColour | ( | void |  | ) | const`[inline]`

return text label colour used for hover / highlight rendering

Returns:
  colour value that is used for the label text when rendering in the hover / highlighted states.

colour CEGUI::ButtonBase::getNormalTextColour | ( | void |  | ) | const`[inline]`

return text label colour used for normal rendering

Returns:
  colour value that is used for the label text when rendering in the normal state.

colour CEGUI::ButtonBase::getPushedTextColour | ( | void |  | ) | const`[inline]`

return text label colour used for pushed rendering

Returns:
  colour value that is used for the label text when rendering in the pushed state.

bool CEGUI::ButtonBase::isHovering | ( | void |  | ) | const`[inline]`

return true if user is hovering over this widget (or it's pushed and user is not over it for highlight)

Returns:
  true if the user is hovering or if the button is pushed and the mouse is not over the button. Otherwise return false.

bool CEGUI::ButtonBase::isPushed | ( | void |  | ) | const`[inline]`

Return true if the button widget is in the pushed state.

Returns:
  true if the button-type widget is pushed, false if the widget is not pushed.

void CEGUI::ButtonBase::onCaptureLost | ( | WindowEventArgs & | e | ) | `[protected, virtual]`

Handler called when this window loses capture of mouse inputs.

Parameters:

  | e | WindowEventArgs object whose 'window' pointer field is set to the window that triggered the event. For this event the trigger window is always 'this'.

Reimplemented from CEGUI::Window.

Reimplemented in CEGUI::Thumb.

void CEGUI::ButtonBase::onMouseButtonDown | ( | MouseEventArgs & | e | ) | `[protected, virtual]`

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

Parameters:

  | e | MouseEventArgs object. All fields are valid.

Reimplemented from CEGUI::Window.

Reimplemented in CEGUI::Thumb.

void CEGUI::ButtonBase::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::Window.

Reimplemented in CEGUI::Checkbox, CEGUI::PushButton, CEGUI::RadioButton, and CEGUI::TabButton.

void CEGUI::ButtonBase::onMouseLeaves | ( | MouseEventArgs & | e | ) | `[protected, virtual]`

Handler called when the mouse cursor has left this window's area.

Parameters:

  | e | MouseEventArgs object. All fields are valid.

Reimplemented from CEGUI::Window.

void CEGUI::ButtonBase::onMouseMove | ( | MouseEventArgs & | e | ) | `[protected, virtual]`

Handler called when the mouse cursor has been moved within this window's area.

Parameters:

  | e | MouseEventArgs object. All fields are valid.

Reimplemented from CEGUI::Window.

Reimplemented in CEGUI::Thumb.

void CEGUI::ButtonBase::setDisabledTextColour | ( | const colour & | colour | ) |

Set the colour to use for the label text when rendering in the disabled state.

Parameters:

  | colour | colour value specifying the colour to be used.

Returns:
  Nothing.

void CEGUI::ButtonBase::setHoverTextColour | ( | const colour & | colour | ) |

Set the colour to use for the label text when rendering in the hover / highlighted states.

Parameters:

  | colour | colour value specifying the colour to be used.

Returns:
  Nothing.

void CEGUI::ButtonBase::setNormalTextColour | ( | const colour & | colour | ) |

Set the colour to use for the label text when rendering in the normal state.

Parameters:

  | colour | colour value specifying the colour to be used.

Returns:
  Nothing.

void CEGUI::ButtonBase::setPushedTextColour | ( | const colour & | colour | ) |

Set the colour to use for the label text when rendering in the pushed state.

Parameters:

  | colour | colour value specifying the colour to be used.

Returns:
  Nothing.

virtual bool CEGUI::ButtonBase::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::Window.

Reimplemented in CEGUI::Checkbox, CEGUI::PushButton, CEGUI::RadioButton, CEGUI::TabButton, and CEGUI::Thumb.

void CEGUI::ButtonBase::updateInternalState | ( | const Point & | mouse_pos | ) | `[protected]`

Update the internal state of the widget with the mouse at the given position.

Parameters:

  | mouse_pos | Point object describing, in screen pixel co-ordinates, the location of the mouse cursor.

Returns:
  Nothing