Torque2D Reference
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | List of all members
GuiControl Class Reference

#include <guiControl.h>

+ Inheritance diagram for GuiControl:

Public Types

enum  horizSizingOptions {
  horizResizeRight = 0, horizResizeWidth, horizResizeLeft, horizResizeCenter,
  horizResizeRelative
}
 
enum  vertSizingOptions {
  vertResizeBottom = 0, vertResizeHeight, vertResizeTop, vertResizeCenter,
  vertResizeRelative
}
 

Public Member Functions

virtual void getScrollLineSizes (U32 *rowHeight, U32 *columnWidth)
 
virtual void getCursor (GuiCursor *&cursor, bool &showCursor, const GuiEvent &lastGuiEvent)
 
void awaken ()
 Called when this control and its children have been wired up. More...
 
void sleep ()
 Called when this control is no more. More...
 
void preRender ()
 Prerender this control and all its children. More...
 
virtual bool onInputEvent (const InputEvent &event)
 General input handler. More...
 
virtual bool ControlIsChild (GuiControl *child)
 
void setControlProfile (GuiControlProfile *prof)
 
virtual void onAction ()
 Occurs when this control performs its "action". More...
 
void renderJustifiedText (Point2I offset, Point2I extent, const char *text)
 
void inspectPostApply ()
 
void inspectPreApply ()
 
Editor

These functions are used by the GUI Editor

void setSizing (S32 horz, S32 vert)
 
void write (Stream &stream, U32 tabStop, U32 flags)
 Overrides Parent Serialization to allow specific controls to not be saved (Dynamic Controls, etc) More...
 
bool getCanSave ()
 Returns boolean specifying if a control can be serialized. More...
 
void setCanSave (bool bCanSave)
 Set serialization flag. More...
 
bool getCanSaveParent ()
 Returns boolean as to whether any parent of this control has the 'no serialization' flag set. More...
 
Accessors
const Point2IgetPosition ()
 Returns position of the control. More...
 
const Point2IgetExtent ()
 Returns extents of the control. More...
 
const RectIgetBounds ()
 Returns the bounds of the control. More...
 
const Point2IgetMinExtent ()
 Returns minimum size the control can be. More...
 
const S32 getLeft ()
 Returns the X position of the control. More...
 
const S32 getTop ()
 Returns the Y position of the control. More...
 
const S32 getWidth ()
 Returns the width of the control. More...
 
const S32 getHeight ()
 Returns the height of the control. More...
 
Flags
virtual void setVisible (bool value)
 
bool isVisible ()
 Returns true if the object is visible. More...
 
void setActive (bool value)
 
bool isActive ()
 Returns true if this control is active. More...
 
bool isAwake ()
 Returns true if this control is awake. More...
 
Children
void addObject (SimObject *obj)
 
void removeObject (SimObject *obj)
 
GuiControlgetParent ()
 Returns the control which owns this one. More...
 
GuiCanvasgetRoot ()
 
Coordinates
Point2I localToGlobalCoord (const Point2I &src)
 
Point2I globalToLocalCoord (const Point2I &src)
 
Resizing
virtual void resize (const Point2I &newPosition, const Point2I &newExtent)
 
virtual void setPosition (const Point2I &newPosition)
 
virtual void setExtent (const Point2I &newExtent)
 
virtual void setBounds (const RectI &newBounds)
 
virtual void setLeft (S32 newLeft)
 
virtual void setTop (S32 newTop)
 
virtual void setWidth (S32 newWidth)
 
virtual void setHeight (S32 newHeight)
 
virtual void childResized (GuiControl *child)
 
virtual void parentResized (const Point2I &oldParentExtent, const Point2I &newParentExtent)
 
Rendering
virtual void onRender (Point2I offset, const RectI &updateRect)
 
virtual bool renderTooltip (Point2I cursorPos, const char *tipText=NULL)
 
void renderChildControls (Point2I offset, const RectI &updateRect)
 
void setUpdateRegion (Point2I pos, Point2I ext)
 
virtual void setUpdate ()
 Sets the update area of the control to encompass the whole control. More...
 
Events

If you subclass these, make sure to call the Parent::'s versions.

virtual bool onWake ()
 Called when this object is asked to wake up returns true if it's actually awake at the end. More...
 
virtual void onSleep ()
 Called when this object is asked to sleep. More...
 
virtual void onPreRender ()
 Do special pre-render proecessing. More...
 
virtual void onRemove ()
 Called when this object is removed. More...
 
virtual void onChildRemoved (GuiControl *child)
 Called when one of this objects children is removed. More...
 
bool onAdd ()
 Called when this object is added to the scene. More...
 
virtual void onChildAdded (GuiControl *child)
 Called when this object has a new child. More...
 
Input (Keyboard/Mouse)
virtual bool pointInControl (const Point2I &parentCoordPoint)
 
bool cursorInControl ()
 Returns true if the global cursor is inside this control. More...
 
virtual GuiControlfindHitControl (const Point2I &pt, S32 initialLayer=-1)
 
void mouseLock (GuiControl *lockingControl)
 
void mouseLock ()
 Turn on mouse locking with last used lock control. More...
 
void mouseUnlock ()
 Unlock the mouse. More...
 
bool isMouseLocked ()
 Returns true if the mouse is locked. More...
 
Mouse Events

These functions are called when the input event which is in the name of the function occurs.

virtual void onMouseUp (const GuiEvent &event)
 
virtual void onMouseDown (const GuiEvent &event)
 
virtual void onMouseMove (const GuiEvent &event)
 
virtual void onMouseDragged (const GuiEvent &event)
 
virtual void onMouseEnter (const GuiEvent &event)
 
virtual void onMouseLeave (const GuiEvent &event)
 
virtual bool onMouseWheelUp (const GuiEvent &event)
 
virtual bool onMouseWheelDown (const GuiEvent &event)
 
virtual void onRightMouseDown (const GuiEvent &event)
 
virtual void onRightMouseUp (const GuiEvent &event)
 
virtual void onRightMouseDragged (const GuiEvent &event)
 
virtual void onMiddleMouseDown (const GuiEvent &event)
 
virtual void onMiddleMouseUp (const GuiEvent &event)
 
virtual void onMiddleMouseDragged (const GuiEvent &event)
 
Editor Mouse Events

These functions are called when the input event which is in the name of the function occurs. Conversly from normal mouse events, these have a boolean return value that, if they return true, the editor will NOT act on them or be able to respond to this particular event.

This is particularly useful for when writing controls so that they may become aware of the editor and allow customization of their data or appearance as if they were actually in use. For example, the GuiTabBookCtrl catches on mouse down to select a tab and NOT let the editor do any instant group manipulation.

virtual bool onMouseDownEditor (const GuiEvent &event, Point2I offset)
 
virtual bool onMouseUpEditor (const GuiEvent &event, Point2I offset)
 
virtual bool onRightMouseDownEditor (const GuiEvent &event, Point2I offset)
 
virtual bool onMouseDraggedEditor (const GuiEvent &event, Point2I offset)
 
Tabs
virtual GuiControlfindFirstTabable ()
 Find the first tab-accessable child of this control. More...
 
virtual GuiControlfindLastTabable (bool firstCall=true)
 
virtual GuiControlfindPrevTabable (GuiControl *curResponder, bool firstCall=true)
 
virtual GuiControlfindNextTabable (GuiControl *curResponder, bool firstCall=true)
 
First Responder

A first responder is the control which reacts first, in it's responder chain, to keyboard events The responder chain is set for each parent and so there is only one first responder amongst it's children.

virtual void setFirstResponder (GuiControl *firstResponder)
 
virtual void makeFirstResponder (bool value)
 
bool isFirstResponder ()
 Returns true if this control is a first responder. More...
 
virtual void setFirstResponder ()
 Sets this object to be a first responder. More...
 
void clearFirstResponder ()
 Clears the first responder for this chain. More...
 
GuiControlgetFirstResponder ()
 Returns the first responder for this chain. More...
 
virtual void onLoseFirstResponder ()
 Occurs when the first responder for this chain is lost. More...
 
Keyboard Events
void addAcceleratorKey ()
 Adds the accelerator key for this object to the canvas. More...
 
virtual void buildAcceleratorMap ()
 
virtual void acceleratorKeyPress (U32 index)
 
virtual void acceleratorKeyRelease (U32 index)
 
virtual bool onKeyDown (const GuiEvent &event)
 
virtual bool onKeyUp (const GuiEvent &event)
 
virtual bool onKeyRepeat (const GuiEvent &event)
 
Peer Messaging

Used to send a message to other GUIControls which are children of the same parent.

This is mostly used by radio controls.

void messageSiblings (S32 message)
 Send a message to all siblings. More...
 
virtual void onMessage (GuiControl *sender, S32 msg)
 
Canvas Events

Functions called by the canvas

virtual void onDialogPush ()
 Called if this object is a dialog, when it is added to the visible layers. More...
 
virtual void onDialogPop ()
 Called if this object is a dialog, when it is removed from the visible layers. More...
 
- Public Member Functions inherited from SimGroup
 ~SimGroup ()
 
void addObject (SimObject *, SimObjectId)
 
void addObject (SimObject *, const char *name)
 
virtual SimObjectfindObject (const char *name)
 Find an object in the group. More...
 
bool processArguments (S32 argc, const char **argv)
 Process constructor options. (ie, new SimObject(1,2,3)) More...
 
 DECLARE_CONOBJECT (SimGroup)
 
- Public Member Functions inherited from SimSet
 SimSet ()
 
 ~SimSet ()
 
virtual void onDeleteNotify (SimObject *object)
 
virtual U32 getTamlChildCount (void) const
 Called when Taml attempts to compile a list of children. More...
 
virtual SimObjectgetTamlChild (const U32 childIndex) const
 Called when Taml attempts to compile a list of children. More...
 
virtual void addTamlChild (SimObject *pSimObject)
 Called when Taml attempts to populate an objects children during a read. More...
 
