Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
IGUITextOwner Class Referenceabstract

Framework for handling Output text. More...

#include <IGUITextOwner.h>

Inheritance diagram for IGUITextOwner:
IGUIObject CButton CCheckBox CList CText CTooltip CRadioButton CDropDown

Public Member Functions

 IGUITextOwner ()
 
virtual ~IGUITextOwner ()
 
void AddText (SGUIText *text)
 Adds a text object. More...
 
virtual void HandleMessage (SGUIMessage &Message)
 
virtual void UpdateCachedSize ()
 
virtual void DrawText (int index, const CColor &color, const CPos &pos, float z, const CRect &clipping=CRect())
 Draws the Text. More...
 
virtual bool MouseOverIcon ()
 Test if mouse position is over an icon. More...
 
- Public Member Functions inherited from IGUIObject
 IGUIObject ()
 
virtual ~IGUIObject ()
 
virtual bool MouseOver ()
 Checks if mouse is hovering this object. More...
 
const CStr & GetName () const
 Get object name, name is unique. More...
 
void SetName (const CStr &Name)
 Get object name. More...
 
CStr GetPresentableName () const
 
void AddToPointersMap (map_pObjects &ObjectMap)
 Adds object and its children to the map, it's name being the first part, and the second being itself. More...
 
void AddChild (IGUIObject *pChild)
 Notice nothing will be returned or thrown if the child hasn't been inputted into the GUI yet. More...
 
vector_pObjects::iterator ChildrenItBegin ()
 
vector_pObjects::iterator ChildrenItEnd ()
 
bool SettingExists (const CStr &Setting) const
 Checks if settings exists, only available for derived classes that has this set up, that's why the base class just returns false. More...
 
PSRETURN SetSetting (const CStr &Setting, const CStrW &Value, const bool &SkipMessage=false)
 Set a setting by string, regardless of what type it is. More...
 
PSRETURN GetSettingType (const CStr &Setting, EGUISettingType &Type) const
 Retrieves the type of a named setting. More...
 
void RegisterScriptHandler (const CStr &Action, const CStr &Code, CGUI *pGUI)
 Set the script handler for a particular object-specific action. More...
 
JSObject * GetJSObject ()
 Retrieves the JSObject representing this GUI object. More...
 
CGUIGetGUI ()
 
const CGUIGetGUI () const
 
void SetFocus ()
 Take focus! More...
 

Protected Member Functions

virtual void SetupText ()=0
 Setup texts. More...
 
void CalculateTextPosition (CRect &ObjSize, CPos &TextPos, SGUIText &Text)
 Calculate the position for the text, based on the alignment. More...
 
- Protected Member Functions inherited from IGUIObject
void AddSetting (const EGUISettingType &Type, const CStr &Name)
 Add a setting to m_Settings. More...
 
virtual void Destroy ()
 Calls Destroy on all children, and deallocates all memory. More...
 
virtual void Draw ()=0
 Draws the object. More...
 
virtual InReaction ManuallyHandleEvent (const SDL_Event_ *ev)
 Some objects need to handle the SDL_Event_ manually. More...
 
void LoadStyle (CGUI &GUIinstance, const CStr &StyleName)
 Loads a style. More...
 
void LoadStyle (const SGUIStyle &Style)
 Loads a style. More...
 
virtual float GetBufferedZ () const
 Returns not the Z value, but the actual buffered Z value, i.e. More...
 
void SetGUI (CGUI *const &pGUI)
 
void SetParent (IGUIObject *pParent)
 Set parent of this object. More...
 
virtual void ResetStates ()
 Reset internal state of this object. More...
 
bool IsFocused () const
 Check if object is focused. More...
 
