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

CGUIElement Class Reference

Basic GUI Element. More...

#include <GUI.h>

Inheritance diagram for CGUIElement:

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

Public Member Functions

 CGUIElement ()
virtual void Initialize ()
virtual int Create (CGUIElement *pParent, tRect WidgetRect, CTexture *pTexture=NULL, CMaterial *pMaterial=NULL, bool bBorder=false)
virtual bool PropertyChanging (const void *pvProperty, void *pvNewValue)
virtual void GetProperties (EPropList &PropList)
virtual int LoadXML (TiXmlNode *pDataNode, CString strFilename)
virtual int SaveXML (TiXmlNode *pDataNode, CString strFilename)
virtual void Draw ()
virtual void Destroy ()
virtual void ProcessMessages ()
virtual void ProcessMessage (tGUIMessage &Message)
virtual int Resize (tRect &NewRect)
virtual int OnKeyDown (UINT uiKeyCode)
virtual int OnKeyUp (UINT uiKeyCode)
virtual int OnMove (UINT x, UINT y)
virtual int OnMouseMove (UINT x, UINT y)
virtual int OnLMouseDown (UINT x, UINT y)
virtual int OnLMouseUp (UINT x, UINT y)
virtual int OnRMouseDown (UINT x, UINT y)
virtual int OnRMouseUp (UINT x, UINT y)
UINT GetWidth ()
void SetWidth (UINT uiWidth)
UINT GetHeight ()
void SetHeight (UINT uiHeight)
CGUIElementGetChild (UINT uiIndex)
CGUIElementGetChild (eGUIControlType eWidgetType)
CGUIElementGetChild (TiXmlElement *pXMLElement)
UINT GetChildCount ()
void RemoveChild (CGUIElement *pChild)
void HideSiblings (int iDeep=-1)
void ShowSiblings (int iDeep=-1)
void SetZOrder (UINT uiZOrder)
UINT GetZOrder ()
bool Visible ()
void Hide ()
void Show ()
CGUIElementGetParent ()
void SetParent (CGUIElement *pParent)
void SetTexture (CTexture *pTexture)
CTextureGetTexture ()
void SetMaterial (CMaterial *pMaterial)
CMaterialGetMaterial ()
void SetTexCoord (UINT uiIndex, float U, float V)
tVERTEX2fGetTexCoord (UINT index)
CGUIGetGUI ()
void SetRect (tRect &NewRect)
tRect & GetRect ()
void SetGUI (CGUI *pGUI)
eGUIControlType & GetType ()
void SetType (eGUIControlType eWidgetType)
void SetFlag (eGUIFlag eFlag, bool bSet)
bool IsFlagSet (eGUIFlag eFlag)
bool IsChild (CGUIElement *pElement)
virtual bool IsOfType (eEntityType eType)
bool IsAutoCalc ()
void SetAutoCalc (bool bAutoCalc)

Protected Attributes

bool m_bAutoCalc
CString m_strElementType
UINT m_iChildren
CString m_strRectangle
bool m_bAllowMoveX
bool m_bAllowMoveY
bool m_bAllowSizeX
bool m_bAllowSizeY
CString m_strMaterialName
int m_iMaterialIndex
COLORREF m_MaterialAmbient
COLORREF m_MaterialDiffuse
COLORREF m_MaterialSpecular
COLORREF m_MaterialEmissive
int m_iMaterialShininess
COLORREF m_ActiveColor
COLORREF m_InactiveColor
bool m_bActive
CString m_strTextureName
CString m_strTextureFilename
int m_iTextureIndex
eGUIControlType m_eControlType
 Widget Core Attributes.
CGUIElementm_pParent
CGUIm_pGUI
tRect m_Rect
DWORD m_dwFlags
CMaterialm_pMaterial
CTexturem_pTexture
tVERTEX2f m_TexCoord [4]
bool m_bVisible

Detailed Description

Basic GUI Element.

This has properties of an XML Resource and is also a representation of a tree/node chain. It handles all basic inputs/outputs from various controls by default, or they can be overriden by derived classes.

Definition at line 238 of file GUI.h.


Constructor & Destructor Documentation

CGUIElement::CGUIElement  ) 
 

Destructor Definition at line 4 of file GUIElement.cpp.

References Initialize(), m_iMaterialIndex, m_iMaterialShininess, m_iTextureIndex, m_pMaterial, m_pParent, m_pTexture, m_strElementType, CEntity::SetEntityType(), and SetType().

Referenced by CGUIProgressBar::Create().


Member Function Documentation

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

Method details:

Parameters:
pParent - Pointer to parent widget
WidgetRect - Rectangle for this widget
pTexture - Pointer to texture for this widget
pMaterial -Pointer to material for this widget
bBorder - Does this widget has border?
Returns:
1 if sucessful, 0 if not
Definition at line 46 of file GUIElement.cpp.

References GetGUI(), m_pMaterial, m_pTexture, SetParent(), and SetRect().

Referenced by CGUIWindow::Create(), CGUIStatic::Create(), CGUIProgressBar::Create(), CGUIListBox::Create(), and CGUIBorder::Create().

void CGUIElement::Destroy  )  [virtual]
 

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

Reimplemented from CXMLResource.

Reimplemented in CGUI, CGUIStatic, CGUITextBox, CGUIButton, and CGUIMenuEntry.

Definition at line 1136 of file GUIElement.cpp.

References CDoubleList< CGUIElement * >::erase().

Referenced by CGUIStatic::Destroy(), CGUI::Destroy(), and PropertyChanging().

void CGUIElement::Draw  )  [virtual]
 

Method details: Draws the widget

Reimplemented in CGUI, CGUIBorder, CGUIStatic, CGUITextBox, CGUIButton, CGUIScrollBar, CGUIProgressBar, CGUIDropList, CGUIListBox, CGUIMenuEntry, CGUIMenu, CGUIRadioGroup, CGUITabControl, and CGUIWindow.

Definition at line 515 of file GUIElement.cpp.

References CDoubleList< CGUIElement * >::begin(), CTexture::Bind(), CMaterial::GetAmbient(), CTexture::IsMasked(), m_pMaterial, m_pTexture, m_Rect, m_TexCoord, CDoubleList< CGUIElement * >::next(), CDoubleList< CGUIElement * >::set_ptr(), and Visible().

Referenced by CGUIWindow::Draw(), CGUIStatic::Draw(), CGUIRadioGroup::Draw(), CGUIListBox::Draw(), CGUIDropList::Draw(), CGUIBorder::Draw(), and CGUI::Draw().

CGUIElement* CGUIElement::GetChild TiXmlElement pXMLElement  ) 
 

Method details: (DEPRICATED)

Parameters:
pXMLElement - Pointer to the XML element that the child has
Returns:
Pointer to the child that hold pointer to the (pXMLElement)

CGUIElement * CGUIElement::GetChild eGUIControlType  eWidgetType  ) 
 

Method details:

Parameters:
eWidgetType - Type if the child
Returns:
Pointer to the child with type of (eWidgetType)
Definition at line 755 of file GUIElement.cpp.

References CDoubleList< CGUIElement * >::begin(), GetType(), CDoubleList< CGUIElement * >::next(), and CDoubleList< CGUIElement * >::set_ptr().

CGUIElement * CGUIElement::GetChild UINT  uiIndex  ) 
 

Method details:

Parameters:
uiIndex uiIndex of the child
Returns:
Pointer to the indexed child, NULL if nothing found
Definition at line 771 of file GUIElement.cpp.

References CDoubleList< CGUIElement * >::at(), and GetChildCount().

Referenced by CGUIDropList::Collapse(), CGUIWindow::Create(), CGUITabControl::Create(), CGUIScrollBar::Create(), CGUIProgressBar::Create(), CGUIMenuEntry::Create(), CGUIListBox::Create(), CGUIDropList::Create(), CGUIWindow::Draw(), CGUIProgressBar::Draw(), CGUIMenu::Draw(), CGUIListBox::Draw(), CGUIDropList::Draw(), CGUIDropList::Expand(), CGUIBorder::GetProperties(), GetZOrder(), CGUIWindow::LoadXML(), CGUIScrollBar::LoadXML(), CGUIProgressBar::LoadXML(), CGUIDropList::LoadXML(), CGUIWindow::Maximize(), CGUIWindow::Minimize(), CGUIScrollBar::OnLMouseUp(), CGUIWindow::ProcessMessage(), CGUIMenu::ProcessMessage(), CGUIListBox::ProcessMessage(), CGUIDropList::ProcessMessage(), CGUIWindow::Resize(), CGUIScrollBar::Resize(), CGUIProgressBar::Resize(), CGUIListBox::Resize(), Resize(), CGUIDropList::Resize(), CGUIWindow::Restore(), and CGUIScrollBar::SetCurPos().

UINT CGUIElement::GetChildCount  ) 
 

Method details:

Returns:
Child count for this widget
Definition at line 779 of file GUIElement.cpp.

References CDoubleList< CGUIElement * >::size().

Referenced by CGUIDropList::Collapse(), CGUIMenuEntry::Draw(), CGUIDropList::Expand(), GetChild(), GetZOrder(), CGUIWindow::LoadXML(), CGUIScrollBar::LoadXML(), CGUIProgressBar::LoadXML(), CGUIMenu::ProcessMessage(), CGUIListBox::ProcessMessage(), CGUIDropList::ProcessMessage(), CGUIWindow::Resize(), CGUIListBox::Resize(), CGUIDropList::Resize(), CGUITabControl::SetCurSel(), and CGUIRadioGroup::SetCurSel().

CGUI * CGUIElement::GetGUI  ) 
 

Method details:

Returns:
Pointer to the Root GUI (Recursive!)
Definition at line 664 of file GUIElement.cpp.

References GetParent(), and GetType().

Referenced by Create(), CGUIWindow::Maximize(), OnLMouseDown(), OnLMouseUp(), CGUIButton::OnLMouseUp(), OnMouseMove(), OnMove(), ProcessMessages(), Resize(), and CGUIScrollBar::SetCurPos().

UINT CGUIElement::GetHeight  ) 
 

Method details:

Returns:
Height of the widget
Definition at line 723 of file GUIElement.cpp.

References m_Rect.

Referenced by CGUIProgressBar::Draw(), CGUIStatic::DrawText(), CGUIWindow::Minimize(), CGUIWindow::Resize(), CGUIScrollBar::Resize(), CGUIScrollBar::SetCurPos(), CGUIScrollBar::SetRange(), and CGUIProgressBar::SetRange().

CMaterial * CGUIElement::GetMaterial  ) 
 

Method details:

Returns:
Pointer to this widget' material
Definition at line 794 of file GUIElement.cpp.

References m_pMaterial.

CGUIElement * CGUIElement::GetParent  ) 
 

Method details:

Returns:
Pointer to this widget' parent
Definition at line 687 of file GUIElement.cpp.

References m_pParent.

Referenced by GetGUI(), GetZOrder(), CGUIMenuEntry::InsertItem(), CGUIScrollBar::LoadXML(), CGUIProgressBar::LoadXML(), CGUIBorder::OnMouseMove(), CGUIMenuEntry::ProcessMessage(), CGUIBorder::ProcessMessage(), CGUIMenuEntry::PropertyChanging(), CGUIBorder::Resize(), SaveXML(), and SetZOrder().

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

Method details:

Parameters:
PropList - Const. reference to the property list

