Inherits CEGUI::Window.
Inherited by CEGUI::Checkbox, CEGUI::PushButton, CEGUI::RadioButton, and CEGUI::TabButton.
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 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 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. |
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)
Referenced by CEGUI::FalagardTabButton::render(), and CEGUI::FalagardButton::render().
bool CEGUI::ButtonBase::isPushed | ( | void | ) | const [inline] |
Return true if the button widget is in the pushed state.
Referenced by CEGUI::TabButton::onMouseButtonUp(), CEGUI::RadioButton::onMouseButtonUp(), CEGUI::PushButton::onMouseButtonUp(), CEGUI::Checkbox::onMouseButtonUp(), CEGUI::FalagardTabButton::render(), and CEGUI::FalagardButton::render().
void CEGUI::ButtonBase::onCaptureLost | ( | WindowEventArgs & | e | ) | [protected, virtual] |
Handler called when this window loses capture of mouse inputs.
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.
References d_pushed, CEGUI::Window::getPosition(), CEGUI::MouseCursor::getSingletonPtr(), CEGUI::EventArgs::handled, CEGUI::Window::requestRedraw(), and updateInternalState().
void CEGUI::ButtonBase::onMouseButtonDown | ( | MouseEventArgs & | e | ) | [protected, virtual] |
Handler called when a mouse button has been depressed within this window's area.
e | MouseEventArgs object. All fields are valid. |
Reimplemented from CEGUI::Window.
Reimplemented in CEGUI::TabButton, and CEGUI::Thumb.
References CEGUI::MouseEventArgs::button, CEGUI::Window::captureInput(), d_pushed, CEGUI::EventArgs::handled, CEGUI::LeftButton, CEGUI::MouseEventArgs::position, CEGUI::Window::requestRedraw(), and updateInternalState().
void CEGUI::ButtonBase::onMouseButtonUp | ( | MouseEventArgs & | e | ) | [protected, virtual] |
Handler called when a mouse button has been released within this window's area.
e | MouseEventArgs object. All fields are valid. |
Reimplemented from CEGUI::Window.
Reimplemented in CEGUI::Checkbox, CEGUI::PushButton, CEGUI::RadioButton, and CEGUI::TabButton.
References CEGUI::MouseEventArgs::button, CEGUI::EventArgs::handled, CEGUI::LeftButton, and CEGUI::Window::releaseInput().
void CEGUI::ButtonBase::onMouseLeaves | ( | MouseEventArgs & | e | ) | [protected, virtual] |
Handler called when the mouse cursor has left this window's area.
e | MouseEventArgs object. All fields are valid. |
Reimplemented from CEGUI::Window.
References d_hovering, CEGUI::EventArgs::handled, and CEGUI::Window::requestRedraw().
void CEGUI::ButtonBase::onMouseMove | ( | MouseEventArgs & | e | ) | [protected, virtual] |
Handler called when the mouse cursor has been moved within this window's area.
e | MouseEventArgs object. All fields are valid. |
Reimplemented from CEGUI::Window.
Reimplemented in CEGUI::TabButton, and CEGUI::Thumb.
References CEGUI::EventArgs::handled, CEGUI::MouseEventArgs::position, and updateInternalState().
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.
class_name | The class name that is to be checked. |
Reimplemented from CEGUI::Window.
Reimplemented in CEGUI::Checkbox, CEGUI::PushButton, CEGUI::RadioButton, CEGUI::TabButton, and CEGUI::Thumb.
References CEGUI::Window::testClassName_impl().
Referenced by CEGUI::TabButton::testClassName_impl(), CEGUI::RadioButton::testClassName_impl(), CEGUI::PushButton::testClassName_impl(), and CEGUI::Checkbox::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.
mouse_pos | Point object describing, in screen pixel co-ordinates, the location of the mouse cursor. |
References d_hovering, CEGUI::Window::getCaptureWindow(), CEGUI::System::getSingletonPtr(), CEGUI::System::getWindowContainingMouse(), CEGUI::Window::isHit(), and CEGUI::Window::requestRedraw().
Referenced by onCaptureLost(), onMouseButtonDown(), and onMouseMove().