IGUIObjectGetParent () const
 NOTE! This will not just return m_pParent, when that is need use it! There is one exception to it, when the parent is the top-node (the object that isn't a real object), this will return NULL, so that the top-node's children are seemingly parentless. More...
 
CPos GetMousePos () const
 Get Mouse from CGUI. More...
 
virtual bool HandleAdditionalChildren (const XMBElement &child, CXeromyces *pFile)
 Handle additional children to the <object>-tag. More...
 
InReaction SendEvent (EGUIMessageType type, const CStr &EventName)
 Send event to this GUI object (HandleMessage and ScriptEvent) More...
 
void ScriptEvent (const CStr &Action)
 Execute the script for a particular action. More...
 
void ScriptEvent (const CStr &Action, const CScriptValRooted &Argument)
 Execute the script for a particular action. More...
 
void SetScriptHandler (const CStr &Action, JSObject *Function)
 
void UpdateMouseOver (IGUIObject *const &pMouseOver)
 Inputes the object that is currently hovered, this function updates this object accordingly (i.e. More...
 

Protected Attributes

bool m_GeneratedTextsValid
 Whether the cached text is currently valid (if not then SetupText will be called by Draw) More...
 
std::vector< SGUIText * > m_GeneratedTexts
 Texts that are generated and ready to be rendered. More...
 
- Protected Attributes inherited from IGUIObject
CRect m_CachedActualSize
 Cached size, real size m_Size is actually dependent on resolution and can have different real outcomes, this is the real outcome cached to avoid slow calculations in real time. More...
 
CStr m_Name
 
vector_pObjects m_Children
 
IGUIObjectm_pParent
 
double m_LastClickTime [6]
 
bool m_MouseHovering
 This is an array of true or false, each element is associated with a string representing a setting. More...
 

Detailed Description

Framework for handling Output text.

See Also
IGUIObject

Definition at line 60 of file IGUITextOwner.h.

Constructor & Destructor Documentation

IGUITextOwner::IGUITextOwner ( )

Definition at line 29 of file IGUITextOwner.cpp.

IGUITextOwner::~IGUITextOwner ( )
virtual

Definition at line 33 of file IGUITextOwner.cpp.

Member Function Documentation

void IGUITextOwner::AddText ( SGUIText text)

Adds a text object.

Definition at line 43 of file IGUITextOwner.cpp.

void IGUITextOwner::CalculateTextPosition ( CRect ObjSize,
CPos TextPos,
SGUIText Text 
)
protected

Calculate the position for the text, based on the alignment.

Definition at line 101 of file IGUITextOwner.cpp.

void IGUITextOwner::DrawText ( int  index,
const CColor color,
const CPos pos,
float  z,
const CRect clipping = CRect() 
)
virtual

Draws the Text.

Parameters
indexIndex value of text. Mostly this will be 0
color
posPosition
zZ value
clippingClipping rectangle, don't even add a parameter to get no clipping.

Definition at line 81 of file IGUITextOwner.cpp.

void IGUITextOwner::HandleMessage ( SGUIMessage Message)
virtual
See Also
IGUIObject::HandleMessage()

Reimplemented from IGUIObject.

Reimplemented in CList, CText, CDropDown, CCheckBox, CButton, CRadioButton, and CTooltip.

Definition at line 48 of file IGUITextOwner.cpp.

bool IGUITextOwner::MouseOverIcon ( )
virtual

Test if mouse position is over an icon.

Reimplemented from IGUIObject.

Reimplemented in CText.

Definition at line 128 of file IGUITextOwner.cpp.

virtual void IGUITextOwner::SetupText ( )
protectedpure virtual

Setup texts.

Functions that sets up all texts when changes have been made.

Implemented in CDropDown, CList, CCheckBox, CButton, CText, and CTooltip.

void IGUITextOwner::UpdateCachedSize ( )
virtual
See Also
IGUIObject::UpdateCachedSize()

Reimplemented from IGUIObject.

Definition at line 72 of file IGUITextOwner.cpp.

Member Data Documentation

std::vector<SGUIText*> IGUITextOwner::m_GeneratedTexts
protected

Texts that are generated and ready to be rendered.

Definition at line 113 of file IGUITextOwner.h.

bool IGUITextOwner::m_GeneratedTextsValid
protected

Whether the cached text is currently valid (if not then SetupText will be called by Draw)

Definition at line 108 of file IGUITextOwner.h.


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