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

CGUIProgressBar Class Reference

Progress Bar Control. More...

#include <GUI.h>

Inheritance diagram for CGUIProgressBar:

CGUIStatic CGUIElement CXMLResource CDoubleList< CGUIElement * > CResource CEntity List of all members.

Public Member Functions

virtual void Initialize ()
virtual int Create (CGUIElement *pParent, tRect WidgetRect, eGUIControlType ProgressBarType, CGUIElement *pPosElement=NULL, CGUIElement *pNegElement=NULL, 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)
void SetRange (UINT uiMin, UINT uiMax, bool bMinToMax=true)
tVERTEX2dGetRange ()
UINT GetCurPos ()
virtual void SetCurPos (float fPos)
virtual bool IsOfType (eEntityType eType)

Protected Member Functions

virtual void ProcessMessage (tGUIMessage &Message)

Protected Attributes

bool m_bMinToMax
bool m_bAutoCoordCalc
int m_iCurPos
int m_iMinPos
int m_iMaxPos
double m_fCurPos
double m_fPixelPerValue

Detailed Description

Progress Bar Control.

This control represents a simple scrollbar (vertical OR horizontal). It features 3 buttons, increment, decrement and thumb ones that are used to control the value of the scrollbar.

Definition at line 1429 of file GUI.h.


Member Function Documentation

int CGUIProgressBar::Create CGUIElement pParent,
tRect  WidgetRect,
eGUIControlType  ProgressBarType,
CGUIElement pPosElement = NULL,
CGUIElement pNegElement = NULL,
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
ProgressBarType - Type of the progress (either GUI_ProgressBar _Horizontal or _Vertical)
pPosElement - Pointer to the positive element for the progressbar
pNegElement - Pointer to the negative element for the progressbar
pFont - Pointer to font for this Static-derived control
pTexture - Pointer to texture
pMaterial - Pointer to material
bBorder - does this widget has a border?
Returns:
1 if sucessful, 0 if not
Definition at line 28 of file GUIProgressBar.cpp.

References CGUIElement::CGUIElement(), CGUIElement::Create(), CGUIStatic::Create(), CGUIElement::GetChild(), CGUIElement::IsChild(), m_iCurPos, m_iMaxPos, m_iMinPos, CDoubleList< CGUIElement * >::push_back(), CGUIElement::RemoveChild(), Resize(), SetCurPos(), CGUIElement::SetFlag(), CEntity::SetName(), CGUIElement::SetParent(), SetRange(), and CGUIElement::SetType().

Referenced by LoadXML().

void CGUIProgressBar::Draw  )  [virtual]
 

Method details: Draws the widget

Reimplemented from CGUIStatic.

Definition at line 213 of file GUIProgressBar.cpp.

References CGUIStatic::Draw(), CGUIStatic::DrawText(), CGUIElement::GetChild(), CTexture::GetHeight(), CGUIElement::GetHeight(), CGUIElement::GetTexture(), CGUIElement::GetType(), CTexture::GetWidth(), CGUIElement::GetWidth(), m_bAutoCoordCalc, m_iCurPos, CGUIElement::RemoveChild(), CGUIElement::SetTexCoord(), CGUIStatic::SetText(), and CGUIElement::Visible().

UINT CGUIProgressBar::GetCurPos  ) 
 

Method details:

Returns:
Current scrollbar position
Definition at line 363 of file GUIProgressBar.cpp.

References m_iCurPos.

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

Method details:

Parameters:
PropList - Const. reference to the property list

Reimplemented from CGUIStatic.

Definition at line 459 of file GUIProgressBar.cpp.

References CGUIStatic::GetProperties(), m_bAutoCoordCalc, m_bMinToMax, m_iCurPos, m_iMaxPos, and m_iMinPos.

tVERTEX2d & CGUIProgressBar::GetRange  ) 
 

Method details:

Returns:
Const. Reference to structure containing minimum and maximum values for the scrollbar (x - Min, y - Max)
Definition at line 392 of file GUIProgressBar.cpp.

References m_iMaxPos, and m_iMinPos.

void CGUIProgressBar::Initialize  )  [virtual]
 

Method details: Initializes ProgressBar Control' variables

Reimplemented from CGUIStatic.

Definition at line 14 of file GUIProgressBar.cpp.

References m_bAutoCoordCalc, m_bMinToMax, m_fCurPos, m_fPixelPerValue, m_iCurPos, m_iMaxPos, m_iMinPos, and CGUIElement::SetType().

bool CGUIProgressBar::IsOfType eEntityType  eType  )  [virtual]
 

Method details: This is an implementation of Custom RTTI

Reimplemented from CGUIStatic.