Reimplemented from CXMLResource.

Reimplemented in CGUI, CGUIBorder, CGUIStatic, CGUIButton, CGUIScrollBar, CGUIProgressBar, CGUIDropList, CGUIListBox, CGUIMenuEntry, CGUIMenu, CGUIRadioGroup, and CGUITabControl.

Definition at line 1024 of file GUIElement.cpp.

References CDoubleList< T >::at(), CMaterial::GetAmbient(), CMaterial::GetDiffuse(), CMaterial::GetEmissive(), CEntity::GetName(), CXMLResource::GetProperties(), CMaterial::GetShininess(), CSingleton< CTextureManager >::GetSingleton(), CSingleton< CMaterialManager >::GetSingleton(), CMaterial::GetSpecular(), CTexture::GetTextureFilename(), m_ActiveColor, m_bAllowMoveX, m_bAllowMoveY, m_bAllowSizeX, m_bAllowSizeY, m_bAutoCalc, m_bVisible, m_iChildren, m_iMaterialIndex, m_iMaterialShininess, m_InactiveColor, m_iTextureIndex, m_MaterialAmbient, m_MaterialDiffuse, m_MaterialEmissive, m_MaterialSpecular, m_pMaterial, m_pTexture, m_Rect, m_strElementType, m_strRectangle, m_strTextureFilename, m_strTextureName, m_TexCoord, CDoubleList< T >::size(), and CDoubleList< CGUIElement * >::size().

Referenced by CGUIStatic::GetProperties(), CGUIListBox::GetProperties(), CGUIBorder::GetProperties(), and CGUI::GetProperties().

tRect & CGUIElement::GetRect  ) 
 

Method details:

Returns:
Const. Reference to this widget' rectangle
Definition at line 718 of file GUIElement.cpp.

References m_Rect.

Referenced by CGUIBorder::Create(), CGUIMenuEntry::Draw(), CGUIStatic::DrawText(), CGUIButton::GetCurrentAnimation(), CGUIRadioGroup::InsertItem(), CGUIMenuEntry::InsertItem(), CGUIListBox::InsertItem(), CGUIDropList::InsertItem(), CGUIScrollBar::LoadXML(), CGUIProgressBar::LoadXML(), CGUIMenu::LoadXML(), CGUIWindow::Maximize(), CGUIWindow::Minimize(), OnLMouseDown(), CGUIScrollBar::OnLMouseUp(), OnLMouseUp(), CGUIButton::OnLMouseUp(), CGUIBorder::OnMouseMove(), CGUIMenuEntry::PointInChildRects(), CGUIWindow::ProcessMessage(), CGUIScrollBar::ProcessMessage(), CGUIProgressBar::ProcessMessage(), CGUIMenuEntry::ProcessMessage(), CGUIMenu::ProcessMessage(), CGUIListBox::ProcessMessage(), CGUIDropList::ProcessMessage(), CGUIBorder::ProcessMessage(), CGUIMenuEntry::PropertyChanging(), CGUIDropList::PropertyChanging(), CGUIWindow::Resize(), CGUIScrollBar::Resize(), CGUIProgressBar::Resize(), CGUIListBox::Resize(), CGUIDropList::Resize(), CGUIBorder::Resize(), CGUIWindow::Restore(), CGUIScrollBar::SetCurPos(), CGUIProgressBar::SetCurPos(), and CGUIScrollBar::SetRange().

tVERTEX2f & CGUIElement::GetTexCoord UINT  index  ) 
 

Method details:

Returns:
Const. Reference to the specified corner'texture coordinates
Definition at line 747 of file GUIElement.cpp.

References m_TexCoord.

CTexture * CGUIElement::GetTexture  ) 
 

Method details:

Returns:
Pointer to this widget' texture
Definition at line 784 of file GUIElement.cpp.

References m_pTexture.

Referenced by CGUIProgressBar::Draw().

eGUIControlType & CGUIElement::GetType  ) 
 

Method details:

Returns:
Type of this widget (RTTI)
Definition at line 659 of file GUIElement.cpp.

References m_eControlType.

Referenced by CGUIDropList::Collapse(), CGUIScrollBar::Create(), CGUIMenuEntry::Create(), CGUIRadioGroup::Draw(), CGUIProgressBar::Draw(), CGUIMenuEntry::Draw(), CGUIDropList::Expand(), GetChild(), GetGUI(), CGUIRadioGroup::GetProperties(), CGUIMenuEntry::GetProperties(), CGUIListBox::GetProperties(), CGUIDropList::GetProperties(), CGUIMenuEntry::HideSiblingsText(), CGUIWindow::LoadXML(), CGUITabControl::LoadXML(), CGUIScrollBar::LoadXML(), CGUIProgressBar::LoadXML(), CGUIDropList::LoadXML(), OnLMouseDown(), CGUIBorder::OnLMouseDown(), CGUIScrollBar::OnLMouseUp(), OnLMouseUp(), CGUIButton::OnLMouseUp(), OnMouseMove(), OnMove(), CGUIMenuEntry::PointInChildRects(), CGUIWindow::ProcessMessage(), CGUITabControl::ProcessMessage(), CGUIScrollBar::ProcessMessage(), CGUIRadioGroup::ProcessMessage(), CGUIProgressBar::ProcessMessage(), CGUIListBox::ProcessMessage(), CGUIDropList::ProcessMessage(), CGUITabControl::PropertyChanging(), CGUIWindow::Resize(), CGUIScrollBar::Resize(), CGUIProgressBar::Resize(), CGUIMenuEntry::Resize(), CGUIListBox::Resize(), Resize(), CGUIDropList::Resize(), CGUIScrollBar::SaveXML(), CGUIProgressBar::SaveXML(), SaveXML(), CGUIScrollBar::SetCurPos(), CGUITabControl::SetCurSel(), CGUIRadioGroup::SetCurSel(), CGUIListBox::SetCurSel(), CGUIDropList::SetCurSel(), CGUIScrollBar::SetRange(), CGUIProgressBar::SetRange(), and CGUIMenuEntry::ShowSiblingsText().

