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

CGUIMenuEntry Class Reference

Menu Entry Class. More...

#include <GUI.h>

Inheritance diagram for CGUIMenuEntry:

CGUIButton CGUIStatic CGUIElement CXMLResource CDoubleList< CGUIElement * > CResource CEntity 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 int LoadXML (TiXmlNode *pDataNode, CString strFilename)
virtual int SaveXML (TiXmlNode *pDataNode, CString strFilename)
int HExpand ()
int VExpand ()
void SetExpand (int iHorizontal, int iVertical)
virtual void Expand ()
virtual void Collapse ()
bool PointInChildRects ()
virtual CGUIElementInsertItem (CString &strItemText, UINT uiInsertAfter=0)
void HideSiblingsText (int iDeep=-1)
void ShowSiblingsText (int iDeep=-1)
virtual int Resize (tRect &NewRect)
virtual void ProcessMessage (tGUIMessage &Message)
virtual void Destroy ()
virtual void Draw ()
const CGUIMenuEntryGetExpanded ()
virtual bool IsOfType (eEntityType eType)

Protected Attributes

int m_iHExpand
int m_iVExpand
int m_iCurSel
CGUIMenuEntrym_pExpandedChild

Detailed Description

Menu Entry Class.

This control represents an entry for the CGUIMenu class NOTE: All of its entries MUST be CGUIMenuEntry (or CGUIMenuEntry-derived) widgets.

Definition at line 1769 of file GUI.h.


Member Function Documentation

void CGUIMenuEntry::Collapse  )  [virtual]
 

Method details: Collapses this menu entry (makes it's children invisible)Definition at line 350 of file GUIMenuEntry.cpp.

References CGUIElement::HideSiblings(), and HideSiblingsText().

Referenced by Draw(), and CGUIMenu::ProcessMessage().

int CGUIMenuEntry::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?
pDefaultEntryBtn - Pointer to the default DropList entry CGUIButton (or -derived) widget
Returns:
1 if sucessful, 0 if not

Reimplemented from CGUIButton.

Reimplemented in CGUIMenu.

Definition at line 24 of file GUIMenuEntry.cpp.

References CGUIButton::Create(), CGUIElement::GetChild(), CGUIElement::GetType(), and CGUIElement::RemoveChild().

Referenced by CGUIMenu::Create(), and InsertItem().

void CGUIMenuEntry::Destroy  )  [virtual]
 

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

Reimplemented from CGUIButton.

Definition at line 429 of file GUIMenuEntry.cpp.

void CGUIMenuEntry::Draw  )  [virtual]
 

Method details: Draws the widget

Reimplemented from CGUIButton.

Reimplemented in CGUIMenu.

Definition at line 254 of file GUIMenuEntry.cpp.

References CDoubleList< CGUIElement * >::begin(), Collapse(), CGUIButton::Draw(), Expand(), CGUIElement::GetChildCount(), CMouse::GetCursorPos(), CInputEngine::GetMouse(), CGUIElement::GetRect(), CSingleton< CInputEngine >::GetSingleton(), CGUIElement::GetType(), m_pExpandedChild, CDoubleList< CGUIElement * >::next(), PointInChildRects(), CDoubleList< CGUIElement * >::set_ptr(), tVERTEX2d::x, and tVERTEX2d::y.

Referenced by CGUIMenu::Draw().

void CGUIMenuEntry::Expand  )  [virtual]
 

Method details: Expands this menu entry (makes it's children visible)Definition at line 248 of file GUIMenuEntry.cpp.

References CGUIElement::ShowSiblings(), and ShowSiblingsText().

Referenced by Draw(), and CGUIMenu::ProcessMessage().

const CGUIMenuEntry * CGUIMenuEntry::GetExpanded  ) 
 

Method details:

Returns:
Pointer to the currently expanded child
Definition at line 356 of file GUIMenuEntry.cpp.

