GuiControlProfile Class Reference

#include <guiTypes.h>

Inheritance diagram for GuiControlProfile:

Inheritance graph
[legend]
List of all members.

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.


Public Types

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

Public Member Functions

GuiControlProfilegetChildrenProfile ()
 Returns our children profile (and finds the profile if it hasn't been set yet).
void setChildrenProfile (GuiControlProfile *prof)
 Sets the children profile for this profile.
 DECLARE_CONOBJECT (GuiControlProfile)
 GuiControlProfile ()
 ~GuiControlProfile ()
bool onAdd ()
 Called when the object is added to the sim.
virtual void onDeleteNotify (SimObject *object)
 Called when mProfileForChildren is deleted.
S32 constructBitmapArray ()
 This method creates an array of bitmaps from one single bitmap with seperator color.
RectI getBitmapArrayRect (U32 i)
 This method returns the ith bitmap array rect, first ensuring that i is a valid index into mBitmapArrayRects.
void incRefCount ()
void decRefCount ()

Static Public Member Functions

static void initPersistFields ()
 Register dynamic fields in a subclass of ConsoleObject.

Public Attributes

S32 mRefCount
 Used to determine if any controls are using this profile.
bool mTabable
 True if this object is accessable from using the tab key.
bool mCanKeyFocus
 True if the object can be given keyboard focus (in other words, made a first responder.
bool mModal
 True if this is a Modeless dialog meaning it will pass input through instead of taking it all.
bool mOpaque
 True if this object is not translucent, and should draw a fill.
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.
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.
S32 mBorderThickness
 Border thickness.
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.
ColorI mBevelColorHL
 Used for the high-light part of the bevel.
ColorI mBevelColorLL
 Used for the low-light part of the bevel.
StringTableEntry mFontType
 Font face name for the control.
S32 mFontSize
 Font size for the control.
ColorI mFontColors [10]
 Array of font colors used for drawText with escape characters for changing color mid-string.
ColorImFontColor
 Main font color.
ColorImFontColorHL
 Highlited font color.
ColorImFontColorNA
 Font color when object is not active/disabled.
ColorImFontColorSEL
 Font color when object/text is selected.
FontCharset mFontCharset
 Font character set.
Resource< GFontmFont
 Font resource.
AlignmentType mAlignment
 Horizontal text alignment.
bool mAutoSizeWidth
 Auto-size the width-bounds of the control to fit it's contents.
bool mAutoSizeHeight
 Auto-size the height-bounds of the control to fit it's contents.
bool mReturnTab
 Used in GuiTextEditCtrl to specify if a tab-event should be simulated when return is pressed.
bool mNumbersOnly
 For text controls, true if this should only accept numerical data.
bool mMouseOverSelected
 True if this object should be "selected" while the mouse is over it.
ColorI mCursorColor
 Color for the blinking cursor in text fields (for example).
Point2I mTextOffset
 Text offset for the control.
StringTableEntry mBitmapName
 Bitmap file name for the bitmap of the control.
bool mUseBitmapArray
 Flag to use the bitmap array or to fallback to non-array rendering.
GFXTexHandle mTextureObject
Vector< RectImBitmapArrayRects
 Used for controls which use an array of bitmaps such as checkboxes.
SFXProfilemSoundButtonDown
 Sound played when the object is "down" ie a button is pushed.
SFXProfilemSoundButtonOver
 Sound played when the mouse is over the object.
StringTableEntry mChildrenProfileName
 The name of the profile to use for the children controls.

Static Public Attributes

static StringTableEntry sFontCacheDirectory
 Directory where Torque will store font *.uft files.

Protected Attributes

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

Private Types

typedef SimObject Parent


Member Typedef Documentation

Reimplemented from SimObject.

Reimplemented in GuiGameListMenuProfile, and GuiGameListOptionsProfile.


Member Enumeration Documentation

anonymous enum

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

Enumerator:
LeftJustify 
RightJustify 
CenterJustify 


Constructor & Destructor Documentation

GuiControlProfile::GuiControlProfile (  ) 

GuiControlProfile::~GuiControlProfile (  ) 


Member Function Documentation

GuiControlProfile* GuiControlProfile::getChildrenProfile (  ) 

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

void GuiControlProfile::setChildrenProfile ( GuiControlProfile prof  ) 

Sets the children profile for this profile.

See also:
GuiControlProfile
Parameters:
prof Tooltip profile to apply

GuiControlProfile::DECLARE_CONOBJECT ( GuiControlProfile   ) 

static void GuiControlProfile::initPersistFields (  )  [static]

Register dynamic fields in a subclass of ConsoleObject.

See also:
addField(), addFieldV(), addDeprecatedField(), addGroup(), endGroup()

Reimplemented from SimObject.

Reimplemented in GuiGameListMenuProfile, and GuiGameListOptionsProfile.

bool GuiControlProfile::onAdd (  )  [virtual]

Called when the object is added to the sim.

Reimplemented from SimObject.

Reimplemented in GuiGameListMenuProfile.

virtual void GuiControlProfile::onDeleteNotify ( SimObject object  )  [virtual]

Called when mProfileForChildren is deleted.

Reimplemented from SimObject.

S32 GuiControlProfile::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.

RectI GuiControlProfile::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 emtpy, we call constructBitmapArray() automatically. If it is still empty, we return a zeroed RectI.

void GuiControlProfile::incRefCount (  ) 

void GuiControlProfile::decRefCount (  ) 


Member Data Documentation

Directory where Torque will store font *.uft files.

Used to determine if any controls are using this profile.

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

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

See also:
GuiControl)

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

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

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

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

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

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

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

Used instead of mBorderColor when the object is highlited.

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

Used for the high-light part of the bevel.

Used for the low-light part of the bevel.

Font face name for the control.

Font size for the control.

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

Highlited font color.

Font color when object is not active/disabled.

Font color when object/text is selected.

Horizontal text alignment.

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

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

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

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

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

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

Text offset for the control.

Bitmap file name for the bitmap of the control.

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

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

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

Sound played when the mouse is over the object.

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

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