UINT CGUIElement::GetWidth  ) 
 

Method details:

Returns:
Width of the widget
Definition at line 728 of file GUIElement.cpp.

References m_Rect.

Referenced by CGUIProgressBar::Draw(), CGUIStatic::DrawText(), CGUIScrollBar::Resize(), CGUIDropList::Resize(), CGUIScrollBar::SetCurPos(), CGUIScrollBar::SetRange(), and CGUIProgressBar::SetRange().

unsigned int CGUIElement::GetZOrder  ) 
 

Method details:

Todo:
Implement this function
Definition at line 916 of file GUIElement.cpp.

References GetChild(), GetChildCount(), and GetParent().

void CGUIElement::Hide  ) 
 

Method details: Hides this widgetDefinition at line 853 of file GUIElement.cpp.

References m_bVisible.

Referenced by CGUIWindow::Close(), HideSiblings(), CGUITabControl::LoadXML(), CGUIWindow::Minimize(), CGUITabControl::ProcessMessage(), and CGUIListBox::Resize().

void CGUIElement::HideSiblings int  iDeep = -1  ) 
 

Method details:

Parameters:
iDeep - How deep to go and hide child widgets (-1 to hide all children, sub-children, etc)
Definition at line 804 of file GUIElement.cpp.

References CDoubleList< CGUIElement * >::begin(), Hide(), CDoubleList< CGUIElement * >::next(), and CDoubleList< CGUIElement * >::set_ptr().

Referenced by CGUIWindow::Close(), CGUIMenuEntry::Collapse(), CGUIWindow::Draw(), CGUIRadioGroup::Draw(), and CGUIMenuEntry::LoadXML().

void CGUIElement::Initialize  )  [virtual]
 

Method details: Initializes GUI Element' variables

Reimplemented in CGUI, CGUIBorder, CGUIStatic, CGUITextBox, CGUIButton, CGUIScrollBar, CGUIProgressBar, CGUIDropList, CGUIListBox, CGUIMenuEntry, CGUIMenu, CGUIRadioGroup, CGUITabControl, and CGUIWindow.

Definition at line 23 of file GUIElement.cpp.

References m_bAllowMoveX, m_bAllowMoveY, m_bAllowSizeX, m_bAllowSizeY, m_bAutoCalc, m_bVisible, m_dwFlags, m_pGUI, m_pMaterial, m_pTexture, m_TexCoord, tVERTEX2f::x, and tVERTEX2f::y.

Referenced by CGUIElement().

bool CGUIElement::IsAutoCalc  ) 
 

Method details:

Returns:
True if Auto-Calculation is on, False otherwise
Definition at line 1126 of file GUIElement.cpp.

References m_bAutoCalc.

Referenced by CGUIMenuEntry::GetProperties(), PropertyChanging(), and CGUIMenuEntry::Resize().

bool CGUIElement::IsChild CGUIElement pElement  ) 
 

Method details:

Parameters:
pElement - returns True if the passed pointer is the child of this widget
Definition at line 889 of file GUIElement.cpp.

References CDoubleList< CGUIElement * >::begin(), CDoubleList< CGUIElement * >::next(), and CDoubleList< CGUIElement * >::set_ptr().

Referenced by CGUIWindow::Create(), CGUITabControl::Create(), CGUIScrollBar::Create(), CGUIProgressBar::Create(), CGUIListBox::Create(), CGUIDropList::Create(), CGUIWindow::ProcessMessage(), CGUITabControl::ProcessMessage(), CGUIScrollBar::ProcessMessage(), CGUIListBox::ProcessMessage(), and CGUIDropList::ProcessMessage().

bool CGUIElement::IsFlagSet eGUIFlag  eFlag  ) 
 

Method details:

Parameters:
eFlag - returns True if this flag is set, False otherwise
Definition at line 875 of file GUIElement.cpp.

References m_bAllowMoveX, m_bAllowMoveY, m_bAllowSizeX, and m_bAllowSizeY.

bool CGUIElement::IsOfType eEntityType  eType  )  [virtual]
 

Method details: This is an implementation of Custom RTTI

Reimplemented from CXMLResource.

Reimplemented in CGUI, CGUIBorder, CGUIStatic, CGUITextBox, CGUIButton, CGUIScrollBar, CGUIProgressBar, CGUIDropList, CGUIListBox, CGUIMenuEntry, CGUIMenu, CGUIRadioGroup, CGUITabControl, and CGUIWindow.

Definition at line 1141 of file GUIElement.cpp.

References CXMLResource::IsOfType().

Referenced by CGUIWindow::IsOfType(), CGUIStatic::IsOfType(), CGUIListBox::IsOfType(), CGUIBorder::IsOfType(), and CGUI::IsOfType().

int CGUIElement::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 CXMLResource.

Reimplemented in CGUI, CGUIBorder, CGUIStatic, CGUITextBox, CGUIButton, CGUIScrollBar, CGUIProgressBar, CGUIDropList, CGUIListBox, CGUIMenuEntry, CGUIMenu, CGUIRadioGroup, CGUITabControl, and CGUIWindow.

Definition at line 69 of file GUIElement.cpp.

