Overview   Project   Class   Tree   Deprecated   Index 
0 A.D.
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

gui
Class GUI

CInternalCGUIAccessorBase
   |
   +--GUI

   in GUIutil.h
   in GUIutil.cpp

class GUI
extends CInternalCGUIAccessorBase

Includes static functions that needs one template argument. int is only to please functions that doesn't even use T and are only within this class because it's convenient


Inner Classes, Typedefs, and Enums
typedef GUI::arg
          
typedef GUI::void_Object_pFunction
          
 
Field Summary
 static template PS_RESULT PS_RESULT GetSettingPointer
          
 static PS_RESULT SetSetting( CGUI& GUIinstance, const CStr& Object, const CStr& Setting, const T& Value, const bool& SkipMessage = false )
          Sets a value by setting and object name using a real datatype as input This is just a wrapper so that we can type the object name and not input the actual pointer.
 
Method Summary
private static bool CheckIfRestricted( int RR, IGUIObject* pObject )
          Checks restrictions for the iteration, for instance if you tell the recursor to avoid all hidden objects, it will, and this function checks a certain object's restriction values.
 static CColor FallBackColor( const CColor& prim, const CColor& sec )
          Same principle as FallBackSprite
 static CGUISpriteInstance& FallBackSprite( CGUISpriteInstance& prim, CGUISpriteInstance& sec )
          This will return the value of the first sprite if it's not null, if it is null, it will return the value of the second sprite, if that one is null, then null it is.
 static PS_RESULT GetSetting( const CGUI& GUIinstance, const CStr& Object, const CStr& Setting, T& Value )
          Retrieves a setting by settings name and object name
 static PS_RESULT GetSetting( const IGUIObject* pObject, const CStr& Setting, T& Value )
          Retrieves a setting by name from object pointer
 static PS_RESULT GetSettingPointer( const IGUIObject* pObject, const CStr& Setting, T*& Value )
          
 static bool ParseColor( const CStr& Value, CColor& tOutput, float DefaultAlpha )
          
 static bool ParseString( const CStr& Value, T& tOutput )
          Sets a value by setting and object name using a real datatype as input.
private static void RecurseObject( int RR, IGUIObject* pObject, void_Object_pFunction_argRefT pFunc, T& Argument )
          Argument is reference.
private static void RecurseObject( int RR, IGUIObject* pObject, GUI::void_Object_pFunction pFunc )
          With no argument.
private static void RecurseObject( int RR, IGUIObject* pObject, void_Object_pFunction_argT pFunc, const T& Argument )
          If you want to call a IGUIObject-function on not just an object, but also on ALL of their children you want to use this recursion system.
 static PS_RESULT SetSetting( IGUIObject* pObject, const CStr& Setting, const T& Value, const bool& SkipMessage = false )
          Sets a value by name using a real datatype as input.
   
Methods inherited from class CInternalCGUIAccessorBase
GetObjectPointer, GetObjectPointer, QueryResetting, HandleMessage
 

Field Detail

GetSettingPointer

 static template PS_RESULT PS_RESULT GetSettingPointer;

SetSetting

public static PS_RESULT SetSetting( CGUI& GUIinstance, const CStr& Object, const CStr& Setting, const T& Value, const bool& SkipMessage = false );
Sets a value by setting and object name using a real datatype as input This is just a wrapper so that we can type the object name and not input the actual pointer.
Parameters:
GUI - GUI Object, reference since we'll be changing values
Object - Object name
Setting - Setting by name
Value - Sets value to this, note type T!


Method Detail

CheckIfRestricted

private static bool CheckIfRestricted( int RR, IGUIObject* pObject );
Checks restrictions for the iteration, for instance if you tell the recursor to avoid all hidden objects, it will, and this function checks a certain object's restriction values.
Parameters:
RR - What kind of restriction, for instance hidden or disabled
pObject - Object
Returns:
true if restricted

FallBackColor

public static CColor FallBackColor( const CColor& prim, const CColor& sec );
Same principle as FallBackSprite
Parameters:
prim - Primary color that should be used
sec - Secondary color if Primary should fail
Returns:
Resulting color
See Also:
FallBackSprite

FallBackSprite

public static CGUISpriteInstance& FallBackSprite( CGUISpriteInstance& prim, CGUISpriteInstance& sec );
This will return the value of the first sprite if it's not null, if it is null, it will return the value of the second sprite, if that one is null, then null it is.
Parameters:
prim - Primary sprite that should be used
sec - Secondary sprite if Primary should fail
Returns:
Resulting string

GetSetting

public static PS_RESULT GetSetting( const CGUI& GUIinstance, const CStr& Object, const CStr& Setting, T& Value );
Retrieves a setting by settings name and object name
Parameters:
GUI - GUI Object const ref
Object - Object name
Setting - Setting by name
Value - Stores value here, note type T!

GetSetting

public static PS_RESULT GetSetting( const IGUIObject* pObject, const CStr& Setting, T& Value );
Retrieves a setting by name from object pointer
Parameters:
pObject - Object pointer
Setting - Setting by name
Value - Stores value here, note type T!

GetSettingPointer

public static PS_RESULT GetSettingPointer( const IGUIObject* pObject, const CStr& Setting, T*& Value );

ParseColor

public static bool ParseColor( const CStr& Value, CColor& tOutput, float DefaultAlpha );

ParseString

public static bool ParseString( const CStr& Value, T& tOutput );
Sets a value by setting and object name using a real datatype as input. This is just a wrapper for _mem_ParseString() which really works the magic.
Parameters:
Value - The value in string form, like "0 0 100% 100%"
tOutput - Parsed value of type T
Returns:
True at success.
See Also:
_mem_ParseString()

RecurseObject

private static void RecurseObject( int RR, IGUIObject* pObject, void_Object_pFunction_argRefT pFunc, T& Argument );
Argument is reference.
See Also:
RecurseObject()

RecurseObject

private static void RecurseObject( int RR, IGUIObject* pObject, GUI::void_Object_pFunction pFunc );
With no argument.
See Also:
RecurseObject()

RecurseObject

private static void RecurseObject( int RR, IGUIObject* pObject, void_Object_pFunction_argT pFunc, const T& Argument );
If you want to call a IGUIObject-function on not just an object, but also on ALL of their children you want to use this recursion system. It recurses an object calling a function on itself and all children (and so forth). Restrictions:\n You can also set restrictions, so that if the recursion reaches an objects with certain setup, it just doesn't call the function on the object, nor it's children for that matter. i.e. it cuts that object off from the recursion tree. What setups that can cause restrictions are hardcoded and specific. Check out the defines GUIRR_* for all different setups. Error reports are either logged or thrown out of RecurseObject. Always use it with try/catch!
Parameters:
RR - Recurse Restrictions, set to 0 if no restrictions
pObject - Top object, this is where the iteration starts
pFunc - Function to recurse
Argument - Argument for pFunc of type T
Throws:
PS_RESULT - Depends on what pFunc might throw. PS_RESULT is standard. Itself doesn't throw anything.

SetSetting

public static PS_RESULT SetSetting( IGUIObject* pObject, const CStr& Setting, const T& Value, const bool& SkipMessage = false );
Sets a value by name using a real datatype as input. This is the official way of setting a setting, no other way should only cautiously be used!
Parameters:
pObject - Object pointer
Setting - Setting by name
Value - Sets value to this, note type T!
SkipMessage - Does not send a GUIM_SETTINGS_UPDATED if true

 Overview   Project   Class   Tree   Deprecated   Index 
0 A.D.
Generated on September 04, 2007 at 18:13
CppDoc v2.4.0
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD