Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

CGUIStatic Class Reference

Static Control. More...

#include <GUI.h>

Inheritance diagram for CGUIStatic:

CGUIElement CXMLResource CDoubleList< CGUIElement * > CResource CEntity CGUIButton CGUIProgressBar CGUIRadioGroup CGUIScrollBar CGUITextBox CGUIDropList CGUIMenuEntry CGUITabControl CGUIMenu List of all members.

Public Member Functions

virtual void Initialize ()
virtual int Create (CGUIElement *pParent, tRect WidgetRect, CCustomFont *pFont=NULL, CTexture *pTexture=NULL, CMaterial *pMaterial=NULL, bool bBorder=false)
virtual bool PropertyChanging (const void *pvProperty, void *pvNewValue)
virtual void GetProperties (EPropList &PropList)
virtual void Draw ()
virtual int LoadXML (TiXmlNode *pDataNode, CString strFilename)
virtual int SaveXML (TiXmlNode *pDataNode, CString strFilename)
virtual int Resize (tRect &NewRect)
virtual void Destroy ()
void DrawText ()
const CCustomFontGetFont ()
void SetFont (CBitmapFont *pBitmapFont)
CString & GetText ()
void SetText (CString &strText)
void SetTextAlign (DWORD dwTextAlignFlags)
DWORD GetTextAlign ()
UINT GetTextLength ()
UINT GetLineCount ()
UINT GetLineLength (UINT uiLine)
void ShowText ()
void HideText ()
virtual bool IsOfType (eEntityType eType)

Protected Member Functions

CString GetLine (UINT uiLine, UINT uiCharacterCount=0)

Protected Attributes

int m_iHorizontalAlign
int m_iVerticalAlign
CString m_strFontName
CString m_strFontFilename
int m_iFontIndex
tVERTEX2d m_TextPos
CString m_strText
CCustomFontm_pFont
bool m_bTextVisible

Detailed Description

Static Control.

This is basically a CGUIElement with the ability to display text using provided Bitmap Font and additional parameters for it (alignment, etc)

Definition at line 930 of file GUI.h.


Member Function Documentation

int CGUIStatic::Create CGUIElement pParent,
tRect  WidgetRect,
CCustomFont pFont = NULL,
CTexture pTexture = NULL,
CMaterial pMaterial = NULL,
bool  bBorder = false
[virtual]
 

Method details:

Parameters:
pParent - Pointer to parent widget
WidgetRect - Rectangle for this widget
pFont - Pointer to CCustomFont derived font for the widget to draw the text
pTexture - Pointer to texture
pMaterial - Pointer to material
bBorder - does this widget has a border?
Returns:
1 if sucessful, 0 if not

Reimplemented in CGUITextBox, CGUIButton, CGUIMenuEntry, CGUIMenu, and CGUIRadioGroup.

Definition at line 31 of file GUIStatic.cpp.

References CGUIElement::Create(), and m_pFont.

Referenced by CGUITextBox::Create(), CGUITabControl::Create(), CGUIScrollBar::Create(), CGUIRadioGroup::Create(), CGUIProgressBar::Create(), and CGUIButton::Create().

void CGUIStatic::Destroy  )  [virtual]
 

Method details: Destroys the widget - e.g Pre-destructor (resets variables)

Reimplemented from CGUIElement.

Reimplemented in CGUITextBox, CGUIButton, and CGUIMenuEntry.

Definition at line 424 of file GUIStatic.cpp.

References CGUIElement::Destroy().

Referenced by CGUIButton::Destroy().

void CGUIStatic::Draw  )  [virtual]
 

Method details: Draws the widget

Reimplemented from CGUIElement.

Reimplemented in CGUITextBox, CGUIButton, CGUIScrollBar, CGUIProgressBar, CGUIDropList, CGUIMenuEntry, CGUIMenu, CGUIRadioGroup, and CGUITabControl.

Definition at line 164 of file GUIStatic.cpp.

References CGUIElement::Draw(), DrawText(), and m_bTextVisible.

Referenced by CGUITextBox::Draw(), CGUITabControl::Draw(), CGUIScrollBar::Draw(), CGUIRadioGroup::Draw(), CGUIProgressBar::Draw(), and CGUIButton::Draw().

