Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CGUIScrollBarVertical.h
Go to the documentation of this file.
1 /* Copyright (C) 2009 Wildfire Games.
2  * This file is part of 0 A.D.
3  *
4  * 0 A.D. is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * 0 A.D. is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 /*
19 A GUI ScrollBar
20 
21 --Overview--
22 
23  A GUI Scrollbar, this class doesn't present all functionality
24  to the scrollbar, it just controls the drawing and a wrapper
25  for interaction with it.
26 
27 --Usage--
28 
29  Used in everywhere scrollbars are needed, like in a combobox for instance.
30 
31 --More info--
32 
33  Check GUI.h
34 
35 */
36 
37 #ifndef INCLUDED_CGUISCROLLBARVERTICAL
38 #define INCLUDED_CGUISCROLLBARVERTICAL
39 
40 //--------------------------------------------------------
41 // Includes / Compiler directives
42 //--------------------------------------------------------
43 #include "IGUIScrollBar.h"
44 #include "GUI.h"
45 
46 //--------------------------------------------------------
47 // Declarations
48 //--------------------------------------------------------
49 
50 /**
51  * Vertical implementation of IGUIScrollBar
52  *
53  * @see IGUIScrollBar
54  */
56 {
57 public:
59  virtual ~CGUIScrollBarVertical();
60 
61 public:
62  /**
63  * Draw the scroll-bar
64  */
65  virtual void Draw();
66 
67  /**
68  * If an object that contains a scrollbar has got messages, send
69  * them to the scroll-bar and it will see if the message regarded
70  * itself.
71  *
72  * @see IGUIObject#HandleMessage()
73  */
74  virtual void HandleMessage(SGUIMessage &Message);
75 
76  /**
77  * Set m_Pos with g_mouse_x/y input, i.e. when dragging.
78  */
79  virtual void SetPosFromMousePos(const CPos &mouse);
80 
81  /**
82  * @see IGUIScrollBar#HoveringButtonMinus
83  */
84  virtual bool HoveringButtonMinus(const CPos &mouse);
85 
86  /**
87  * @see IGUIScrollBar#HoveringButtonPlus
88  */
89  virtual bool HoveringButtonPlus(const CPos &mouse);
90 
91  /**
92  * Set Right Aligned
93  * @param align Alignment
94  */
95  void SetRightAligned(const bool &align) { m_RightAligned = align; }
96 
97  /**
98  * Get the rectangle of the actual BAR.
99  * @return Rectangle, CRect
100  */
101  virtual CRect GetBarRect() const;
102 
103  /**
104  * Get the rectangle of the outline of the scrollbar, every component of the
105  * scroll-bar should be inside this area.
106  * @return Rectangle, CRect
107  */
108  virtual CRect GetOuterRect() const;
109 
110 protected:
111  /**
112  * Should the scroll bar proceed to the left or to the right of the m_X value.
113  * Notice, this has nothing to do with where the owner places it.
114  */
116 };
117 
118 #endif
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 ...
virtual CRect GetOuterRect() const
Get the rectangle of the outline of the scrollbar, every component of the scroll-bar should be inside...
virtual void SetPosFromMousePos(const CPos &mouse)
Set m_Pos with g_mouse_x/y input, i.e.
virtual void Draw()
Draw the scroll-bar.
Vertical implementation of IGUIScrollBar.
virtual CRect GetBarRect() const
Get the rectangle of the actual BAR.
Made to represent screen positions and delta values.
Definition: Overlay.h:167
virtual bool HoveringButtonMinus(const CPos &mouse)
void SetRightAligned(const bool &align)
Set Right Aligned.
The GUI Scroll-bar, used everywhere there is a scroll-bar in the game.
virtual bool HoveringButtonPlus(const CPos &mouse)
Message send to IGUIObject::HandleMessage() in order to give life to Objects manually with a derived ...
Definition: GUIbase.h:106
bool m_RightAligned
Should the scroll bar proceed to the left or to the right of the m_X value.
Rectangle class used for screen rectangles.
Definition: Overlay.h:71