Torque3D Documentation / _generateds / GuiControlProfile

GuiControlProfile

Engine/source/gui/core/guiTypes.h

A GuiControlProfile is used by every GuiObject and is akin to a datablock.

More...

Public Types

enum
_Anonymous_ {
  BaseColor = 0
  ColorHL 
  ColorNA 
  ColorSEL 
  ColorUser0 
  ColorUser1 
  ColorUser2 
  ColorUser3 
  ColorUser4 
  ColorUser5 
}
enum
AlignmentType {
  LeftJustify 
  RightJustify 
  CenterJustify 
  TopJustify 
  BottomJustify 
}

Private Types

Parent 

Public Static Attributes

Directory where Torque will store font *.uft files.

Public Attributes

Horizontal text alignment.

bool

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

bool

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

Used for the high-light part of the bevel.

Used for the low-light part of the bevel.

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

Bitmap file name for the bitmap of the control.

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

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

Used instead of mBorderColor when the object is highlighted.

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

Border thickness.

bool

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

Category name for editing in the Gui Editor.

The name of the profile to use for the children controls.

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

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

This is used instead of mFillColor if the object has an error or is invalid.

This is used instead of mFillColor if the object is highlighted.

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

This is used instead of mFillColor if the object is selected.

Font resource.

Font character set.

Main font color.

Highlighted font color.

Font color when object is not active/disabled.

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

Font color when object/text is selected.

Font size for the control.

Font face name for the control.

Number of controls in woken state using this profile; resources for the profile are loaded when this is >0.

bool

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

bool

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

bool

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

bool

True if this object is not translucent, and should draw a fill.

bool

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

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

Sound played when the mouse is over the object.

bool

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

Text offset for the control.

bool

Flag to use the bitmap array or to fallback to non-array rendering.

Total number of controls currently referencing this profile.

Protected Attributes

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

Public Functions

This method creates an array of bitmaps from one single bitmap with separator color.

This method returns the ith bitmap array rect, first ensuring that i is a valid index into mBitmapArrayRects.

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

bool
bool
bool

Called when the object is added to the sim.

Called when mProfileForChildren is deleted.

onStaticModified(const char * slotName, const char * newValue)

Specifically, these are called by setDataField when a static or dynamic field is modified, see the console details.

Sets the children profile for this profile.

Protected Static Functions

const char *
protectedGetSoundButtonDown(void * object, const char * data)
const char *
protectedGetSoundButtonOver(void * object, const char * data)
bool
protectedSetBitmap(void * object, const char * index, const char * data)
bool
protectedSetSoundButtonDown(void * object, const char * index, const char * data)
bool
protectedSetSoundButtonOver(void * object, const char * index, const char * data)

Public Static Functions

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 completely different just with a different profile.

Public Types

@102

Enumerator

BaseColor = 0
ColorHL
ColorNA
ColorSEL
ColorUser0
ColorUser1
ColorUser2
ColorUser3
ColorUser4
ColorUser5
AlignmentType

Enumerator

LeftJustify
RightJustify
CenterJustify
TopJustify
BottomJustify

Private Types

typedef SimObject Parent 

Public Static Attributes

StringTableEntry sFontCacheDirectory 

Directory where Torque will store font *.uft files.

Public Attributes

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:

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

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.

String mCategory 

Category name for editing in the Gui Editor.

StringTableEntry mChildrenProfileName 

The name of the profile to use for the children controls.

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 mFillColorERR 

This is used instead of mFillColor if the object has an error or is invalid.

ColorI mFillColorHL 

This is used instead of mFillColor if the object is highlighted.

ColorI mFillColorNA 

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

ColorI mFillColorSEL 

This is used instead of mFillColor if the object is selected.

Resource< GFont > mFont 

Font resource.

FontCharset mFontCharset 

Font character set.

ColorI & mFontColor 

Main font color.

ColorI & mFontColorHL 

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

U32 mLoadCount 

Number of controls in woken state using this profile; resources for the profile are loaded when this is >0.

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, and should draw a fill.

bool mReturnTab 

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

SimObjectPtr< SFXTrack > mSoundButtonDown 

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

SimObjectPtr< SFXTrack > mSoundButtonOver 

Sound played when the mouse is over the object.

bool mTabable 

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

Point2I mTextOffset 

Text offset for the control.

GFXTexHandle mTextureObject 
bool mUseBitmapArray 

Flag to use the bitmap array or to fallback to non-array rendering.

U32 mUseCount 

Total number of controls currently referencing this profile.

Protected Attributes

GuiControlProfile * mChildrenProfile 

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

Public Functions

GuiControlProfile()

~GuiControlProfile()

constructBitmapArray()

This method creates an array of bitmaps from one single bitmap with separator color.

The separator 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 )

decLoadCount()

decUseCount()

getBitmapArrayRect(U32 i)

This method returns the ith bitmap array rect, first ensuring that i is a valid index into mBitmapArrayRects.

If the vector is empty, we call constructBitmapArray() automatically. If it is still empty, we return a zeroed RectI.

getChildrenProfile()

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

incLoadCount()

incUseCount()

isInUse()

loadFont()

onAdd()

Reimplemented from: SimObject

onDeleteNotify(SimObject * object)

Reimplemented from: SimObject

onStaticModified(const char * slotName, const char * newValue)

Reimplemented from: SimObject

setBitmapHandle(GFXTexHandle handle)

setChildrenProfile(GuiControlProfile * prof)

Sets the children profile for this profile.

Parameters:
prof

Tooltip profile to apply

Protected Static Functions

protectedGetSoundButtonDown(void * object, const char * data)

protectedGetSoundButtonOver(void * object, const char * data)

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

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

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

Public Static Functions

initPersistFields()