GuiControl

Engine/source/gui/core/guiControl.h

More...

Input (Keyboard/Mouse)

enum
EHitTestFlags {
  HIT_FullBoxOnly = BIT( 0 )
  HIT_ParentPreventsChildHit = BIT( 1 )
  HIT_AddParentHits = BIT( 2 )
  HIT_NoCanHitNoRecurse = BIT( 3 )
}
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

Returns true if the global cursor is inside this control.

findHitControl(const Point2I & pt, S32 initialLayer)

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

bool
findHitControls(const RectI & rect, Vector< GuiControl * > & outResult, U32 flags, S32 initialLayer, U32 depth)
mouseLock(GuiControl * lockingControl)

Lock the mouse within the provided control.

Turn on mouse locking with last used lock control.

Unlock the mouse.

bool

Returns true if the mouse is locked.

Control State

bool
setProfileProt(void * object, const char * index, const char * data)
bool
setTooltipProfileProt(void * object, const char * index, const char * data)
bool
defaultTooltipRender(const Point2I & hoverPos, const Point2I & cursorPos, const char * tipText)

The default tooltip rendering function.

Delegate called to render a tooltip for this control.

bool
bool
bool
bool

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

bool

Set from horizSizingOptions.

Set from vertSizingOptions.

bool

static GuiControl boolean that specifies if the GUI Editor is active

CollapseGroupVec 

Console

const char *
evaluate(const char * str)

Set $ThisControl and evaluate the given script code.

setVariable(const char * value)

Sets the value of the console variable bound to this control.

Sets the value of the console variable bound to this control.

Sets the value of the console variable bound to this control.

const char *

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

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

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

const char *

Returns the value of the variable bound to this object.

setScriptValue(const char * value)

Sets the value of the variable bound to this object.

$ThisControl variable for callback execution.

Design Time Editor Access

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

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.

DECLARE_CALLBACK(void , onVisible , (bool state) )
DECLARE_CALLBACK(void , onActive , (bool state) )
DECLARE_CALLBACK(void , onControlDragEnter , (GuiControl *control, const Point2I &dropPoint) )
DECLARE_CALLBACK(void , onControlDragExit , (GuiControl *control, const Point2I &dropPoint) )
DECLARE_CALLBACK(void , onControlDragged , (GuiControl *control, const Point2I &dropPoint) )
DECLARE_CALLBACK(void , onControlDropped , (GuiControl *control, const Point2I &dropPoint) )
const char *

Executes mConsoleCommand, and returns the result.

const char *

Executes mAltConsoleCommand, and returns the result.

Editor

These functions are used by the GUI Editor

setSizing(S32 horz, S32 vert)

Sets the size of the GuiControl.

write(Stream & stream, U32 tabStop, U32 flags)

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

bool

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

Initialization

DECLARE_CATEGORY("Gui Core" )
DECLARE_DESCRIPTION("Base class <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> GUI controls. Can also be used as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> generic container." )
bool

Process constructor options. (ie, new SimObject(1,2,3))

Accessors

Returns position of the control.

Returns extents of the control.

Returns the bounds of the control.

Returns minimum size the control can be.

setMinExtent(const Point2I & newMinExtent)

Returns the X position of the control.

Returns the Y position of the control.

Returns the width of the control.

Returns the height of the control.

Flags

setVisible(bool value)

Sets the visibility of the control.

bool

Returns true if the object is visible.

bool
setHidden(bool state)
setCanHit(bool value)
setActive(bool value)

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

bool

Returns true if this control is active.

bool

Returns true if this control is awake.

Children

Adds an object as a child of this object.

Removes a child object from this control.

Returns the control which owns this one.

Returns the root canvas of this control.

bool

Return true if this set accepts the given object as a child.

Called when the object is removed from a SimGroup.

Coordinates

Translates local coordinates (wrt this object) into global coordinates.

Returns global coordinates translated into local space.

Resizing

bool
resize(const Point2I & newPosition, const Point2I & newExtent)

Changes the size and/or position of this control.

bool
setPosition(const Point2I & newPosition)

Changes the position of this control.

bool
setExtent(const Point2I & newExtent)

Changes the size of this control.

setExtent(const S32 width, const S32 height)
bool
setBounds(const RectI & newBounds)

Changes the bounds of this control.

setBounds(const S32 left, const S32 top, const S32 width, const S32 height)
setLeft(S32 newLeft)

Changes the X position of this control.

setTop(S32 newTop)

Changes the Y position of this control.

setWidth(S32 newWidth)

Changes the width of this control.

setHeight(S32 newHeight)

Changes the height of this control.

Called when a child control of the object is resized.

parentResized(const RectI & oldParentRect, const RectI & newParentRect)

Called when this objects parent is resized.

Rendering

onRender(Point2I offset, const RectI & updateRect)

Called when this control is to render itself.

renderChildControls(Point2I offset, const RectI & updateRect)

Called when this control should render its children.

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

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.

bool

Called when this object is asked to wake up returns true if it's actually awake at the end.

Called when this object is asked to sleep.

Do special pre-render processing.

Called when this object is removed.

Called when one of this objects children is removed.

bool

Called when this object is added to the scene.

Called when the mProfile or mToolTipProfile is deleted.

Called when this object has a new child.

Mouse Events

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

Gamepad Events

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

bool

Default behavior is call-through to onKeyDown.

bool

Default behavior is call-through to onKeyUp.

Editor Mouse Events

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

Conversely 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.

bool

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

bool

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

bool

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

bool

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

Tabs

Find the first tab-accessible child of this control.

findLastTabable(bool firstCall)

Find the last tab-accessible child of this control.

findPrevTabable(GuiControl * curResponder, bool firstCall)

Find previous tab-accessible control with respect to the provided one.

findNextTabable(GuiControl * curResponder, bool firstCall)

Find next tab-accessible 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.

setFirstResponder(GuiControl * firstResponder)

Sets the first responder for child controls.

makeFirstResponder(bool value)

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

bool

Returns true if this control is a first responder.

Sets this object to be a first responder.

Clears the first responder for this chain.

Returns the first responder for this chain.

Occurs when the control gains first-responder status.

Occurs when the control loses first-responder status.

Keyboard Events

Adds the accelerator key for this object to the canvas.

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

Occurs when the accelerator key for this control is pressed.

Occurs when the accelerator key for this control is released.

bool

Happens when a key is depressed.

bool

Happens when a key is released.

bool

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.

Send a message to all siblings.

onMessage(GuiControl * sender, S32 msg)

Receive a message from another control.

Canvas Events

Functions called by the canvas

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

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

Public Types

enum
_Anonymous_ {  NoCheckParentCanSave = BIT( 31 )
}

Additional write flags for GuiControls.

enum
horizSizingOptions {
  horizResizeRight = 0
  horizResizeWidth 
  horizResizeLeft 
  horizResizeCenter 
  horizResizeRelative 
  horizResizeAspectLeft 
  horizResizeAspectRight 
  horizResizeAspectCenter 
  horizResizeWindowRelative 
}
enum
vertSizingOptions {
  vertResizeBottom = 0
  vertResizeHeight 
  vertResizeTop 
  vertResizeCenter 
  vertResizeRelative 
  vertResizeAspectTop 
  vertResizeAspectBottom 
  vertResizeAspectCenter 
  vertResizeWindowRelative 
}
Children 
Parent 

Public Friends

Private Attributes

The internal name of a SimGroup child of the global GuiGroup in which to organize this gui on creation.

The internal bounds of this control.

Protected Attributes

The profile for this gui (data settings that are likely to be shared by multiple guis)

The profile for any tooltips.

Public Functions

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

clipText(String & inOutText, U32 width)

Returns text clipped to fit within a pixel width.

bool

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

const char *

Returns the name of the function bound to this GuiControl.