References m_pExpandedChild.

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

Method details:

Parameters:
PropList - Const. reference to the property list

Reimplemented from CGUIButton.

Reimplemented in CGUIMenu.

Definition at line 384 of file GUIMenuEntry.cpp.

References CDoubleList< CGUIElement * >::begin(), CGUIButton::GetProperties(), CGUIElement::GetType(), CGUIElement::IsAutoCalc(), m_iCurSel, m_iHExpand, m_iVExpand, CDoubleList< CGUIElement * >::next(), and CDoubleList< CGUIElement * >::set_ptr().

Referenced by CGUIMenu::GetProperties().

int CGUIMenuEntry::HExpand  ) 
 

Method details:

Returns:
-1 if this entry is offsetted to the left, 0 of it is not ofsetted, and 1 if it is ofsetted to the right
Definition at line 45 of file GUIMenuEntry.cpp.

References m_iHExpand.

Referenced by Resize().

void CGUIMenuEntry::HideSiblingsText int  iDeep = -1  ) 
 

Method details:

Parameters:
iDeep - How deep to go and hide the children at that depth (-1 to hide them all)
Definition at line 168 of file GUIMenuEntry.cpp.

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

Referenced by Collapse(), and LoadXML().

void CGUIMenuEntry::Initialize  )  [virtual]
 

Method details: Initializes GUI DropList' variables

Reimplemented from CGUIButton.

Reimplemented in CGUIMenu.

Definition at line 14 of file GUIMenuEntry.cpp.

References m_iCurSel, m_iHExpand, m_iVExpand, m_pExpandedChild, and CGUIElement::SetType().

CGUIElement * CGUIMenuEntry::InsertItem CString &  strItemText,
UINT  uiInsertAfter = 0
[virtual]
 

Method details:

Parameters:
strItemText - Text for the new item entry
uiInsertAfter - Insert new entry after item specified by index this parameter
Definition at line 50 of file GUIMenuEntry.cpp.

References Create(), CGUIElement::GetParent(), CGUIElement::GetRect(), LoadXML(), CDoubleList< CGUIElement * >::push_front(), Resize(), CGUIElement::Resize(), SetExpand(), CGUIElement::SetFlag(), and CGUIStatic::SetText().

Referenced by PropertyChanging().

bool CGUIMenuEntry::IsOfType eEntityType  eType  )  [virtual]
 

Method details: This is an implementation of Custom RTTI

Reimplemented from CGUIButton.

Reimplemented in CGUIMenu.

Definition at line 376 of file GUIMenuEntry.cpp.

References CGUIButton::IsOfType().

Referenced by CGUIMenu::IsOfType().

int CGUIMenuEntry::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 CGUIButton.

Reimplemented in CGUIMenu.

Definition at line 76 of file GUIMenuEntry.cpp.

References TiXmlElement::Attribute(), CEntity::GetID(), CEntity::GetName(), CSingleton< CGlobalLogger >::GetSingleton(), CGUIElement::HideSiblings(), HideSiblingsText(), CGUIButton::LoadXML(), m_iHExpand, m_iVExpand, CGUIElement::SetAutoCalc(), and CLogger::Write().

Referenced by InsertItem(), and CGUIMenu::LoadXML().

bool CGUIMenuEntry::PointInChildRects  ) 
 

Method details:

Returns:
True if the mouse is within ANY child' rectangle, False otherwise (to keep track that this menu entry should be expanded)
Definition at line 434 of file GUIMenuEntry.cpp.

References CDoubleList< CGUIElement * >::begin(), CMouse::GetCursorPos(), CInputEngine::GetMouse(), CGUIElement::GetRect(), CSingleton< CInputEngine >::GetSingleton(), CGUIElement::GetType(), CDoubleList< CGUIElement * >::next(), CDoubleList< CGUIElement * >::set_ptr(), CGUIElement::Visible(), tVERTEX2d::x, and tVERTEX2d::y.