References TiXmlElement::Attribute(), TiXmlNode::FirstChild(), CEntity::GetID(), CEntity::GetName(), CSingleton< CMaterialManager >::GetSingleton(), CSingleton< CTextureManager >::GetSingleton(), CSingleton< CGlobalLogger >::GetSingleton(), TiXmlNode::IterateChildren(), CMaterialManager::LoadResource(), CTextureManager::LoadResource(), CXMLResource::LoadXML(), m_bAllowMoveX, m_bAllowMoveY, m_bAllowSizeX, m_bAllowSizeY, m_dwFlags, m_pMaterial, m_pTexture, m_Rect, m_strElementType, m_TexCoord, TiXmlNode::pcValue(), CDoubleList< CGUIElement * >::push_back(), Resize(), SetParent(), and CLogger::Write().

Referenced by CGUIWindow::LoadXML(), CGUIStatic::LoadXML(), CGUIListBox::LoadXML(), CGUIBorder::LoadXML(), CGUI::LoadXML(), and PropertyChanging().

int CGUIElement::OnKeyDown UINT  uiKeyCode  )  [virtual]
 

Method details:

Parameters:
uiKeyCode - Key code
Returns:
Returns 1 if key has been processed (by widget OR by it's children), 0 if not
Definition at line 599 of file GUIElement.cpp.

int CGUIElement::OnKeyUp UINT  uiKeyCode  )  [virtual]
 

Method details:

