|
0 A.D. | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The GUI Scroll-bar, used everywhere there is a scroll-bar in the game. To include a scroll-bar to an object, inherent the object from IGUIScrollBarOwner and call AddScrollBar() to add the scroll-bars. It's also important that the scrollbar is located within the parent object's mouse over area. Otherwise the input won't be sent to the scroll-bar. The class does not provide all functionality to the scroll-bar, many things the parent of the scroll-bar, must provide. Like a combo-box.
Field Summary | |
protected bool |
m_BarHovered
Bar being hovered or not |
protected bool |
m_BarPressed
If the bar is currently being pressed and dragged. |
protected CPos |
m_BarPressedAtPos
Mouse position when bar was pressed |
protected float |
m_BarSize
Use input from the scroll-wheel? True or false. |
protected bool |
m_ButtonMinusHovered
Scroll buttons hovered |
protected bool |
m_ButtonMinusPressed
Scroll buttons pressed |
protected bool |
m_ButtonPlusHovered
Scroll buttons hovered |
protected bool |
m_ButtonPlusPressed
Scroll buttons pressed |
protected float |
m_Length
Total length of scrollbar, including edge buttons. |
protected CGUI* |
m_pGUI
Reference to CGUI object, these cannot work stand-alone |
protected IGUIScrollBarOwner* |
m_pHostObject
Host object, prerequisite! |
protected float |
m_Pos
Position of scroll bar, 0 means scrolled all the way to one side. |
protected float |
m_PosWhenPressed
Position from 0. |
protected SGUIScrollBarStyle* |
m_pStyle
Pointer to scroll bar style used. |
protected CStr |
m_ScrollBarStyle
Scroll bar style reference name |
protected float |
m_ScrollRange
Content that can be scrolled, in pixels |
protected float |
m_ScrollSpace
Content that can be viewed at a time, in pixels |
protected bool |
m_UseEdgeButtons
True if you want edge buttons, i. |
protected float |
m_Width
Width of the scroll bar |
protected float |
m_X
Absolute X Position |
protected float |
m_Y
Absolute Y Position |
protected float |
m_Z
Absolute Z Position |
Constructor Summary | |
IGUIScrollBar()
|
|
virtual ~IGUIScrollBar()
|
Method Summary | |
virtual void |
Draw()= 0
Draw the scroll-bar |
virtual CRect |
GetBarRect() const = 0
Get the rectangle of the actual BAR. |
CGUI* |
GetGUI() const
Get GUI pointer |
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. |
float |
GetPos() const
Get scroll-position |
SGUIScrollBarStyle* |
GetStyle() const
Get style used by the scrollbar |
virtual void |
HandleMessage( const 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. |
virtual bool |
HoveringButtonMinus( const CPos& UNUSED( mouse ) )
Hovering the scroll minus button |
virtual bool |
HoveringButtonPlus( const CPos& UNUSED( mouse ) )
Hovering the scroll plus button |
virtual void |
ScrollMinus()
Scroll towards 0.0 one step |
virtual void |
ScrollMinusPlenty()
Scroll towards 0.0 one step |
virtual void |
ScrollPlus()
Scroll towards 1.0 one step |
virtual void |
ScrollPlusPlenty()
Scroll towards 1.0 one step |
void |
SetBarPressed( const bool& b )
Set bar pressed |
void |
SetGUI( CGUI* pGUI )
Set GUI pointer |
void |
SetHostObject( IGUIScrollBarOwner* pOwner )
Set host object, must be done almost at creation of scroll bar. |
void |
SetLength( const float& length )
Set Length of scroll bar |
virtual void |
SetPos( const float& f )
Set scroll-position by hand |
virtual void |
SetPosFromMousePos( const CPos& mouse )= 0
Set m_Pos with g_mouse_x/y input, i. |
void |
SetScrollBarStyle( const CStr& style )
Set Scroll bar style string |
void |
SetScrollRange( const float& range )
Set content length |
void |
SetScrollSpace( const float& space )
Set space that is visible in the scrollable control. |
protected void |
SetupBarSize()
Sets up bar size |
void |
SetUseEdgeButtons( const bool& b )
Set use edge buttons |
void |
SetWidth( const float& width )
Set Width |
void |
SetX( const float& x )
Set X Position |
void |
SetY( const float& y )
Set Y Position |
void |
SetZ( const float& z )
Set Z Position |
protected void |
UpdatePosBoundaries()
Call every time m_Pos has been updated. |
Field Detail |
protected bool m_BarHovered;
protected bool m_BarPressed;
protected CPos m_BarPressedAtPos;
protected float m_BarSize;
protected bool m_ButtonMinusHovered;
protected bool m_ButtonMinusPressed;
protected bool m_ButtonPlusHovered;
protected bool m_ButtonPlusPressed;
protected float m_Length;
protected CGUI* m_pGUI;
protected IGUIScrollBarOwner* m_pHostObject;
protected float m_Pos;
protected float m_PosWhenPressed;
protected SGUIScrollBarStyle* m_pStyle;
protected CStr m_ScrollBarStyle;
protected float m_ScrollRange;
protected float m_ScrollSpace;
protected bool m_UseEdgeButtons;
protected float m_Width;
protected float m_X;
protected float m_Y;
protected float m_Z;
Constructor Detail |
public IGUIScrollBar();
public virtual ~IGUIScrollBar();
Method Detail |
public virtual void Draw()= 0;
public virtual CRect GetBarRect() const = 0;
public CGUI* GetGUI() const;
public virtual CRect GetOuterRect() const = 0;
public float GetPos() const;
public SGUIScrollBarStyle* GetStyle() const;
public virtual void HandleMessage( const SGUIMessage& Message )= 0;
Message
- SGUIMessagepublic virtual bool HoveringButtonMinus( const CPos& UNUSED( mouse ) );
m_x
- mouse x
m_y
- mouse ypublic virtual bool HoveringButtonPlus( const CPos& UNUSED( mouse ) );
m_x
- mouse x
m_y
- mouse ypublic virtual void ScrollMinus();
public virtual void ScrollMinusPlenty();
public virtual void ScrollPlus();
public virtual void ScrollPlusPlenty();
public void SetBarPressed( const bool& b );
pressed
- True if bar is pressedpublic void SetGUI( CGUI* pGUI );
pGUI
- pointer to CGUI object.public void SetHostObject( IGUIScrollBarOwner* pOwner );
pOwner
- Pointer to host object.public void SetLength( const float& length );
length
- Lengthpublic virtual void SetPos( const float& f );
public virtual void SetPosFromMousePos( const CPos& mouse )= 0;
public void SetScrollBarStyle( const CStr& style );
style
- String with scroll bar style reference namepublic void SetScrollRange( const float& range );
range
- Maximum scrollable rangepublic void SetScrollSpace( const float& space );
space
- Visible area in the scrollable control.protected void SetupBarSize();
public void SetUseEdgeButtons( const bool& b );
b
- True if edge buttons should be usedpublic void SetWidth( const float& width );
width
- Widthpublic void SetX( const float& x );
x
- Position in this axispublic void SetY( const float& y );
y
- Position in this axispublic void SetZ( const float& z );
z
- Position in this axisprotected void UpdatePosBoundaries();
|
0 A.D.
Generated on September 04, 2007 at 18:13 CppDoc v2.4.0 |
|||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |