Added different textures for each ptolemaic camel rank
[0ad.git] / source / gui / CGUIScrollBarVertical.h
blob76dad8241e819c0a4883265675e79ce34e578afc
1 /* Copyright (C) 2009 Wildfire Games.
2 * This file is part of 0 A.D.
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.
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.
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/>.
19 A GUI ScrollBar
21 --Overview--
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.
27 --Usage--
29 Used in everywhere scrollbars are needed, like in a combobox for instance.
31 --More info--
33 Check GUI.h
37 #ifndef INCLUDED_CGUISCROLLBARVERTICAL
38 #define INCLUDED_CGUISCROLLBARVERTICAL
40 //--------------------------------------------------------
41 // Includes / Compiler directives
42 //--------------------------------------------------------
43 #include "IGUIScrollBar.h"
44 #include "GUI.h"
46 //--------------------------------------------------------
47 // Declarations
48 //--------------------------------------------------------
50 /**
51 * Vertical implementation of IGUIScrollBar
53 * @see IGUIScrollBar
55 class CGUIScrollBarVertical : public IGUIScrollBar
57 public:
58 CGUIScrollBarVertical();
59 virtual ~CGUIScrollBarVertical();
61 public:
62 /**
63 * Draw the scroll-bar
65 virtual void Draw();
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.
72 * @see IGUIObject#HandleMessage()
74 virtual void HandleMessage(SGUIMessage &Message);
76 /**
77 * Set m_Pos with g_mouse_x/y input, i.e. when dragging.
79 virtual void SetPosFromMousePos(const CPos &mouse);
81 /**
82 * @see IGUIScrollBar#HoveringButtonMinus
84 virtual bool HoveringButtonMinus(const CPos &mouse);
86 /**
87 * @see IGUIScrollBar#HoveringButtonPlus
89 virtual bool HoveringButtonPlus(const CPos &mouse);
91 /**
92 * Set Right Aligned
93 * @param align Alignment
95 void SetRightAligned(const bool &align) { m_RightAligned = align; }
97 /**
98 * Get the rectangle of the actual BAR.
99 * @return Rectangle, CRect
101 virtual CRect GetBarRect() const;
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
108 virtual CRect GetOuterRect() const;
110 protected:
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.
115 bool m_RightAligned;
118 #endif