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

A class that represents a single-line text label or field that is part of a window. More...

#include <omGUITextField.h>

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

Classes

class  Delegate
 A class that contains function objects that recieve text field events. More...
 

Public Member Functions

 TextField ()
 Create a new text field with no text content and positioned at the origin of its coordinate system. More...
 
 TextField (const UTF8String &newText, const Size2D &newSize)
 Create a new text field which uses the specified text content, positioned at the origin of its coordinate system. More...
 
 TextField (const UTF8String &newText, const Size2D &newSize, const Vector2i &newPosition)
 Create a new text field which uses the specified text content and position. More...
 
 ~TextField ()
 Destroy a text field, releasing all resources associated with it. More...
 
UTF8String getText () const
 Return a string which contains the contents of this text field. More...
 
Bool setText (const UTF8String &newText)
 Set the text contents of this text field. More...
 
virtual Size2D getSize () const
 Return a 2D vector indicating the size on the screen of this text field 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 getIsEditable () const
 Return whether or not the text field is able to be edited by the user. More...
 
void setIsEditable (Bool newIsEditable)
 Set whether or not the text field is able to be edited by the user. More...
 
Bool getIsSelectable () const
 Return whether or not the contents of the text field are able to be selected by the user. More...
 
void setIsSelectable (Bool newIsSelectable)
 Set whether or not the contents of the text field are able to be selected by the user. More...
 
const DelegategetDelegate () const
 Return a const reference to the object that responds to events for this TextField. More...
 
void setDelegate (const Delegate &newDelegate)
 Set the object to which TextField events should be delegated. More...
 
virtual void * getInternalPointer () const
 Return a pointer to platform-specific data for this text field. 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 text field. 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 single-line text label or field that is part of a window.

Constructor & Destructor Documentation

om::gui::objects::TextField::TextField ( )

Create a new text field with no text content and positioned at the origin of its coordinate system.

om::gui::objects::TextField::TextField ( const UTF8String &  newText,
const Size2D &  newSize 
)

Create a new text field which uses the specified text content, positioned at the origin of its coordinate system.

om::gui::objects::TextField::TextField ( const UTF8String &  newText,
const Size2D &  newSize,
const Vector2i &  newPosition 
)

Create a new text field which uses the specified text content and position.

om::gui::objects::TextField::~TextField ( )

Destroy a text field, releasing all resources associated with it.

Member Function Documentation

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

Return a string which contains the contents of this text field.

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

Set the text contents of this text field.

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

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

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

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

virtual Bool om::gui::objects::TextField::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::TextField::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::TextField::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::TextField::getIsEditable ( ) const

Return whether or not the text field is able to be edited by the user.

A text field that is not editable will appear as a simple text label.

void om::gui::objects::TextField::setIsEditable ( Bool  newIsEditable)

Set whether or not the text field is able to be edited by the user.

A text field that is not editable will appear as a simple text label.

Bool om::gui::objects::TextField::getIsSelectable ( ) const

Return whether or not the contents of the text field are able to be selected by the user.

void om::gui::objects::TextField::setIsSelectable ( Bool  newIsSelectable)

Set whether or not the contents of the text field are able to be selected by the user.

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

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

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

Set the object to which TextField events should be delegated.

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

Return a pointer to platform-specific data for this text field.

On Mac OS X, this method returns a pointer to a subclass of NSTextField which represents the text field.

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

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

Member Data Documentation

Wrapper* om::gui::objects::TextField::wrapper

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


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