Parameters:
uiKeyCode - Key code
Returns:
Returns 1 if key has been processed (by widget OR by it's children), 0 if not
Definition at line 593 of file GUIElement.cpp.

int CGUIElement::OnLMouseDown UINT  x,
UINT  y
[virtual]
 

Method details:

Parameters:
x - X Location of the mouse when Left button has been held
y - Y Location of the mouse when Left button has been held
Returns:
1 if it has been processed by widget (or it's children), 0 if not

Reimplemented in CGUI, and CGUIBorder.

Definition at line 370 of file GUIElement.cpp.

References CDoubleList< CGUIElement * >::end(), GetGUI(), GetRect(), GetType(), CGUI::Lock(), CDoubleList< CGUIElement * >::prev(), CDoubleList< CGUIElement * >::set_ptr(), and CGUI::SetActiveElement().

Referenced by CGUIBorder::OnLMouseDown(), and CGUI::OnLMouseDown().

int CGUIElement::OnLMouseUp UINT  x,
UINT  y
[virtual]
 

Method details:

Parameters:
x - X Location of the mouse when Left button has been released
y - Y Location of the mouse when Left button has been released
Returns:
1 if it has been processed by widget (or it's children), 0 if not

Reimplemented in CGUI, CGUIBorder, CGUIButton, and CGUIScrollBar.

Definition at line 395 of file GUIElement.cpp.

References CDoubleList< CGUIElement * >::end(), GetGUI(), GetRect(), GetType(), CGUI::PostMessage(), CDoubleList< CGUIElement * >::prev(), and CDoubleList< CGUIElement * >::set_ptr().

Referenced by CGUIScrollBar::OnLMouseUp(), CGUIButton::OnLMouseUp(), CGUIBorder::OnLMouseUp(), and CGUI::OnLMouseUp().

int CGUIElement::OnMouseMove UINT  x,
UINT  y
[virtual]
 

Method details:

Parameters:
x - X Units the mosue has moved
y - Y Units the mosue has moved
Returns:
1 if it has been processed by widget (or it's children), 0 if not

Reimplemented in CGUIBorder.

Definition at line 419 of file GUIElement.cpp.

References CDoubleList< CGUIElement * >::end(), CGUI::GetActiveElement(), CMouse::GetCursorPos(), GetGUI(), CInputEngine::GetMouse(), CMouse::GetPrevCursorPos(), CSingleton< CInputEngine >::GetSingleton(), GetType(), CGUI::IsLocked(), m_Rect, OnMove(), CDoubleList< CGUIElement * >::prev(), CDoubleList< CGUIElement * >::set_ptr(), Visible(), tVERTEX2d::x, and tVERTEX2d::y.

Referenced by CGUIBorder::OnMouseMove(), and CGUI::Update().

int CGUIElement::OnMove UINT  x,
UINT  y
[virtual]
 

Method details:

Parameters:
x - Units this widget has to be moved
y - Units this widget has to be moved
Returns:
Varied return values
See also:
GUI_Message_MoveX/Y/XY
Definition at line 472 of file GUIElement.cpp.

References GetGUI(), GetType(), m_bAllowMoveX, m_bAllowMoveY, m_Rect, CGUI::PostMessage(), and Visible().

Referenced by OnMouseMove().

int CGUIElement::OnRMouseDown UINT  x,
UINT  y
[virtual]
 

Method details:

Parameters:
x - X Location of the mouse when Right button has been held
y - Y Location of the mouse when Right button has been held
Returns:
1 if it has been processed by widget (or it's children), 0 if not
Definition at line 460 of file GUIElement.cpp.

int CGUIElement::OnRMouseUp UINT  x,
UINT  y
[virtual]
 

Method details:

Parameters:
x - X Location of the mouse when Right button has been released
y - Y Location of the mouse when Right button has been released
Returns:
1 if it has been processed by widget (or it's children), 0 if not
Definition at line 466 of file GUIElement.cpp.

void CGUIElement::ProcessMessage tGUIMessage Message  )  [virtual]
 

Method details:

Parameters:
Message - Const. Reference to the message structure that is to be processed.

Reimplemented in CGUI, CGUIBorder, CGUIScrollBar, CGUIProgressBar, CGUIDropList, CGUIListBox, CGUIMenuEntry, CGUIMenu, CGUIRadioGroup, CGUITabControl, and CGUIWindow.

Definition at line 692 of file GUIElement.cpp.

Referenced by CGUIEventHandler::Dispatch(), and ProcessMessages().

void CGUIElement::ProcessMessages  )  [virtual]
 

Method details: Processes messages from the GUI Event Handler

Reimplemented in CGUI.

Definition at line 697 of file GUIElement.cpp.

References CDoubleList< CGUIElement * >::begin(), GetGUI(), CGUI::GetMessage(), CGUI::GetMessageCount(), CDoubleList< CGUIElement * >::next(), ProcessMessage(), and CDoubleList< CGUIElement * >::set_ptr().

Referenced by CGUI::ProcessMessages().

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

Method details:

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

Reimplemented from CXMLResource.

Reimplemented in CGUI, CGUIBorder, CGUIStatic, CGUIButton, CGUIScrollBar, CGUIProgressBar, CGUIDropList, CGUIListBox, CGUIMenuEntry, CGUIMenu, CGUIRadioGroup, and CGUITabControl.

Definition at line 957 of file GUIElement.cpp.

References Destroy(), CTextureManager::GetResource(), CMaterialManager::GetResource(), CSingleton< CTextureManager >::GetSingleton(), CSingleton< CMaterialManager >::GetSingleton(), IsAutoCalc(), LoadXML(), m_bAutoCalc, m_iMaterialIndex, m_iTextureIndex, m_pMaterial, m_pTexture, m_Rect, m_strRectangle, m_TexCoord, CXMLResource::PropertyChanging(), Resize(), and tVERTEX2f::x.

Referenced by CGUIStatic::PropertyChanging(), CGUIListBox::PropertyChanging(), CGUIBorder::PropertyChanging(), and CGUI::PropertyChanging().

void CGUIElement::RemoveChild CGUIElement pChild  ) 
 

Method details:

Parameters:
pChild - Pointer to the child to be removed
Definition at line 937 of file GUIElement.cpp.

References CDoubleList< CGUIElement * >::begin(), CDoubleList< CGUIElement * >::next(), CDoubleList< CGUIElement * >::remove(), and CDoubleList< CGUIElement * >::set_ptr().

Referenced by CGUIWindow::Create(), CGUITabControl::Create(), CGUIScrollBar::Create(), CGUIProgressBar::Create(), CGUIMenuEntry::Create(), CGUIListBox::Create(), CGUIDropList::Create(), CGUIWindow::Draw(), CGUIProgressBar::Draw(), CGUIListBox::Draw(), CGUIDropList::Draw(), CGUIWindow::LoadXML(), CGUIDropList::LoadXML(), CGUIWindow::Resize(), and CGUIScrollBar::Resize().

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

Method details:

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

Reimplemented in CGUIBorder, CGUIStatic, CGUITextBox, CGUIScrollBar, CGUIProgressBar, CGUIDropList, CGUIListBox, CGUIMenuEntry, and CGUIWindow.

Definition at line 605 of file GUIElement.cpp.

References GetChild(), GetGUI(), GetType(), m_bAllowSizeX, m_bAllowSizeY, m_Rect, and CGUI::PostMessage().

Referenced by CGUIMenuEntry::InsertItem(), LoadXML(), CGUIBorder::OnMouseMove(), CGUIMenuEntry::PropertyChanging(), PropertyChanging(), CGUIWindow::Resize(), CGUIStatic::Resize(), CGUIListBox::Resize(), and CGUIDropList::Resize().

int CGUIElement::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 CXMLResource.

Reimplemented in CGUI, CGUIBorder, CGUIStatic, CGUITextBox, CGUIButton, CGUIScrollBar, CGUIProgressBar, CGUIDropList, CGUIListBox, CGUIMenuEntry, CGUIMenu, CGUIRadioGroup, CGUITabControl, and CGUIWindow.

Definition at line 255 of file GUIElement.cpp.

References CDoubleList< CGUIElement * >::begin(), CEntity::GetID(), CEntity::GetName(), GetParent(), GetType(), TiXmlNode::InsertEndChild(), m_ActiveColor, m_bAllowMoveX, m_bAllowMoveY, m_bAllowSizeX, m_bAllowSizeY, m_InactiveColor, m_pMaterial, m_pTexture, m_Rect, m_strElementType, m_TexCoord, CDoubleList< CGUIElement * >::next(), TiXmlDocument::SaveFile(), CDoubleList< CGUIElement * >::set_ptr(), TiXmlElement::SetAttribute(), TiXmlNode::ToElement(), Visible(), tVERTEX2f::x, and tVERTEX2f::y.

Referenced by CGUIWindow::SaveXML(), CGUIStatic::SaveXML(), CGUIRadioGroup::SaveXML(), CGUIListBox::SaveXML(), and CGUI::SaveXML().

void CGUIElement::SetAutoCalc bool  bAutoCalc  ) 
 

Method details:

Parameters:
bAutoCalc - Sets Auto-Calculation to the value of this parameter
Definition at line 1131 of file GUIElement.cpp.

References m_bAutoCalc.

Referenced by CGUIMenuEntry::LoadXML().

void CGUIElement::SetFlag eGUIFlag  eFlag,
bool  bSet
 

Method details:

Parameters:
eWidgetType - Sets type of this widget (WARNING: Do not use in public!)
bSet - Sets the flag to the value of this parameter
Definition at line 863 of file GUIElement.cpp.

References m_bAllowMoveX, m_bAllowMoveY, m_bAllowSizeX, and m_bAllowSizeY.

Referenced by CGUIScrollBar::Create(), CGUIProgressBar::Create(), CGUIMenuEntry::InsertItem(), CGUIWindow::LoadXML(), CGUIProgressBar::LoadXML(), CGUIWindow::Maximize(), CGUIWindow::Minimize(), and CGUIWindow::Restore().

void CGUIElement::SetGUI CGUI pGUI  ) 
 

Method details:

Parameters:
pGUI - Pointer to Root GUI
Definition at line 677 of file GUIElement.cpp.

References m_pGUI.

void CGUIElement::SetHeight UINT  uiHeight  ) 
 

