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

A class that represents a rectangular region that responds to mouse click events. More...

#include <omGUIButton.h>

Inheritance diagram for om::gui::objects::Button:
om::gui::objects::WindowObject om::gui::objects::GUIObject

Classes

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

Public Member Functions

 Button (const UTF8String &buttonText, const Size2D &newSize, const Vector2i &newPosition)
 Create a new button which uses the specified text label, size, and position. More...
 
 ~Button ()
 Destroy a button, releasing all resources associated with it. More...
 
UTF8String getText () const
 Return a string that represents the text label for this button. More...
 
Bool setText (const UTF8String &newText)
 Set a string that represents the text label for this button. More...
 
virtual Size2D getSize () const
 Return a 2D vector indicating the size on the screen of this button in pixels. More...
 
virtual Bool setSize (const Size2D &size)
 Set the size on the screen of this text field in pixels. More...
 
virtual Vector2i getPosition () const
 Return the 2D position of this text field in pixels, relative to the bottom left corner. More...
 
virtual Bool setPosition (const Vector2i &position)
 Set the 2D position of this text field in pixels, relative to the bottom left corner. More...
 
Bool getIsPressed () const
 Return whether or not this button is currently pressed. More...
 
const DelegategetDelegate () const
 Return a const reference to the object that responds to events for this button. More...
 
void setDelegate (const Delegate &newDelegate)
 Set the object to which button events should be delegated. More...
 
virtual void * getInternalPointer () const
 Return a pointer to platform-specific data for this button. More...
 
- Public Member Functions inherited from om::gui::objects::WindowObject
 WindowObject ()
 Create a new default window element. More...
 
Size getWidth () const
 Return the horizontal size in pixels of this window element. More...
 
Size getHeight () const
 Return the vertical size in pixels of this window element. More...
 
Bool setSize (Size newWidth, Size newHeight)
 Set the size on the screen of this window element in pixels. More...
 
WindowgetParentWindow () const
 Return the window that is a parent of this window element. More...
 
virtual void setParentWindow (Window *newParentWindow)
 Set the window that is going to be a parent of this window element. More...
 
Bool hasParentWindow () const
 Return whether or not this window element belongs to a window. More...
 
- Public Member Functions inherited from om::gui::objects::GUIObject
virtual ~GUIObject ()
 Destroy a GUI element and release all resources associated with it. More...
 

Public Attributes

Wrapper * wrapper
 A pointer to an object that wraps platform-specific data for this button. More...
 

Additional Inherited Members

- Protected Attributes inherited from om::gui::objects::WindowObject
WindowparentWindow
 The parent window of this window element, or NULL if this element is not part of a window. More...
 

Detailed Description

A class that represents a rectangular region that responds to mouse click events.

Constructor & Destructor Documentation

om::gui::objects::Button::Button ( const UTF8String &  buttonText,
const Size2D &  newSize,
const Vector2i &  newPosition 
)

Create a new button which uses the specified text label, size, and position.

om::gui::objects::Button::~Button ( )

Destroy a button, releasing all resources associated with it.

Member Function Documentation

UTF8String om::gui::objects::Button::getText ( ) const

Return a string that represents the text label for this button.

Bool om::gui::objects::Button::setText ( const UTF8String &  newText)

Set a string that represents the text label for this button.

The method returns whether or not the text change operation was successful.

virtual Size2D om::gui::objects::Button::getSize ( ) const
virtual

Return a 2D vector indicating the size on the screen of this button in pixels.

Implements om::gui::objects::WindowObject.

virtual Bool om::gui::objects::Button::setSize ( const Size2D &  size)
virtual

Set the size on the screen of this text field in pixels.

The method returns whether or not the size change operation was successful.

Implements om::gui::objects::WindowObject.

virtual Vector2i om::gui::objects::Button::getPosition ( ) const
virtual

Return the 2D position of this text field in pixels, relative to the bottom left corner.

The coordinate position is defined relative to its enclosing coordinate frame where the origin will be the bottom left corner of the enclosing view or window.

Implements om::gui::objects::WindowObject.

virtual Bool om::gui::objects::Button::setPosition ( const Vector2i &  position)
virtual

Set the 2D position of this text field in pixels, relative to the bottom left corner.

The coordinate position is defined relative to its enclosing coordinate frame where the origin will be the bottom left corner of the enclosing view or window.

If the position change operation is successful, TRUE is returned and the text field is moved. Otherwise, FALSE is returned and the text field is not moved.

Implements om::gui::objects::WindowObject.

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

Return whether or not this button is currently pressed.

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

Return a const reference to the object that responds to events for this button.

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

Set the object to which button events should be delegated.

virtual void* om::gui::objects::Button::getInternalPointer ( ) const
virtual

Return a pointer to platform-specific data for this button.

On Mac OS X, this method returns a pointer to a subclass of NSButton which represents the button.

On Windows, this method returns an HWND indicating the 'window' which represents the button.

Implements om::gui::objects::GUIObject.

Member Data Documentation

Wrapper* om::gui::objects::Button::wrapper

A pointer to an object that wraps platform-specific data for this button.


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