void CGUIStatic::DrawText  ) 
 

Method details: Draws only text that this Static (or Static-derived) Control hasDefinition at line 172 of file GUIStatic.cpp.

References CBitmapFont::Draw(), CCustomFont::GetFontType(), CGUIElement::GetHeight(), GetLine(), GetLineCount(), GetLineLength(), CBitmapFont::GetQuadHeight(), CBitmapFont::GetQuadLength(), CGUIElement::GetRect(), CGUIElement::GetWidth(), m_iHorizontalAlign, m_iVerticalAlign, m_pFont, m_strText, m_TextPos, CBitmapFont::SetTextPos(), tVERTEX2d::x, and tVERTEX2d::y.

Referenced by Draw(), and CGUIProgressBar::Draw().

const CCustomFont * CGUIStatic::GetFont  ) 
 

Method details:

Returns:
Pointer to CCustomFont derived font
Definition at line 293 of file GUIStatic.cpp.

References m_pFont.

Referenced by CGUIListBox::Resize().

CString CGUIStatic::GetLine UINT  uiLine,
UINT  uiCharacterCount = 0
[protected]
 

Method details:

Parameters:
uiLine - Line index
uiCharacterCount - Number of characters OF the line to return (0 for none)
Returns:
CString containing text for the specified line
Definition at line 320 of file GUIStatic.cpp.

References GetLineLength(), and m_strText.

Referenced by DrawText().

UINT CGUIStatic::GetLineCount  ) 
 

Method details:

Returns:
Line count in the text
Definition at line 308 of file GUIStatic.cpp.

References m_strText.

Referenced by DrawText(), and CGUIListBox::Resize().

UINT CGUIStatic::GetLineLength UINT  uiLine  ) 
 

Method details:

Returns:
Line count in the text
Definition at line 270 of file GUIStatic.cpp.

References m_strText.

Referenced by DrawText(), GetLine(), and CGUIListBox::Resize().

void CGUIStatic::GetProperties EPropList &  PropList  )  [virtual]
 

Method details:

Parameters:
PropList - Const. reference to the property list

Reimplemented from CGUIElement.

Reimplemented in CGUIButton, CGUIScrollBar, CGUIProgressBar, CGUIDropList, CGUIMenuEntry, CGUIMenu, CGUIRadioGroup, and CGUITabControl.

Definition at line 386 of file GUIStatic.cpp.

References CDoubleList< T >::at(), CEntity::GetName(), CGUIElement::GetProperties(), CSingleton< CFontManager >::GetSingleton(), m_bTextVisible, m_iFontIndex, m_iHorizontalAlign, m_iVerticalAlign, m_strFontFilename, m_strFontName, m_strText, and CDoubleList< T >::size().

Referenced by CGUIScrollBar::GetProperties(), CGUIRadioGroup::GetProperties(), CGUIProgressBar::GetProperties(), and CGUIButton::GetProperties().

CString & CGUIStatic::GetText  ) 
 

Method details:

Returns:
Const. Reference to string containing text
Definition at line 265 of file GUIStatic.cpp.

References m_strText.

Referenced by CGUIDropList::SetCurSel().

DWORD CGUIStatic::GetTextAlign  ) 
 

Method details:

Returns:
DWORD containing text alignment flags

UINT CGUIStatic::GetTextLength  ) 
 

Method details:

Returns:
Length of the entire text (including new lines)
Definition at line 303 of file GUIStatic.cpp.

References m_strText.

void CGUIStatic::HideText  ) 
 

Method details:

See also:
m_bTextVisible
Definition at line 357 of file GUIStatic.cpp.

References m_bTextVisible.

Referenced by CGUIMenuEntry::HideSiblingsText(), and CGUIListBox::Resize().

void CGUIStatic::Initialize  )  [virtual]
 

Method details: Initializes Static Control' variables

Reimplemented from CGUIElement.

Reimplemented in CGUITextBox, CGUIButton, CGUIScrollBar, CGUIProgressBar, CGUIDropList, CGUIMenuEntry, CGUIMenu, CGUIRadioGroup, and CGUITabControl.

