Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
IGUIScrollBarOwner.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 GUI Object Base - Scroll-bar owner
20 
21 --Overview--
22 
23  Base-class this if you want scroll-bars in an object.
24 
25 --More info--
26 
27  Check GUI.h
28 
29 */
30 
31 #ifndef INCLUDED_IGUISCROLLBAROWNER
32 #define INCLUDED_IGUISCROLLBAROWNER
33 
34 //--------------------------------------------------------
35 // Includes / Compiler directives
36 //--------------------------------------------------------
37 #include "GUI.h"
38 
39 struct SGUIScrollBarStyle;
40 class IGUIScrollBar;
41 
42 //--------------------------------------------------------
43 // Macros
44 //--------------------------------------------------------
45 
46 //--------------------------------------------------------
47 // Types
48 //--------------------------------------------------------
49 
50 //--------------------------------------------------------
51 // Declarations
52 //--------------------------------------------------------
53 
54 /**
55  * Base-class this if you want an object to contain
56  * one, or several, scroll-bars.
57  *
58  * @see IGUIObject
59  * @see IGUIScrollBar
60  */
61 class IGUIScrollBarOwner : virtual public IGUIObject
62 {
63  friend class IGUIScrollBar;
64 
65 public:
67  virtual ~IGUIScrollBarOwner();
68 
69  virtual void Draw();
70 
71  /**
72  * @see IGUIObject#HandleMessage()
73  */
74  virtual void HandleMessage(SGUIMessage &Message);
75 
76  /**
77  * @see IGUIObject#ResetStates()
78  */
79  virtual void ResetStates();
80 
81  /**
82  * Interface for the m_ScrollBar to use.
83  */
84  virtual const SGUIScrollBarStyle *GetScrollBarStyle(const CStr& style) const;
85 
86  /**
87  * Add a scroll-bar
88  */
89  virtual void AddScrollBar(IGUIScrollBar * scrollbar);
90 
91  /**
92  * Get Scroll Bar reference (it should be transparent it's actually
93  * pointers).
94  */
95  virtual IGUIScrollBar & GetScrollBar(const int &index)
96  {
97  return *m_ScrollBars[index];
98  }
99 
100 protected:
101 
102  /**
103  * Predominately you will only have one, but you can have
104  * as many as you like.
105  */
106  std::vector<IGUIScrollBar*> m_ScrollBars;
107 };
108 
109 #endif
virtual const SGUIScrollBarStyle * GetScrollBarStyle(const CStr &style) const
Interface for the m_ScrollBar to use.
virtual IGUIScrollBar & GetScrollBar(const int &index)
Get Scroll Bar reference (it should be transparent it&#39;s actually pointers).
The GUI Scroll-bar style.
Definition: IGUIScrollBar.h:57
Base settings, all objects possess these settings in their m_BaseSettings Instructions can be found i...
Definition: IGUIObject.h:140
std::vector< IGUIScrollBar * > m_ScrollBars
Predominately you will only have one, but you can have as many as you like.
virtual void AddScrollBar(IGUIScrollBar *scrollbar)
Add a scroll-bar.
virtual void Draw()
Draws the object.
virtual void ResetStates()
The GUI Scroll-bar, used everywhere there is a scroll-bar in the game.
Message send to IGUIObject::HandleMessage() in order to give life to Objects manually with a derived ...
Definition: GUIbase.h:106
Base-class this if you want an object to contain one, or several, scroll-bars.
virtual void HandleMessage(SGUIMessage &Message)