Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
CGUIScrollBarHorizontal Class Reference

Horizontal implementation of IGUIScrollBar. More...

#include <CGUIScrollBarHorizontal.h>

Inheritance diagram for CGUIScrollBarHorizontal:
Collaboration diagram for CGUIScrollBarHorizontal:

Public Member Functions

 CGUIScrollBarHorizontal (CGUI &pGUI)
 
virtual ~CGUIScrollBarHorizontal ()
 
virtual void Draw (CCanvas2D &canvas)
 Draw the scroll-bar. More...
 
virtual void HandleMessage (SGUIMessage &Message)
 If an object that contains a scrollbar has got messages, send them to the scroll-bar and it will see if the message regarded itself. More...
 
virtual void SetPosFromMousePos (const CVector2D &mouse)
 Set m_Pos with g_mouse_x/y input, i.e. More...
 
virtual void SetScrollPlentyFromMousePos (const CVector2D &mouse)
 
virtual bool HoveringButtonMinus (const CVector2D &mouse)
 
virtual bool HoveringButtonPlus (const CVector2D &mouse)
 
void SetBottomAligned (const bool &align)
 Set Right Aligned. More...
 
virtual CRect GetBarRect () const
 Get the rectangle of the actual BAR. More...
 
virtual CRect GetOuterRect () const
 Get the rectangle of the outline of the scrollbar, every component of the scroll-bar should be inside this area. More...
 
- Public Member Functions inherited from IGUIScrollBar
 NONCOPYABLE (IGUIScrollBar)
 
 IGUIScrollBar (CGUI &pGUI)
 
virtual ~IGUIScrollBar ()
 
virtual void Draw (CCanvas2D &canvas)=0
 Draw the scroll-bar. More...
 
virtual void HandleMessage (SGUIMessage &Message)=0
 If an object that contains a scrollbar has got messages, send them to the scroll-bar and it will see if the message regarded itself. More...
 
virtual void SetPosFromMousePos (const CVector2D &mouse)=0
 Set m_Pos with g_mouse_x/y input, i.e. More...
 
virtual void SetScrollPlentyFromMousePos (const CVector2D &mouse)=0
 
virtual bool HoveringButtonMinus (const CVector2D &)
 Hovering the scroll minus button. More...
 
virtual bool HoveringButtonPlus (const CVector2D &)
 Hovering the scroll plus button. More...
 
float GetPos () const
 Get scroll-position. More...
 
virtual void SetPos (float f)
 Set scroll-position by hand. More...
 
float GetMaxPos () const
 Get the value of m_Pos that corresponds to the bottom of the scrollable region. More...
 
bool IsVisible () const
 Whether to draw the scrollbar. More...
 
virtual void ScrollPlus ()
 Increase scroll one step. More...
 
virtual void ScrollMinus ()
 Decrease scroll one step. More...
 
virtual void ScrollPlusPlenty ()
 Increase scroll three steps. More...
 
virtual void ScrollMinusPlenty ()
 Decrease scroll three steps. More...
 
void SetHostObject (IGUIScrollBarOwner *pOwner)
 Set host object, must be done almost at creation of scroll bar. More...
 
void SetWidth (float width)
 Set Width. More...
 
void SetX (float x)
 Set X Position. More...
 
void SetY (float y)
 Set Y Position. More...
 
void SetZ (float z)
 Set Z Position. More...
 
void SetLength (float length)
 Set Length of scroll bar. More...
 
void SetScrollRange (float range)
 Set content length. More...
 
void SetScrollSpace (float space)
 Set space that is visible in the scrollable control. More...
 
void SetBarPressed (bool b)
 Set bar pressed. More...
 
void SetScrollBarStyle (const CStr &style)
 Set Scroll bar style string. More...
 
const SGUIScrollBarStyle * GetStyle () const
 Get style used by the scrollbar. More...
 
virtual CRect GetBarRect () const =0
 Get the rectangle of the actual BAR. More...
 
virtual CRect GetOuterRect () const =0
 Get the rectangle of the outline of the scrollbar, every component of the scroll-bar should be inside this area. More...
 

Protected Attributes

bool m_BottomAligned
 Should the scroll bar proceed to the top or to the bottom of the m_Y value. More...
 
- Protected Attributes inherited from IGUIScrollBar
float m_Width
 Width of the scroll bar. More...
 
float m_X
 Absolute X Position. More...
 
float m_Y
 Absolute Y Position. More...
 
