Om  1.0.0
A universal framework for multimedia simulation
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
om::graphics::gui::objects::Button Class Reference

A class that represents a rectangular region that can be clicked on to perform an action. More...

#include <omGraphicsGUIButton.h>

Inheritance diagram for om::graphics::gui::objects::Button:
om::graphics::gui::objects::GUIObject om::gui::input::InputHandler

Classes

class  Delegate
 A class that contains function objects that recieve button events. More...
 

Public Types

enum  Type { ACTION, MOMENTARY, SWITCH }
 An enum that specifies the different kinds of buttons. More...
 

Public Member Functions

 Button ()
 Create a new sizeless button with no text label and positioned at the origin of its coordinate system. More...
 
 Button (const Rectangle &newRectangle)
 Create a new button which occupies the specified rectangle with no text label. More...
 
 Button (const Rectangle &newRectangle, const UTF8String &newText)
 Create a new button which occupies the specifieid rectangle with the given label text. More...
 
const UTF8String & getText () const
 Return a reference to a string representing the text label of this button. More...
 
void setText (const UTF8String &newText)
 Set a string representing the text label of this button. More...
 
const UTF8String & getAlternateText () const
 Return a reference to a string representing the text label of this button when it is selected. More...
 
void setAlternateText (const UTF8String &newAlternateText)
 Set a string representing the text label of this button when it is selected. More...
 
const OrigingetTextAlignment () const
 Return an object that describes how this button's text is aligned within the button's bounds. More...
 
void setTextAlignment (const Origin &newTextAlignment)
 Set an object that describes how this button's text is aligned within the button's bounds. More...
 
void setTextAlignment (Origin::XOrigin newXOrigin, Origin::YOrigin newYOrigin)
 Set an object that describes how this button's text is aligned within the button's bounds. More...
 
Bool getTextIsVisible () const
 Return a boolean value indicating whether or not this button's text label is displayed. More...
 
void setTextIsVisible (Bool newTextIsVisible)
 Set a boolean value indicating whether or not this button's text label is displayed. More...
 
const GUIImagegetImage () const
 Return a reference to the image that is displayed in the button's content area when in its normal state. More...
 
void setImage (const GUIImage &newImage)
 Set the image that is displayed in the button's content area when in its normal state. More...
 
const GUIImagegetAlternateImage () const
 Return a reference to the image that is displayed in the button's content area when in its alternate state. More...
 
void setAlternateImage (const GUIImage &newAlternateImage)
 Set the image that is displayed in the button's content area when in its alternate state. More...
 
const OrigingetImageAlignment () const
 Return an object that describes how this button's image is aligned within the button's bounds. More...
 
void setImageAlignment (const Origin &newImageAlignment)
 Set an object that describes how this button's image is aligned within the button's bounds. More...
 
void setImageAlignment (Origin::XOrigin newXOrigin, Origin::YOrigin newYOrigin)
 Set an object that describes how this button's image is aligned within the button's bounds. More...
 
Bool getImageIsVisible () const
 Return a boolean value indicating whether or not this button's image is displayed. More...
 
void setImageIsVisible (Bool newImageIsVisible)
 Set a boolean value indicating whether or not this button's image is displayed. More...
 
Menu * getMenu () const
 Return a pointer to the menu that is opened when the button is selected. More...
 
void setMenu (Menu *newMenu)
 Set a pointer to the menu that is opened when the button is selected. More...
 
Bool getIsEnabled () const
 Return whether or not this button is currently active. More...
 
void setIsEnabled (Bool newIsEnabled)
 Set whether or not this button is currently active. More...
 
Bool getIsSelected () const
 Return whether or not this button is currently selected (in its alternate state). More...
 
void setIsSelected (Bool newIsSelected)
 Set whether or not this button is currently selected (in its alternate state). More...
 
Bool getIsPressed () const
 Return whether or not this button is currently pressed by the user. More...
 
