Crazy Eddie's GUI System  0.8.4
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::PushButton, CEGUI::TabButton, and CEGUI::ToggleButton.

+ 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.
void setPushedState (const bool pushed)
 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 Vector2f &mouse_pos)
 Update the internal state of the widget with the mouse at the given position.
bool calculateCurrentHoverState (const Vector2f &mouse_pos)

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::TabButton, CEGUI::PushButton, and CEGUI::ToggleButton.

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.

void CEGUI::ButtonBase::setPushedState ( const bool  pushed)

Internal function to set button's pushed state. Normally you would not call this, except perhaps when building compound widgets.

void CEGUI::ButtonBase::updateInternalState ( const Vector2f 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
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends