GuiControl Class Reference#include <guiControl.h>
Inheritance diagram for GuiControl:
[legend]
Detailed Description
Root class for all GUI controls in Torque.
- See also:
- GUI for an overview of the Torque GUI system.
Introduction
GuiControl is the base class for GUI controls in Torque. It provides these basic areas of functionality:
The Graphical User Interface (GUI) has an overview of the GUI system.
|
Control State |
GuiControlProfile * | mProfile |
GuiControlProfile * | mTooltipProfile |
S32 | mTipHoverTime |
bool | mVisible |
bool | mActive |
bool | mAwake |
bool | mSetFirstResponder |
bool | mCanSave |
S32 | mLayer |
RectI | mBounds |
Point2I | mMinExtent |
StringTableEntry | mLangTableName |
LangTable * | mLangTable |
static bool | smDesignTime |
| static GuiControl boolean that specifies if the GUI Editor is active
|
Keyboard Input |
GuiControl * | mFirstResponder |
static GuiControl * | smPrevResponder |
static GuiControl * | smCurResponder |
Design Time Editor Access |
static GuiEditCtrl * | smEditorHandle |
| static GuiEditCtrl pointer that gives controls access to editor-NULL if editor is closed
|
Control State |
S32 | mHorizSizing |
| Set from horizSizingOptions.
|
S32 | mVertSizing |
| Set from vertSizingOptions.
|
StringTableEntry | mConsoleVariable |
StringTableEntry | mConsoleCommand |
StringTableEntry | mAltConsoleCommand |
StringTableEntry | mAcceleratorKey |
StringTableEntry | mTooltip |
Console |
The console variable collection of functions allows a console variable to be bound to the GUI control.
This allows, say, an edit field to be bound to '$foo'. The value of the console variable '$foo' would then be equal to the text inside the text field. Changing either changes the other.
|
void | setVariable (const char *value) |
| Sets the value of the console variable bound to this control.
|
void | setIntVariable (S32 value) |
| Sets the value of the console variable bound to this control.
|
void | setFloatVariable (F32 value) |
| Sets the value of the console variable bound to this control.
|
const char * | getVariable () |
| Returns value of control's bound variable as a string.
|
S32 | getIntVariable () |
| Returns value of control's bound variable as a integer.
|
F32 | getFloatVariable () |
| Returns value of control's bound variable as a float.
|
void | setConsoleVariable (const char *variable) |
| Set the name of the console variable which this GuiObject is bound to.
|
void | setConsoleCommand (const char *newCmd) |
| Set the name of the console function bound to, such as a script function a button calls when clicked.
|
const char * | getConsoleCommand () |
| Returns the name of the function bound to this GuiControl.
|
LangTable * | getGUILangTable (void) |
const UTF8 * | getGUIString (S32 id) |
Editor |
These functions are used by the GUI Editor
|
void | setSizing (S32 horz, S32 vert) |
| Sets the size of the GuiControl.
|
void | write (Stream &stream, U32 tabStop, U32 flags) |
| Overrides Parent Serialization to allow specific controls to not be saved (Dynamic Controls, etc).
|
bool | getCanSave () |
| Returns boolean specifying if a control can be serialized.
|
void | setCanSave (bool bCanSave) |
| Set serialization flag.
|
bool | getCanSaveParent () |
| Returns boolean as to whether any parent of this control has the 'no serialization' flag set.
|
Initialization |
| DECLARE_CONOBJECT (GuiControl) |
| GuiControl () |
virtual | ~GuiControl () |
static void | initPersistFields () |
| Register dynamic fields in a subclass of ConsoleObject.
|
Accessors |
const Point2I & | getPosition () |
| Returns position of the control.
|
const Point2I & | getExtent () |
| Returns extents of the control.
|
const RectI & | getBounds () |
| Returns the bounds of the control.
|
const Point2I & | getMinExtent () |
| Returns minimum size the control can be.
|
const S32 | getLeft () |
| Returns the X position of the control.
|
const S32 | getTop () |
| Returns the Y position of the control.
|
const S32 | getWidth () |
| Returns the width of the control.
|
const S32 | getHeight () |
| Returns the height of the control.
|
Flags |
virtual void | setVisible (bool value) |
| Sets the visibility of the control.
|
bool | isVisible () |
| Returns true if the object is visible.
|
void | setActive (bool value) |
| Sets the status of this control as active and responding or inactive.
|
bool | isActive () |
| Returns true if this control is active.
|
bool | isAwake () |
| Returns true if this control is awake.
|
Children |
void | addObject (SimObject *obj) |
| Adds an object as a child of this object.
|
void | removeObject (SimObject *obj) |
| Removes a child object from this control.
|
GuiControl * | getParent () |
| Returns the control which owns this one.
|
GuiCanvas * | getRoot () |
| Returns the root canvas of this control.
|
Coordinates |
Point2I | localToGlobalCoord (const Point2I &src) |
| Translates local coordinates (wrt this object) into global coordinates.
|
Point2I | globalToLocalCoord (const Point2I &src) |
| Returns global coordinates translated into local space.
|
Resizing |
virtual void | resize (const Point2I &newPosition, const Point2I &newExtent) |
| Changes the size and/or position of this control.
|
virtual void | setPosition (const Point2I &newPosition) |
| Changes the position of this control.
|
virtual void | setExtent (const Point2I &newExtent) |
| Changes the size of this control.
|
virtual void | setBounds (const RectI &newBounds) |
| Changes the bounds of this control.
|
virtual void | setLeft (S32 newLeft) |
| Changes the X position of this control.
|
virtual void | setTop (S32 newTop) |
| Changes the Y position of this control.
|
virtual void | setWidth (S32 newWidth) |
| Changes the width of this control.
|
virtual void | setHeight (S32 newHeight) |
| Changes the height of this control.
|
virtual void | childResized (GuiControl *child) |
| Called when a child control of the object is resized.
|
virtual void | parentResized (const Point2I &oldParentExtent, const Point2I &newParentExtent) |
| Called when this objects parent is resized.
|
Rendering |
virtual void | onRender (Point2I offset, const RectI &updateRect) |
| Called when this control is to render itself.
|
virtual bool | renderTooltip (Point2I cursorPos, const char *tipText=NULL) |
void | renderChildControls (Point2I offset, const RectI &updateRect) |
| Called when this control should render its children.
|
void | setUpdateRegion (Point2I pos, Point2I ext) |
| Sets the area (local coordinates) this control wants refreshed each frame.
|
virtual void | setUpdate () |
| Sets the update area of the control to encompass the whole control.
|
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.
|
virtual void | onSleep () |
| Called when this object is asked to sleep.
|
virtual void | onPreRender () |
| Do special pre-render proecessing.
|
virtual void | onRemove () |
| Called when this object is removed.
|
virtual void | onChildRemoved (GuiControl *child) |
| Called when one of this objects children is removed.
|
bool | onAdd () |
| Called when this object is added to the scene.
|
virtual void | onChildAdded (GuiControl *child) |
| Called when this object has a new child.
|
Console |
virtual const char * | getScriptValue () |
| Returns the value of the variable bound to this object.
|
virtual void | setScriptValue (const char *value) |
| Sets the value of the variable bound to this object.
|
Input (Keyboard/Mouse) |
virtual bool | pointInControl (const Point2I &parentCoordPoint) |
| This function will return true if the provided coordinates (wrt parent object) are within the bounds of this control.
|
bool | cursorInControl () |
| Returns true if the global cursor is inside this control.
|
virtual GuiControl * | findHitControl (const Point2I &pt, S32 initialLayer=-1) |
| Returns the control which the provided point is under, with layering.
|
void | mouseLock (GuiControl *lockingControl) |
| Lock the mouse within the provided control.
|
void | mouseLock () |
| Turn on mouse locking with last used lock control.
|
void | mouseUnlock () |
| Unlock the mouse.
|
bool | isMouseLocked () |
| Returns true if the mouse is locked.
|
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) |
| Called when a mouseDown event occurs on a control and the GUI editor is active.
|
virtual bool | onMouseUpEditor (const GuiEvent &event, Point2I offset) |
| Called when a mouseUp event occurs on a control and the GUI editor is active.
|
virtual bool | onRightMouseDownEditor (const GuiEvent &event, Point2I offset) |
| Called when a rightMouseDown event occurs on a control and the GUI editor is active.
|
virtual bool | onMouseDraggedEditor (const GuiEvent &event, Point2I offset) |
| Called when a mouseDragged event occurs on a control and the GUI editor is active.
|
Tabs |
virtual GuiControl * | findFirstTabable () |
| Find the first tab-accessable child of this control.
|
virtual GuiControl * | findLastTabable (bool firstCall=true) |
| Find the last tab-accessable child of this control.
|
virtual GuiControl * | findPrevTabable (GuiControl *curResponder, bool firstCall=true) |
| Find previous tab-accessable control with respect to the provided one.
|
virtual GuiControl * | findNextTabable (GuiControl *curResponder, bool firstCall=true) |
| Find next tab-accessable control with regards to the provided control.
|
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) |
| Sets the first responder for child controls.
|
virtual void | makeFirstResponder (bool value) |
| Sets up this control to be the first in it's group to respond to an input event.
|
bool | isFirstResponder () |
| Returns true if this control is a first responder.
|
virtual void | setFirstResponder () |
| Sets this object to be a first responder.
|
void | clearFirstResponder () |
| Clears the first responder for this chain.
|
GuiControl * | getFirstResponder () |
| Returns the first responder for this chain.
|
virtual void | onLoseFirstResponder () |
| Occurs when the first responder for this chain is lost.
|
Keyboard Events |
void | addAcceleratorKey () |
| Adds the accelerator key for this object to the canvas.
|
virtual void | buildAcceleratorMap () |
| Adds this control's accelerator key to the accelerator map, and recursively tells all children to do the same.
|
virtual void | acceleratorKeyPress (U32 index) |
| Occurs when the accelerator key for this control is pressed.
|
virtual void | acceleratorKeyRelease (U32 index) |
| Occurs when the accelerator key for this control is released.
|
virtual bool | onKeyDown (const GuiEvent &event) |
| Happens when a key is depressed.
|
virtual bool | onKeyUp (const GuiEvent &event) |
| Happens when a key is released.
|
virtual bool | onKeyRepeat (const GuiEvent &event) |
| Happens when a key is held down, resulting in repeated keystrokes.
|
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.
|
virtual void | onMessage (GuiControl *sender, S32 msg) |
| Receive a message from another control.
|
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.
|
virtual void | onDialogPop () |
| Called if this object is a dialog, when it is removed from the visible layers.
|
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) |
| Get information about the size of a scroll line.
|
virtual void | getCursor (GuiCursor *&cursor, bool &showCursor, const GuiEvent &lastGuiEvent) |
| Get information about the cursor.
|
void | awaken () |
| Called when this control and its children have been wired up.
|
void | sleep () |
| Called when this control is no more.
|
void | preRender () |
| Prerender this control and all its children.
|
virtual bool | onInputEvent (const InputEvent &event) |
| General input handler.
|
virtual bool | ControlIsChild (GuiControl *child) |
| Returns true if the provided control is a child (grandchild, or greatgrandchild) of this one.
|
void | setControlProfile (GuiControlProfile *prof) |
| Sets the control profile for this control.
|
virtual void | onAction () |
| Occurs when this control performs its "action".
|
void | renderJustifiedText (Point2I offset, Point2I extent, const char *text) |
| Renders justified text using the profile.
|
void | inspectPostApply () |
| Called after any property of the object is changed in the world editor.
|
void | inspectPreApply () |
| Called before any property of the object is changed in the world editor.
|
Private Types |
typedef SimGroup | Parent |
Private Attributes |
StringTableEntry | mClassName |
StringTableEntry | mSuperClassName |
Member Typedef Documentation
Reimplemented from SimGroup.
Reimplemented in CreatorTree, EditManager, EditTSCtrl, GuiTerrPreviewCtrl, MissionAreaEditor, TerrainEditor, WorldEditor, DebugView, GameTSCtrl, GuiPlayerView, GuiControlArrayControl, GuiFrameSetCtrl, GuiPaneControl, GuiScrollCtrl, GuiStackControl, GuiTabBookCtrl, GuiWindowCtrl, GuiBackgroundCtrl, GuiBitmapButtonCtrl, GuiBitmapButtonTextCtrl, GuiBitmapCtrl, GuiButtonBaseCtrl, GuiButtonCtrl, GuiCheckBoxCtrl, GuiColorPickerCtrl, GuiConsole, GuiConsoleEditCtrl, GuiConsoleTextCtrl, GuiDirectoryFileListCtrl, GuiDirectoryTreeCtrl, GuiListBoxCtrl, GuiMLTextCtrl, GuiMLTextEditCtrl, GuiPopUpTextListCtrl, GuiPopUpMenuCtrl, GuiRadioCtrl, GuiSliderCtrl, GuiTabPageCtrl, GuiTextCtrl, GuiTextEditCtrl, GuiTextEditSliderCtrl, GuiTextListCtrl, GuiTreeViewCtrl, GuiArrayCtrl, GuiCanvas, GuiTSCtrl, DbgFileView, GuiEditCtrl, GuiFilterCtrl, GuiGraphCtrl, GuiInspector, GuiInspectorField, GuiInspectorGroup, GuiInspectorDynamicField, GuiInspectorDynamicGroup, GuiInspectorDatablockField, GuiInspectorTypeEnum, GuiInspectorTypeCheckBox, GuiInspectorTypeGuiProfile, GuiInspectorTypeFileName, GuiInspectorTypeColor, GuiInspectorTypeColorI, GuiInspectorTypeColorF, GuiMenuBackgroundCtrl, GuiSubmenuBackgroundCtrl, GuiMenuTextListCtrl, GuiMenuBar, GuiAviBitmapCtrl, GuiMessageVectorCtrl, GuiProgressCtrl, GuiEffectCanvas, GuiTheoraCtrl, GuiTickCtrl, GuiBubbleTextCtrl, GuiInputCtrl, GuiMouseEventCtrl, and GuiVectorFieldCtrl.
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::GuiControl |
( |
|
) |
|
virtual GuiControl::~GuiControl |
( |
|
) |
[virtual] |
Member Function Documentation
void GuiControl::setVariable |
( |
const char * |
value |
) |
[protected] |
Sets the value of the console variable bound to this control.
- Parameters:
-
| value | String value to assign to control's console variable |
void GuiControl::setIntVariable |
( |
S32 |
value |
) |
[protected] |
Sets the value of the console variable bound to this control.
- Parameters:
-
| value | Integer value to assign to control's console variable |
void GuiControl::setFloatVariable |
( |
F32 |
value |
) |
[protected] |
Sets the value of the console variable bound to this control.
- Parameters:
-
| value | Float value to assign to control's console variable |
const char* GuiControl::getVariable |
( |
|
) |
[protected] |
Returns value of control's bound variable as a string.
S32 GuiControl::getIntVariable |
( |
|
) |
[protected] |
Returns value of control's bound variable as a integer.
F32 GuiControl::getFloatVariable |
( |
|
) |
[protected] |
Returns value of control's bound variable as a float.
void GuiControl::setConsoleVariable |
( |
const char * |
variable |
) |
|
Set the name of the console variable which this GuiObject is bound to.
- Parameters:
-
void GuiControl::setConsoleCommand |
( |
const char * |
newCmd |
) |
|
Set the name of the console function bound to, such as a script function a button calls when clicked.
- Parameters:
-
| newCmd | Console function to attach to this GuiControl |
const char* GuiControl::getConsoleCommand |
( |
|
) |
|
Returns the name of the function bound to this GuiControl.
const UTF8* GuiControl::getGUIString |
( |
S32 |
id |
) |
|
Sets the size of the GuiControl.
- Parameters:
-
| horz | Width of the control |
| vert | Height of the control |
Overrides Parent Serialization to allow specific controls to not be saved (Dynamic Controls, etc).
Reimplemented from SimSet.
bool GuiControl::getCanSave |
( |
|
) |
|
Returns boolean specifying if a control can be serialized.
void GuiControl::setCanSave |
( |
bool |
bCanSave |
) |
|
bool GuiControl::getCanSaveParent |
( |
|
) |
|
Returns boolean as to whether any parent of this control has the 'no serialization' flag set.
static void GuiControl::initPersistFields |
( |
|
) |
[static] |
Register dynamic fields in a subclass of ConsoleObject.
- See also:
- addField(), addFieldV(), addDepricatedField(), addGroup(), endGroup()
Reimplemented from SimObject.
Reimplemented in EditTSCtrl, GuiTerrPreviewCtrl, MissionAreaEditor, TerrainEditor, WorldEditor, GuiControlArrayControl, GuiFrameSetCtrl, GuiPaneControl, GuiScrollCtrl, GuiStackControl, GuiTabBookCtrl, GuiWindowCtrl, GuiBitmapButtonCtrl, GuiBitmapCtrl, GuiButtonBaseCtrl, GuiCheckBoxCtrl, GuiColorPickerCtrl, GuiConsoleEditCtrl, GuiConsoleTextCtrl, GuiListBoxCtrl, GuiMLTextCtrl, GuiMLTextEditCtrl, GuiPopUpMenuCtrl, GuiSliderCtrl, GuiTabPageCtrl, GuiTextCtrl, GuiTextEditCtrl, GuiTextEditSliderCtrl, GuiTextListCtrl, GuiTreeViewCtrl, GuiTSCtrl, GuiFilterCtrl, GuiInspectorGroup, GuiMenuBar, GuiAviBitmapCtrl, GuiMessageVectorCtrl, GuiTheoraCtrl, and GuiMouseEventCtrl.
const Point2I& GuiControl::getPosition |
( |
|
) |
[inline] |
Returns position of the control.
const Point2I& GuiControl::getExtent |
( |
|
) |
[inline] |
Returns extents of the control.
const RectI& GuiControl::getBounds |
( |
|
) |
[inline] |
Returns the bounds of the control.
const Point2I& GuiControl::getMinExtent |
( |
|
) |
[inline] |
Returns minimum size the control can be.
const S32 GuiControl::getLeft |
( |
|
) |
[inline] |
Returns the X position of the control.
const S32 GuiControl::getTop |
( |
|
) |
[inline] |
Returns the Y position of the control.
const S32 GuiControl::getWidth |
( |
|
) |
[inline] |
Returns the width of the control.
const S32 GuiControl::getHeight |
( |
|
) |
[inline] |
Returns the height of the control.
virtual void GuiControl::setVisible |
( |
bool |
value |
) |
[virtual] |
Sets the visibility of the control.
- Parameters:
-
| value | True if object should be visible |
bool GuiControl::isVisible |
( |
|
) |
[inline] |
Returns true if the object is visible.
void GuiControl::setActive |
( |
bool |
value |
) |
|
Sets the status of this control as active and responding or inactive.
- Parameters:
-
| value | True if this is active |
bool GuiControl::isActive |
( |
|
) |
[inline] |
Returns true if this control is active.
bool GuiControl::isAwake |
( |
|
) |
[inline] |
Returns true if this control is awake.
virtual void GuiControl::getScrollLineSizes |
( |
U32 * |
rowHeight, |
|
|
U32 * |
columnWidth | |
|
) |
| | [virtual] |
Get information about the size of a scroll line.
- Parameters:
-
| rowHeight | The height, in pixels, of a row |
| columnWidth | The width, in pixels, of a column |
virtual void GuiControl::getCursor |
( |
GuiCursor *& |
cursor, |
|
|
bool & |
showCursor, |
|
|
const GuiEvent & |
lastGuiEvent | |
|
) |
| | [virtual] |
Returns the control which owns this one.
Translates local coordinates (wrt this object) into global coordinates.
- Parameters:
-
| src | Local coordinates to translate |
Returns global coordinates translated into local space.
- Parameters:
-
| src | Global coordinates to translate |
virtual void GuiControl::resize |
( |
const Point2I & |
newPosition, |
|
|
const Point2I & |
newExtent | |
|
) |
| | [virtual] |
Changes the size and/or position of this control.
- Parameters:
-
| newPosition | New position of this control |
| newExtent | New size of this control |
Reimplemented in GuiControlArrayControl, GuiFrameSetCtrl, GuiPaneControl, GuiScrollCtrl, GuiStackControl, GuiTabBookCtrl, GuiWindowCtrl, GuiMLTextCtrl, GuiMLTextEditCtrl, GuiInspectorField, GuiInspectorGroup, GuiInspectorDynamicField, GuiInspectorTypeFileName, GuiInspectorTypeColor, and GuiVectorFieldCtrl.
virtual void GuiControl::setPosition |
( |
const Point2I & |
newPosition |
) |
[virtual] |
Changes the position of this control.
- Parameters:
-
| newPosition | New position of this control |
virtual void GuiControl::setExtent |
( |
const Point2I & |
newExtent |
) |
[virtual] |
Changes the size of this control.
- Parameters:
-
| newExtent | New size of this control |
virtual void GuiControl::setBounds |
( |
const RectI & |
newBounds |
) |
[virtual] |
Changes the bounds of this control.
- Parameters:
-
| newBounds | New bounds of this control |
virtual void GuiControl::setLeft |
( |
S32 |
newLeft |
) |
[virtual] |
Changes the X position of this control.
- Parameters:
-
| newXPosition | New X Position of this control |
virtual void GuiControl::setTop |
( |
S32 |
newTop |
) |
[virtual] |
Changes the Y position of this control.
- Parameters:
-
| newYPosition | New Y Position of this control |
virtual void GuiControl::setWidth |
( |
S32 |
newWidth |
) |
[virtual] |
Changes the width of this control.
- Parameters:
-
| newWidth | New width of this control |
virtual void GuiControl::setHeight |
( |
S32 |
newHeight |
) |
[virtual] |
Changes the height of this control.
- Parameters:
-
| newHeight | New Height of this control |
virtual void GuiControl::childResized |
( |
GuiControl * |
child |
) |
[virtual] |
virtual void GuiControl::parentResized |
( |
const Point2I & |
oldParentExtent, |
|
|
const Point2I & |
newParentExtent | |
|
) |
| | [virtual] |
virtual void GuiControl::onRender |
( |
Point2I |
offset, |
|
|
const RectI & |
updateRect | |
|
) |
| | [virtual] |
Called when this control is to render itself.
- Parameters:
-
| offset | The location this control is to begin rendering |
| updateRect | The screen area this control has drawing access to |
Reimplemented in EditTSCtrl, GuiTerrPreviewCtrl, MissionAreaEditor, DebugView, GameTSCtrl, GuiFrameSetCtrl, GuiPaneControl, GuiScrollCtrl, GuiTabBookCtrl, GuiWindowCtrl, GuiBackgroundCtrl, GuiBitmapButtonCtrl, GuiBitmapButtonTextCtrl, GuiBitmapCtrl, GuiButtonCtrl, GuiCheckBoxCtrl, GuiColorPickerCtrl, GuiConsoleTextCtrl, GuiListBoxCtrl, GuiMLTextCtrl, GuiMLTextEditCtrl, GuiPopUpMenuCtrl, GuiSliderCtrl, GuiTabPageCtrl, GuiTextCtrl, GuiTextEditCtrl, GuiTextEditSliderCtrl, GuiTreeViewCtrl, GuiArrayCtrl, GuiTSCtrl, GuiEditCtrl, GuiFilterCtrl, GuiGraphCtrl, GuiInspectorField, GuiInspectorGroup, GuiInspectorDynamicField, GuiInspectorDynamicGroup, GuiMenuBar, GuiMessageVectorCtrl, GuiProgressCtrl, GuiTheoraCtrl, and GuiVectorFieldCtrl.
virtual bool GuiControl::renderTooltip |
( |
Point2I |
cursorPos, |
|
|
const char * |
tipText = NULL | |
|
) |
| | [virtual] |
void GuiControl::renderChildControls |
( |
Point2I |
offset, |
|
|
const RectI & |
updateRect | |
|
) |
| | |
Called when this control should render its children.
- Parameters:
-
| offset | The location this control is to begin rendering |
| updateRect | The screen area this control has drawing access to |
Sets the area (local coordinates) this control wants refreshed each frame.
- Parameters:
-
| pos | UpperLeft point on rectangle of refresh area |
| ext | Extent of update rect |
virtual void GuiControl::setUpdate |
( |
|
) |
[virtual] |
Sets the update area of the control to encompass the whole control.
Reimplemented in GuiTabBookCtrl.
void GuiControl::awaken |
( |
|
) |
|
Called when this control and its children have been wired up.
void GuiControl::sleep |
( |
|
) |
|
Called when this control is no more.
void GuiControl::preRender |
( |
|
) |
|
Prerender this control and all its children.
virtual bool GuiControl::onWake |
( |
|
) |
[virtual] |
Called when this object is asked to wake up returns true if it's actually awake at the end.
Reimplemented in CreatorTree, EditManager, GuiTerrPreviewCtrl, MissionAreaEditor, GuiPlayerView, GuiControlArrayControl, GuiFrameSetCtrl, GuiPaneControl, GuiScrollCtrl, GuiStackControl, GuiTabBookCtrl, GuiWindowCtrl, GuiBitmapButtonCtrl, GuiBitmapCtrl, GuiButtonBaseCtrl, GuiButtonCtrl, GuiCheckBoxCtrl, GuiConsole, GuiConsoleTextCtrl, GuiDirectoryFileListCtrl, GuiDirectoryTreeCtrl, GuiListBoxCtrl, GuiMLTextCtrl, GuiSliderCtrl, GuiTabPageCtrl, GuiTextCtrl, GuiTextEditCtrl, GuiTextListCtrl, GuiTreeViewCtrl, GuiArrayCtrl, DbgFileView, GuiEditCtrl, GuiFilterCtrl, GuiGraphCtrl, GuiMenuBar, GuiMessageVectorCtrl, GuiTheoraCtrl, and GuiInputCtrl.
virtual void GuiControl::onSleep |
( |
|
) |
[virtual] |
Called when this object is asked to sleep.
Reimplemented in EditManager, GuiTerrPreviewCtrl, MissionAreaEditor, GuiControlArrayControl, GuiPaneControl, GuiScrollCtrl, GuiStackControl, GuiTabBookCtrl, GuiWindowCtrl, GuiBitmapButtonCtrl, GuiBitmapCtrl, GuiConsoleTextCtrl, GuiMLTextCtrl, GuiPopUpMenuCtrl, GuiTabPageCtrl, GuiTextCtrl, GuiTextEditCtrl, GuiTreeViewCtrl, GuiArrayCtrl, GuiEditCtrl, GuiMenuBar, GuiMessageVectorCtrl, GuiTheoraCtrl, and GuiInputCtrl.
virtual void GuiControl::onPreRender |
( |
|
) |
[virtual] |
Do special pre-render proecessing.
Reimplemented in GuiTerrPreviewCtrl, GuiScrollCtrl, GuiTabBookCtrl, GuiConsole, GuiConsoleTextCtrl, GuiMLTextCtrl, GuiTextCtrl, GuiTextEditCtrl, GuiTextEditSliderCtrl, GuiTreeViewCtrl, GuiTSCtrl, DbgFileView, GuiEditCtrl, GuiFilterCtrl, GuiMenuBar, and GuiProgressCtrl.
virtual void GuiControl::onRemove |
( |
|
) |
[virtual] |
virtual void GuiControl::onChildRemoved |
( |
GuiControl * |
child |
) |
[virtual] |
Called when one of this objects children is removed.
Reimplemented in GuiTabBookCtrl.
bool GuiControl::onAdd |
( |
|
) |
[virtual] |
Called when this object is added to the scene.
Reimplemented from SimObject.
Reimplemented in EditManager, EditTSCtrl, MissionAreaEditor, TerrainEditor, WorldEditor, GuiFrameSetCtrl, GuiTabBookCtrl, GuiDirectoryTreeCtrl, GuiMLTextCtrl, GuiPopUpMenuCtrl, GuiTextCtrl, GuiTextEditCtrl, GuiInspector, GuiInspectorField, GuiInspectorGroup, GuiInspectorDynamicField, GuiMessageVectorCtrl, and GuiVectorFieldCtrl.
virtual void GuiControl::onChildAdded |
( |
GuiControl * |
child |
) |
[virtual] |
Called when this object has a new child.
Reimplemented in GuiTabBookCtrl.
virtual const char* GuiControl::getScriptValue |
( |
|
) |
[virtual] |
virtual void GuiControl::setScriptValue |
( |
const char * |
value |
) |
[virtual] |
virtual bool GuiControl::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:
-
| parentCoordPoint | Coordinates to test |
Reimplemented in GuiSubmenuBackgroundCtrl.
bool GuiControl::cursorInControl |
( |
|
) |
|
Returns true if the global cursor is inside this control.
virtual GuiControl* GuiControl::findHitControl |
( |
const Point2I & |
pt, |
|
|
S32 |
initialLayer = -1 | |
|
) |
| | [virtual] |
Returns the control which the provided point is under, with layering.
- Parameters:
-
| pt | Point to test |
| initialLayer | Layer of gui objects to begin the search |
Reimplemented in GuiScrollCtrl, GuiWindowCtrl, and GuiTabPageCtrl.
Lock the mouse within the provided control.
- Parameters:
-
| lockingControl | Control to lock the mouse within |
Reimplemented in GuiCanvas.
void GuiControl::mouseLock |
( |
|
) |
|
Turn on mouse locking with last used lock control.
void GuiControl::mouseUnlock |
( |
|
) |
|
bool GuiControl::isMouseLocked |
( |
|
) |
|
Returns true if the mouse is locked.
virtual bool GuiControl::onInputEvent |
( |
const InputEvent & |
event |
) |
[virtual] |
virtual void GuiControl::onMouseUp |
( |
const GuiEvent & |
event |
) |
[virtual] |
Reimplemented in CreatorTree, EditTSCtrl, MissionAreaEditor, GuiPlayerView, GuiFrameSetCtrl, GuiPaneControl, GuiScrollCtrl, GuiWindowCtrl, GuiButtonBaseCtrl, GuiCheckBoxCtrl, GuiColorPickerCtrl, GuiMLTextCtrl, GuiPopUpMenuCtrl, GuiSliderCtrl, GuiTextEditCtrl, GuiTextEditSliderCtrl, GuiTreeViewCtrl, DbgFileView, GuiEditCtrl, GuiFilterCtrl, GuiMenuTextListCtrl, GuiMenuBar, GuiMessageVectorCtrl, and GuiMouseEventCtrl.
virtual void GuiControl::onMouseDown |
( |
const GuiEvent & |
event |
) |
[virtual] |
Reimplemented in CreatorTree, EditTSCtrl, MissionAreaEditor, GuiPlayerView, GuiFrameSetCtrl, GuiPaneControl, GuiScrollCtrl, GuiTabBookCtrl, GuiWindowCtrl, GuiButtonBaseCtrl, GuiCheckBoxCtrl, GuiColorPickerCtrl, GuiDirectoryFileListCtrl, GuiListBoxCtrl, GuiMLTextCtrl, GuiPopUpBackgroundCtrl, GuiPopUpTextListCtrl, GuiPopUpMenuCtrl, GuiSliderCtrl, GuiTabPageCtrl, GuiTextEditCtrl, GuiTextEditSliderCtrl, GuiTreeViewCtrl, GuiArrayCtrl, DbgFileView, GuiEditCtrl, GuiFilterCtrl, GuiInspectorGroup, GuiInspectorDynamicGroup, GuiMenuBackgroundCtrl, GuiSubmenuBackgroundCtrl, GuiMenuTextListCtrl, GuiMenuBar, GuiMessageVectorCtrl, GuiBubbleTextCtrl, and GuiMouseEventCtrl.
virtual void GuiControl::onMouseMove |
( |
const GuiEvent & |
event |
) |
[virtual] |
Reimplemented in EditTSCtrl, MissionAreaEditor, GameTSCtrl, GuiPaneControl, GuiTabBookCtrl, GuiColorPickerCtrl, GuiTreeViewCtrl, GuiArrayCtrl, GuiMenuBackgroundCtrl, GuiMenuBar, and GuiMouseEventCtrl.
virtual void GuiControl::onMouseDragged |
( |
const GuiEvent & |
event |
) |
[virtual] |
Reimplemented in CreatorTree, EditTSCtrl, MissionAreaEditor, GuiPlayerView, GuiFrameSetCtrl, GuiScrollCtrl, GuiWindowCtrl, GuiColorPickerCtrl, GuiMLTextCtrl, GuiSliderCtrl, GuiTextEditCtrl, GuiTextEditSliderCtrl, GuiTreeViewCtrl, GuiArrayCtrl, DbgFileView, GuiEditCtrl, GuiFilterCtrl, GuiMenuBackgroundCtrl, GuiMenuBar, and GuiMouseEventCtrl.
virtual void GuiControl::onMouseEnter |
( |
const GuiEvent & |
event |
) |
[virtual] |
Reimplemented in EditTSCtrl, MissionAreaEditor, GuiPlayerView, GuiFrameSetCtrl, GuiPaneControl, GuiButtonBaseCtrl, GuiColorPickerCtrl, GuiSliderCtrl, GuiTreeViewCtrl, GuiArrayCtrl, and GuiMouseEventCtrl.
virtual void GuiControl::onMouseLeave |
( |
const GuiEvent & |
event |
) |
[virtual] |
Reimplemented in EditTSCtrl, MissionAreaEditor, GuiPlayerView, GuiFrameSetCtrl, GuiPaneControl, GuiTabBookCtrl, GuiButtonBaseCtrl, GuiColorPickerCtrl, GuiSliderCtrl, GuiTreeViewCtrl, GuiArrayCtrl, GuiMenuBar, and GuiMouseEventCtrl.
virtual bool GuiControl::onMouseWheelUp |
( |
const GuiEvent & |
event |
) |
[virtual] |
virtual bool GuiControl::onMouseWheelDown |
( |
const GuiEvent & |
event |
) |
[virtual] |
virtual void GuiControl::onRightMouseDown |
( |
const GuiEvent & |
event |
) |
[virtual] |
virtual void GuiControl::onRightMouseUp |
( |
const GuiEvent & |
event |
) |
[virtual] |
virtual void GuiControl::onRightMouseDragged |
( |
const GuiEvent & |
event |
) |
[virtual] |
virtual void GuiControl::onMiddleMouseDown |
( |
const GuiEvent & |
event |
) |
[virtual] |
virtual void GuiControl::onMiddleMouseUp |
( |
const GuiEvent & |
event |
) |
[virtual] |
virtual void GuiControl::onMiddleMouseDragged |
( |
const GuiEvent & |
event |
) |
[virtual] |
virtual bool GuiControl::onMouseDownEditor |
( |
const GuiEvent & |
event, |
|
|
Point2I |
offset | |
|
) |
| | [inline, virtual] |
Called when a mouseDown event occurs on a control and the GUI editor is active.
- Parameters:
-
| event | the GuiEvent which caused the call to this function |
| offset | the offset which is representative of the units x and y that the editor takes up on screen |
Reimplemented in GuiTabBookCtrl, and GuiTabPageCtrl.
virtual bool GuiControl::onMouseUpEditor |
( |
const GuiEvent & |
event, |
|
|
Point2I |
offset | |
|
) |
| | [inline, virtual] |
Called when a mouseUp event occurs on a control and the GUI editor is active.
- Parameters:
-
| event | the GuiEvent which caused the call to this function |
| offset | the offset which is representative of the units x and y that the editor takes up on screen |
virtual bool GuiControl::onRightMouseDownEditor |
( |
const GuiEvent & |
event, |
|
|
Point2I |
offset | |
|
) |
| | [inline, virtual] |
Called when a rightMouseDown event occurs on a control and the GUI editor is active.
- Parameters:
-
| event | the GuiEvent which caused the call to this function |
| offset | the offset which is representative of the units x and y that the editor takes up on screen |
virtual bool GuiControl::onMouseDraggedEditor |
( |
const GuiEvent & |
event, |
|
|
Point2I |
offset | |
|
) |
| | [inline, virtual] |
Called when a mouseDragged event occurs on a control and the GUI editor is active.
- Parameters:
-
| event | the GuiEvent which caused the call to this function |
| offset | the offset which is representative of the units x and y that the editor takes up on screen |
virtual GuiControl* GuiControl::findFirstTabable |
( |
|
) |
[virtual] |
Find the first tab-accessable child of this control.
virtual GuiControl* GuiControl::findLastTabable |
( |
bool |
firstCall = true |
) |
[virtual] |
Find the last tab-accessable child of this control.
- Parameters:
-
| firstCall | Set to true to clear the global previous responder |
virtual GuiControl* GuiControl::findPrevTabable |
( |
GuiControl * |
curResponder, |
|
|
bool |
firstCall = true | |
|
) |
| | [virtual] |
Find previous tab-accessable control with respect to the provided one.
- Parameters:
-
| curResponder | Current control |
| firstCall | Set to true to clear the global previous responder |
Reimplemented in GuiWindowCtrl, and GuiTabPageCtrl.
virtual GuiControl* GuiControl::findNextTabable |
( |
GuiControl * |
curResponder, |
|
|
bool |
firstCall = true | |
|
) |
| | [virtual] |
Find next tab-accessable control with regards to the provided control.
- Parameters:
-
| curResponder | Current control |
| firstCall | Set to true to clear the global current responder |
Reimplemented in GuiWindowCtrl, and GuiTabPageCtrl.
virtual bool GuiControl::ControlIsChild |
( |
GuiControl * |
child |
) |
[virtual] |
Returns true if the provided control is a child (grandchild, or greatgrandchild) of this one.
- Parameters:
-
virtual void GuiControl::setFirstResponder |
( |
GuiControl * |
firstResponder |
) |
[virtual] |
Sets the first responder for child controls.
- Parameters:
-
| firstResponder | First responder for this chain |
Reimplemented in GuiCanvas.
virtual void GuiControl::makeFirstResponder |
( |
bool |
value |
) |
[virtual] |
Sets up this control to be the first in it's group to respond to an input event.
- Parameters:
-
| value | True if this should be a first responder |
bool GuiControl::isFirstResponder |
( |
|
) |
|
Returns true if this control is a first responder.
virtual void GuiControl::setFirstResponder |
( |
|
) |
[virtual] |
Sets this object to be a first responder.
Reimplemented in GuiTextEditCtrl.
void GuiControl::clearFirstResponder |
( |
|
) |
|
Clears the first responder for this chain.
GuiControl* GuiControl::getFirstResponder |
( |
|
) |
[inline] |
Returns the first responder for this chain.
virtual void GuiControl::onLoseFirstResponder |
( |
|
) |
[virtual] |
Occurs when the first responder for this chain is lost.
Reimplemented in GuiTextEditCtrl.
void GuiControl::addAcceleratorKey |
( |
|
) |
|
Adds the accelerator key for this object to the canvas.
virtual void GuiControl::buildAcceleratorMap |
( |
|
) |
[virtual] |
Adds this control's accelerator key to the accelerator map, and recursively tells all children to do the same.
Reimplemented in GuiMenuBar.
virtual void GuiControl::acceleratorKeyPress |
( |
U32 |
index |
) |
[virtual] |
Occurs when the accelerator key for this control is pressed.
- Parameters:
-
| index | Index in the acclerator map of the key |
Reimplemented in GuiButtonBaseCtrl, and GuiMenuBar.
virtual void GuiControl::acceleratorKeyRelease |
( |
U32 |
index |
) |
[virtual] |
Occurs when the accelerator key for this control is released.
- Parameters:
-
| index | Index in the acclerator map of the key |
Reimplemented in GuiButtonBaseCtrl.
virtual bool GuiControl::onKeyDown |
( |
const GuiEvent & |
event |
) |
[virtual] |
Happens when a key is depressed.
- Parameters:
-
| event | Event descriptor (which contains the key) |
Reimplemented in GuiScrollCtrl, GuiTabBookCtrl, GuiWindowCtrl, GuiButtonBaseCtrl, GuiConsoleEditCtrl, GuiMLTextCtrl, GuiMLTextEditCtrl, GuiPopUpTextListCtrl, GuiPopUpMenuCtrl, GuiTabPageCtrl, GuiTextEditCtrl, GuiTextEditSliderCtrl, GuiTextListCtrl, GuiTreeViewCtrl, GuiArrayCtrl, GuiEditCtrl, and GuiMenuTextListCtrl.
virtual bool GuiControl::onKeyUp |
( |
const GuiEvent & |
event |
) |
[virtual] |
Happens when a key is released.
- Parameters:
-
| event | Event descriptor (which contains the key) |
Reimplemented in GuiButtonBaseCtrl.
virtual bool GuiControl::onKeyRepeat |
( |
const GuiEvent & |
event |
) |
[virtual] |
Happens when a key is held down, resulting in repeated keystrokes.
- Parameters:
-
| event | Event descriptor (which contains the key) |
Sets the control profile for this control.
- See also:
- GuiControlProfile
- Parameters:
-
| prof | Control profile to apply |
virtual void GuiControl::onAction |
( |
|
) |
[virtual] |
void GuiControl::messageSiblings |
( |
S32 |
message |
) |
|
Send a message to all siblings.
virtual void GuiControl::onDialogPush |
( |
|
) |
[virtual] |
Called if this object is a dialog, when it is added to the visible layers.
virtual void GuiControl::onDialogPop |
( |
|
) |
[virtual] |
Called if this object is a dialog, when it is removed from the visible layers.
void GuiControl::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
void GuiControl::inspectPostApply |
( |
|
) |
[virtual] |
void GuiControl::inspectPreApply |
( |
|
) |
[virtual] |
Called before any property of the object is changed in the world editor.
The calling order here is:
Reimplemented from SimObject.
Field Documentation
static GuiControl boolean that specifies if the GUI Editor is active
static GuiEditCtrl pointer that gives controls access to editor-NULL if editor is closed
Set from horizSizingOptions.
Set from vertSizingOptions.
|