const ButtonFlagsgetFlags () const
 Return an object containing boolean configuration flags for this button. More...
 
void setFlags (const ButtonFlags &newFlags)
 Set an object containing boolean configuration flags for this button. More...
 
Type getType () const
 Return an object that represents the type of this button. More...
 
void setType (Type newType)
 Set an object that represents the type of this button. More...
 
const Color4f & getAlternateColor () const
 Return the alternate color for this button's main area. More...
 
void setAlternateColor (const Color4f &newAlternateColor)
 Set the alternate color for this button's main area. More...
 
const TextStylegetTextStyle () const
 Return a const reference to the text style that is used to render the text for a button. More...
 
void setTextStyle (const TextStyle &newTextStyle)
 Set the text style that is used to render the text for a button. More...
 
virtual Bool drawSelf (GUIRenderer &renderer, const AABB3f &parentBounds) const
 Draw this object using the specified GUI renderer to the given parent coordinate system bounds. More...
 
virtual Bool keyEvent (const KeyEvent &event)
 Handle the specified keyboard event that occured when this object had focus. More...
 
virtual Bool mouseButtonEvent (const MouseButtonEvent &event)
 Handle the specified mouse button event that occurred. More...
 
DelegategetDelegate ()
 Return a reference to the delegate which responds to events for this button. More...
 
const DelegategetDelegate () const
 Return a reference to the delegate which responds to events for this button. More...
 
void setDelegate (const Delegate &newDelegate)
 Return a reference to the delegate which responds to events for this button. More...
 
- Public Member Functions inherited from om::graphics::gui::objects::GUIObject
 GUIObject ()
 Create a default visible GUI object positioned at the origin (0,0) with 0 width and 0 height. More...
 
 GUIObject (const RectangleStyle &newRectangleStyle)
 Create a visible GUI object positioned at the origin (0,0) with 0 width and 0 height and the given rectangle style. More...
 
 GUIObject (const Rectangle &newRectangle)
 Create a visible GUI object that occupies the specified rectangle. More...
 
 GUIObject (const Rectangle &newRectangle, const RectangleStyle &newRectangleStyle)
 Create a visible GUI object that occupies the specified rectangle and rectangle style. More...
 
virtual ~GUIObject ()
 Destory the GUI object, releasing all internal resources. More...
 
const RectanglegetRectangle () const
 Return a reference to this GUI object's rectangle. More...
 
const Vector3fgetSize () const
 Return a reference to the 3D size of this object along each of its local axes. More...
 
const Vector2fgetSizeXY () const
 Return a reference to the 2D scaling factor of this object along each of its local axes. More...
 
virtual Bool setSize (const Vector3f &newSize)
 Set the 3D size of this object along each of its local axes. More...
 
Bool setSize (const Vector2f &newSizeXY)
 Set the 2D size of this object along the X and Y local axes. More...
 
Bool setSize (Float newWidth, Float newHeight)
 Set the 2D size of this object along the X and Y local axes. More...
 
Bool setSizeX (Float newWidth)
 Set the size of this object along the X axis. More...
 
Bool setSizeY (Float newHeight)
 Set the size of this object along the Y axis. More...
 
Bool setSizeZ (Float newDepth)
 Set the size of this object along the Z axis. More...
 
virtual Bool resizeForContent ()
 Resize this object to fit tightly around its contents, if possible. More...
 
void fillParent (const Vector3f &parentSize)
 Resize and resposition this object so that it fills the specified parent bounding box size. More...
 
const Vector3fgetScale () const
 Return a reference to the 3D scaling factor of this object along each of its local axes. More...
 
const Vector2fgetScaleXY () const
 Return a reference to the 2D scaling factor of this object along each of its local axes. More...
 
virtual Bool setScale (const Vector3f &newScale)
 Set the 3D scaling factor of this object along each of its local axes. More...
 
Bool setScale (const Vector2f &newScaleXY)
 Set the 2D scaling factor of this object along the X and Y local axes. More...
 