Returns our profile (and finds the profile if it hasn't been set yet)

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

Get information about the cursor.

Return the delegate used to render tooltips on this control.

getScrollLineSizes(U32 * rowHeight, U32 * columnWidth)

Get information about the size of a scroll line.

Returns the tooltip.

Returns our tooltip profile (and finds the profile if it hasn't been set yet)

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

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

Occurs when this control performs its "action".

bool

General input handler.

Pre-render this control and all its children.

renderJustifiedText(Point2I offset, Point2I extent, const char * text)

Renders justified text using the profile.

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

setConsoleVariable(const char * variable)

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

Sets the control profile for this control.

Sets the tooltip profile for this control.

Called when this control is no more.

Public Static Functions

bool
_setActive(void * object, const char * index, const char * data)
bool
_setVisible(void * object, const char * index, const char * data)

Detailed Description

Input (Keyboard/Mouse)

EHitTestFlags

Enumerator

HIT_FullBoxOnly = BIT( 0 )

Hit only counts if all of a control's bounds are within the hit rectangle.

HIT_ParentPreventsChildHit = BIT( 1 )

A positive hit test on a parent control will prevent hit tests on children.

HIT_AddParentHits = BIT( 2 )

Parent's that get hit should be added regardless of whether any of their children get hit, too.

HIT_NoCanHitNoRecurse = BIT( 3 )

A hit-disabled control will not recurse into children.

pointInControl(const Point2I & parentCoordPoint)

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 by: GuiNoMouseCtrl, GuiBitmapButtonCtrl

cursorInControl()

Returns true if the global cursor is inside this control.

findHitControl(const Point2I & pt, S32 initialLayer)

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 by: GuiInspector, GuiScrollCtrl, GuiWindowCtrl, GuiTabPageCtrl

findHitControls(const RectI & rect, Vector< GuiControl * > & outResult, U32 flags, S32 initialLayer, U32 depth)

mouseLock(GuiControl * lockingControl)

Lock the mouse within the provided control.

Parameters:

lockingControl

Control to lock the mouse within

mouseLock()

Turn on mouse locking with last used lock control.

mouseUnlock()

Unlock the mouse.

isMouseLocked()

Returns true if the mouse is locked.

Control State

setProfileProt(void * object, const char * index, const char * data)

setTooltipProfileProt(void * object, const char * index, const char * data)

defaultTooltipRender(const Point2I & hoverPos, const Point2I & cursorPos, const char * tipText)

The default tooltip rendering function.

S32 mTipHoverTime 
RenderTooltipDelegate mRenderTooltipDelegate 

Delegate called to render a tooltip for this control.

By default this will be set to defaultTooltipRender.

bool mVisible 
bool mActive 
bool mAwake 
bool mSetFirstResponder 
bool mIsContainer 

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

bool mCanResize 
bool mCanHit 
S32 mLayer 
Point2I mMinExtent 
StringTableEntry mLangTableName 
LangTable * mLangTable 
bool mNotifyChildrenResized 
CollapseGroupVec mCollapseGroupVec 
S32 mHorizSizing 

Set from horizSizingOptions.

S32 mVertSizing 

Set from vertSizingOptions.

StringTableEntry mAcceleratorKey 
StringTableEntry mConsoleVariable 
String mConsoleCommand 
String mAltConsoleCommand 
String mTooltip 
bool smDesignTime 

static GuiControl boolean that specifies if the GUI Editor is active

typedef Vector< Vector< GuiWindowCtrl * > > CollapseGroupVec 

Keyboard Input

GuiControl * mFirstResponder 
GuiControl * smPrevResponder 
GuiControl * smCurResponder 

Console

evaluate(const char * str)

Set $ThisControl and evaluate the given script code.

setVariable(const char * value)

Sets the value of the console variable bound to this control.

Parameters:

value

String value to assign to control's console variable

setIntVariable(S32 value)

Sets the value of the console variable bound to this control.

Parameters:

value

Integer value to assign to control's console variable

setFloatVariable(F32 value)

Sets the value of the console variable bound to this control.

Parameters:

value

Float value to assign to control's console variable

getVariable()

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

getIntVariable()

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

getFloatVariable()

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

getScriptValue()

Returns the value of the variable bound to this object.

Reimplemented by: GuiButtonBaseCtrl, GuiColorPickerCtrl, GuiConsoleTextCtrl, GuiMLTextCtrl, GuiPopUpMenuCtrl, GuiPopUpMenuCtrlEx, GuiTextCtrl, GuiTextEditCtrl, GuiTextListCtrl, GuiProgressBitmapCtrl, GuiProgressCtrl

setScriptValue(const char * value)

Sets the value of the variable bound to this object.

Reimplemented by: GuiSliderCtrl, GuiButtonBaseCtrl, GuiColorPickerCtrl, GuiConsoleTextCtrl, GuiMLTextCtrl, GuiTextCtrl, GuiTextEditCtrl, GuiTextListCtrl, GuiProgressBitmapCtrl, GuiProgressCtrl

GFXStateBlockRef mDefaultGuiSB 
GuiControl * smThisControl 

$ThisControl variable for callback execution.

Design Time Editor Access

GuiEditCtrl * smEditorHandle 

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

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.

DECLARE_CALLBACK(void , onAdd , () )

DECLARE_CALLBACK(void , onRemove , () )

DECLARE_CALLBACK(void , onWake , () )

DECLARE_CALLBACK(void , onSleep , () )

DECLARE_CALLBACK(void , onLoseFirstResponder , () )

DECLARE_CALLBACK(void , onGainFirstResponder , () )

DECLARE_CALLBACK(void , onAction , () )

DECLARE_CALLBACK(void , onVisible , (bool state) )

DECLARE_CALLBACK(void , onActive , (bool state) )

DECLARE_CALLBACK(void , onDialogPush , () )

DECLARE_CALLBACK(void , onDialogPop , () )

DECLARE_CALLBACK(void , onControlDragEnter , (GuiControl *control, const Point2I &dropPoint) )

DECLARE_CALLBACK(void , onControlDragExit , (GuiControl *control, const Point2I &dropPoint) )

DECLARE_CALLBACK(void , onControlDragged , (GuiControl *control, const Point2I &dropPoint) )

DECLARE_CALLBACK(void , onControlDropped , (GuiControl *control, const Point2I &dropPoint) )

execConsoleCallback()

Executes mConsoleCommand, and returns the result.

execAltConsoleCallback()

Executes mAltConsoleCommand, and returns the result.

Editor

These functions are used by the GUI Editor

setSizing(S32 horz, S32 vert)

Sets the size of the GuiControl.

Parameters:

horz

Width of the control

vert

Height of the control

write(Stream & stream, U32 tabStop, U32 flags)

Reimplemented from: SimSet

getCanSaveParent()

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

Initialization

DECLARE_CONOBJECT(GuiControl )

DECLARE_CATEGORY("Gui Core" )

DECLARE_DESCRIPTION("Base class <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> GUI controls. Can also be used as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> generic container." )

GuiControl()

~GuiControl()

processArguments(S32 argc, ConsoleValueRef * argv)

Reimplemented from: SimGroup

initPersistFields()

consoleInit()

Accessors

getPosition()

Returns position of the control.

getExtent()

Returns extents of the control.

getBounds()

Returns the bounds of the control.

getGlobalBounds()

getMinExtent()

Returns minimum size the control can be.

Reimplemented by: GuiSplitContainer, GuiGameListMenuCtrl

setMinExtent(const Point2I & newMinExtent)

getLeft()

Returns the X position of the control.

getTop()

Returns the Y position of the control.

getWidth()

Returns the width of the control.

getHeight()

Returns the height of the control.

getHorizSizing()

getVertSizing()

Flags

setVisible(bool value)

Sets the visibility of the control.

Parameters:

value

True if object should be visible

Reimplemented by: GuiPanel, GuiConvexEditorCtrl

isVisible()

Returns true if the object is visible.

isHidden()

Reimplemented from: SimObject

setHidden(bool state)

Reimplemented from: SimObject

setCanHit(bool value)

setActive(bool value)

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

Parameters:

value

True if this is active

Reimplemented by: GuiSliderCtrl

isActive()

Returns true if this control is active.

isAwake()

Returns true if this control is awake.

Children

addObject(SimObject * obj)

Reimplemented from: SimGroup

Reimplemented by: GuiMenuBar

removeObject(SimObject * obj)

Reimplemented from: SimGroup

getParent()

Returns the control which owns this one.

getRoot()

Returns the root canvas of this control.

acceptsAsChild(SimObject * object)

Reimplemented from: SimSet

Reimplemented by: GuiFormCtrl, GuiTabBookCtrl

onGroupRemove()

Reimplemented from: SimObject

Coordinates

localToGlobalCoord(const Point2I & src)

Translates local coordinates (wrt this object) into global coordinates.

Parameters:

src

Local coordinates to translate

globalToLocalCoord(const Point2I & src)

Returns global coordinates translated into local space.

Parameters:

src

Global coordinates to translate

Resizing

resize(const Point2I & newPosition, const Point2I & newExtent)

Changes the size and/or position of this control.

Parameters:

newPosition

New position of this control

newExtent

New size of this control

Reimplemented by: GuiIconButtonCtrl, GuiAutoScrollCtrl, GuiContainer, GuiControlArrayControl, GuiDynamicCtrlArrayControl, GuiFormCtrl, GuiFrameSetCtrl, GuiPaneControl, GuiRolloutCtrl, GuiScrollCtrl, GuiSplitContainer, GuiStackControl, GuiTabBookCtrl, GuiWindowCtrl, GuiMLTextCtrl, GuiMLTextEditCtrl, GuiScriptNotifyCtrl, GuiInspector, GuiInspectorTypeFileName, GuiInspectorTypeEaseF, GuiInspectorTypeColor, GuiInspectorTypeBitMask32, GuiInspectorTypeBitMask32Helper, GuiInspectorField, EditTSCtrl, GuiSliderCtrl

setPosition(const Point2I & newPosition)

Changes the position of this control.

Parameters:

newPosition

New position of this control

setPosition(const S32 x, const S32 y)

setExtent(const Point2I & newExtent)

Changes the size of this control.

Parameters:

newExtent

New size of this control

setExtent(const S32 width, const S32 height)

setBounds(const RectI & newBounds)

Changes the bounds of this control.

Parameters:

newBounds

New bounds of this control

setBounds(const S32 left, const S32 top, const S32 width, const S32 height)

setLeft(S32 newLeft)

Changes the X position of this control.

Parameters:

newXPosition

New X Position of this control

setTop(S32 newTop)

Changes the Y position of this control.

Parameters:

newYPosition

New Y Position of this control

setWidth(S32 newWidth)

Changes the width of this control.

Parameters:

newWidth

New width of this control

setHeight(S32 newHeight)

Changes the height of this control.

Parameters:

newHeight

New Height of this control

childResized(GuiControl * child)

Called when a child control of the object is resized.

Parameters:

child

Child object

Reimplemented by: GuiAutoScrollCtrl, GuiContainer, GuiDynamicCtrlArrayControl, GuiRolloutCtrl, GuiScrollCtrl, GuiStackControl, GuiTabBookCtrl, GuiInspectorTypeBitMask32

parentResized(const RectI & oldParentRect, const RectI & newParentRect)

Called when this objects parent is resized.

Parameters:

oldParentRect

The old rectangle of the parent object

newParentRect

The new rectangle of the parent object

Reimplemented by: GuiContainer, GuiSplitContainer, GuiWindowCtrl, GuiListBoxCtrl, GuiMLTextCtrl, GuiSliderCtrl, GuiScriptNotifyCtrl, GuiInspector, GuiMessageVectorCtrl

Rendering

onRender(Point2I offset, const RectI & updateRect)

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 by: afxGuiTextHud, afxSpellButton, afxTSCtrl, GuiRiverEditorCtrl, GuiRoadEditorCtrl, GuiTSCtrl, GuiBitmapButtonCtrl, GuiBorderButtonCtrl, GuiButtonCtrl, GuiCheckBoxCtrl, GuiIconButtonCtrl, GuiSwatchButtonCtrl, GuiToggleButtonCtrl, GuiToolboxButtonCtrl, GuiFormCtrl, GuiFrameSetCtrl, GuiPaneControl, GuiPanel, GuiRolloutCtrl, GuiScrollCtrl, GuiSplitContainer, GuiTabBookCtrl, GuiWindowCtrl, Gui3DProjectionCtrl, guiAnimBitmapCtrl, GuiBackgroundCtrl, GuiBitmapBarCtrl, GuiBitmapBorderCtrl, GuiBitmapCtrl, GuiColorPickerCtrl, GuiConsoleTextCtrl, GuiGameListMenuCtrl, GuiGameListOptionsCtrl, GuiGradientSwatchCtrl, GuiGradientCtrl, GuiListBoxCtrl, GuiMaterialCtrl, GuiMLTextCtrl, GuiMLTextEditCtrl, GuiPopUpMenuCtrl, GuiPopUpMenuCtrlEx, GuiSliderCtrl, GuiTabPageCtrl, GuiTextCtrl, GuiTextEditCtrl, GuiTextEditSliderBitmapCtrl, GuiTextEditSliderCtrl, GuiTreeViewCtrl, GuiArrayCtrl, GuiEditorRuler, GuiEditCtrl, GuiFilterCtrl, GuiGraphCtrl, GuiMenuBar, GuiParticleGraphCtrl, GuiRectHandles, GuiSeparatorCtrl, GuiInspectorField, GuiChunkedBitmapCtrl, GuiFadeinBitmapCtrl, GuiIdleCamFadeBitmapCtrl, GuiMessageVectorCtrl, GuiProgressBitmapCtrl, GuiProgressCtrl, GuiRenderTargetVizCtrl, EditTSCtrl, GuiDecalEditorCtrl, GuiMissionAreaCtrl, GuiTerrPreviewCtrl, GuiNavEditorCtrl, GuiShapeNameHud, GameTSCtrl, VEditorButton, VTimeLineControl, VEditorScrollControl, VFadeControl, afxSpellCastBar, afxStatusBar, GuiEaseViewCtrl, GuiClockHud, GuiCrossHairHud, GuiHealthBarHud, GuiHealthTextHud, GuiSpeedometerHud

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

setUpdateRegion(Point2I pos, Point2I ext)

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

setUpdate()

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

Reimplemented by: GuiTabBookCtrl

Events

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

onWake()

Called when this object is asked to wake up returns true if it's actually awake at the end.

Reimplemented by: afxSpellButton, afxStatusBar, ForestEditorCtrl, GuiTSCtrl, GuiBitmapButtonCtrl, GuiButtonBaseCtrl, GuiButtonCtrl, GuiCheckBoxCtrl, GuiIconButtonCtrl, GuiSwatchButtonCtrl, GuiToolboxButtonCtrl, GuiAutoScrollCtrl, GuiControlArrayControl, GuiFormCtrl, GuiFrameSetCtrl, GuiPaneControl, GuiRolloutCtrl, GuiScrollCtrl, GuiSplitContainer, GuiStackControl, GuiTabBookCtrl, GuiWindowCtrl, Gui3DProjectionCtrl, GuiBitmapBorderCtrl, GuiBitmapCtrl, GuiConsole, GuiConsoleTextCtrl, GuiDirectoryFileListCtrl, GuiFileTreeCtrl, GuiGameListMenuCtrl, GuiGradientSwatchCtrl, GuiListBoxCtrl, GuiMaterialCtrl, GuiMLTextCtrl, GuiMLTextEditCtrl, GuiPopUpMenuCtrl, GuiPopUpMenuCtrlEx, GuiSliderCtrl, GuiTabPageCtrl, GuiTextCtrl, GuiTextEditSliderBitmapCtrl, GuiTextListCtrl, GuiTreeViewCtrl, GuiArrayCtrl, DbgFileView, GuiEaseViewCtrl, GuiEditorRuler, GuiEditCtrl, GuiFilterCtrl, GuiMenuBar, GuiParticleGraphCtrl, GuiShapeEdPreview, GuiChunkedBitmapCtrl, GuiFadeinBitmapCtrl, GuiIdleCamFadeBitmapCtrl, GuiMessageVectorCtrl, GuiProgressBitmapCtrl, GuiInputCtrl, GuiRenderTargetVizCtrl, CreatorTree, EditManager, GuiConvexEditorCtrl, GuiDecalEditorCtrl, GuiMissionAreaCtrl, GuiTerrPreviewCtrl, TerrainEditor, GuiMaterialPreview, GuiObjectView, VPathEditor

onSleep()

Called when this object is asked to sleep.

Reimplemented by: afxSpellButton, afxStatusBar, afxStatusBox, GuiMeshRoadEditorCtrl, GuiRiverEditorCtrl, GuiRoadEditorCtrl, ForestEditorCtrl, GuiTSCtrl, GuiBitmapButtonCtrl, GuiIconButtonCtrl, GuiToolboxButtonCtrl, GuiAutoScrollCtrl, GuiControlArrayControl, GuiFormCtrl, GuiScrollCtrl, GuiStackControl, GuiWindowCtrl, Gui3DProjectionCtrl, GuiBitmapBorderCtrl, GuiBitmapCtrl, GuiConsoleTextCtrl, GuiMaterialCtrl, GuiMLTextCtrl, GuiPopUpMenuCtrl, GuiPopUpMenuCtrlEx, GuiTabPageCtrl, GuiTreeViewCtrl, GuiArrayCtrl, GuiEaseViewCtrl, GuiEditCtrl, GuiMenuBar, GuiChunkedBitmapCtrl, GuiMessageVectorCtrl, GuiInputCtrl, EditManager, GuiConvexEditorCtrl, GuiDecalEditorCtrl, GuiMissionAreaCtrl, GuiTerrPreviewCtrl, TerrainEditor, GuiNavEditorCtrl

onPreRender()

Do special pre-render processing.

Reimplemented by: GuiTSCtrl, GuiToggleButtonCtrl, GuiContainer, GuiScrollCtrl, GuiConsole, GuiConsoleTextCtrl, GuiMLTextCtrl, GuiTextCtrl, GuiTextEditCtrl, GuiTextEditSliderBitmapCtrl, GuiTextEditSliderCtrl, GuiTreeViewCtrl, DbgFileView, GuiEditorRuler, GuiEditCtrl, GuiFilterCtrl, GuiMenuBar, GuiFadeinBitmapCtrl, GuiIdleCamFadeBitmapCtrl, GuiProgressBitmapCtrl, GuiProgressCtrl, GuiTerrPreviewCtrl, TerrainEditor, VTimeLineControl

onRemove()

Reimplemented from: SimGroup

Reimplemented by: GuiTextListCtrl, GuiCanvas, GuiOffscreenCanvas, GuiEditCtrl, GuiInspector, GuiMenuBar, GuiMessageVectorCtrl, EditTSCtrl, GuiConvexEditorCtrl, OpenVROverlay

onChildRemoved(GuiControl * child)

Called when one of this objects children is removed.

Reimplemented by: GuiTabBookCtrl, GuiScriptNotifyCtrl, GuiAutoScrollCtrl, GuiContainer

onAdd()

Reimplemented from: SimObject

Reimplemented by: afxGuiSubstitutionField, afxSpellButton, GuiMeshRoadEditorCtrl, GuiRiverEditorCtrl, GuiRoadEditorCtrl, ForestEditorCtrl, GuiFrameSetCtrl, GuiRolloutCtrl, GuiSplitContainer, guiAnimBitmapCtrl, GuiGameListMenuCtrl, GuiGameListOptionsCtrl, GuiGradientCtrl, GuiMLTextCtrl, GuiPopUpMenuCtrl, GuiPopUpMenuCtrlEx, GuiTextCtrl, GuiTextEditCtrl, GuiTreeViewCtrl, GuiCanvas, GuiOffscreenCanvas, GuiEditCtrl, GuiInspectorTypeBitMask32, GuiInspectorCustomField, GuiInspectorDynamicField, GuiInspectorField, GuiInspectorGroup, GuiInspectorVariableField, GuiMessageVectorCtrl, EditManager, EditTSCtrl, GuiConvexEditorCtrl, GuiDecalEditorCtrl, GuiMissionAreaCtrl, GuiMissionAreaEditorCtrl, GuiTerrPreviewCtrl, TerrainEditor, WorldEditor, GuiNavEditorCtrl, OpenVROverlay, GameTSCtrl, VEditorWindow, VPathEditor

onDeleteNotify(SimObject * object)

Reimplemented from: SimSet

Reimplemented by: afxSpellButton, afxStatusBar, Gui3DProjectionCtrl, GuiInspector, TerrainEditor

onChildAdded(GuiControl * child)

Called when this object has a new child.

Reimplemented by: GuiTabBookCtrl, GuiScriptNotifyCtrl, GuiAutoScrollCtrl, GuiContainer

Mouse Events

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

onMouseUp(const GuiEvent & event)

Reimplemented by: afxEventCatchAll, GuiButtonBaseCtrl, GuiColorPickerCtrl, GuiGradientCtrl, GuiMLTextCtrl, GuiSliderCtrl, GuiFilterCtrl, GuiDragAndDropControl, GuiFormCtrl, GuiFrameSetCtrl, GuiPaneControl, GuiRolloutCtrl, GuiScrollCtrl, GuiSplitContainer, GuiTabBookCtrl, GuiWindowCtrl, GuiDecoyCtrl, GuiGameListMenuCtrl, GuiGameListOptionsCtrl, GuiListBoxCtrl, GuiPopupTextListCtrl, GuiPopUpMenuCtrl, GuiPopupTextListCtrlEx, GuiPopUpMenuCtrlEx, GuiTextEditCtrl, GuiTextEditSliderBitmapCtrl, GuiTextEditSliderCtrl, GuiTreeViewCtrl, GuiArrayCtrl, DbgFileView, GuiEditCtrl, GuiInspector, GuiMenuBar, GuiParticleGraphCtrl, GuiPopupMenuTextListCtrl, GuiPopupMenuBackgroundCtrl, GuiRectHandles, GuiShapeEdPreview, GuiMessageVectorCtrl, GuiMouseEventCtrl, CreatorTree, EditTSCtrl, GuiMissionAreaCtrl, GuiMaterialPreview, GuiObjectView, ForestEditorCtrl, GameTSCtrl, VEditorButton, VEditorScrollControl, VTimeLineControl

onMouseDown(const GuiEvent & event)

Reimplemented by: afxEventCatchAll, afxTSCtrl, GuiButtonBaseCtrl, GuiColorPickerCtrl, GuiGradientSwatchCtrl, GuiGradientCtrl, GuiMLTextCtrl, GuiFadeinBitmapCtrl, GuiIdleCamFadeBitmapCtrl, afxStatusBar, afxStatusBox, afxStatusLabel, GuiDragAndDropControl, GuiFormCtrl, GuiFrameSetCtrl, GuiPaneControl, GuiRolloutCtrl, GuiScrollCtrl, GuiSplitContainer, GuiTabBookCtrl, GuiWindowCtrl, GuiDecoyCtrl, GuiDirectoryFileListCtrl, GuiGameListMenuCtrl, GuiListBoxCtrl, GuiPopUpBackgroundCtrl, GuiPopUpMenuCtrl, GuiPopUpBackgroundCtrlEx, GuiPopUpMenuCtrlEx, GuiSliderCtrl, GuiTabPageCtrl, GuiTextEditCtrl, GuiTextEditSliderBitmapCtrl, GuiTextEditSliderCtrl, GuiTreeViewCtrl, GuiArrayCtrl, DbgFileView, GuiEditorRuler, GuiEditCtrl, GuiFilterCtrl, GuiInspector, GuiMenuBar, GuiParticleGraphCtrl, GuiPopupMenuTextListCtrl, GuiPopupMenuBackgroundCtrl, GuiRectHandles, GuiShapeEdPreview, GuiInspectorField, GuiMessageVectorCtrl, GuiBubbleTextCtrl, GuiMouseEventCtrl, CreatorTree, EditTSCtrl, GuiMissionAreaCtrl, GuiMaterialPreview, GuiObjectView, GameTSCtrl, VEditorButton, VTimeLineControl

onMouseMove(const GuiEvent & event)

Reimplemented by: afxEventCatchAll, afxTSCtrl, GuiFormCtrl, GuiPaneControl, GuiTabBookCtrl, GuiWindowCtrl, GuiColorPickerCtrl, GuiDecoyCtrl, GuiGameListMenuCtrl, GuiPopupTextListCtrlEx, GuiTreeViewCtrl, GuiArrayCtrl, GuiInspector, GuiMenuBar, GuiParticleGraphCtrl, GuiPopupMenuBackgroundCtrl, GuiShapeEdPreview, GuiMouseEventCtrl, EditTSCtrl, GuiMissionAreaCtrl, GameTSCtrl

onMouseDragged(const GuiEvent & event)

Reimplemented by: afxEventCatchAll, afxTSCtrl, GuiMLTextCtrl, GuiButtonBaseCtrl, GuiDragAndDropControl, GuiFrameSetCtrl, GuiScrollCtrl, GuiSplitContainer, GuiTabBookCtrl, GuiWindowCtrl, GuiColorPickerCtrl, GuiDecoyCtrl, GuiGameListMenuCtrl, GuiGradientSwatchCtrl, GuiListBoxCtrl, GuiSliderCtrl, GuiTextEditCtrl, GuiTextEditSliderBitmapCtrl, GuiTextEditSliderCtrl, GuiTreeViewCtrl, GuiArrayCtrl, DbgFileView, GuiEditCtrl, GuiFilterCtrl, GuiInspector, GuiMenuBar, GuiParticleGraphCtrl, GuiPopupMenuBackgroundCtrl, GuiRectHandles, GuiShapeEdPreview, GuiMouseEventCtrl, CreatorTree, EditTSCtrl, GuiMissionAreaCtrl, GuiMaterialPreview, GuiObjectView, VEditorButton, VTimeLineControl

onMouseEnter(const GuiEvent & event)

Reimplemented by: afxEventCatchAll, afxTSCtrl, GuiButtonBaseCtrl, GuiColorPickerCtrl, GuiGradientCtrl, GuiSliderCtrl, afxSpellButton, GuiFormCtrl, GuiPaneControl, GuiDecoyCtrl, GuiPopUpMenuCtrl, GuiPopUpMenuCtrlEx, GuiTreeViewCtrl, GuiArrayCtrl, GuiMenuBar, GuiMouseEventCtrl, EditTSCtrl, GuiMissionAreaCtrl, GuiMaterialPreview, GuiObjectView, VEditorButton

onMouseLeave(const GuiEvent & event)

Reimplemented by: afxEventCatchAll, afxTSCtrl, GuiButtonBaseCtrl, GuiColorPickerCtrl, GuiGradientCtrl, GuiPopUpMenuCtrl, GuiPopUpMenuCtrlEx, GuiSliderCtrl, afxSpellButton, GuiFormCtrl, GuiPaneControl, GuiTabBookCtrl, GuiDecoyCtrl, GuiGameListMenuCtrl, GuiTreeViewCtrl, GuiArrayCtrl, GuiMenuBar, GuiMouseEventCtrl, EditTSCtrl, GuiMissionAreaCtrl, GuiMaterialPreview, GuiObjectView, VEditorButton

onMouseWheelUp(const GuiEvent & event)

Reimplemented by: afxEventCatchAll, afxTSCtrl, GuiScrollCtrl, GuiDecoyCtrl, GuiSliderCtrl, GuiTextEditSliderBitmapCtrl, GuiTextEditSliderCtrl, EditTSCtrl, GuiMaterialPreview, ForestEditorCtrl, TerrainEditor

onMouseWheelDown(const GuiEvent & event)

Reimplemented by: afxEventCatchAll, afxTSCtrl, GuiScrollCtrl, GuiDecoyCtrl, GuiSliderCtrl, GuiTextEditSliderBitmapCtrl, GuiTextEditSliderCtrl, EditTSCtrl, GuiMaterialPreview, ForestEditorCtrl, TerrainEditor

onRightMouseDown(const GuiEvent & event)

Reimplemented by: afxEventCatchAll, afxTSCtrl, GuiGradientSwatchCtrl, GuiDecoyCtrl, GuiTreeViewCtrl, GuiArrayCtrl, GuiEditCtrl, GuiParticleGraphCtrl, GuiShapeEdPreview, GuiMouseEventCtrl, EditTSCtrl, GuiMaterialPreview, GuiObjectView, GameTSCtrl, VEditorButton, VTimeLineControl

onRightMouseUp(const GuiEvent & event)

Reimplemented by: afxEventCatchAll, GuiButtonBaseCtrl, GuiRolloutCtrl, GuiTabBookCtrl, GuiDecoyCtrl, GuiTreeViewCtrl, GuiParticleGraphCtrl, GuiShapeEdPreview, GuiInspectorField, GuiMouseEventCtrl, EditTSCtrl, GuiMaterialPreview, GuiObjectView, GameTSCtrl, VEditorButton, VEditorScrollControl

onRightMouseDragged(const GuiEvent & event)

Reimplemented by: afxEventCatchAll, GuiDecoyCtrl, GuiParticleGraphCtrl, GuiShapeEdPreview, GuiMouseEventCtrl, EditTSCtrl, GuiMaterialPreview, GuiObjectView

onMiddleMouseDown(const GuiEvent & event)

Reimplemented by: GuiDecoyCtrl, GuiTreeViewCtrl, GuiShapeEdPreview, EditTSCtrl, GuiMaterialPreview, GameTSCtrl

onMiddleMouseUp(const GuiEvent & event)

Reimplemented by: GuiDecoyCtrl, GuiShapeEdPreview, EditTSCtrl, GuiMaterialPreview, GameTSCtrl

onMiddleMouseDragged(const GuiEvent & event)

Reimplemented by: GuiDecoyCtrl, GuiShapeEdPreview, EditTSCtrl, GuiMaterialPreview

Gamepad Events

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

onGamepadButtonDown(const GuiEvent & event)

Default behavior is call-through to onKeyDown.

Reimplemented by: GuiFadeinBitmapCtrl

onGamepadButtonUp(const GuiEvent & event)

Default behavior is call-through to onKeyUp.

onGamepadAxisUp(const GuiEvent & event)

Reimplemented by: GuiGameListMenuCtrl, GuiTextListCtrl

onGamepadAxisDown(const GuiEvent & event)

Reimplemented by: GuiGameListMenuCtrl, GuiTextListCtrl

onGamepadAxisLeft(const GuiEvent & event)

Reimplemented by: GuiGameListMenuCtrl, GuiGameListOptionsCtrl

onGamepadAxisRight(const GuiEvent & event)

Reimplemented by: GuiGameListMenuCtrl, GuiGameListOptionsCtrl

onGamepadTrigger(const GuiEvent & event)

Editor Mouse Events

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

Conversely 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.

onMouseDownEditor(const GuiEvent & event, Point2I offset)

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 by: GuiScrollCtrl, GuiTabBookCtrl, GuiTabPageCtrl

onMouseUpEditor(const GuiEvent & event, Point2I offset)

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

Reimplemented by: GuiRolloutCtrl

onRightMouseDownEditor(const GuiEvent & event, Point2I offset)

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

onMouseDraggedEditor(const GuiEvent & event, Point2I offset)

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

Tabs

findFirstTabable()

Find the first tab-accessible child of this control.

findLastTabable(bool firstCall)

Find the last tab-accessible child of this control.

Parameters:

firstCall

Set to true to clear the global previous responder

findPrevTabable(GuiControl * curResponder, bool firstCall)

Find previous tab-accessible control with respect to the provided one.

Parameters:

curResponder

Current control

firstCall

Set to true to clear the global previous responder

Reimplemented by: GuiWindowCtrl, GuiTabPageCtrl

findNextTabable(GuiControl * curResponder, bool firstCall)

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

Parameters:

curResponder

Current control

firstCall

Set to true to clear the global current responder

Reimplemented by: GuiWindowCtrl, GuiTabPageCtrl

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.

setFirstResponder(GuiControl * firstResponder)

Sets the first responder for child controls.

Parameters:

firstResponder

First responder for this chain

Reimplemented by: GuiCanvas, GuiScriptNotifyCtrl, GuiInspectorField

makeFirstResponder(bool value)

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

isFirstResponder()

Returns true if this control is a first responder.

setFirstResponder()

Sets this object to be a first responder.

Reimplemented by: GuiMLTextEditCtrl, GuiTextEditCtrl, GuiScriptNotifyCtrl

clearFirstResponder()

Clears the first responder for this chain.

getFirstResponder()

Returns the first responder for this chain.

onGainFirstResponder()

Occurs when the control gains first-responder status.

onLoseFirstResponder()

Occurs when the control loses first-responder status.

Reimplemented by: GuiMLTextEditCtrl, GuiTextEditCtrl, GuiScriptNotifyCtrl

Keyboard Events

addAcceleratorKey()

Adds the accelerator key for this object to the canvas.

buildAcceleratorMap()

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

acceleratorKeyPress(U32 index)

Occurs when the accelerator key for this control is pressed.

Parameters:

index

Index in the accelerator map of the key

Reimplemented by: GuiButtonBaseCtrl, GuiMenuBar

acceleratorKeyRelease(U32 index)

Occurs when the accelerator key for this control is released.

Parameters:

index

Index in the accelerator map of the key

Reimplemented by: GuiButtonBaseCtrl

onKeyDown(const GuiEvent & event)

Happens when a key is depressed.

Parameters:

event

Event descriptor (which contains the key)

Reimplemented by: GuiFadeinBitmapCtrl, GuiIdleCamFadeBitmapCtrl, GuiMeshRoadEditorCtrl, GuiRiverEditorCtrl, GuiRoadEditorCtrl, GuiButtonBaseCtrl, GuiScrollCtrl, GuiTabBookCtrl, GuiWindowCtrl, GuiConsoleEditCtrl, GuiGameListMenuCtrl, GuiGameListOptionsCtrl, GuiListBoxCtrl, GuiMLTextCtrl, GuiMLTextEditCtrl, GuiPopupTextListCtrl, GuiPopUpMenuCtrl, GuiPopupTextListCtrlEx, GuiPopUpMenuCtrlEx, GuiTextEditCtrl, GuiTextEditSliderBitmapCtrl, GuiTextEditSliderCtrl, GuiTextListCtrl, GuiTreeViewCtrl, GuiArrayCtrl, GuiEditCtrl, GuiPopupMenuTextListCtrl, GuiConvexEditorCtrl

onKeyUp(const GuiEvent & event)

Happens when a key is released.

Parameters:

event

Event descriptor (which contains the key)

Reimplemented by: GuiButtonBaseCtrl, GuiConvexEditorCtrl

onKeyRepeat(const GuiEvent & event)

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

Parameters:

event

Event descriptor (which contains the key)

Reimplemented by: GuiGameListMenuCtrl, GuiGameListOptionsCtrl

Peer Messaging

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

This is mostly used by radio controls.

messageSiblings(S32 message)

Send a message to all siblings.

onMessage(GuiControl * sender, S32 msg)

Receive a message from another control.

Reimplemented by: GuiButtonBaseCtrl

Canvas Events

Functions called by the canvas

onDialogPush()

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

Reimplemented by: GuiScriptNotifyCtrl

onDialogPop()

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

Reimplemented by: GuiScriptNotifyCtrl

Public Types

@101

Enumerator

NoCheckParentCanSave = BIT( 31 )

Don't inherit mCanSave=false from parents.

Additional write flags for GuiControls.

horizSizingOptions

Enumerator

horizResizeRight = 0

fixed on the left and width

horizResizeWidth

fixed on the left and right

horizResizeLeft

fixed on the right and width

horizResizeCenter
horizResizeRelative

resize relative

horizResizeAspectLeft

resize relative to height delta (offset Left)

horizResizeAspectRight

resize relative to height delta (offset Right)

horizResizeAspectCenter

resize relative to height delta (Centered)

horizResizeWindowRelative

resize window relative

vertSizingOptions

Enumerator

vertResizeBottom = 0

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

vertResizeAspectTop

resize relative to width delta (offset Left)

vertResizeAspectBottom

resize relative to width delta (offset Right)

vertResizeAspectCenter

resize relative to width delta Centered)

vertResizeWindowRelative

resize window relative

typedef GuiControl Children 
typedef SimGroup Parent 

Public Friends

Private Attributes

SimGroup * mAddGroup 

The internal name of a SimGroup child of the global GuiGroup in which to organize this gui on creation.

RectI mBounds 

The internal bounds of this control.

Protected Attributes

F32 fade_amt 
GuiControlProfile * mProfile 

The profile for this gui (data settings that are likely to be shared by multiple guis)

GuiControlProfile * mTooltipProfile 

The profile for any tooltips.

Public Functions

awaken()

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

clipText(String & inOutText, U32 width)

Returns text clipped to fit within a pixel width.

The clipping occurs on the right side and "..." is appended. It returns width of the final clipped text in pixels.

controlIsChild(GuiControl * child)

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

Parameters:

child

Control to test

getConsoleCommand()

Returns the name of the function bound to this GuiControl.

getControlProfile()

Returns our profile (and finds the profile if it hasn't been set yet)

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

Get information about the cursor.

Parameters:

cursor

Cursor information will be stored here

showCursor

Will be set to true if the cursor is visible

lastGuiEvent

GuiEvent containing cursor position and modifier keys (ie ctrl, shift, alt etc)

Reimplemented by: afxEventCatchAll, afxTSCtrl, GuiFrameSetCtrl, GuiSplitContainer, GuiWindowCtrl, GuiMLTextCtrl, GuiEditCtrl, GuiInspector, EditTSCtrl

getGUILangTable(void )

getGUIString(S32 id)

getRenderTooltipDelegate()

Return the delegate used to render tooltips on this control.

getRenderTooltipDelegate()

getScrollLineSizes(U32 * rowHeight, U32 * columnWidth)

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

getTooltip()

Returns the tooltip.

getTooltipProfile()

Returns our tooltip profile (and finds the profile if it hasn't been set yet)

inspectPostApply()

Reimplemented from: SimObject

Reimplemented by: GuiMessageVectorCtrl

inspectPreApply()

Reimplemented from: SimObject

onAction()

Occurs when this control performs its "action".

Reimplemented by: GuiBitmapButtonCtrl, GuiButtonBaseCtrl, GuiPopUpMenuCtrl, GuiPopUpMenuCtrlEx, GuiMenuBar

onInputEvent(const InputEventInfo & event)

General input handler.

Reimplemented by: GuiGameListMenuCtrl, GuiInputCtrl, EditTSCtrl, TerrainEditor

preRender()

Pre-render this control and all its children.

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

setConsoleCommand(const String & 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

setConsoleVariable(const char * variable)

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

Parameters:

variable

Variable name

setControlProfile(GuiControlProfile * prof)

Sets the control profile for this control.

Parameters:
prof

Control profile to apply

setFadeAmount(F32 amt)

setTooltipProfile(GuiControlProfile * prof)

Sets the tooltip profile for this control.

Parameters:
prof

Tooltip profile to apply

sleep()

Called when this control is no more.

Public Static Functions

_setActive(void * object, const char * index, const char * data)

_setVisible(void * object, const char * index, const char * data)