|
| DECLARE_CONOBJECT (GuiCanvas) |
|
| GuiCanvas () |
|
virtual | ~GuiCanvas () |
|
void | setBackgroundColor (const ColorF &backgroundColor) |
| Background color. More...
|
|
const ColorF & | getBackgroundColor (void) const |
|
void | setUseBackgroundColor (const bool useBackgroundColor) |
|
bool | getUseBackgroundColor (void) const |
|
virtual void | setRenderFront (bool front) |
|
Point2I | getCursorExtent () |
|
|
virtual void | renderFrame (bool preRenderOnly, bool bufferSwap=true) |
|
virtual void | paint () |
| Repaints the entire canvas by calling resetUpdateRegions() and then renderFrame() More...
|
|
virtual void | addUpdateRegion (Point2I pos, Point2I ext) |
|
virtual void | resetUpdateRegions () |
|
void | maintainSizing () |
| Resizes the content control to match the canvas size. More...
|
|
virtual void | buildUpdateUnion (RectI *updateUnion) |
|
virtual void | swapBuffers () |
|
|
virtual void | setContentControl (GuiControl *gui) |
|
virtual GuiControl * | getContentControl () |
| Returns the content control. More...
|
|
virtual void | pushDialogControl (GuiControl *gui, S32 layer=0) |
|
virtual void | popDialogControl (S32 layer=0) |
|
virtual void | popDialogControl (GuiControl *gui) |
|
|
A cursor can be on, but not be shown. If a cursor is not on, than it does not process input.
|
virtual void | setCursor (GuiCursor *cursor) |
|
virtual bool | isCursorON () |
| Returns true if the cursor is on. More...
|
|
void | setDoubleClickTime (S32 time) |
| Sets the time allowed between clicks to be considered a double click. More...
|
|
void | setDoubleClickWidth (S32 width) |
| Sets the amount of movement allowed that won't cancel a double click. More...
|
|
void | setDoubleClickHeight (S32 height) |
|
virtual void | setCursorON (bool onOff) |
|
virtual void | setCursorPos (const Point2I &pt) |
|
virtual Point2I | getCursorPos () |
| Returns the point, in screenspace, at which the cursor is located. More...
|
|
virtual void | showCursor (bool state) |
|
virtual bool | isCursorShown () |
| Returns true if the cursor is being rendered. More...
|
|
|
virtual bool | processInputEvent (const InputEvent *event) |
|
virtual void | processMouseMoveEvent (const MouseMoveEvent *event) |
|
virtual void | processScreenTouchEvent (const ScreenTouchEvent *event) |
|
|
virtual void | mouseLock (GuiControl *lockingControl) |
|
virtual void | mouseUnlock (GuiControl *lockingControl) |
|
virtual GuiControl * | getMouseControl () |
| Returns the control which the mouse is over. More...
|
|
virtual GuiControl * | getMouseLockedControl () |
| Returns the control which the mouse is locked to if any. More...
|
|
virtual bool | mouseButtonDown (void) |
| Returns true if the left mouse button is down. More...
|
|
virtual bool | mouseRightButtonDown (void) |
| Returns true if the right mouse button is down. More...
|
|
virtual void | checkLockMouseMove (const GuiEvent &event) |
|
|
These events process the events before passing them down to the controls they effect. This allows for things such as the input locking and such.
Each of these methods corosponds to the action in it's method name and processes the GuiEvent passd as a parameter
|
virtual void | rootMouseUp (const GuiEvent &event) |
|
virtual void | rootMouseDown (const GuiEvent &event) |
|
virtual void | rootMouseMove (const GuiEvent &event) |
|
virtual void | rootMouseDragged (const GuiEvent &event) |
|
virtual void | rootScreenTouchUp (const GuiEvent &event) |
|
virtual void | rootScreenTouchDown (const GuiEvent &event) |
|
virtual void | rootScreenTouchMove (const GuiEvent &event) |
|
virtual void | rootRightMouseDown (const GuiEvent &event) |
|
virtual void | rootRightMouseUp (const GuiEvent &event) |
|
virtual void | rootRightMouseDragged (const GuiEvent &event) |
|
virtual void | rootMiddleMouseDown (const GuiEvent &event) |
|
virtual void | rootMiddleMouseUp (const GuiEvent &event) |
|
virtual void | rootMiddleMouseDragged (const GuiEvent &event) |
|
virtual void | rootMouseWheelUp (const GuiEvent &event) |
|
virtual void | rootMouseWheelDown (const GuiEvent &event) |
|
|
First responders
A first responder is a the GuiControl which responds first to input events before passing them off for further processing.
|
virtual bool | tabNext (void) |
| Moves the first responder to the next tabable controle. More...
|
|
virtual bool | tabPrev (void) |
| Moves the first responder to the previous tabable control. More...
|
|
virtual void | addAcceleratorKey (GuiControl *ctrl, U32 index, U32 keyCode, U32 modifier) |
|
virtual void | setFirstResponder (GuiControl *firstResponder) |
|
virtual void | getScrollLineSizes (U32 *rowHeight, U32 *columnWidth) |
|
virtual void | getCursor (GuiCursor *&cursor, bool &showCursor, const GuiEvent &lastGuiEvent) |
|
void | awaken () |
| Called when this control and its children have been wired up. More...
|
|
void | sleep () |
| Called when this control is no more. More...
|
|
void | preRender () |
| Prerender this control and all its children. More...
|
|
virtual bool | onInputEvent (const InputEvent &event) |
| General input handler. More...
|
|
virtual bool | ControlIsChild (GuiControl *child) |
|
void | setControlProfile (GuiControlProfile *prof) |
|
virtual void | onAction () |
| Occurs when this control performs its "action". More...
|
|
void | renderJustifiedText (Point2I offset, Point2I extent, const char *text) |
|
void | inspectPostApply () |
|
void | inspectPreApply () |
|
void | setSizing (S32 horz, S32 vert) |
|
void | write (Stream &stream, U32 tabStop, U32 flags) |
| Overrides Parent Serialization to allow specific controls to not be saved (Dynamic Controls, etc) More...
|
|
bool | getCanSave () |
| Returns boolean specifying if a control can be serialized. More...
|
|
void | setCanSave (bool bCanSave) |
| Set serialization flag. More...
|
|
bool | getCanSaveParent () |
| Returns boolean as to whether any parent of this control has the 'no serialization' flag set. More...
|
|
const Point2I & | getPosition () |
| Returns position of the control. More...
|
|
const Point2I & | getExtent () |
| Returns extents of the control. More...
|
|
const RectI & | getBounds () |
| Returns the bounds of the control. More...
|
|
const Point2I & | getMinExtent () |
| Returns minimum size the control can be. More...
|
|
const S32 | getLeft () |
| Returns the X position of the control. More...
|
|
const S32 | getTop () |
| Returns the Y position of the control. More...
|
|
const S32 | getWidth () |
| Returns the width of the control. More...
|
|
const S32 | getHeight () |
| Returns the height of the control. More...
|
|
virtual void | setVisible (bool value) |
|
bool | isVisible () |
| Returns true if the object is visible. More...
|
|
void | setActive (bool value) |
|
bool | isActive () |
| Returns true if this control is active. More...
|
|
bool | isAwake () |
| Returns true if this control is awake. More...
|
|
void | addObject (SimObject *obj) |
|
void | removeObject (SimObject *obj) |
|
GuiControl * | getParent () |
| Returns the control which owns this one. More...
|
|
GuiCanvas * | getRoot () |
|
Point2I | localToGlobalCoord (const Point2I &src) |
|
Point2I | globalToLocalCoord (const Point2I &src) |
|
virtual void | resize (const Point2I &newPosition, const Point2I &newExtent) |
|
virtual void | setPosition (const Point2I &newPosition) |
|
virtual void | setExtent (const Point2I &newExtent) |
|
virtual void | setBounds (const RectI &newBounds) |
|
virtual void | setLeft (S32 newLeft) |
|
virtual void | setTop (S32 newTop) |
|
virtual void | setWidth (S32 newWidth) |
|
virtual void | setHeight (S32 newHeight) |
|
virtual void | childResized (GuiControl *child) |
|
virtual void | parentResized (const Point2I &oldParentExtent, const Point2I &newParentExtent) |
|
virtual void | onRender (Point2I offset, const RectI &updateRect) |
|
virtual bool | renderTooltip (Point2I cursorPos, const char *tipText=NULL) |
|
void | renderChildControls (Point2I offset, const RectI &updateRect) |
|
void | setUpdateRegion (Point2I pos, Point2I ext) |
|
virtual void | setUpdate () |
| Sets the update area of the control to encompass the whole control. More...
|
|
virtual bool | onWake () |
| Called when this object is asked to wake up returns true if it's actually awake at the end. More...
|
|
virtual void | onSleep () |
| Called when this object is asked to sleep. More...
|
|
virtual void | onPreRender () |
| Do special pre-render proecessing. More...
|
|
virtual void | onRemove () |
| Called when this object is removed. More...
|
|
virtual void | onChildRemoved (GuiControl *child) |
| Called when one of this objects children is removed. More...
|
|
bool | onAdd () |
| Called when this object is added to the scene. More...
|
|
virtual void | onChildAdded (GuiControl *child) |
| Called when this object has a new child. More...
|
|
virtual bool | pointInControl (const Point2I &parentCoordPoint) |
|
bool | cursorInControl () |
| Returns true if the global cursor is inside this control. More...
|
|
virtual GuiControl * | findHitControl (const Point2I &pt, S32 initialLayer=-1) |
|
void | mouseLock (GuiControl *lockingControl) |
|
void | mouseLock () |
| Turn on mouse locking with last used lock control. More...
|
|
void | mouseUnlock () |
| Unlock the mouse. More...
|
|
bool | isMouseLocked () |
| Returns true if the mouse is locked. More...
|
|
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) |
|
virtual bool | onMouseDownEditor (const GuiEvent &event, Point2I offset) |
|
virtual bool | onMouseUpEditor (const GuiEvent &event, Point2I offset) |
|
virtual bool | onRightMouseDownEditor (const GuiEvent &event, Point2I offset) |
|
virtual bool | onMouseDraggedEditor (const GuiEvent &event, Point2I offset) |
|
virtual GuiControl * | findFirstTabable () |
| Find the first tab-accessable child of this control. More...
|
|
virtual GuiControl * | findLastTabable (bool firstCall=true) |
|
virtual GuiControl * | findPrevTabable (GuiControl *curResponder, bool firstCall=true) |
|
virtual GuiControl * | findNextTabable (GuiControl *curResponder, bool firstCall=true) |
|
virtual void | makeFirstResponder (bool value) |
|
bool | isFirstResponder () |
| Returns true if this control is a first responder. More...
|
|
virtual void | setFirstResponder () |
| Sets this object to be a first responder. More...
|
|
void | clearFirstResponder () |
| Clears the first responder for this chain. More...
|
|
GuiControl * | getFirstResponder () |
| Returns the first responder for this chain. More...
|
|
virtual void | onLoseFirstResponder () |
| Occurs when the first responder for this chain is lost. More...
|
|
void | addAcceleratorKey () |
| Adds the accelerator key for this object to the canvas. More...
|
|
virtual void | buildAcceleratorMap () |
|
virtual void | acceleratorKeyPress (U32 index) |
|
virtual void | acceleratorKeyRelease (U32 index) |
|
virtual bool | onKeyDown (const GuiEvent &event) |
|
virtual bool | onKeyUp (const GuiEvent &event) |
|
virtual bool | onKeyRepeat (const GuiEvent &event) |
|
void | messageSiblings (S32 message) |
| Send a message to all siblings. More...
|
|
virtual void | onMessage (GuiControl *sender, S32 msg) |
|
virtual void | onDialogPush () |
| Called if this object is a dialog, when it is added to the visible layers. More...
|
|
virtual void | onDialogPop () |
| Called if this object is a dialog, when it is removed from the visible layers. More...
|
|
void | setConsoleVariable (const char *variable) |
|
void | setConsoleCommand (const char *newCmd) |
|
const char * | getConsoleCommand () |
| Returns the name of the function bound to this GuiControl. More...
|
|
LangTable * | getGUILangTable (void) |
|
const UTF8 * | getGUIString (S32 id) |
|
virtual const char * | getScriptValue () |
| Returns the value of the variable bound to this object. More...
|
|
virtual void | setScriptValue (const char *value) |
| Sets the value of the variable bound to this object. More...
|
|
| DECLARE_CONOBJECT (GuiControl) |
|
| GuiControl () |
|
virtual | ~GuiControl () |
|
| ~SimGroup () |
|
void | addObject (SimObject *, SimObjectId) |
|
void | addObject (SimObject *, const char *name) |
|
virtual SimObject * | findObject (const char *name) |
| Find an object in the group. More...
|
|
bool | processArguments (S32 argc, const char **argv) |
| Process constructor options. (ie, new SimObject(1,2,3)) More...
|
|
| DECLARE_CONOBJECT (SimGroup) |
|
| SimSet () |
|
| ~SimSet () |
|
virtual void | onDeleteNotify (SimObject *object) |
|
virtual U32 | getTamlChildCount (void) const |
| Called when Taml attempts to compile a list of children. More...
|
|
virtual SimObject * | getTamlChild (const U32 childIndex) const |
| Called when Taml attempts to compile a list of children. More...
|
|
virtual void | addTamlChild (SimObject *pSimObject) |
| Called when Taml attempts to populate an objects children during a read. More...
|
|
void | callOnChildren (const char *method, S32 argc, const char *argv[], bool executeOnChildGroups=true) |
|
SimObject * | findObjectByInternalName (const char *internalName, bool searchChildren=false) |
|
virtual bool | writeObject (Stream *stream) |
|
virtual bool | readObject (Stream *stream) |
|
void | lock () |
|
void | unlock () |
|
| DECLARE_CONOBJECT (SimSet) |
|
void | _setVectorAssoc (const char *file, const U32 line) |
|
virtual void | pushObject (SimObject *) |
|
virtual void | popObject () |
| Remove an object from the end of the list. More...
|
|
void | bringObjectToFront (SimObject *obj) |
|
void | pushObjectToBack (SimObject *obj) |
|
SimObject * | front () |
|
SimObject * | first () |
|
SimObject * | last () |
|
bool | empty () |
|
S32 | size () const |
|
iterator | begin () |
|
iterator | end () |
|
value | operator[] (S32 index) |
|
iterator | find (iterator first, iterator last, SimObject *obj) |
|
iterator | find (SimObject *obj) |
|
template<typename T > |
bool | containsType (void) |
|
virtual bool | reOrder (SimObject *obj, SimObject *target=0) |
|
SimObject * | at (S32 index) const |
|
void | deleteObjects (void) |
|
void | clear () |
|
StringTableEntry | getClassNamespace () const |
|
StringTableEntry | getSuperClassNamespace () const |
|
void | setClassNamespace (const char *classNamespace) |
|
void | setSuperClassNamespace (const char *superClassNamespace) |
|
void | pushScriptCallbackGuard (void) |
|
void | popScriptCallbackGuard (void) |
|
S32 | getScriptCallbackGuard (void) |
|
Namespace * | getNamespace () |
| Return the object's namespace. More...
|
|
const char * | tabComplete (const char *prevText, S32 baseLen, bool) |
|
virtual void | dump () |
|
virtual void | dumpClassHierarchy () |
|
SimObject * | clone (const bool copyDynamicFields) |
|
virtual void | copyTo (SimObject *object) |
|
template<typename T > |
bool | isType (void) |
|
virtual bool | handlesConsoleMethod (const char *fname, S32 *routingId) |
|
| DECLARE_CONOBJECT (SimObject) |
|
Notify * | removeNotify (void *ptr, Notify::Type) |
| Remove a notification from the list. More...
|
|
void | deleteNotify (SimObject *obj) |
| Notify an object when we are deleted. More...
|
|
void | clearNotify (SimObject *obj) |
| Notify an object when we are cleared. More...
|
|
void | clearAllNotifications () |
| Remove all notifications for this object. More...
|
|
void | processDeleteNotifies () |
| Send out deletion notifications. More...
|
|
void | registerReference (SimObject **obj) |
|
void | unregisterReference (SimObject **obj) |
|
const char * | getDataField (StringTableEntry slotName, const char *array) |
|
void | setDataField (StringTableEntry slotName, const char *array, const char *value) |
|
const char * | getPrefixedDataField (StringTableEntry fieldName, const char *array) |
|
void | setPrefixedDataField (StringTableEntry fieldName, const char *array, const char *value) |
|
const char * | getPrefixedDynamicDataField (StringTableEntry fieldName, const char *array, const S32 fieldType=-1) |
|
void | setPrefixedDynamicDataField (StringTableEntry fieldName, const char *array, const char *value, const S32 fieldType=-1) |
|
StringTableEntry | getDataFieldPrefix (StringTableEntry fieldName) |
|
U32 | getDataFieldType (StringTableEntry slotName, const char *array) |
|
SimFieldDictionary * | getFieldDictionary () |
|
void | clearDynamicFields (void) |
| Clear all dynamic fields. More...
|
|
void | setCanSaveDynamicFields (bool bCanSave) |
| Set whether fields created at runtime should be saved. Default is true. More...
|
|
bool | getCanSaveDynamicFields (void) const |
| Get whether fields created at runtime should be saved. Default is true. More...
|
|
void | setInternalName (const char *newname) |
|
StringTableEntry | getInternalName () |
| Get the internal of of this control. More...
|
|
virtual bool | save (const char *pcFilePath, bool bOnlySelected=false) |
| Save object as a TorqueScript File. More...
|
|
virtual bool | isMethod (const char *methodName) |
| Check if a method exists in the objects current namespace. More...
|
|
SimObjectId | getId (void) const |
|
StringTableEntry | getIdString (void) const |
|
U32 | getType () const |
|
const StringTableEntry | getName (void) const |
|
void | setId (SimObjectId id) |
|
void | assignName (const char *name) |
|
SimGroup * | getGroup () const |
|
bool | isChildOfGroup (SimGroup *pGroup) |
|
bool | isProperlyAdded () const |
|
bool | isDeleted () const |
|
bool | isRemoved () const |
|
bool | isLocked () |
|
void | setLocked (bool b) |
|
bool | isHidden () |
|
void | setHidden (bool b) |
|
void | setProgenitorFile (const char *pFile) |
|
StringTableEntry | getProgenitorFile (void) const |
|
void | setPeriodicTimerID (const S32 timerID) |
|
S32 | getPeriodicTimerID (void) const |
|
bool | isPeriodicTimerActive (void) const |
|
bool | isSelected () const |
|
bool | isExpanded () const |
|
void | setSelected (bool sel) |
|
void | setExpanded (bool exp) |
|
void | setModDynamicFields (bool dyn) |
|
void | setModStaticFields (bool sta) |
|
| SimObject (const U8 namespaceLinkMask=LinkSuperClassName|LinkClassName) |
|
virtual | ~SimObject () |
|
virtual void | onGroupAdd () |
| Called when the object is added to a SimGroup. More...
|
|
virtual void | onGroupRemove () |
| Called when the object is removed from a SimGroup. More...
|
|
virtual void | onNameChange (const char *name) |
| Called when the object's name is changed. More...
|
|
virtual void | onStaticModified (const char *slotName, const char *newValue=NULL) |
|
virtual void | onEditorEnable () |
| Called when the editor is activated. More...
|
|
virtual void | onEditorDisable () |
| Called when the editor is deactivated. More...
|
|
bool | registerObject () |
|
bool | registerObject (U32 id) |
|
bool | registerObject (const char *name) |
|
bool | registerObject (const char *name, U32 id) |
|
void | unregisterObject () |
|
void | deleteObject () |
|
bool | addToSet (SimObjectId) |
|
bool | addToSet (const char *) |
|
bool | removeFromSet (SimObjectId) |
|
bool | removeFromSet (const char *) |
|
virtual bool | writeField (StringTableEntry fieldname, const char *value) |
|
virtual void | writeFields (Stream &stream, U32 tabStop) |
|
virtual void | buildFilterList () |
|
void | addFieldFilter (const char *fieldName) |
|
void | removeFieldFilter (const char *fieldName) |
|
void | clearFieldFilters () |
|
bool | isFiltered (const char *fieldName) |
|
void | assignFieldsFrom (SimObject *obj) |
|
void | assignDynamicFieldsFrom (SimObject *obj) |
|
const AbstractClassRep::Field * | findField (StringTableEntry fieldName) const |
| Get a reference to a field by name. More...
|
|
virtual AbstractClassRep * | getClassRep () const |
| Gets the ClassRep. More...
|
|
bool | setField (const char *fieldName, const char *value) |
| Set the value of a field. More...
|
|
virtual | ~ConsoleObject () |
|
const AbstractClassRep::FieldList & | getFieldList () const |
| Get a list of all the fields. This information cannot be modified. More...
|
|
AbstractClassRep::FieldList & | getModifiableFieldList () |
|
bool & | getDynamicGroupExpand () |
|
S32 | getClassId (U32 netClassGroup) const |
|
const char * | getClassName () const |
|
A canvas on which rendering occurs.
What a GUICanvas Can Contain...
Content Control
A content control is the top level GuiControl for a screen. This GuiControl will be the parent control for all other GuiControls on that particular screen.
Dialogs
A dialog is essentially another screen, only it gets overlaid on top of the current content control, and all input goes to the dialog. This is most akin to the "Open File" dialog box found in most operating systems. When you choose to open a file, and the "Open File" dialog pops up, you can no longer send input to the application, and must complete or cancel the open file request. Torque keeps track of layers of dialogs. The dialog with the highest layer is on top and will get all the input, unless the dialog is modeless, which is a profile option.
- See Also
- GuiControlProfile
Dirty Rectangles
The GuiCanvas is based on dirty regions.
Every frame the canvas paints only the areas of the canvas that are 'dirty' or need updating. In most cases, this only is the area under the mouse cursor. This is why if you look in guiCanvas.cc the call to glClear is commented out. If you want a really good idea of what exactly dirty regions are and how they work, un-comment that glClear line in the renderFrame method of guiCanvas.cc
What you will see is a black screen, except in the dirty regions, where the screen will be painted normally. If you are making an animated GuiControl you need to add your control to the dirty areas of the canvas.