Bool setScale (Float newScaleX, Float newScaleY)
 Set the 2D scaling factor of this object along the X and Y local axes. More...
 
Bool setScale (Float newScale)
 Set the scaling factor of this object along all 3 axes. More...
 
const Vector3fgetPosition () const
 Return the position of this GUI object's origin relative to its parent's coordinate origin. More...
 
const Vector2fgetPositionXY () const
 Return the 2D position of this GUI object's origin relative to its parent's coordinate origin. More...
 
Bool setPosition (const Vector2f &newPosition)
 Set the position of this GUI object's origin relative to its parent's coordinate origin. More...
 
virtual Bool setPosition (const Vector3f &newPosition)
 Set the position of this GUI object's origin relative to its parent's coordinate origin. More...
 
const Matrix3fgetRotation () const
 Return a 3x3 orthonormal matrix indicating the basis of this object's coordinate frame. More...
 
virtual Bool setRotation (const Matrix3f &newRotation)
 Set a 3x3 orthonormal matrix indicating the basis of this object's coordinate frame. More...
 
Bool setRotation (Float radians)
 Set the rotation of this GUI object to be along the Z-axis with a rotation specified in radians. More...
 
Bool setRotationDegrees (Float degrees)
 Set the rotation of this GUI object to be along the Z-axis with a rotation specified in degrees. More...
 
OrigingetOrigin ()
 Return the alignment of the coordinate origin for this object. More...
 
const OrigingetOrigin () const
 Return the alignment of the coordinate origin for this object. More...
 
virtual Bool setOrigin (const Origin &newPositionOrigin)
 Set the alignment of the coordinate origin for this object. More...
 
void setOrigin (Origin::XOrigin newXOrigin, Origin::YOrigin newYOrigin)
 Set the XY alignment of the coordinate origin for this object. More...
 
void setOrigin (Origin::XOrigin newXOrigin, Origin::YOrigin newYOrigin, Origin::ZOrigin newZOrigin)
 Set the XYZ alignment of the coordinate origin for this object. More...
 
AABB2f getBoundsInParent (const AABB2f &parentBounds) const
 Return the 2D bounding box of this object in the coordinate frame of the specified parent bounding box. More...
 
AABB3f getBoundsInParent (const AABB3f &parentBounds) const
 Return the 3D bounding box of this object in the coordinate frame of the specified parent bounding box. More...
 
AABB2f getLocalBoundsXY () const
 Return the 2D bounding box of this object in its local coordinate frame. More...
 
AABB3f getLocalBounds () const
 Return the 3D bounding box of this object in its local coordinate frame. More...
 
Vector2f getLocalCenterXY () const
 Return the 2D center of this object's rectangle in its local coordinate frame. More...
 
Vector3f getLocalCenter () const
 Return the 3D center of this object's rectangle in its local coordinate frame. More...
 
Matrix4f getTransformMatrix (const AABB3f &parentBounds) const
 Return the object-space-to-parent-space homogeneous transformation matrix for the given parent bounding box. More...
 
Vector2f transformToLocal (const Vector2f &pointInParent, const AABB2f &parentBounds) const
 Transform a 3D point in the parent coordinate system into this object's coordinate system. More...
 
Vector3f transformToLocal (const Vector3f &pointInParent, const AABB3f &parentBounds) const
 Transform a 3D point in the parent coordinate system into this object's coordinate system. More...
 
Vector2f transformFromLocal (const Vector2f &localPoint, const AABB2f &parentBounds) const
 Transform a 2D point in this object's local coordinate system into its parent's coordinate system. More...
 
Vector3f transformFromLocal (const Vector3f &localPoint, const AABB3f &parentBounds) const
 Transform a 3D point in this object's local coordinate system into its parent's coordinate system. More...
 
Vector2f transformVectorToLocal (const Vector2f &vectorInParent) const
 Transform a 3D vector in the parent coordinate system into this object's coordinate system. More...
 
Vector3f transformVectorToLocal (const Vector3f &vectorInParent) const
 Transform a 3D vector in the parent coordinate system into this object's coordinate system. More...
 
Vector2f transformVectorFromLocal (const Vector2f &localVector) const
 Transform a 2D vector in this object's local coordinate system into its parent's coordinate system. More...
 
Vector3f transformVectorFromLocal (const Vector3f &localVector) const
 Transform a 3D vector in this object's local coordinate system into its parent's coordinate system. More...
 
MouseButtonEvent transformEventToLocal (const MouseButtonEvent &event, const AABB2f &parentBounds) const
 Transform a mouse button event in the parent coordinate system into this object's coordinate system. More...
 
MouseButtonEvent transformEventFromLocal (const MouseButtonEvent &event, const AABB2f &parentBounds) const
 Transform a mouse button event in this object's local coordinate system into its parent's coordinate system. More...
 
MouseMotionEvent transformEventToLocal (const MouseMotionEvent &event, const AABB2f &parentBounds) const
 Transform a mouse motion event in the parent coordinate system into this object's coordinate system. More...
 
MouseMotionEvent transformEventFromLocal (const MouseMotionEvent &event, const AABB2f &parentBounds) const
 Transform a mouse motion event in this object's local coordinate system into its parent's coordinate system. More...
 
MouseWheelEvent transformEventToLocal (const MouseWheelEvent &event, const AABB2f &parentBounds) const
 Transform a mouse wheel event in the parent coordinate system into this object's coordinate system. More...
 
MouseWheelEvent transformEventFromLocal (const MouseWheelEvent &event, const AABB2f &parentBounds) const
 Transform a mouse wheel event in this object's local coordinate system into its parent's coordinate system. More...
 
virtual Bool containsLocalPoint (const Vector2f &localPoint) const
 Return whether or not this GUI object contains the specified local 2D point within its local bounds. More...
 
virtual Bool containsLocalPoint (const Vector3f &localPoint) const
 Return whether or not this GUI object contains the specified local 3D point within its local bounds. More...
 
AABB2f getLocalContentBoundsXY () const
 Return the 2D bounding box for the object's rectangle inside area in its local coordinate frame. More...
 
virtual AABB3f getLocalContentBounds () const
 Return the 3D bounding box for the object's rectangle inside area in its local coordinate frame. More...
 
GUIStylegetStyle () const
 Return a pointer to the style object to use when drawing this GUI object. More...
 
void setStyle (GUIStyle *newStyle)
 Set a pointer to the style object to use when drawing this GUI object. More...
 
const RectangleStylegetRectangleStyle () const
 Return an object that describes the style of the main outside rectangle of this object. More...
 
virtual Bool setRectangleStyle (const RectangleStyle &newRectangleStyle)
 Set an object that describes the style of the main outside rectangle of this object. More...
 
const BordergetBorder () const
 Return an object that describes the border for this object's main rectangle. More...
 
virtual Bool setBorder (const Border &newBorder)
 Set an object that describes the border for this object's main rectangle. More...
 
Float getBorderWidth () const
 Return the width of this object's main rectangle border. More...
 
Bool setBorderWidth (Float newWidth)
 Set the width of this object's main rectangle border. More...
 
Float getBorderRadius () const
 Return the corner radius of this object's main rectangle border. More...
 
Bool setBorderRadius (Float newRadius)
 Set the corner radius of this object's main rectangle border. More...
 
const MargingetBorderMargin () const
 Return an object that describes the padding between the exterior and interior of the object's main rectangle. More...
 
Bool setBorderMargin (const Margin &newMargin)
 Set an object that describes the padding between the exterior and interior of the object's main rectangle. More...
 
const Color4f & getBackgroundColor () const
 Return the background color for this object's main rectangle. More...
 
virtual Bool setBackgroundColor (const Color4f &newBackgroundColor)
 Set the background color for this object's main rectangle. More...
 
const Color4f & getBorderColor () const
 Return the border color used when rendering the object's main rectangle. More...
 
virtual Bool setBorderColor (const Color4f &newBorderColor)
 Set the border color used when rendering the object's main rectangle. More...
 
const GUIObjectFlagsgetFlags () const
 Return a const reference to the flags for this GUI object. More...
 
Bool flagIsSet (GUIObjectFlags::Flag flag) const
 Return whether or not the specified boolan flag is set for this GUI object. More...
 
virtual Bool setFlags (const GUIObjectFlags &newFlags)
 Set the flags for this GUI object. More...
 
Bool setFlag (GUIObjectFlags::Flag flag, Bool newIsSet=true)
 Set whether or not the specified boolan flag is set for this GUI object. More...
 
Bool getIsVisible () const
 Return whether or not this GUI object should be drawn to the screen. More...
 
void setIsVisible (Bool newIsVisible)
 Set whether or not this GUI object should be drawn to the screen. More...
 
Bool hasFocus () const
 Return whether or not this GUI object currently has keyboard focus at its level in the GUI hierarchy. More...
 
virtual Bool setFocus (Bool newHasFocus)
 Set whether or not this GUI object currently has keyboard focus at its level in the GUI hierarchy. More...
 
virtual void update (Float dt)
 Update the current internal state of this object for the specified time interval in seconds. More...
 
- Public Member Functions inherited from om::gui::input::InputHandler
virtual ~InputHandler ()
 Destroy an input handler. More...
 
virtual Bool guiEvent (const GUIEvent &event)
 Handle the specified GUI event that occured when this object had focus. More...
 
virtual Bool textEvent (const TextEvent &event)
 Handle the specified text input event that occured when this object had focus. More...
 
virtual Bool mouseMotionEvent (const MouseMotionEvent &event)
 Handle the specified mouse motion event that occurred. More...
 
virtual Bool mouseWheelEvent (const MouseWheelEvent &event)
 Handle the specified mouse wheel event that occurred. More...
 

Static Public Attributes

static const Origin DEFAULT_TEXT_ALIGNMENT
 The default alignment that is used for a button's text label. More...
 
static const Origin DEFAULT_IMAGE_ALIGNMENT
 The default alignment that is used for a button's image label. More...
 
static const Border DEFAULT_BORDER
 The default border that is used for a button. More...
 
static const Color4f DEFAULT_BACKGROUND_COLOR
 The default background color that is used for a button's area. More...
 
static const Color4f DEFAULT_BORDER_COLOR
 The default border color that is used for a button. More...
 
static const Color4f DEFAULT_ALTERNATE_COLOR
 The default color that is used for a button's background when it is pressed. More...
 

Detailed Description

A class that represents a rectangular region that can be clicked on to perform an action.

Member Enumeration Documentation

An enum that specifies the different kinds of buttons.

Enumerator
ACTION 

A button type where the button selection event is sent when the button is released after being pressed.

The button sends a 'select' message when the button is pressed and then released. The button is then immediatedly set to be unselected.

This button type should be used to perform an action when it is selected. Since the button is not selected until released over the button's area, it gives the user the ability to confirm their choice.

MOMENTARY 

A button type where the button is only selected while it is pressed.

The button sends a 'select' message when the button is first pressed and an 'unselect' message when the button is released.

SWITCH 

A button type where the button is either in an 'on' or 'off' state.

The button sends a 'select' message when the button is pressed and then released, turning the button to the 'on' state. An 'unselect' message is sent when the button is pressed again and released, turning it to the 'off' state.

Constructor & Destructor Documentation

om::graphics::gui::objects::Button::Button ( )

Create a new sizeless button with no text label and positioned at the origin of its coordinate system.

om::graphics::gui::objects::Button::Button ( const Rectangle newRectangle)

Create a new button which occupies the specified rectangle with no text label.

