Crazy Eddies GUI System  0.7.6
Public Member Functions | Protected Member Functions | Protected Attributes
CEGUI::ButtonBase Class Reference

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

Inherits CEGUI::Window.

Inherited by CEGUI::Checkbox, CEGUI::PushButton, CEGUI::RadioButton, and CEGUI::TabButton.

+ Collaboration diagram for CEGUI::ButtonBase:

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.
 ButtonBase (const String &type, const String &name)
 Constructor for ButtonBase objects.
virtual ~ButtonBase (void)
 Destructor for ButtonBase objects.

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 is no longer over this window's surface area. This will be called when the mouse is not over a part of this Window's actual surface - even though technically the mouse is still within the Window's area, for example if the mouse moves over a child window.
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 hierarchy.

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.

Detailed Description

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


Member Function Documentation

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.
virtual void CEGUI::ButtonBase::onCaptureLost ( WindowEventArgs e) [protected, virtual]

Handler called when this window loses capture of mouse inputs.

Parameters:
eWindowEventArgs 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.

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

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

Parameters:
eMouseEventArgs object. All fields are valid.

Reimplemented from CEGUI::Window.

Reimplemented in CEGUI::Thumb, and CEGUI::TabButton.

virtual void CEGUI::ButtonBase::onMouseButtonUp ( MouseEventArgs e) [protected, virtual]

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

Parameters:
eMouseEventArgs object. All fields are valid.

Reimplemented from CEGUI::Window.

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

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

Handler called when the mouse cursor is no longer over this window's surface area. This will be called when the mouse is not over a part of this Window's actual surface - even though technically the mouse is still within the Window's area, for example if the mouse moves over a child window.

Parameters:
eMouseEventArgs object. All fields are valid.
See also:
Window::onMouseLeavesArea

Reimplemented from CEGUI::Window.

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

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

Parameters:
eMouseEventArgs object. All fields are valid.

Reimplemented from CEGUI::Window.

Reimplemented in CEGUI::Thumb, and CEGUI::TabButton.

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 hierarchy.

Parameters:
class_nameThe 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::Thumb, CEGUI::RadioButton, CEGUI::TabButton, CEGUI::Checkbox, and CEGUI::PushButton.

References CEGUI::Window::testClassName_impl().

Referenced by CEGUI::PushButton::testClassName_impl(), CEGUI::Checkbox::testClassName_impl(), CEGUI::TabButton::testClassName_impl(), and CEGUI::RadioButton::testClassName_impl().

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_posPoint object describing, in screen pixel co-ordinates, the location of the mouse cursor.
Returns:
Nothing