Definition at line 424 of file GUIProgressBar.cpp.

References CGUIStatic::IsOfType().

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

Definition at line 88 of file GUIProgressBar.cpp.

References TiXmlElement::Attribute(), Create(), CGUIElement::GetChild(), CGUIElement::GetChildCount(), CEntity::GetID(), CEntity::GetName(), CGUIElement::GetParent(), CGUIElement::GetRect(), CSingleton< CGlobalLogger >::GetSingleton(), CGUIElement::GetType(), CGUIStatic::LoadXML(), m_fCurPos, m_iCurPos, m_iMaxPos, m_iMinPos, CGUIElement::SetFlag(), CGUIElement::SetType(), and CLogger::Write().

void CGUIProgressBar::ProcessMessage tGUIMessage Message  )  [protected, virtual]
 

Method details:

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

Reimplemented from CGUIElement.

Definition at line 397 of file GUIProgressBar.cpp.

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

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

Method details:

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

Reimplemented from CGUIStatic.

Definition at line 432 of file GUIProgressBar.cpp.

References m_fCurPos, m_iCurPos, m_iMaxPos, m_iMinPos, CGUIStatic::PropertyChanging(), SetCurPos(), and SetRange().

int CGUIProgressBar::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 292 of file GUIProgressBar.cpp.

References CGUIElement::GetChild(), CGUIElement::GetRect(), CGUIElement::GetType(), m_bMinToMax, m_fCurPos, m_fPixelPerValue, m_iCurPos, m_iMaxPos, m_iMinPos, CGUIStatic::Resize(), SetRange(), and CGUIElement::SetRect().

Referenced by Create(), ProcessMessage(), and SetCurPos().

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

Definition at line 175 of file GUIProgressBar.cpp.

References CGUIElement::GetType(), TiXmlNode::InsertEndChild(), m_iCurPos, m_iMaxPos, m_iMinPos, TiXmlDocument::SaveFile(), CGUIStatic::SaveXML(), TiXmlElement::SetAttribute(), and TiXmlNode::ToElement().

void CGUIProgressBar::SetCurPos float  fPos  )  [virtual]
 

Method details:

Parameters:
fPos - New position for the scrollbar
Definition at line 368 of file GUIProgressBar.cpp.

References CGUIElement::GetRect(), m_iCurPos, m_iMaxPos, m_iMinPos, and Resize().

Referenced by Create(), and PropertyChanging().

void CGUIProgressBar::SetRange UINT  uiMin,
UINT  uiMax,
bool  bMinToMax = true
 

Method details:

Parameters:
uiMin - Minimum value for the scrollbar
uiMax - Maximum value for the scrollbar
bMinToMax - progress is happening usually from left to right (or bottom to top), with this value set to False, it can be reversed.
Definition at line 380 of file GUIProgressBar.cpp.

References CGUIElement::GetHeight(), CGUIElement::GetType(), CGUIElement::GetWidth(), m_bMinToMax, m_fPixelPerValue, m_iMaxPos, and m_iMinPos.

Referenced by Create(), PropertyChanging(), and Resize().


Member Data Documentation

bool CGUIProgressBar::m_bAutoCoordCalc [protected]
 

Automatic texture coordinate(s) calculation for positive & negative elements Definition at line 1534 of file GUI.h.

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

bool CGUIProgressBar::m_bMinToMax [protected]
 

Direction in which it progesses Definition at line 1533 of file GUI.h.

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

double CGUIProgressBar::m_fCurPos [protected]
 

Floating current position (see PPV) Definition at line 1539 of file GUI.h.

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

double CGUIProgressBar::m_fPixelPerValue [protected]
 

Pixel Per Value attribute Definition at line 1539 of file GUI.h.

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

int CGUIProgressBar::m_iCurPos [protected]
 

Current progressbar position Definition at line 1536 of file GUI.h.

Referenced by Create(), Draw(), GetCurPos(), GetProperties(), Initialize(), LoadXML(), PropertyChanging(), Resize(), SaveXML(), and SetCurPos().

int CGUIProgressBar::m_iMaxPos [protected]
 

uiMax value Definition at line 1536 of file GUI.h.

Referenced by Create(), GetProperties(), GetRange(), Initialize(), LoadXML(), PropertyChanging(), Resize(), SaveXML(), SetCurPos(), and SetRange().

int CGUIProgressBar::m_iMinPos [protected]
 

uiMin value Definition at line 1536 of file GUI.h.

Referenced by Create(), GetProperties(), GetRange(), Initialize(), LoadXML(), PropertyChanging(), Resize(), SaveXML(), SetCurPos(), and SetRange().


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