Definition at line 16 of file GUIStatic.cpp.

References m_bTextVisible, m_iFontIndex, m_iHorizontalAlign, m_iVerticalAlign, m_pFont, m_strFontFilename, m_strFontName, m_strText, and m_TextPos.

bool CGUIStatic::IsOfType eEntityType  eType  )  [virtual]
 

Method details: This is an implementation of Custom RTTI

Reimplemented from CGUIElement.

Reimplemented in CGUITextBox, CGUIButton, CGUIScrollBar, CGUIProgressBar, CGUIDropList, CGUIMenuEntry, CGUIMenu, CGUIRadioGroup, and CGUITabControl.

Definition at line 362 of file GUIStatic.cpp.

References CGUIElement::IsOfType().

Referenced by CGUITextBox::IsOfType(), CGUIScrollBar::IsOfType(), CGUIRadioGroup::IsOfType(), CGUIProgressBar::IsOfType(), and CGUIButton::IsOfType().

int CGUIStatic::LoadXML TiXmlNode pDataNode,
CString  strFilename
[virtual]
 

Method details:

Parameters:
pDataNode - Pointer to XML Node that holds data for this widget
strFilename - String containing filename where the data for the widget is stored

Reimplemented from CGUIElement.

Reimplemented in CGUITextBox, CGUIButton, CGUIScrollBar, CGUIProgressBar, CGUIDropList, CGUIMenuEntry, CGUIMenu, CGUIRadioGroup, and CGUITabControl.

Definition at line 42 of file GUIStatic.cpp.

References TiXmlElement::Attribute(), CEntity::GetID(), CEntity::GetName(), CSingleton< CFontManager >::GetSingleton(), CSingleton< CGlobalLogger >::GetSingleton(), CFontManager::LoadResource(), CGUIElement::LoadXML(), m_iHorizontalAlign, m_iVerticalAlign, m_pFont, m_strText, and CLogger::Write().

Referenced by CGUITextBox::LoadXML(), CGUIScrollBar::LoadXML(), CGUIRadioGroup::LoadXML(), CGUIProgressBar::LoadXML(), and CGUIButton::LoadXML().

bool CGUIStatic::PropertyChanging const void *  pvProperty,
void *  pvNewValue
[virtual]
 

Method details:

Parameters:
pvProperty - Pointer to the property
pvNewValue - Pointer to the new value

Reimplemented from CGUIElement.

Reimplemented in CGUIButton, CGUIScrollBar, CGUIProgressBar, CGUIDropList, CGUIMenuEntry, CGUIMenu, CGUIRadioGroup, and CGUITabControl.

Definition at line 370 of file GUIStatic.cpp.

References CFontManager::GetResource(), CSingleton< CFontManager >::GetSingleton(), m_iFontIndex, m_pFont, and CGUIElement::PropertyChanging().

Referenced by CGUIScrollBar::PropertyChanging(), CGUIRadioGroup::PropertyChanging(), CGUIProgressBar::PropertyChanging(), and CGUIButton::PropertyChanging().

int CGUIStatic::Resize tRect &  NewRect  )  [virtual]
 

Method details:

Parameters:
NewRect - New rectangle for the widget
Returns:
Varied returns
See also:
GUI_Message_SizeX/Y/XY

Reimplemented from CGUIElement.

Reimplemented in CGUITextBox, CGUIScrollBar, CGUIProgressBar, CGUIDropList, and CGUIMenuEntry.

Definition at line 157 of file GUIStatic.cpp.

References CGUIElement::Resize().

Referenced by CGUIRadioGroup::InsertItem(), CGUITextBox::Resize(), CGUIScrollBar::Resize(), CGUIProgressBar::Resize(), and CGUIMenuEntry::Resize().

int CGUIStatic::SaveXML TiXmlNode pDataNode,
CString  strFilename
[virtual]
 

Method details:

Parameters:
pDataNode - Pointer to XML Node that will be the parent hold the data for this element
strFilename - String containing filename where the data for the widget is stored

Reimplemented from CGUIElement.