void callOnChildren (const char *method, S32 argc, const char *argv[], bool executeOnChildGroups=true)
 
SimObjectfindObjectByInternalName (const char *internalName, bool searchChildren=false)
 
virtual bool writeObject (Stream *stream)
 
virtual bool readObject (Stream *stream)
 
void lock ()
 
void unlock ()
 
 DECLARE_CONOBJECT (SimSet)
 
void _setVectorAssoc (const char *file, const U32 line)
 
virtual void pushObject (SimObject *)
 
virtual void popObject ()
 Remove an object from the end of the list. More...
 
void bringObjectToFront (SimObject *obj)
 
void pushObjectToBack (SimObject *obj)
 
SimObjectfront ()
 
SimObjectfirst ()
 
SimObjectlast ()
 
bool empty ()
 
S32 size () const
 
iterator begin ()
 
iterator end ()
 
value operator[] (S32 index)
 
iterator find (iterator first, iterator last, SimObject *obj)
 
iterator find (SimObject *obj)
 
template<typename T >
bool containsType (void)
 
virtual bool reOrder (SimObject *obj, SimObject *target=0)
 
SimObjectat (S32 index) const
 
void deleteObjects (void)
 
void clear ()
 
- Public Member Functions inherited from SimObject
StringTableEntry getClassNamespace () const
 
StringTableEntry getSuperClassNamespace () const
 
void setClassNamespace (const char *classNamespace)
 
void setSuperClassNamespace (const char *superClassNamespace)
 
void pushScriptCallbackGuard (void)
 
void popScriptCallbackGuard (void)
 
S32 getScriptCallbackGuard (void)
 
NamespacegetNamespace ()
 Return the object's namespace. More...
 
const char * tabComplete (const char *prevText, S32 baseLen, bool)
 
virtual void dump ()
 
virtual void dumpClassHierarchy ()
 
SimObjectclone (const bool copyDynamicFields)
 
virtual void copyTo (SimObject *object)
 
template<typename T >
bool isType (void)
 
virtual bool handlesConsoleMethod (const char *fname, S32 *routingId)
 
 DECLARE_CONOBJECT (SimObject)
 
NotifyremoveNotify (void *ptr, Notify::Type)
 Remove a notification from the list. More...
 
void deleteNotify (SimObject *obj)
 Notify an object when we are deleted. More...
 
void clearNotify (SimObject *obj)
 Notify an object when we are cleared. More...
 
void clearAllNotifications ()
 Remove all notifications for this object. More...
 
void processDeleteNotifies ()
 Send out deletion notifications. More...
 
void registerReference (SimObject **obj)
 
void unregisterReference (SimObject **obj)
 
const char * getDataField (StringTableEntry slotName, const char *array)
 
void setDataField (StringTableEntry slotName, const char *array, const char *value)
 
const char * getPrefixedDataField (StringTableEntry fieldName, const char *array)
 
void setPrefixedDataField (StringTableEntry fieldName, const char *array, const char *value)
 
const char * getPrefixedDynamicDataField (StringTableEntry fieldName, const char *array, const S32 fieldType=-1)
 
void setPrefixedDynamicDataField (StringTableEntry fieldName, const char *array, const char *value, const S32 fieldType=-1)
 
StringTableEntry getDataFieldPrefix (StringTableEntry fieldName)
 
U32 getDataFieldType (StringTableEntry slotName, const char *array)
 
SimFieldDictionarygetFieldDictionary ()
 
void clearDynamicFields (void)
 Clear all dynamic fields. More...
 
void setCanSaveDynamicFields (bool bCanSave)
 Set whether fields created at runtime should be saved. Default is true. More...
 
bool getCanSaveDynamicFields (void) const
 Get whether fields created at runtime should be saved. Default is true. More...
 
void setInternalName (const char *newname)
 
StringTableEntry getInternalName ()
 Get the internal of of this control. More...
 
virtual bool save (const char *pcFilePath, bool bOnlySelected=false)
 Save object as a TorqueScript File. More...
 
virtual bool isMethod (const char *methodName)
 Check if a method exists in the objects current namespace. More...
 
SimObjectId getId (void) const
 
StringTableEntry getIdString (void) const
 
U32 getType () const
 
const StringTableEntry getName (void) const
 
void setId (SimObjectId id)
 
void assignName (const char *name)
 
SimGroupgetGroup () const
 
bool isChildOfGroup (SimGroup *pGroup)
 
bool isProperlyAdded () const
 
bool isDeleted () const
 
bool isRemoved () const
 
bool isLocked ()
 
void setLocked (bool b)
 
bool isHidden ()
 
void setHidden (bool b)
 
void setProgenitorFile (const char *pFile)
 
StringTableEntry getProgenitorFile (void) const
 
void setPeriodicTimerID (const S32 timerID)
 
S32 getPeriodicTimerID (void) const
 
bool isPeriodicTimerActive (void) const
 
bool isSelected () const
 
bool isExpanded () const
 
void setSelected (bool sel)
 
void setExpanded (bool exp)
 
void setModDynamicFields (bool dyn)
 
void setModStaticFields (bool sta)
 
 SimObject (const U8 namespaceLinkMask=LinkSuperClassName|LinkClassName)
 
virtual ~SimObject ()
 
virtual void onGroupAdd ()
 Called when the object is added to a SimGroup. More...
 
virtual void onGroupRemove ()
 Called when the object is removed from a SimGroup. More...
 
virtual void onNameChange (const char *name)
 Called when the object's name is changed. More...
 
virtual void onStaticModified (const char *slotName, const char *newValue=NULL)
 
virtual void onEditorEnable ()
 Called when the editor is activated. More...
 
virtual void onEditorDisable ()
 Called when the editor is deactivated. More...
 
bool registerObject ()
 
bool registerObject (U32 id)
 
bool registerObject (const char *name)
 
bool registerObject (const char *name, U32 id)
 
void unregisterObject ()
 
void deleteObject ()
 
bool addToSet (SimObjectId)
 
bool addToSet (const char *)
 
bool removeFromSet (SimObjectId)
 
bool removeFromSet (const char *)
 
virtual bool writeField (StringTableEntry fieldname, const char *value)
 
virtual void writeFields (Stream &stream, U32 tabStop)
 
virtual void buildFilterList ()
 
void addFieldFilter (const char *fieldName)
 
void removeFieldFilter (const char *fieldName)
 
void clearFieldFilters ()
 
bool isFiltered (const char *fieldName)
 
void assignFieldsFrom (SimObject *obj)
 
void assignDynamicFieldsFrom (SimObject *obj)
 
- Public Member Functions inherited from ConsoleObject
const AbstractClassRep::FieldfindField (StringTableEntry fieldName) const
 Get a reference to a field by name. More...
 
virtual AbstractClassRepgetClassRep () const
 Gets the ClassRep. More...
 
bool setField (const char *fieldName, const char *value)
 Set the value of a field. More...
 
virtual ~ConsoleObject ()
 
const AbstractClassRep::FieldListgetFieldList () const
 Get a list of all the fields. This information cannot be modified. More...
 
AbstractClassRep::FieldListgetModifiableFieldList ()
 
bool & getDynamicGroupExpand ()
 
S32 getClassId (U32 netClassGroup) const
 
const char * getClassName () const
 

Static Public Attributes

Design Time Editor Access
static GuiEditCtrlsmEditorHandle = NULL
 

Protected Member Functions

Callbacks

Executes a console command, and returns the result.

The global console variable $ThisControl is set to the id of the calling control. WARNING: because multiple controls may set $ThisControl, at any time, the value of $ThisControl should be stored in a local variable by the callback code. The use of the $ThisControl variable is not thread safe.

const char * execConsoleCallback ()
 Executes mConsoleCommand, and returns the result. More...
 
const char * execAltConsoleCallback ()
 Executes mAltConsoleCommand, and returns the result. More...
 

Control State

GuiControlProfilemProfile
 
GuiControlProfilemTooltipProfile
 
S32 mTipHoverTime
 
S32 mTooltipWidth
 
bool mVisible
 
bool mActive
 
bool mAwake
 
bool mSetFirstResponder
 
bool mCanSave
 
bool mIsContainer
 if true, then the GuiEditor can drag other controls into this one. More...
 
S32 mLayer
 
RectI mBounds
 
Point2I mMinExtent
 
StringTableEntry mLangTableName
 
LangTablemLangTable
 
static S32 smCursorChanged = -1
 Has this control modified the cursor? -1 or type. More...
 
static bool smDesignTime = false
 
S32 mHorizSizing
 Set from horizSizingOptions. More...
 
S32 mVertSizing
 Set from vertSizingOptions. More...
 
StringTableEntry mConsoleVariable
 
StringTableEntry mConsoleCommand
 
StringTableEntry mAltConsoleCommand
 
StringTableEntry mAcceleratorKey
 
StringTableEntry mTooltip
 

Keyboard Input

SimObjectPtr< GuiControlmFirstResponder
 
static GuiControlsmPrevResponder = NULL
 
static GuiControlsmCurResponder = NULL
 

Console

void setVariable (const char *value)
 
void setIntVariable (S32 value)
 
void setFloatVariable (F32 value)
 
const char * getVariable ()
 Returns value of control's bound variable as a string. More...
 
S32 getIntVariable ()
 Returns value of control's bound variable as a integer. More...
 
F32 getFloatVariable ()
 Returns value of control's bound variable as a float. More...
 
void setConsoleVariable (const char *variable)
 
void setConsoleCommand (const char *newCmd)
 
const char * getConsoleCommand ()
 Returns the name of the function bound to this GuiControl. More...
 
LangTablegetGUILangTable (void)
 
const UTF8 * getGUIString (S32 id)
 
virtual const char * getScriptValue ()
 Returns the value of the variable bound to this object. More...
 
virtual void setScriptValue (const char *value)
 Sets the value of the variable bound to this object. More...
 

Initialization

 DECLARE_CONOBJECT (GuiControl)
 
 GuiControl ()
 
virtual ~GuiControl ()
 
static void initPersistFields ()
 

Additional Inherited Members

- Static Public Member Functions inherited from SimObject
static void initPersistFields ()
 
- Protected Types inherited from SimObject
enum  SimObjectNSLinkType { LinkClassName = BIT(0), LinkSuperClassName = BIT(1) }
 
- Static Protected Member Functions inherited from SimObject
static bool setClass (void *obj, const char *data)
 
static bool setSuperClass (void *obj, const char *data)
 
static bool writeCanSaveDynamicFields (void *obj, StringTableEntry pFieldName)
 
static bool writeInternalName (void *obj, StringTableEntry pFieldName)
 
static bool setParentGroup (void *obj, const char *data)
 
static bool writeParentGroup (void *obj, StringTableEntry pFieldName)
 
static bool writeSuperclass (void *obj, StringTableEntry pFieldName)
 
static bool writeClass (void *obj, StringTableEntry pFieldName)
 
static SimObject::NotifyallocNotify ()
 Get a free Notify structure. More...
 
static void freeNotify (SimObject::Notify *)
 Mark a Notify structure as free. More...
 
- Protected Attributes inherited from SimSet
SimObjectList objectList
 
void * mMutex
 
- Static Protected Attributes inherited from SimObject
static SimObject::NotifymNotifyFreeList = NULL
 

Member Enumeration Documentation

Enumerator
horizResizeRight 

fixed on the left and width

horizResizeWidth 

fixed on the left and right

horizResizeLeft 

fixed on the right and width

horizResizeCenter 
horizResizeRelative 

resize relative

Enumerator
vertResizeBottom 

fixed on the top and in height

vertResizeHeight 

fixed on the top and bottom

vertResizeTop 

fixed in height and on the bottom

vertResizeCenter 
vertResizeRelative 

resize relative

Constructor & Destructor Documentation

~GuiControl ( )
virtual

Member Function Documentation

void acceleratorKeyPress ( U32  index)
virtual

Occurs when the accelerator key for this control is pressed

Parameters
indexIndex in the acclerator map of the key

Reimplemented in GuiMenuBar, and GuiButtonBaseCtrl.

void acceleratorKeyRelease ( U32  index)
virtual

Occurs when the accelerator key for this control is released

Parameters
indexIndex in the acclerator map of the key

Reimplemented in GuiButtonBaseCtrl.

void addAcceleratorKey ( )

Adds the accelerator key for this object to the canvas.

void addObject ( SimObject obj)
virtual

Adds an object as a child of this object.

Parameters
objNew child object of this control

Reimplemented from SimGroup.

void awaken ( )

Called when this control and its children have been wired up.

void buildAcceleratorMap ( )
virtual

Adds this control's accelerator key to the accelerator map, and recursively tells all children to do the same.

Reimplemented in GuiMenuBar.

void childResized ( GuiControl child)
virtual

Called when a child control of the object is resized

Parameters
childChild object

Reimplemented in GuiTabBookCtrl, GuiScrollCtrl, GuiRolloutCtrl, GuiStackControl, GuiAutoScrollCtrl, and GuiDynamicCtrlArrayControl.

void clearFirstResponder ( )

Clears the first responder for this chain.

bool ControlIsChild ( GuiControl child)
virtual

Returns true if the provided control is a child (grandchild, or greatgrandchild) of this one.

Parameters
childControl to test
bool cursorInControl ( )

Returns true if the global cursor is inside this control.

DECLARE_CONOBJECT ( GuiControl  )
const char * execAltConsoleCallback ( )
protected

Executes mAltConsoleCommand, and returns the result.

const char * execConsoleCallback ( )
protected

Executes mConsoleCommand, and returns the result.

GuiControl * findFirstTabable ( )
virtual

Find the first tab-accessable child of this control.

GuiControl * findHitControl ( const Point2I pt,
S32  initialLayer = -1 
)
virtual

Returns the control which the provided point is under, with layering

Parameters
ptPoint to test
initialLayerLayer of gui objects to begin the search

Reimplemented in GuiScrollCtrl, GuiWindowCtrl, and GuiTabPageCtrl.

GuiControl * findLastTabable ( bool  firstCall = true)
virtual

Find the last tab-accessable child of this control

Parameters
firstCallSet to true to clear the global previous responder
GuiControl * findNextTabable ( GuiControl curResponder,
bool  firstCall = true 
)
virtual

Find next tab-accessable control with regards to the provided control.

Parameters
curResponderCurrent control
firstCallSet to true to clear the global current responder

Reimplemented in GuiWindowCtrl, and GuiTabPageCtrl.

GuiControl * findPrevTabable ( GuiControl curResponder,
bool  firstCall = true 
)
virtual

Find previous tab-accessable control with respect to the provided one

Parameters
curResponderCurrent control
firstCallSet to true to clear the global previous responder

Reimplemented in GuiWindowCtrl, and GuiTabPageCtrl.

const RectI& getBounds ( )
inline

Returns the bounds of the control.

bool getCanSave ( )

Returns boolean specifying if a control can be serialized.

bool getCanSaveParent ( )