Method details:

Parameters:
uiHeight - new height of the widget
Definition at line 733 of file GUIElement.cpp.

References m_Rect.

Referenced by CGUIWindow::Minimize(), and CGUIWindow::Resize().

void CGUIElement::SetMaterial CMaterial pMaterial  ) 
 

Method details:

Parameters:
pMaterial - Pointer to the material for this widget
Definition at line 799 of file GUIElement.cpp.

References m_pMaterial.

void CGUIElement::SetParent CGUIElement pParent  ) 
 

Method details:

Parameters:
pParent - Pointer to the parent for this widget
Definition at line 682 of file GUIElement.cpp.

References m_pParent.

Referenced by CGUIWindow::Create(), CGUITabControl::Create(), CGUIScrollBar::Create(), CGUIProgressBar::Create(), CGUIListBox::Create(), Create(), CGUIDropList::Create(), and LoadXML().

void CGUIElement::SetRect tRect &  NewRect  ) 
 

Method details:

Parameters:
NewRect - New rectangle for this widget This function assigns passed rectangle AND doesn't send messages (GUI_Message_SizeX/Y) and does not resize sub-children!
Definition at line 932 of file GUIElement.cpp.

References m_Rect.

Referenced by Create(), CGUIWindow::Maximize(), CGUIWindow::Resize(), CGUIScrollBar::Resize(), CGUIProgressBar::Resize(), CGUIListBox::Resize(), CGUIDropList::Resize(), CGUIBorder::Resize(), CGUIWindow::Restore(), and CGUIScrollBar::SetCurPos().

void CGUIElement::SetTexCoord UINT  uiIndex,
float  U,
float  V
 

Method details:

Parameters:
uiIndex - Index for texture coordinate:
0 for Top Left, 1 - Top Right, 2 - Bottom Right, 3 - Bottom Left
U,V - UV Coordinates for given corner (uiIndex)
Definition at line 738 of file GUIElement.cpp.

References m_TexCoord, tVERTEX2f::x, and tVERTEX2f::y.

Referenced by CGUIProgressBar::Draw().

void CGUIElement::SetTexture CTexture pTexture  ) 
 

Method details:

Parameters:
pTexture - Pointer to the texture for this widget
Definition at line 789 of file GUIElement.cpp.

References m_pTexture.

Referenced by CGUIButton::Draw().

void CGUIElement::SetType eGUIControlType  eWidgetType  ) 
 

Method details:

Parameters:
eWidgetType - Sets type of this widget (WARNING: Do not use in public!)
Definition at line 654 of file GUIElement.cpp.

References m_eControlType.

Referenced by CGUIElement(), CGUIWindow::Create(), CGUITabControl::Create(), CGUIScrollBar::Create(), CGUIProgressBar::Create(), CGUIWindow::Initialize(), CGUITextBox::Initialize(), CGUITabControl::Initialize(), CGUIScrollBar::Initialize(), CGUIRadioGroup::Initialize(), CGUIProgressBar::Initialize(), CGUIMenuEntry::Initialize(), CGUIMenu::Initialize(), CGUIListBox::Initialize(), CGUIDropList::Initialize(), CGUI::Initialize(), CGUIWindow::LoadXML(), CGUITabControl::LoadXML(), CGUIScrollBar::LoadXML(), CGUIProgressBar::LoadXML(), and CGUITabControl::PropertyChanging().

void CGUIElement::SetWidth UINT  uiWidth  ) 
 

Method details:

Parameters:
uiWidth - new width of the widget

void CGUIElement::SetZOrder UINT  uiZOrder  ) 
 

Method details:

Todo:
Implement this function
Definition at line 906 of file GUIElement.cpp.

References GetParent(), CDoubleList< T >::move_to(), and CDoubleList< T >::size().

void CGUIElement::Show  ) 
 

Method details: Makes this widget visibleDefinition at line 848 of file GUIElement.cpp.

References m_bVisible.

Referenced by CGUIMenu::Draw(), CGUITabControl::LoadXML(), CGUITabControl::ProcessMessage(), CGUIListBox::Resize(), CGUIWindow::Restore(), and ShowSiblings().

void CGUIElement::ShowSiblings int  iDeep = -1  ) 
 

Method details:

Parameters:
iDeep - How deep to go and show child widgets (-1 to show all children, sub-children, etc)
Definition at line 824 of file GUIElement.cpp.

References CDoubleList< CGUIElement * >::begin(), CDoubleList< CGUIElement * >::next(), CDoubleList< CGUIElement * >::set_ptr(), and Show().

Referenced by CGUIWindow::Draw(), CGUIRadioGroup::Draw(), CGUIMenu::Draw(), and CGUIMenuEntry::Expand().

bool CGUIElement::Visible  ) 
 

Method details:

Returns:
True if widget is visible, False otherwise
Definition at line 858 of file GUIElement.cpp.

References m_bVisible.

Referenced by CGUIWindow::Draw(), CGUIRadioGroup::Draw(), CGUIProgressBar::Draw(), Draw(), CGUIButton::OnLMouseUp(), OnMouseMove(), OnMove(), CGUIMenuEntry::PointInChildRects(), CGUIMenu::ProcessMessage(), CGUI::ProcessMessage(), CGUIWindow::Resize(), and SaveXML().


Member Data Documentation

COLORREF CGUIElement::m_ActiveColor [protected]
 

Material' Active Color (RGB) Definition at line 610 of file GUI.h.

Referenced by GetProperties(), and SaveXML().

bool CGUIElement::m_bActive [protected]
 

Is this widget active or inactive Definition at line 612 of file GUI.h.

bool CGUIElement::m_bAllowMoveX [protected]
 

Flag to allow this widget to move on X Axis (or not) Definition at line 595 of file GUI.h.