Referenced by Draw().

void CGUIMenuEntry::ProcessMessage tGUIMessage Message  )  [virtual]
 

Method details:

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

Reimplemented from CGUIElement.

Reimplemented in CGUIMenu.

Definition at line 361 of file GUIMenuEntry.cpp.

References CGUIElement::GetParent(), CGUIElement::GetRect(), tGUIMessage::pSender, and Resize().

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

Method details:

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

Reimplemented from CGUIButton.

Reimplemented in CGUIMenu.

Definition at line 218 of file GUIMenuEntry.cpp.

References CGUIElement::GetParent(), CGUIElement::GetRect(), InsertItem(), m_iCurSel, m_iHExpand, m_iVExpand, CGUIButton::PropertyChanging(), and CGUIElement::Resize().

Referenced by CGUIMenu::PropertyChanging().

int CGUIMenuEntry::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 CGUIStatic.

Definition at line 290 of file GUIMenuEntry.cpp.

References CDoubleList< CGUIElement * >::begin(), CGUIElement::GetType(), HExpand(), CGUIElement::IsAutoCalc(), CDoubleList< CGUIElement * >::next(), CGUIStatic::Resize(), CDoubleList< CGUIElement * >::set_ptr(), and VExpand().

Referenced by InsertItem(), CGUIMenu::LoadXML(), ProcessMessage(), and CGUIMenu::ProcessMessage().

int CGUIMenuEntry::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 CGUIButton.

Reimplemented in CGUIMenu.

Definition at line 136 of file GUIMenuEntry.cpp.

References m_iHExpand, m_iVExpand, CGUIButton::SaveXML(), TiXmlElement::SetAttribute(), and TiXmlNode::ToElement().

Referenced by CGUIMenu::SaveXML().

void CGUIMenuEntry::SetExpand int  iHorizontal,
int  iVertical
 

Method details:

Parameters:
iHorizontal - Horizontal offset for this menu entry (-1 to the left, 0 - none, 1 - to the right)
iHorizontal - Horizontal offset for this menu entry (-1 to the bottom, 0 - none, 1 - to the top)
Definition at line 34 of file GUIMenuEntry.cpp.

References m_iHExpand, and m_iVExpand.

Referenced by InsertItem().

void CGUIMenuEntry::ShowSiblingsText int  iDeep = -1  ) 
 

Method details:

Parameters:
iDeep - How deep to go and show the children at that depth (-1 to show them all)
Definition at line 191 of file GUIMenuEntry.cpp.

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

Referenced by Expand().

int CGUIMenuEntry::VExpand  ) 
 

Method details:

Returns:
-1 if this entry is offsetted to the bottom, 0 of it is not ofsetted, and 1 if it is ofsetted to the top
Definition at line 40 of file GUIMenuEntry.cpp.

References m_iVExpand.

Referenced by Resize().


Member Data Documentation

int CGUIMenuEntry::m_iCurSel [protected]
 

Currently selected child (used to add new sub-entries) Definition at line 1900 of file GUI.h.

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

int CGUIMenuEntry::m_iHExpand [protected]
 

See also:
CGUIMenuEntry::HExpand()
Definition at line 1898 of file GUI.h.

Referenced by GetProperties(), HExpand(), Initialize(), LoadXML(), PropertyChanging(), SaveXML(), and SetExpand().

int CGUIMenuEntry::m_iVExpand [protected]
 

See also:
CGUIMenuEntry::VExpand()
Definition at line 1898 of file GUI.h.

Referenced by GetProperties(), Initialize(), LoadXML(), PropertyChanging(), SaveXML(), SetExpand(), and VExpand().

CGUIMenuEntry* CGUIMenuEntry::m_pExpandedChild [protected]
 

Pointer to expanded child Definition at line 1901 of file GUI.h.

Referenced by Draw(), GetExpanded(), 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