Returns boolean as to whether any parent of this control has the 'no serialization' flag set.

const char * getConsoleCommand ( )

Returns the name of the function bound to this GuiControl.

void getCursor ( GuiCursor *&  cursor,
bool &  showCursor,
const GuiEvent lastGuiEvent 
)
virtual

Get information about the cursor.

Parameters
cursorCursor information will be stored here
showCursorWill be set to true if the cursor is visible
lastGuiEventGuiEvent containing cursor position and modifyer keys (ie ctrl, shift, alt etc)

Reimplemented in GuiFrameSetCtrl, GuiWindowCtrl, and GuiEditCtrl.

const Point2I& getExtent ( )
inline

Returns extents of the control.

GuiControl* getFirstResponder ( )
inline

Returns the first responder for this chain.

F32 getFloatVariable ( )
protected

Returns value of control's bound variable as a float.

LangTable * getGUILangTable ( void  )
const UTF8 * getGUIString ( S32  id)
const S32 getHeight ( )
inline

Returns the height of the control.

S32 getIntVariable ( )
protected

Returns value of control's bound variable as a integer.

const S32 getLeft ( )
inline

Returns the X position of the control.

const Point2I& getMinExtent ( )
inline

Returns minimum size the control can be.

GuiControl * getParent ( )

Returns the control which owns this one.

const Point2I& getPosition ( )
inline

Returns position of the control.

GuiCanvas * getRoot ( )

Returns the root canvas of this control.

const char * getScriptValue ( )
virtual
void getScrollLineSizes ( U32 *  rowHeight,
U32 *  columnWidth 
)
virtual

Get information about the size of a scroll line.

Parameters
rowHeightThe height, in pixels, of a row
columnWidthThe width, in pixels, of a column
const S32 getTop ( )
inline

Returns the Y position of the control.

const char * getVariable ( )
protected

Returns value of control's bound variable as a string.

const S32 getWidth ( )
inline

Returns the width of the control.

Point2I globalToLocalCoord ( const Point2I src)

Returns global coordinates translated into local space

Parameters
srcGlobal coordinates to translate
void initPersistFields ( void  )
static
void inspectPostApply ( )
virtual

Called after any property of the object is changed in the world editor.

See Also
inspectPreApply

Reimplemented from SimObject.

Reimplemented in GuiMLTextCtrl, GuiTextCtrl, and GuiMessageVectorCtrl.

void inspectPreApply ( )
virtual

Specifically, this is called by setDataField when a static field is modified, see the console details. Called before any property of the object is changed in the world editor.

The calling order here is:

Reimplemented from SimObject.

bool isActive ( )
inline

Returns true if this control is active.

bool isAwake ( )
inline

Returns true if this control is awake.

bool isFirstResponder ( )

Returns true if this control is a first responder.

bool isMouseLocked ( )

Returns true if the mouse is locked.

bool isVisible ( )
inline

Returns true if the object is visible.

Point2I localToGlobalCoord ( const Point2I src)

Translates local coordinates (wrt this object) into global coordinates

Parameters
srcLocal coordinates to translate
void makeFirstResponder ( bool  value)
virtual

Sets up this control to be the first in it's group to respond to an input event

Parameters
valueTrue if this should be a first responder
void messageSiblings ( S32  message)

Send a message to all siblings.

void mouseLock ( GuiControl lockingControl)

Lock the mouse within the provided control

Parameters
lockingControlControl to lock the mouse within
void mouseLock ( )

Turn on mouse locking with last used lock control.

void mouseUnlock ( )

Unlock the mouse.

void onAction ( )
virtual

Occurs when this control performs its "action".

Reimplemented in GuiMenuBar, GuiPopUpMenuCtrlEx, GuiPopUpMenuCtrl, GuiButtonBaseCtrl, and GuiCheckBoxCtrl.

bool onAdd ( void  )
virtual

Called when this object is added to the scene.

Reimplemented from SimObject.

Reimplemented in GuiMLTextCtrl, GuiPopUpMenuCtrlEx, GuiPopUpMenuCtrl, GuiTextEditCtrl, GuiTextCtrl, and GuiMessageVectorCtrl.

void onChildAdded ( GuiControl child)
virtual

Called when this object has a new child.

Reimplemented in GuiTabBookCtrl, GuiAutoScrollCtrl, and GuiScriptNotifyCtrl.

void onChildRemoved ( GuiControl child)
virtual

Called when one of this objects children is removed.

Reimplemented in GuiTabBookCtrl, GuiAutoScrollCtrl, and GuiScriptNotifyCtrl.

void onDialogPop ( )
virtual

Called if this object is a dialog, when it is removed from the visible layers.

Reimplemented in GuiScriptNotifyCtrl.

void onDialogPush ( )
virtual

Called if this object is a dialog, when it is added to the visible layers.

Reimplemented in GuiScriptNotifyCtrl.

bool onInputEvent ( const InputEvent event)
virtual

General input handler.

Reimplemented in GuiInputCtrl.

bool onKeyDown ( const GuiEvent event)
virtual
bool onKeyRepeat ( const GuiEvent event)
virtual

