|
TorqueScript Reference
|
#include <guiControl_ScriptBinding.h>
Inherits SimGroup.
Inherited by GuiButtonCtrl, GuiCanvas, GuiChainCtrl, GuiColorPickerCtrl, GuiColorPopupCtrl, GuiDragAndDropCtrl, GuiDropDownCtrl, GuiEditFrameStripCtrl, GuiEditorCursorCtrl, GuiExpandCtrl, GuiFrameSetCtrl, GuiGridCtrl, GuiListBoxCtrl, GuiMenuBarCtrl, GuiPanelCtrl, GuiParticleGraphInspector, GuiProgressCtrl, GuiScrollCtrl, GuiTabBookCtrl, GuiTextEditCtrl, GuiWindowCtrl, and SceneWindow.
| void addGuiControl | ( | int | controlId | ) |
Adds the gui control
| controlId | integer ID of the control to add |
| void applySizing | ( | ) |
Re-applies this control's sizing flags against its parent's current size.
HorizSizing and VertSizing are only ever consulted from parentResized, so setting one leaves the control exactly where it was until something else resizes the parent. That is fine for the modes that describe what happens to a size CHANGE, but "center" and "fill" describe a position the control should always be in, and those look broken until the next layout pass.
Calling this runs the layout with a zero delta, so the modes that need a delta do nothing – which is correct, they have nothing to respond to – and center and fill take effect at once.
Does nothing if the control has no parent.
| Boolean canBeChildOf | ( | GuiControl | parent | ) |
Whether this control is allowed to become a child of the given container.
The Gui Editor asks before every reparent it performs - a drag in the Explorer tree, a drag across the canvas, a paste - and leaves the control where it is when the answer is false. Almost everything answers true; a GuiTabPageCtrl answers true only for a GuiTabBookCtrl.
Nothing enforces this below the editor: add() will still put a control anywhere. This is the question, not the gate.
| parent | The container being proposed. |
| void childrenReordered | ( | ) |
Tell this control that the order of its children has changed, so that one which lays its children out - a chain, a grid, a frame set - places them again.
reorderChild and the SimSet ordering methods change the list and announce nothing, so anything that rearranges children from script has to say so afterwards. Adding and removing a child already notify on their own; this is for the case where the same children are simply in a different order.
| Integer findHitControl | ( | int | x, |
| int | y ) |
Searches for the control at the given point
| String getCenter | ( | ) |
| String getExtent | ( | ... | ) |
Get the width and height of the control.
| String getGlobalCenter | ( | ) |
| String getGlobalPosition | ( | ) |
| String getMinExtent | ( | ) |
Get the minimum allowed size of the control.
| Integer getParent | ( | ) |
| String getPosition | ( | ) |
| String getText | ( | ) |
returns the text of the control.
| Boolean getTextExtend | ( | ) |
Returns if text extend is on.
| Boolean getTextWrap | ( | ) |
Returns if text wrap is on.
| String getValue | ( | ) |
Use the getValue method to get the control-specific 'value' for this control.
| Boolean isActive | ( | ) |
Use the isActive method to determine if this control is active. An inactive control may be visible, but will not accept inputs. It will also normally re-shade or re-skin itself to reflect its inactive state
| Boolean isAwake | ( | ) |
Use the isAwake method to determine if this control is awake.
| Boolean isGeometryEditable | ( | ) |
Whether the Gui Editor may move or resize this control.
False where the PARENT dictates the geometry and the control's own Position and Extent are written over the moment anything re-lays it out - a tab page, a menu item. The editor draws such a control the way it draws a locked one: an outline rather than eight sizing handles.
This is the control's own nature, not the user's padlock; isLocked is that, and the editor honours both.
| Boolean isVisible | ( | ) |
Use the isVisible method to determine if this control is visible. This can return true, even if the entire control covered by another. This merely means that the control will render if not covered
| void makeFirstResponder | ( | isFirst | ) |
Use the makeFirstResponder method to force this control to become the first responder.
| isFirst | A boolean value. If true, then this control become first reponder and at captures inputs before all other controls, excluding dialogs above this control. |
| void performClick | ( | ) |
Simulates a click on the control.
| Boolean pointInControl | ( | int | x, |
| int | y ) |
Check if point id in the control
| x | Point x coordinate in parent coords |
| y | Point y coordinate in parent coords |
| Boolean pullIntoView | ( | ) |
Moves this control back inside its parent if a move has left it entirely outside.
Reparenting in the Explorer tree is a gesture with no pointer in it, so nothing supplies a position and the control keeps the local one it held in its old parent. Dropped into something smaller that can put it entirely outside: not clipped, not partly visible, gone.
An axis on which nothing of the control is visible is set to 0. The other axis is left alone – a control that was 20 pixels down and 400 across is still 20 pixels down – and so is a control that merely overhangs an edge, because one the user can see is one the user can drag.
Does nothing to a control with no parent, so a whole selection can be offered without checking each member.
| Boolean rendersChildren | ( | ) |
Returns true if this control draws its children. A control that does not render children can never be a container: the isContainer field is forced to false for it and editing that field is meaningless. This is fixed by the class and cannot be changed.
| void reorderChild | ( | child1 | , |
| child2 | ) |
uses simset reorder to push child 1 after child 2 - both must already be child controls of this control
| void resize | ( | int | x, |
| int | y, | ||
| int | w, | ||
| int | h ) |
Resizes the control to the given dimensions
Use the setActive method to (de)activate this control. Once active, a control can accept inputs. Controls automatically re-shade/skin themselves to reflect their active/inactive state.
| isActive | A boolean value. If isActive is true, this control is activated, else it is set to inactive. |
| void setCanSave | ( | bool | canSave | ) |
Sets whether this control can serialize itself to the hard disk
| Flag | setting |
| void setCenter | ( | int | x, |
| int | y ) |
Sets control position, by center - coords are local not global
| void setExtent | ( | int | width, |
| int | height ) |
Sets the width & height of the control.
| void setFirstResponder | ( | ) |
Sets this control as the first responder
| void setPosition | ( | int | x, |
| int | y ) |
Sets the current control position in local space
| void setPositionGlobal | ( | int | x, |
| int | y ) |
Sets the control's position in global space
| void setProfile | ( | GuiControlProfile | p | ) |
Sets the currently used from for the GuiControl
| p | The profile you wish to set the control to use |
| void setText | ( | text | ) |
Sets the text of the control to the string.
| void setTextExtend | ( | setting | ) |
Turns on or off text Extend.
| setting | True turns on text extend. |
| void setTextID | ( | id | ) |
Sets the text of the control to the localized string.
| void setTextWrap | ( | setting | ) |
Turns on or off text wrap.
| setting | True turns on text wrap. |
| void setValue | ( | value | ) |
Use the setValue method to set the control specific value to value. Purpose and type varies by control type.
| value | Some control specific value. |