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

CGUIDropList Class Reference

DropList Control. More...

#include <GUI.h>

Inheritance diagram for CGUIDropList:

CGUIButton CGUIStatic CGUIElement CXMLResource CDoubleList< CGUIElement * > CResource CEntity 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, CGUIButton *pDefaultEntryBtn=NULL)
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 ProcessMessage (tGUIMessage &Message)
virtual void Expand ()
virtual void Collapse ()
virtual void SetCurSel (int iSelection)
int GetCurSel ()
virtual CGUIElementInsertItem (CString &strItemText, UINT uiInsertAfter=0)
virtual bool IsOfType (eEntityType eType)

Protected Attributes

int m_iSpacing
int m_iListType
bool m_bExpanded
bool m_bIdentSize
int m_iCurSel

Detailed Description

DropList Control.

This control represents a simple drop list. It is a derivative of CGUIButton, thus it can be clicked upon to expand the list. NOTE: All of its entries MUST be CGUIButton (or CGUIButton-derived) widgets.

Definition at line 1548 of file GUI.h.


Member Function Documentation

void CGUIDropList::Collapse  )  [virtual]
 

Method details: Collapses the drop listDefinition at line 67 of file GUIDropList.cpp.

References CGUIElement::GetChild(), CGUIElement::GetChildCount(), CGUIElement::GetType(), and m_bExpanded.

Referenced by LoadXML(), ProcessMessage(), and PropertyChanging().

int CGUIDropList::Create CGUIElement pParent,
tRect  WidgetRect,
CCustomFont pFont = NULL,
CTexture pTexture = NULL,
CMaterial pMaterial = NULL,
bool  bBorder = false,
CGUIButton pDefaultEntryBtn = NULL
[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
Definition at line 32 of file GUIDropList.cpp.

References CGUIButton::Create(), CGUIElement::GetChild(), CGUIElement::IsChild(), CDoubleList< CGUIElement * >::push_back(), CGUIElement::RemoveChild(), Resize(), and CGUIElement::SetParent().

void CGUIDropList::Draw  )  [virtual]
 

Method details: Draws the widget

Reimplemented from CGUIButton.

Definition at line 84 of file GUIDropList.cpp.

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

void CGUIDropList::Expand  )  [virtual]
 

Method details: Expands the drop listDefinition at line 51 of file GUIDropList.cpp.

References CGUIElement::GetChild(), CGUIElement::GetChildCount(), CGUIElement::GetType(), and m_bExpanded.

Referenced by LoadXML(), and ProcessMessage().

int CGUIDropList::GetCurSel  ) 
 

Method details:

Returns:
Index of current selection
Definition at line 390 of file GUIDropList.cpp.

References m_iCurSel.

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

Method details:

Parameters:
PropList - Const. reference to the property list

Reimplemented from CGUIButton.

Definition at line 458 of file GUIDropList.cpp.

References CDoubleList< CGUIElement * >::begin(), CGUIButton::GetProperties(), CGUIElement::GetType(), m_iCurSel, m_iListType, m_iSpacing, CDoubleList< CGUIElement * >::next(), and CDoubleList< CGUIElement * >::set_ptr().

void CGUIDropList::Initialize  )  [virtual]
 

Method details: Initializes GUI DropList' variables

Reimplemented from CGUIButton.

Definition at line 20 of file GUIDropList.cpp.

References m_bExpanded, m_bIdentSize, m_iCurSel, m_iListType, m_iSpacing, and CGUIElement::SetType().

CGUIElement * CGUIDropList::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 395 of file GUIDropList.cpp.

References CGUIButton::Create(), CGUIElement::GetRect(), CGUIButton::LoadXML(), CDoubleList< CGUIElement * >::push_back(), Resize(), and CGUIStatic::SetText().

Referenced by PropertyChanging().

bool CGUIDropList::IsOfType eEntityType  eType  )  [virtual]
 

Method details: This is an implementation of Custom RTTI