Happens when a key is held down, resulting in repeated keystrokes.

Parameters
eventEvent descriptor (which contains the key)
bool onKeyUp ( const GuiEvent event)
virtual

Happens when a key is released

Parameters
eventEvent descriptor (which contains the key)

Reimplemented in GuiButtonBaseCtrl.

void onLoseFirstResponder ( )
virtual

Occurs when the first responder for this chain is lost.

Reimplemented in GuiTextEditCtrl, and GuiScriptNotifyCtrl.

void onMessage ( GuiControl sender,
S32  msg 
)
virtual

Receive a message from another control

Reimplemented in GuiButtonBaseCtrl.

void onMiddleMouseDown ( const GuiEvent event)
virtual

Reimplemented in GuiTreeViewCtrl, and SceneWindow.

void onMiddleMouseDragged ( const GuiEvent event)
virtual

Reimplemented in SceneWindow.

void onMiddleMouseUp ( const GuiEvent event)
virtual

Reimplemented in SceneWindow.

void onMouseDown ( const GuiEvent event)
virtual
virtual bool onMouseDownEditor ( const GuiEvent event,
Point2I  offset 
)
inlinevirtual

Called when a mouseDown event occurs on a control and the GUI editor is active

Parameters
eventthe GuiEvent which caused the call to this function
offsetthe offset which is representative of the units x and y that the editor takes up on screen

Reimplemented in GuiTabBookCtrl, and GuiTabPageCtrl.

void onMouseDragged ( const GuiEvent event)
virtual
virtual bool onMouseDraggedEditor ( const GuiEvent event,
Point2I  offset 
)
inlinevirtual

Called when a mouseDragged event occurs on a control and the GUI editor is active

Parameters
eventthe GuiEvent which caused the call to this function
offsetthe offset which is representative of the units x and y that the editor takes up on screen
void onMouseEnter ( const GuiEvent event)
virtual
void onMouseLeave ( const GuiEvent event)
virtual
void onMouseMove ( const GuiEvent event)
virtual
void onMouseUp ( const GuiEvent event)
virtual
virtual bool onMouseUpEditor ( const GuiEvent event,
Point2I  offset 
)
inlinevirtual

Called when a mouseUp event occurs on a control and the GUI editor is active

Parameters
eventthe GuiEvent which caused the call to this function
offsetthe offset which is representative of the units x and y that the editor takes up on screen
bool onMouseWheelDown ( const GuiEvent event)
virtual

Reimplemented in SceneWindow, and GuiScrollCtrl.

bool onMouseWheelUp ( const GuiEvent event)
virtual

Reimplemented in SceneWindow, and GuiScrollCtrl.

void onPreRender ( )
virtual
void onRemove ( )
virtual

Called when this object is removed.

Reimplemented from SimGroup.

Reimplemented in SceneWindow, GuiTabBookCtrl, GuiEditCtrl, GuiTextListCtrl, and GuiMessageVectorCtrl.

void onRender ( Point2I  offset,
const RectI updateRect 
)
virtual
void onRightMouseDown ( const GuiEvent event)
virtual
virtual bool onRightMouseDownEditor ( const GuiEvent event,
Point2I  offset 
)
inlinevirtual

Called when a rightMouseDown event occurs on a control and the GUI editor is active

Parameters
eventthe GuiEvent which caused the call to this function
offsetthe offset which is representative of the units x and y that the editor takes up on screen
void onRightMouseDragged ( const GuiEvent event)
virtual

Reimplemented in SceneWindow, and GuiMouseEventCtrl.

void onRightMouseUp ( const GuiEvent event)
virtual
void onSleep ( )
virtual
bool onWake ( )
virtual
void parentResized ( const Point2I oldParentExtent,
const Point2I newParentExtent 
)
virtual

Called when this objects parent is resized

Parameters
oldParentExtentThe old size of the parent object
newParentExtentThe new size of the parent object

Reimplemented in GuiMLTextCtrl, GuiTextEditCtrl, GuiListBoxCtrl, GuiInspector, GuiMessageVectorCtrl, and GuiScriptNotifyCtrl.

bool pointInControl ( const Point2I parentCoordPoint)
virtual

This function will return true if the provided coordinates (wrt parent object) are within the bounds of this control

Parameters
parentCoordPointCoordinates to test

Reimplemented in GuiSubmenuBackgroundCtrl.

void preRender ( )

Prerender this control and all its children.

void removeObject ( SimObject obj)
virtual

Removes a child object from this control.

Parameters
objObject to remove from this control

Reimplemented from SimGroup.

void renderChildControls ( Point2I  offset,
const RectI updateRect 
)

Called when this control should render its children

Parameters
offsetThe location this control is to begin rendering
updateRectThe screen area this control has drawing access to
void renderJustifiedText ( Point2I  offset,
Point2I  extent,
const char *  text 
)

Renders justified text using the profile.

Note
This should move into the graphics library at some point
bool renderTooltip ( Point2I  cursorPos,
const char *  tipText = NULL 
)
virtual

Render a tooltip at the specified cursor position for this control