om::graphics::gui::objects::Button::Button ( const Rectangle newRectangle,
const UTF8String &  newText 
)

Create a new button which occupies the specifieid rectangle with the given label text.

Member Function Documentation

const UTF8String& om::graphics::gui::objects::Button::getText ( ) const
inline

Return a reference to a string representing the text label of this button.

void om::graphics::gui::objects::Button::setText ( const UTF8String &  newText)
inline

Set a string representing the text label of this button.

const UTF8String& om::graphics::gui::objects::Button::getAlternateText ( ) const
inline

Return a reference to a string representing the text label of this button when it is selected.

void om::graphics::gui::objects::Button::setAlternateText ( const UTF8String &  newAlternateText)
inline

Set a string representing the text label of this button when it is selected.

const Origin& om::graphics::gui::objects::Button::getTextAlignment ( ) const
inline

Return an object that describes how this button's text is aligned within the button's bounds.

void om::graphics::gui::objects::Button::setTextAlignment ( const Origin newTextAlignment)
inline

Set an object that describes how this button's text is aligned within the button's bounds.

void om::graphics::gui::objects::Button::setTextAlignment ( Origin::XOrigin  newXOrigin,
Origin::YOrigin  newYOrigin 
)
inline

Set an object that describes how this button's text is aligned within the button's bounds.

Bool om::graphics::gui::objects::Button::getTextIsVisible ( ) const
inline

Return a boolean value indicating whether or not this button's text label is displayed.

void om::graphics::gui::objects::Button::setTextIsVisible ( Bool  newTextIsVisible)
inline

Set a boolean value indicating whether or not this button's text label is displayed.

const GUIImage& om::graphics::gui::objects::Button::getImage ( ) const
inline

Return a reference to the image that is displayed in the button's content area when in its normal state.

void om::graphics::gui::objects::Button::setImage ( const GUIImage newImage)
inline

Set the image that is displayed in the button's content area when in its normal state.

const GUIImage& om::graphics::gui::objects::Button::getAlternateImage ( ) const
inline

Return a reference to the image that is displayed in the button's content area when in its alternate state.

void om::graphics::gui::objects::Button::setAlternateImage ( const GUIImage newAlternateImage)
inline

Set the image that is displayed in the button's content area when in its alternate state.

const Origin& om::graphics::gui::objects::Button::getImageAlignment ( ) const
inline

Return an object that describes how this button's image is aligned within the button's bounds.

void om::graphics::gui::objects::Button::setImageAlignment ( const Origin newImageAlignment)
inline

Set an object that describes how this button's image is aligned within the button's bounds.

void om::graphics::gui::objects::Button::setImageAlignment ( Origin::XOrigin  newXOrigin,
Origin::YOrigin  newYOrigin 
)
inline

Set an object that describes how this button's image is aligned within the button's bounds.

Bool om::graphics::gui::objects::Button::getImageIsVisible ( ) const
inline

Return a boolean value indicating whether or not this button's image is displayed.

void om::graphics::gui::objects::Button::setImageIsVisible ( Bool  newImageIsVisible)
inline

Set a boolean value indicating whether or not this button's image is displayed.

Menu* om::graphics::gui::objects::Button::getMenu ( ) const
inline

Return a pointer to the menu that is opened when the button is selected.

void om::graphics::gui::objects::Button::setMenu ( Menu *  newMenu)
inline

Set a pointer to the menu that is opened when the button is selected.

Bool om::graphics::gui::objects::Button::getIsEnabled ( ) const
inline

Return whether or not this button is currently active.

An enabled button (the default) can be interacted with by the user and is displayed normally. A disabled button can't be pressed by the user and displays more transparently, indicating its state.

void om::graphics::gui::objects::Button::setIsEnabled ( Bool  newIsEnabled)
inline

Set whether or not this button is currently active.

An enabled button (the default) can be interacted with by the user and is displayed normally. A disabled button can't be pressed by the user and displays more transparently, indicating its state.

