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/>.
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.
29 Used in everywhere scrollbars are needed, like in a combobox for instance.
37 #ifndef INCLUDED_CGUISCROLLBARVERTICAL
38 #define INCLUDED_CGUISCROLLBARVERTICAL
40 //--------------------------------------------------------
41 // Includes / Compiler directives
42 //--------------------------------------------------------
43 #include "IGUIScrollBar.h"
46 //--------------------------------------------------------
48 //--------------------------------------------------------
51 * Vertical implementation of IGUIScrollBar
55 class CGUIScrollBarVertical
: public IGUIScrollBar
58 CGUIScrollBarVertical();
59 virtual ~CGUIScrollBarVertical();
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
72 * @see IGUIObject#HandleMessage()
74 virtual void HandleMessage(SGUIMessage
&Message
);
77 * Set m_Pos with g_mouse_x/y input, i.e. when dragging.
79 virtual void SetPosFromMousePos(const CPos
&mouse
);
82 * @see IGUIScrollBar#HoveringButtonMinus
84 virtual bool HoveringButtonMinus(const CPos
&mouse
);
87 * @see IGUIScrollBar#HoveringButtonPlus
89 virtual bool HoveringButtonPlus(const CPos
&mouse
);
93 * @param align Alignment
95 void SetRightAligned(const bool &align
) { m_RightAligned
= align
; }
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;
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.