Referenced by GetProperties(), Initialize(), IsFlagSet(), LoadXML(), OnMove(), SaveXML(), and SetFlag().

bool CGUIElement::m_bAllowMoveY [protected]
 

Flag to allow this widget to move on Y Axis (or not) Definition at line 596 of file GUI.h.

Referenced by GetProperties(), Initialize(), IsFlagSet(), LoadXML(), OnMove(), SaveXML(), and SetFlag().

bool CGUIElement::m_bAllowSizeX [protected]
 

Flag to allow this widget to have Width changed (or not) Definition at line 597 of file GUI.h.

Referenced by GetProperties(), Initialize(), IsFlagSet(), LoadXML(), Resize(), SaveXML(), and SetFlag().

bool CGUIElement::m_bAllowSizeY [protected]
 

Flag to allow this widget to have Height changed (or not) Definition at line 598 of file GUI.h.

Referenced by GetProperties(), Initialize(), IsFlagSet(), LoadXML(), Resize(), SaveXML(), and SetFlag().

bool CGUIElement::m_bAutoCalc [protected]
 

Auto-Calculation flag: used for various purposes Definition at line 588 of file GUI.h.

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

bool CGUIElement::m_bVisible [protected]
 

Is widget visible Definition at line 630 of file GUI.h.

Referenced by GetProperties(), Hide(), Initialize(), Show(), and Visible().

DWORD CGUIElement::m_dwFlags [protected]
 

Widget' flags Definition at line 626 of file GUI.h.

Referenced by Initialize(), and LoadXML().

eGUIControlType CGUIElement::m_eControlType [protected]
 

Widget Core Attributes.

Widget' Type Definition at line 621 of file GUI.h.

Referenced by GetType(), and SetType().

UINT CGUIElement::m_iChildren [protected]
 

Number of children for the widget Definition at line 591 of file GUI.h.

Referenced by GetProperties().

int CGUIElement::m_iMaterialIndex [protected]
 

Index of the material from Material Database Definition at line 602 of file GUI.h.

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

int CGUIElement::m_iMaterialShininess [protected]
 

Material' Shininess value Definition at line 608 of file GUI.h.

Referenced by CGUIElement(), and GetProperties().

COLORREF CGUIElement::m_InactiveColor [protected]
 

Material' Inactive Color (RGB) Definition at line 611 of file GUI.h.

Referenced by GetProperties(), and SaveXML().

int CGUIElement::m_iTextureIndex [protected]
 

Texture' index for the Texture Database Definition at line 617 of file GUI.h.

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

COLORREF CGUIElement::m_MaterialAmbient [protected]
 

Material' Ambient color (RGB) Definition at line 604 of file GUI.h.

Referenced by GetProperties().

COLORREF CGUIElement::m_MaterialDiffuse [protected]
 

Material' Diffuse color (RGB) Definition at line 605 of file GUI.h.

Referenced by GetProperties().

COLORREF CGUIElement::m_MaterialEmissive [protected]
 

Material' Emissive color (RGB) Definition at line 607 of file GUI.h.

Referenced by GetProperties().

COLORREF CGUIElement::m_MaterialSpecular [protected]
 

Material' Specular color (RGB) Definition at line 606 of file GUI.h.

Referenced by GetProperties().

CGUI* CGUIElement::m_pGUI [protected]
 

Pointer to the Root GUI Definition at line 624 of file GUI.h.

Referenced by Initialize(), and SetGUI().

CMaterial* CGUIElement::m_pMaterial [protected]
 

Pointer to widget' material Definition at line 627 of file GUI.h.

Referenced by CGUIElement(), Create(), Draw(), GetMaterial(), GetProperties(), Initialize(), LoadXML(), PropertyChanging(), SaveXML(), and SetMaterial().

CGUIElement* CGUIElement::m_pParent [protected]
 

Pointer to the widget parent Definition at line 623 of file GUI.h.

Referenced by CGUIElement(), GetParent(), and SetParent().

CTexture* CGUIElement::m_pTexture [protected]
 

Pointer to widget' texture Definition at line 628 of file GUI.h.

Referenced by CGUIElement(), Create(), Draw(), GetProperties(), GetTexture(), Initialize(), LoadXML(), PropertyChanging(), SaveXML(), and SetTexture().

tRect CGUIElement::m_Rect [protected]
 

Widget' Rectangle Definition at line 625 of file GUI.h.

Referenced by Draw(), GetHeight(), GetProperties(), GetRect(), GetWidth(), LoadXML(), OnMouseMove(), OnMove(), PropertyChanging(), Resize(), SaveXML(), SetHeight(), and SetRect().

CString CGUIElement::m_strElementType [protected]
 

String with the name for the widget (used for XML) Definition at line 590 of file GUI.h.

Referenced by CGUIElement(), GetProperties(), LoadXML(), and SaveXML().

CString CGUIElement::m_strMaterialName [protected]
 

Material' name Definition at line 601 of file GUI.h.

CString CGUIElement::m_strRectangle [protected]
 

Rectangle string Definition at line 593 of file GUI.h.

Referenced by GetProperties(), and PropertyChanging().

CString CGUIElement::m_strTextureFilename [protected]
 

Texture' Filename Definition at line 616 of file GUI.h.

Referenced by GetProperties().

CString CGUIElement::m_strTextureName [protected]
 

Texture' name Definition at line 615 of file GUI.h.

Referenced by GetProperties().

tVERTEX2f CGUIElement::m_TexCoord[4] [protected]
 

Widget' texture coordinates Definition at line 629 of file GUI.h.

Referenced by Draw(), GetProperties(), GetTexCoord(), Initialize(), LoadXML(), PropertyChanging(), SaveXML(), and SetTexCoord().


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