Reimplemented from CGUIButton.

Definition at line 417 of file GUIDropList.cpp.

References CGUIButton::IsOfType().

int CGUIDropList::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.

Definition at line 100 of file GUIDropList.cpp.

References TiXmlElement::Attribute(), CDoubleList< CGUIElement * >::begin(), Collapse(), Expand(), CGUIElement::GetChild(), CEntity::GetID(), CEntity::GetName(), CSingleton< CGlobalLogger >::GetSingleton(), CGUIElement::GetType(), CGUIButton::LoadXML(), m_bExpanded, m_iListType, CDoubleList< CGUIElement * >::next(), CGUIElement::RemoveChild(), CDoubleList< CGUIElement * >::set_ptr(), SetCurSel(), and CLogger::Write().

void CGUIDropList::ProcessMessage tGUIMessage Message  )  [virtual]
 

Method details:

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

Reimplemented from CGUIElement.

Definition at line 308 of file GUIDropList.cpp.

References Collapse(), Expand(), CGUIElement::GetChild(), CGUIElement::GetChildCount(), CGUIElement::GetRect(), CGUIElement::GetType(), CGUIElement::IsChild(), m_bExpanded, tGUIMessage::pSender, Resize(), and SetCurSel().

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

Method details:

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

Reimplemented from CGUIButton.

Definition at line 425 of file GUIDropList.cpp.

References Collapse(), CGUIElement::GetRect(), InsertItem(), m_iCurSel, m_iListType, CGUIButton::PropertyChanging(), Resize(), and SetCurSel().

int CGUIDropList::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 197 of file GUIDropList.cpp.

References CGUIElement::GetChild(), CGUIElement::GetChildCount(), CBitmapFont::GetQuadHeight(), CBitmapFont::GetQuadLength(), CGUIElement::GetRect(), CBitmapFont::GetSpacing(), CGUIElement::GetType(), CGUIElement::GetWidth(), m_bIdentSize, m_iListType, m_iSpacing, CGUIElement::Resize(), and CGUIElement::SetRect().

Referenced by Create(), InsertItem(), ProcessMessage(), and PropertyChanging().

int CGUIDropList::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.

Definition at line 164 of file GUIDropList.cpp.

References TiXmlNode::InsertEndChild(), m_bExpanded, m_iCurSel, m_iListType, TiXmlDocument::SaveFile(), CGUIButton::SaveXML(), TiXmlElement::SetAttribute(), and TiXmlNode::ToElement().

void CGUIDropList::SetCurSel int  iSelection  )  [virtual]
 

Method details:

Parameters:
iSelection - Sets current drop list selection to the one specified by value (by index).
Definition at line 365 of file GUIDropList.cpp.

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

Referenced by LoadXML(), ProcessMessage(), and PropertyChanging().


Member Data Documentation

bool CGUIDropList::m_bExpanded [protected]
 

Indicates when list is expanded Definition at line 1655 of file GUI.h.

Referenced by Collapse(), Expand(), Initialize(), LoadXML(), ProcessMessage(), and SaveXML().

bool CGUIDropList::m_bIdentSize [protected]
 

All entries are of the same size? Definition at line 1655 of file GUI.h.

Referenced by Initialize(), and Resize().

int CGUIDropList::m_iCurSel [protected]
 

Currently selected item (-1 for none) Definition at line 1657 of file GUI.h.

Referenced by GetCurSel(), GetProperties(), Initialize(), PropertyChanging(), SaveXML(), and SetCurSel().

int CGUIDropList::m_iListType [protected]
 

List types:
0: All entries are of the same width
1: All entries are of the same width of maximum entry and droplist is of that max. width
2: All entries are own width, but droplist becomes of max. width Definition at line 1650 of file GUI.h.

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

int CGUIDropList::m_iSpacing [protected]
 

Spacing between items (and drop list) Definition at line 1650 of file GUI.h.

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


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