Reimplemented in CGUITextBox, CGUIButton, CGUIScrollBar, CGUIProgressBar, CGUIDropList, CGUIMenuEntry, CGUIMenu, CGUIRadioGroup, and CGUITabControl.

Definition at line 108 of file GUIStatic.cpp.

References CEntity::GetName(), TiXmlNode::InsertEndChild(), m_iHorizontalAlign, m_iVerticalAlign, m_pFont, m_strText, TiXmlDocument::SaveFile(), CGUIElement::SaveXML(), TiXmlElement::SetAttribute(), and TiXmlNode::ToElement().

Referenced by CGUIScrollBar::SaveXML(), CGUIProgressBar::SaveXML(), and CGUIButton::SaveXML().

void CGUIStatic::SetFont CBitmapFont pBitmapFont  ) 
 

Method details:

Parameters:
pBitmapFont - Pointer to Bitmap Font (Only bitmap!)
Definition at line 298 of file GUIStatic.cpp.

References m_pFont.

void CGUIStatic::SetText CString &  strText  ) 
 

Method details:

Parameters:
strText - Const. Reference to new text for this widget
Definition at line 259 of file GUIStatic.cpp.

References m_strText.

Referenced by CGUIScrollBar::Draw(), CGUIProgressBar::Draw(), CGUIRadioGroup::InsertItem(), CGUIMenuEntry::InsertItem(), CGUIListBox::InsertItem(), CGUIDropList::InsertItem(), and CGUIDropList::SetCurSel().

void CGUIStatic::SetTextAlign DWORD  dwTextAlignFlags  ) 
 

Method details:

Parameters:
strText - Const. Reference to new text for this widget

void CGUIStatic::ShowText  ) 
 

Method details:

See also:
m_bTextVisible
Definition at line 352 of file GUIStatic.cpp.

References m_bTextVisible.

Referenced by CGUIListBox::Resize(), and CGUIMenuEntry::ShowSiblingsText().


Member Data Documentation

bool CGUIStatic::m_bTextVisible [protected]
 

If True, text will be drawn, otherwise not Definition at line 1085 of file GUI.h.

Referenced by Draw(), GetProperties(), HideText(), Initialize(), and ShowText().

int CGUIStatic::m_iFontIndex [protected]
 

Database Font Index Definition at line 1072 of file GUI.h.

Referenced by GetProperties(), Initialize(), and PropertyChanging().

int CGUIStatic::m_iHorizontalAlign [protected]
 

Horizontal Text alignment (left, center or right)

See also:
eTextAlign
Definition at line 1067 of file GUI.h.

Referenced by DrawText(), GetProperties(), Initialize(), LoadXML(), and SaveXML().

int CGUIStatic::m_iVerticalAlign [protected]
 

Vertical Text alignment (top, middle or bottom)

See also:
eTextAlign
Definition at line 1068 of file GUI.h.

Referenced by DrawText(), GetProperties(), Initialize(), LoadXML(), and SaveXML().

CCustomFont* CGUIStatic::m_pFont [protected]
 

Pointer to font Definition at line 1084 of file GUI.h.

Referenced by Create(), DrawText(), GetFont(), Initialize(), LoadXML(), PropertyChanging(), SaveXML(), and SetFont().

CString CGUIStatic::m_strFontFilename [protected]
 

Font Filename Definition at line 1071 of file GUI.h.

Referenced by GetProperties(), and Initialize().

CString CGUIStatic::m_strFontName [protected]
 

Font strName Definition at line 1070 of file GUI.h.

Referenced by GetProperties(), and Initialize().

CString CGUIStatic::m_strText [protected]
 

Text string Definition at line 1083 of file GUI.h.

Referenced by DrawText(), GetLine(), GetLineCount(), GetLineLength(), GetProperties(), GetText(), GetTextLength(), Initialize(), LoadXML(), SaveXML(), and SetText().

tVERTEX2d CGUIStatic::m_TextPos [protected]
 

XY Text coordinate (top left of first character) Definition at line 1082 of file GUI.h.

Referenced by DrawText(), and Initialize().


The documentation for this class was generated from the following files:
Generated on Sun Jul 17 21:34:29 2005 for OpenGL GUI by doxygen 1.3.8