Om
1.0.0
A universal framework for multimedia simulation
|
A class that represents a rectangular region that responds to mouse click events. More...
#include <omGUIButton.h>
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 Delegate & | getDelegate () 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... | |
Window * | getParentWindow () 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 | |
Window * | parentWindow |
The parent window of this window element, or NULL if this element is not part of a window. More... | |
A class that represents a rectangular region that responds to mouse click events.
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.
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 |
Return a 2D vector indicating the size on the screen of this button in pixels.
Implements om::gui::objects::WindowObject.
|
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 |
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 |
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 |
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.
Wrapper* om::gui::objects::Button::wrapper |
A pointer to an object that wraps platform-specific data for this button.