Bool om::graphics::gui::objects::Button::getIsSelected ( ) const
inline

Return whether or not this button is currently selected (in its alternate state).

When a button is selected, its alternate text and image will be displayed instead of the normal text or image.

void om::graphics::gui::objects::Button::setIsSelected ( Bool  newIsSelected)
inline

Set whether or not this button is currently selected (in its alternate state).

When a button is selected, its alternate text and image will be displayed instead of the normal text or image.

Bool om::graphics::gui::objects::Button::getIsPressed ( ) const
inline

Return whether or not this button is currently pressed by the user.

If this method returns TRUE, the user is currently pressing the button but has not yet released the button. Depending on the type of button different actions will be taken after the button is released.

const ButtonFlags& om::graphics::gui::objects::Button::getFlags ( ) const
inline

Return an object containing boolean configuration flags for this button.

void om::graphics::gui::objects::Button::setFlags ( const ButtonFlags newFlags)
inline

Set an object containing boolean configuration flags for this button.

Type om::graphics::gui::objects::Button::getType ( ) const
inline

Return an object that represents the type of this button.

void om::graphics::gui::objects::Button::setType ( Type  newType)
inline

Set an object that represents the type of this button.

const Color4f& om::graphics::gui::objects::Button::getAlternateColor ( ) const
inline

Return the alternate color for this button's main area.

This is the color of the button when it is pressed.

void om::graphics::gui::objects::Button::setAlternateColor ( const Color4f &  newAlternateColor)
inline

Set the alternate color for this button's main area.

This is the color of the button when it is pressed.

const TextStyle& om::graphics::gui::objects::Button::getTextStyle ( ) const
inline

Return a const reference to the text style that is used to render the text for a button.

void om::graphics::gui::objects::Button::setTextStyle ( const TextStyle newTextStyle)
inline

Set the text style that is used to render the text for a button.

virtual Bool om::graphics::gui::objects::Button::drawSelf ( GUIRenderer renderer,
const AABB3f parentBounds 
) const
virtual

Draw this object using the specified GUI renderer to the given parent coordinate system bounds.

The method returns whether or not the object was successfully drawn.

The default implementation draws nothing and returns TRUE.

Reimplemented from om::graphics::gui::objects::GUIObject.

virtual Bool om::graphics::gui::objects::Button::keyEvent ( const KeyEvent event)
virtual

Handle the specified keyboard event that occured when this object had focus.

Reimplemented from om::gui::input::InputHandler.

virtual Bool om::graphics::gui::objects::Button::mouseButtonEvent ( const MouseButtonEvent event)
virtual

Handle the specified mouse button event that occurred.

Reimplemented from om::gui::input::InputHandler.

Delegate& om::graphics::gui::objects::Button::getDelegate ( )
inline

Return a reference to the delegate which responds to events for this button.

const Delegate& om::graphics::gui::objects::Button::getDelegate ( ) const
inline

Return a reference to the delegate which responds to events for this button.

void om::graphics::gui::objects::Button::setDelegate ( const Delegate newDelegate)
inline

Return a reference to the delegate which responds to events for this button.

Member Data Documentation

const Origin om::graphics::gui::objects::Button::DEFAULT_TEXT_ALIGNMENT
static

The default alignment that is used for a button's text label.

const Origin om::graphics::gui::objects::Button::DEFAULT_IMAGE_ALIGNMENT
static

The default alignment that is used for a button's image label.

const Border om::graphics::gui::objects::Button::DEFAULT_BORDER
static

The default border that is used for a button.

const Color4f om::graphics::gui::objects::Button::DEFAULT_BACKGROUND_COLOR
static

The default background color that is used for a button's area.

const Color4f om::graphics::gui::objects::Button::DEFAULT_BORDER_COLOR
static

The default border color that is used for a button.

const Color4f om::graphics::gui::objects::Button::DEFAULT_ALTERNATE_COLOR
static

The default color that is used for a button's background when it is pressed.


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