float m_Z
 Absolute Z Position. More...
 
float m_Length
 Total length of scrollbar, including edge buttons. More...
 
float m_ScrollRange
 Content that can be scrolled, in pixels. More...
 
float m_ScrollSpace
 Content that can be viewed at a time, in pixels. More...
 
float m_BarSize
 Use input from the scroll-wheel? True or false. More...
 
CStr m_ScrollBarStyle
 Scroll bar style reference name. More...
 
SGUIScrollBarStyle * m_pStyle
 Pointer to scroll bar style used. More...
 
IGUIScrollBarOwner * m_pHostObject
 Host object, prerequisite! More...
 
CGUI & m_pGUI
 Reference to CGUI object, these cannot work stand-alone. More...
 
CVector2D m_BarPressedAtPos
 Mouse position when bar was pressed. More...
 
bool m_BarPressed
 If the bar is currently being pressed and dragged. More...
 
bool m_BarHovered
 Bar being hovered or not. More...
 
bool m_ButtonMinusHovered
 Scroll buttons hovered. More...
 
bool m_ButtonPlusHovered
 
bool m_ButtonMinusPressed
 Scroll buttons pressed. More...
 
bool m_ButtonPlusPressed
 
float m_Pos
 Position of scroll bar, 0 means scrolled all the way to one side. More...
 
float m_PosWhenPressed
 Position from 0.f to 1.f it had when the bar was pressed. More...
 

Additional Inherited Members

- Protected Member Functions inherited from IGUIScrollBar
void SetupBarSize ()
 Sets up bar size. More...
 
void UpdatePosBoundaries ()
 Call every time m_Pos has been updated. More...
 

Detailed Description

Horizontal implementation of IGUIScrollBar.

See also
IGUIScrollBar

Constructor & Destructor Documentation

◆ CGUIScrollBarHorizontal()

CGUIScrollBarHorizontal::CGUIScrollBarHorizontal ( CGUI &  pGUI)

◆ ~CGUIScrollBarHorizontal()

CGUIScrollBarHorizontal::~CGUIScrollBarHorizontal ( )
virtual

Member Function Documentation

◆ Draw()

void CGUIScrollBarHorizontal::Draw ( CCanvas2D &  canvas)
virtual

Draw the scroll-bar.

Implements IGUIScrollBar.

◆ GetBarRect()

CRect CGUIScrollBarHorizontal::GetBarRect ( ) const
virtual

Get the rectangle of the actual BAR.

Returns
Rectangle, CRect

Implements IGUIScrollBar.

◆ GetOuterRect()

CRect CGUIScrollBarHorizontal::GetOuterRect ( ) const
virtual

Get the rectangle of the outline of the scrollbar, every component of the scroll-bar should be inside this area.

Returns
Rectangle, CRect

Implements IGUIScrollBar.

◆ HandleMessage()

void CGUIScrollBarHorizontal::HandleMessage ( SGUIMessage &  Message)
virtual

If an object that contains a scrollbar has got messages, send them to the scroll-bar and it will see if the message regarded itself.

See also
IGUIObject::HandleMessage()

Implements IGUIScrollBar.

◆ HoveringButtonMinus()

bool CGUIScrollBarHorizontal::HoveringButtonMinus ( const CVector2D &  mouse)
virtual

◆ HoveringButtonPlus()

bool CGUIScrollBarHorizontal::HoveringButtonPlus ( const CVector2D &  mouse)
virtual
See also
IGUIScrollBar::HoveringButtonPlus

Reimplemented from IGUIScrollBar.

◆ SetBottomAligned()

void CGUIScrollBarHorizontal::SetBottomAligned ( const bool &  align)
inline

Set Right Aligned.

Parameters
alignAlignment

◆ SetPosFromMousePos()

void CGUIScrollBarHorizontal::SetPosFromMousePos ( const CVector2D &  mouse)
virtual

Set m_Pos with g_mouse_x/y input, i.e.

when dragging.

Implements IGUIScrollBar.

◆ SetScrollPlentyFromMousePos()

void CGUIScrollBarHorizontal::SetScrollPlentyFromMousePos ( const CVector2D &  mouse)
virtual

Implements IGUIScrollBar.

Member Data Documentation

◆ m_BottomAligned

bool CGUIScrollBarHorizontal::m_BottomAligned
protected

Should the scroll bar proceed to the top or to the bottom of the m_Y value.

Notice, this has nothing to do with where the owner places it.


The documentation for this class was generated from the following files: