Torque2D Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
GuiControlProfile Class Reference

`#include <guiTypes.h>`

Inheritance diagram for GuiControlProfile:

## Public Types
enum | { BaseColor = 0, ColorHL, ColorNA, ColorSEL, ColorUser0, ColorUser1, ColorUser2, ColorUser3, ColorUser4, ColorUser5 }
enum | AlignmentType { LeftJustify, RightJustify, CenterJustify }
Public Types inherited from SimObject
enum | WriteFlags { SelectedOnly = BIT(0) }

## Public Member Functions
| DECLARE_CONOBJECT (GuiControlProfile)
| GuiControlProfile ()
| ~GuiControlProfile ()
bool | onAdd ()
| Called when the object is added to the sim. More...
S32 | constructBitmapArray ()
void | incRefCount ()
void | decRefCount ()
Public Member Functions inherited from SimObject
StringTableEntry | getClassNamespace () const
StringTableEntry | getSuperClassNamespace () const
void | setClassNamespace (const char *classNamespace)
void | setSuperClassNamespace (const char *superClassNamespace)
void | pushScriptCallbackGuard (void)
void | popScriptCallbackGuard (void)
S32 | getScriptCallbackGuard (void)
virtual SimObject * | findObject (const char *name)
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 ()
virtual | ~SimObject ()
virtual bool | processArguments (S32 argc, const char **argv)
| Process constructor options. (ie, new SimObject(1,2,3)) More...
virtual void | onRemove ()
| Called when the object is removed from the sim. More...
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 | inspectPreApply ()
virtual void | inspectPostApply ()
virtual void | onDeleteNotify (SimObject *object)
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 | write (Stream &stream, U32 tabStop, U32 flags=0)
virtual void | writeFields (Stream &stream, U32 tabStop)
virtual bool | writeObject (Stream *stream)
virtual bool | readObject (Stream *stream)
virtual void | buildFilterList ()
void | addFieldFilter (const char *fieldName)
void | removeFieldFilter (const char *fieldName)
void | clearFieldFilters ()
bool | isFiltered (const char *fieldName)
void | assignFieldsFrom (SimObject *obj)
void | assignDynamicFieldsFrom (SimObject *obj)
Public Member Functions inherited from ConsoleObject
const AbstractClassRep::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

## Static Public Member Functions
static void | initPersistFields ()
Static Public Member Functions inherited from SimObject
static void | initPersistFields ()
Static Public Member Functions inherited from ConsoleObject
static const char * | lookupClassName (const U32 in_classTag)
| Get the classname from a class tag. More...
static void | initPersistFields ()
static void | consoleInit ()
static ConsoleObject * | create (const char *in_pClassName)
static ConsoleObject * | create (const U32 groupId, const U32 typeId, const U32 in_classId)
static AbstractClassRep * | getStaticClassRep ()
| Get the abstract class information for this class. More...
static AbstractClassRep * | getParentStaticClassRep ()
| Get the abstract class information for this class's superclass. More...

## Public Attributes
S32 | mRefCount
| Used to determine if any controls are using this profile. More...
bool | mTabable
| True if this object is accessable from using the tab key. More...
bool | mCanKeyFocus
| True if the object can be given keyboard focus (in other words, made a first responder. More...
bool | mModal
| True if this is a Modeless dialog meaning it will pass input through instead of taking it all. More...
bool | mOpaque
| True if this object is not translucent. More...
ColorI | mFillColor
| Fill color, this is used to fill the bounds of the control if it is opaque. More...
ColorI | mFillColorHL
| This is used insetead of mFillColor if the object is highlited. More...
ColorI | mFillColorNA
| This is used to instead of mFillColor if the object is not active or disabled. More...
S32 | mBorder
| For most controls, if mBorder is > 0 a border will be drawn, some controls use this to draw different types of borders however. More...
S32 | mBorderThickness
| Border thickness. More...
ColorI | mBorderColor
| Border color, used to draw a border around the bounds if border is enabled. More...
ColorI | mBorderColorHL
| Used instead of mBorderColor when the object is highlited. More...
ColorI | mBorderColorNA
| Used instead of mBorderColor when the object is not active or disabled. More...
ColorI | mBevelColorHL
| Used for the high-light part of the bevel. More...
ColorI | mBevelColorLL
| Used for the low-light part of the bevel. More...
StringTableEntry | mFontType
| Font face name for the control. More...
S32 | mFontSize
| Font size for the control. More...
ColorI | mFontColors [10]
| Array of font colors used for drawText with escape characters for changing color mid-string. More...
ColorI & | mFontColor
| Main font color. More...
ColorI & | mFontColorHL
| Highlited font color. More...
ColorI & | mFontColorNA
| Font color when object is not active/disabled. More...
ColorI & | mFontColorSEL
| Font color when object/text is selected. More...
FontCharset | mFontCharset
| Font character set. More...
Resource< GFont > | mFont
| Font resource. More...
AlignmentType | mAlignment
| Horizontal text alignment. More...
bool | mAutoSizeWidth
| Auto-size the width-bounds of the control to fit it's contents. More...
bool | mAutoSizeHeight
| Auto-size the height-bounds of the control to fit it's contents. More...
bool | mReturnTab
| Used in GuiTextEditCtrl to specify if a tab-event should be simulated when return is pressed. More...
bool | mNumbersOnly
| For text controls, true if this should only accept numerical data. More...
bool | mMouseOverSelected
| True if this object should be "selected" while the mouse is over it. More...
ColorI | mCursorColor
| Color for the blinking cursor in text fields (for example) More...
Point2I | mTextOffset
| Text offset for the control. More...
StringTableEntry | mBitmapName
| Bitmap file name for the bitmap of the control. More...
TextureHandle | mTextureHandle
| Texture handle for the control. More...
Vector< RectI > | mBitmapArrayRects
| Used for controls which use an array of bitmaps such as checkboxes. More...
AssetPtr< AudioAsset > | mSoundButtonDown
| Sound played when the object is "down" ie a button is pushed. More...
AssetPtr< AudioAsset > | mSoundButtonOver
| Sound played when the mouse is over the object. More...
GuiControlProfile * | mProfileForChildren
| Profile used with children controls (such as the scroll bar on a popup menu) when defined. More...

## Static Public Attributes
static StringTableEntry | sFontCacheDirectory = ""

## Additional Inherited Members
Protected Member Functions inherited from SimObject
virtual void | onTamlPreWrite (void)
| Taml callbacks. More...
virtual void | onTamlPostWrite (void)
| Called after Taml has finished writing the object. More...
virtual void | onTamlPreRead (void)
| Called prior to Taml reading the object. More...
virtual void | onTamlPostRead (const TamlCustomNodes &customNodes)
virtual void | onTamlAddParent (SimObject *pParentObject)
| Called after Taml has finished reading the object and has added the object to any parent. More...
virtual void | onTamlCustomWrite (TamlCustomNodes &customNodes)
| Called during the writing of the object to allow custom properties to be written. More...
virtual void | onTamlCustomRead (const TamlCustomNodes &customNodes)
| Called during the reading of the object to allow custom properties to be read. More...
void | linkNamespaces ()
void | unlinkNamespaces ()
Protected Member Functions inherited from ConsoleObject
| ConsoleObject ()
| ConsoleObject (const ConsoleObject &)
Static Protected Member Functions inherited from SimObject
static bool | setClass (void *obj, const char *data)
static bool | setSuperClass (void *obj, const char *data)
static bool | writeCanSaveDynamicFields (void *obj, StringTableEntry pFieldName)
static bool | writeInternalName (void *obj, StringTableEntry pFieldName)
static bool | setParentGroup (void *obj, const char *data)
static bool | writeParentGroup (void *obj, StringTableEntry pFieldName)
static bool | writeSuperclass (void *obj, StringTableEntry pFieldName)
static bool | writeClass (void *obj, StringTableEntry pFieldName)
static SimObject::Notify * | allocNotify ()
| Get a free Notify structure. More...
static void | freeNotify (SimObject::Notify *)
| Mark a Notify structure as free. More...
Static Protected Member Functions inherited from ConsoleObject
static void | addGroup (const char *in_pGroupname, const char *in_pGroupDocs=NULL)
static void | endGroup (const char *in_pGroupname)
static void | addField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, const U32 in_elementCount=1, EnumTable *in_table=NULL, const char *in_pFieldDocs=NULL)
static void | addField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, AbstractClassRep::WriteDataNotify in_writeDataFn, const U32 in_elementCount=1, EnumTable *in_table=NULL, const char *in_pFieldDocs=NULL)
static void | addField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, const char *in_pFieldDocs)
static void | addField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, AbstractClassRep::WriteDataNotify in_writeDataFn, const char *in_pFieldDocs)
static void | addFieldV (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, ConsoleTypeValidator *v, const char *in_pFieldDocs=NULL)
static void | addProtectedField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, AbstractClassRep::SetDataNotify in_setDataFn, AbstractClassRep::GetDataNotify in_getDataFn=&defaultProtectedGetFn, const U32 in_elementCount=1, EnumTable *in_table=NULL, const char *in_pFieldDocs=NULL)
static void | addProtectedField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, AbstractClassRep::SetDataNotify in_setDataFn, AbstractClassRep::GetDataNotify in_getDataFn=&defaultProtectedGetFn, AbstractClassRep::WriteDataNotify in_writeDataFn=&defaultProtectedWriteFn, const U32 in_elementCount=1, EnumTable *in_table=NULL, const char *in_pFieldDocs=NULL)
static void | addProtectedField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, AbstractClassRep::SetDataNotify in_setDataFn, AbstractClassRep::GetDataNotify in_getDataFn=&defaultProtectedGetFn, const char *in_pFieldDocs=NULL)
static void | addProtectedField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, AbstractClassRep::SetDataNotify in_setDataFn, AbstractClassRep::GetDataNotify in_getDataFn=&defaultProtectedGetFn, AbstractClassRep::WriteDataNotify in_writeDataFn=&defaultProtectedWriteFn, const char *in_pFieldDocs=NULL)
static void | addDepricatedField (const char *fieldName)
static bool | removeField (const char *in_pFieldname)
Protected Attributes inherited from SimObject
SimObjectId | mId
| Id number for this object. More...
StringTableEntry | mIdString
Namespace * | mNameSpace
U32 | mTypeMask
S32 | mScriptCallbackGuard
| Whether the object is executing a script callback. More...
bool | mCanSaveFieldDictionary
| true if dynamic fields (added at runtime) should be saved, defaults to true More...
StringTableEntry | mInternalName
| Stores object Internal Name. More...
StringTableEntry | mClassName
| Stores the class name to link script class namespaces. More...
StringTableEntry | mSuperClassName
| Stores super class name to link script class namespaces. More...
Static Protected Attributes inherited from SimObject
static SimObject::Notify * | mNotifyFreeList = NULL

## Detailed Description

A GuiControlProfile is used by every GuiObject and is akin to a datablock. It is used to control information that does not change or is unlikely to change during execution of a program. It is also a level of abstraction between script and GUI control so that you can use the same control, say a button, and have it look completly different just with a different profile.

## Member Enumeration Documentation

anonymous enum

Enumerator
BaseColor |
ColorHL |
ColorNA |
ColorSEL |
ColorUser0 |
ColorUser1 |
ColorUser2 |
ColorUser3 |
ColorUser4 |
ColorUser5 |

enum AlignmentType

Enumerator
LeftJustify |
RightJustify |
CenterJustify |

## Constructor & Destructor Documentation

GuiControlProfile | ( | void |  | ) |

~GuiControlProfile | ( |  | ) |

## Member Function Documentation

S32 constructBitmapArray | ( |  | ) |

This method creates an array of bitmaps from one single bitmap with seperator color. The seperator color is whatever color is in pixel 0,0 of the bitmap. For an example see darkWindow.png and some of the other UI textures. It returns the number of bitmaps in the array it created It also stores the sizes in the mBitmapArrayRects vector.

DECLARE_CONOBJECT | ( | GuiControlProfile |  | ) |

void decRefCount | ( |  | ) |

void incRefCount | ( |  | ) |

void initPersistFields | ( | void |  | ) |
| static

bool onAdd | ( | void |  | ) |
| virtual

Called when the object is added to the sim.

Reimplemented from SimObject.

## Member Data Documentation

AlignmentType mAlignment

Horizontal text alignment.

bool mAutoSizeHeight

Auto-size the height-bounds of the control to fit it's contents.

bool mAutoSizeWidth

Auto-size the width-bounds of the control to fit it's contents.

ColorI mBevelColorHL

Used for the high-light part of the bevel.

ColorI mBevelColorLL

Used for the low-light part of the bevel.

Vector<RectI> mBitmapArrayRects

Used for controls which use an array of bitmaps such as checkboxes.

StringTableEntry mBitmapName

Bitmap file name for the bitmap of the control.

S32 mBorder

For most controls, if mBorder is > 0 a border will be drawn, some controls use this to draw different types of borders however.

See also
  guiDefaultControlRender.cc

ColorI mBorderColor

Border color, used to draw a border around the bounds if border is enabled.

ColorI mBorderColorHL

Used instead of mBorderColor when the object is highlited.

ColorI mBorderColorNA

Used instead of mBorderColor when the object is not active or disabled.

S32 mBorderThickness

Border thickness.

bool mCanKeyFocus

True if the object can be given keyboard focus (in other words, made a first responder.

See also
  GuiControl)

ColorI mCursorColor

Color for the blinking cursor in text fields (for example)

ColorI mFillColor

Fill color, this is used to fill the bounds of the control if it is opaque.

ColorI mFillColorHL

This is used insetead of mFillColor if the object is highlited.

ColorI mFillColorNA

This is used to instead of mFillColor if the object is not active or disabled.

Resource<GFont> mFont

Font resource.

FontCharset mFontCharset

Font character set.

ColorI& mFontColor

Main font color.

ColorI& mFontColorHL

Highlited font color.

ColorI& mFontColorNA

Font color when object is not active/disabled.

ColorI mFontColors[10]

Array of font colors used for drawText with escape characters for changing color mid-string.

ColorI& mFontColorSEL

Font color when object/text is selected.

S32 mFontSize

Font size for the control.

StringTableEntry mFontType

Font face name for the control.

bool mModal

True if this is a Modeless dialog meaning it will pass input through instead of taking it all.

bool mMouseOverSelected

True if this object should be "selected" while the mouse is over it.

bool mNumbersOnly

For text controls, true if this should only accept numerical data.

bool mOpaque

True if this object is not translucent.

GuiControlProfile* mProfileForChildren

Profile used with children controls (such as the scroll bar on a popup menu) when defined.

S32 mRefCount

Used to determine if any controls are using this profile.

bool mReturnTab

Used in GuiTextEditCtrl to specify if a tab-event should be simulated when return is pressed.

AssetPtr<AudioAsset> mSoundButtonDown

Sound played when the object is "down" ie a button is pushed.

AssetPtr<AudioAsset> mSoundButtonOver

Sound played when the mouse is over the object.

bool mTabable

True if this object is accessable from using the tab key.

Point2I mTextOffset

Text offset for the control.

TextureHandle mTextureHandle

Texture handle for the control.

StringTableEntry sFontCacheDirectory = ""
| static

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

- gui/guiTypes.h
- gui/guiTypes.cc