Parameters
cursorPosposition of cursor to display the tip near
tipTextoptional alternate tip to be rendered
void resize ( const Point2I newPosition,
const Point2I newExtent 
)
virtual
void setActive ( bool  value)

Sets the status of this control as active and responding or inactive

Parameters
valueTrue if this is active
void setBounds ( const RectI newBounds)
virtual

Changes the bounds of this control

Parameters
newBoundsNew bounds of this control
void setCanSave ( bool  bCanSave)

Set serialization flag.

void setConsoleCommand ( const char *  newCmd)

Set the name of the console function bound to, such as a script function a button calls when clicked.

Parameters
newCmdConsole function to attach to this GuiControl
void setConsoleVariable ( const char *  variable)

Set the name of the console variable which this GuiObject is bound to

Parameters
variableVariable name
void setControlProfile ( GuiControlProfile prof)

Sets the control profile for this control.

See Also
GuiControlProfile
Parameters
profControl profile to apply
void setExtent ( const Point2I newExtent)
virtual

Changes the size of this control

Parameters
newExtentNew size of this control
void setFirstResponder ( GuiControl firstResponder)
virtual

Sets the first responder for child controls

Parameters
firstResponderFirst responder for this chain

Reimplemented in GuiCanvas, and GuiScriptNotifyCtrl.

void setFirstResponder ( )
virtual

Sets this object to be a first responder.

Reimplemented in GuiTextEditCtrl, and GuiScriptNotifyCtrl.

void setFloatVariable ( F32  value)
protected

Sets the value of the console variable bound to this control

Parameters
valueFloat value to assign to control's console variable
void setHeight ( S32  newHeight)
virtual

Changes the height of this control

Parameters
newHeightNew Height of this control
void setIntVariable ( S32  value)
protected

Sets the value of the console variable bound to this control

Parameters
valueInteger value to assign to control's console variable
void setLeft ( S32  newLeft)
virtual

Changes the X position of this control

Parameters
newXPositionNew X Position of this control
void setPosition ( const Point2I newPosition)
virtual

Changes the position of this control

Parameters
newPositionNew position of this control
void setScriptValue ( const char *  value)
virtual

Sets the value of the variable bound to this object.

Reimplemented in GuiMLTextCtrl, GuiColorPickerCtrl, GuiTextEditCtrl, GuiTextCtrl, GuiButtonBaseCtrl, GuiSliderCtrl, GuiTextListCtrl, GuiConsoleTextCtrl, and GuiProgressCtrl.

void setSizing ( S32  horz,
S32  vert 
)

Sets the size of the GuiControl

Parameters
horzWidth of the control
vertHeight of the control
void setTop ( S32  newTop)
virtual

Changes the Y position of this control

Parameters
newYPositionNew Y Position of this control
void setUpdate ( )
virtual

Sets the update area of the control to encompass the whole control.

Reimplemented in GuiTabBookCtrl.

void setUpdateRegion ( Point2I  pos,
Point2I  ext 
)

Sets the area (local coordinates) this control wants refreshed each frame

Parameters
posUpperLeft point on rectangle of refresh area
extExtent of update rect
void setVariable ( const char *  value)
protected

Sets the value of the console variable bound to this control

Parameters
valueString value to assign to control's console variable
void setVisible ( bool  value)
virtual

Sets the visibility of the control

Parameters
valueTrue if object should be visible
void setWidth ( S32  newWidth)
virtual

Changes the width of this control

Parameters
newWidthNew width of this control
void sleep ( )

Called when this control is no more.

void write ( Stream stream,
U32  tabStop,
U32  flags 
)
virtual

Overrides Parent Serialization to allow specific controls to not be saved (Dynamic Controls, etc)

Reimplemented from SimSet.

Member Data Documentation

StringTableEntry mAcceleratorKey
protected
bool mActive
StringTableEntry mAltConsoleCommand
protected
bool mAwake
RectI mBounds
bool mCanSave
StringTableEntry mConsoleCommand
protected
StringTableEntry mConsoleVariable
protected
SimObjectPtr<GuiControl> mFirstResponder
S32 mHorizSizing
protected

Set from horizSizingOptions.

bool mIsContainer

if true, then the GuiEditor can drag other controls into this one.

LangTable* mLangTable
StringTableEntry mLangTableName
S32 mLayer
Point2I mMinExtent
GuiControlProfile* mProfile
bool mSetFirstResponder
S32 mTipHoverTime
StringTableEntry mTooltip
protected
GuiControlProfile* mTooltipProfile
S32 mTooltipWidth
S32 mVertSizing
protected

Set from vertSizingOptions.

bool mVisible
GuiControl * smCurResponder = NULL
static
S32 smCursorChanged = -1
static

Has this control modified the cursor? -1 or type.

bool smDesignTime = false
static

static GuiControl boolean that specifies if the GUI Editor is active

GuiEditCtrl * smEditorHandle = NULL
static

static GuiEditCtrl pointer that gives controls access to editor-NULL if editor is closed

GuiControl * smPrevResponder = NULL
static

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