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

CGUIScrollBar Class Reference

Scroll Bar Control. More...

#include <GUI.h>

Inheritance diagram for CGUIScrollBar:

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 ScrollBarType, CGUIButton *pIncButton=NULL, CGUIButton *pDecButton=NULL, CGUIButton *pThumbButton=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)
virtual int OnLMouseUp (UINT x, UINT y)
void SetRange (UINT uiMin, UINT uiMax)
tVERTEX2dGetRange ()
UINT GetCurPos ()
virtual void SetCurPos (float fPos)
virtual bool IsOfType (eEntityType eType)

Protected Member Functions

virtual void ProcessMessage (tGUIMessage &Message)

Protected Attributes

int m_iCurPos
int m_iMinPos
int m_iMaxPos
int m_iBtnInc
int m_iScrlInc
int m_iPrevPos
double m_fCurPos
double m_fPixelPerValue

Detailed Description

Scroll 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 1300 of file GUI.h.


Member Function Documentation

int CGUIScrollBar::Create CGUIElement pParent,
tRect  WidgetRect,
eGUIControlType  ScrollBarType,
CGUIButton pIncButton = NULL,
CGUIButton pDecButton = NULL,
CGUIButton pThumbButton = 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
ScrollBarType - Type of the scrollbar (either GUI_ScrollBar _Horizontal or _Vertical)
pIncButton - Pointer to Incremental Button
pDecButton - Pointer to Decremental Button
pThumbButton - Pointer to Thumb Button
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 29 of file GUIScrollBar.cpp.

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

Referenced by LoadXML().

void CGUIScrollBar::Draw  )  [virtual]
 

Method details: Draws the widget

Reimplemented from CGUIStatic.

Definition at line 232 of file GUIScrollBar.cpp.

References CGUIStatic::Draw(), m_iCurPos, and CGUIStatic::SetText().

UINT CGUIScrollBar::GetCurPos  ) 
 

Method details:

Returns:
Current scrollbar position
Definition at line 452 of file GUIScrollBar.cpp.

References m_iCurPos.

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

Method details:

Parameters:
PropList - Const. reference to the property list

Reimplemented from CGUIStatic.

Definition at line 587 of file GUIScrollBar.cpp.

References CGUIStatic::GetProperties(), m_iBtnInc, m_iCurPos, m_iMaxPos, m_iMinPos, and m_iScrlInc.

tVERTEX2d & CGUIScrollBar::GetRange  ) 
 

Method details:

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

References m_iMaxPos, and m_iMinPos.

void CGUIScrollBar::Initialize  )  [virtual]
 

Method details: Initializes ScrollBar Control' variables

Reimplemented from CGUIStatic.

Definition at line 18 of file GUIScrollBar.cpp.

References m_fCurPos, m_fPixelPerValue, m_iBtnInc, m_iMaxPos, m_iMinPos, m_iPrevPos, m_iScrlInc, and CGUIElement::SetType().

bool CGUIScrollBar::IsOfType eEntityType  eType  )  [virtual]
 

Method details: This is an implementation of Custom RTTI

Reimplemented from CGUIStatic.

Definition at line 552 of file GUIScrollBar.cpp.

References CGUIStatic::IsOfType().

int CGUIScrollBar::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 109 of file GUIScrollBar.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_iBtnInc, m_iCurPos, m_iMaxPos, m_iMinPos, CGUIElement::SetType(), and CLogger::Write().

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

Definition at line 499 of file GUIScrollBar.cpp.

References CGUIElement::GetChild(), CGUIElement::GetRect(), CGUIElement::GetType(), m_iCurPos, m_iScrlInc, CGUIElement::OnLMouseUp(), and SetCurPos().

void CGUIScrollBar::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 457 of file GUIScrollBar.cpp.

References CMouse::GetCursorPos(), CInputEngine::GetMouse(), CMouse::GetPrevCursorPos(), CGUIElement::GetRect(), CSingleton< CInputEngine >::GetSingleton(), CGUIElement::GetType(), CGUIElement::IsChild(), m_fCurPos, m_fPixelPerValue, m_iBtnInc, m_iMaxPos, m_iMinPos, tGUIMessage::pSender, Resize(), SetCurPos(), tVERTEX2d::x, and tVERTEX2d::y.

bool CGUIScrollBar::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 560 of file GUIScrollBar.cpp.

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

int CGUIScrollBar::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 241 of file GUIScrollBar.cpp.

References CGUIElement::GetChild(), CGUIElement::GetHeight(), CGUIElement::GetRect(), CGUIElement::GetType(), CGUIElement::GetWidth(), m_fCurPos, CGUIElement::RemoveChild(), CGUIStatic::Resize(), SetCurPos(), and CGUIElement::SetRect().

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

int CGUIScrollBar::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 193 of file GUIScrollBar.cpp.

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

void CGUIScrollBar::SetCurPos float  fPos  )  [virtual]
 

Method details:

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

References CGUIElement::GetChild(), CGUIElement::GetGUI(), CGUIElement::GetHeight(), CGUIElement::GetRect(), CGUIElement::GetType(), CGUIElement::GetWidth(), m_fCurPos, m_fPixelPerValue, m_iCurPos, m_iMaxPos, m_iMinPos, m_iPrevPos, CGUI::PostMessage(), and CGUIElement::SetRect().

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

void CGUIScrollBar::SetRange UINT  uiMin,
UINT  uiMax
 

Method details:

Parameters:
uiMin - Minimum value for the scrollbar
uiMax - Maximum value for the scrollbar
Definition at line 349 of file GUIScrollBar.cpp.

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

Referenced by Create(), and PropertyChanging().


Member Data Documentation

double CGUIScrollBar::m_fCurPos [protected]
 

Floating point current position

See also:
m_fPixelPerValue)
Definition at line 1420 of file GUI.h.

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

double CGUIScrollBar::m_fPixelPerValue [protected]
 

Pixel Per Value attribute (how many pixels to scroll if a change of 1 unit has occured) Definition at line 1420 of file GUI.h.

Referenced by Initialize(), ProcessMessage(), SetCurPos(), and SetRange().

int CGUIScrollBar::m_iBtnInc [protected]
 

Increments that much when clicked on button (either top - bottom, or left - right) Definition at line 1412 of file GUI.h.

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

int CGUIScrollBar::m_iCurPos [protected]
 

Current progress bar position Definition at line 1412 of file GUI.h.

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

int CGUIScrollBar::m_iMaxPos [protected]
 

Max scrollbar value Definition at line 1412 of file GUI.h.

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

int CGUIScrollBar::m_iMinPos [protected]
 

Minimum scrollbar value Definition at line 1412 of file GUI.h.

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

int CGUIScrollBar::m_iPrevPos [protected]
 

Previous scrollbar value Definition at line 1418 of file GUI.h.

Referenced by Initialize(), and SetCurPos().

int CGUIScrollBar::m_iScrlInc [protected]
 

Increments that much when clicked on the scrollbar (not on any of its buttons!) Definition at line 1412 of file GUI.h.

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


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