Crazy Eddies GUI System  0.6.0
CEGUIScrolledItemListBase.h
1 /************************************************************************
2  filename: CEGUIIScrolledItemListBase.h
3  created: Sat Oct 29 2005
4  author: Tomas Lindquist Olsen
5 *************************************************************************/
6 /*************************************************************************
7  Crazy Eddie's GUI System (http://www.cegui.org.uk)
8  Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
9 
10  This library is free software; you can redistribute it and/or
11  modify it under the terms of the GNU Lesser General Public
12  License as published by the Free Software Foundation; either
13  version 2.1 of the License, or (at your option) any later version.
14 
15  This library is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public
21  License along with this library; if not, write to the Free Software
22  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *************************************************************************/
24 #ifndef _CEGUIScrolledItemListBase_h_
25 #define _CEGUIScrolledItemListBase_h_
26 
27 #include "elements/CEGUIItemListBase.h"
28 #include "elements/CEGUIScrollbar.h"
29 #include "elements/CEGUIScrolledItemListBaseProperties.h"
30 
31 #if defined(_MSC_VER)
32 # pragma warning(push)
33 # pragma warning(disable : 4251)
34 #endif
35 // begin CEGUI namespace
36 namespace CEGUI
37 {
38 
43 class CEGUIEXPORT ScrolledItemListBase : public ItemListBase
44 {
45 public:
46  static const String EventNamespace;
47 
48  /************************************************************************
49  Constants
50  *************************************************************************/
54 
57 
58  /************************************************************************
59  Accessors
60  *************************************************************************/
65  bool isVertScrollbarAlwaysShown(void) const {return d_forceVScroll;}
66 
71  bool isHorzScrollbarAlwaysShown(void) const {return d_forceHScroll;}
72 
77  Scrollbar* getVertScrollbar() const;
78 
83  Scrollbar* getHorzScrollbar() const;
84 
85  /************************************************************************
86  Manipulators
87  *************************************************************************/
92  void setShowVertScrollbar(bool mode);
93 
98  void setShowHorzScrollbar(bool mode);
99 
100  /************************************************************************
101  Object Construction and Destruction
102  *************************************************************************/
107  ScrolledItemListBase(const String& type, const String& name);
108 
113  virtual ~ScrolledItemListBase(void);
114 
115  // overridden from ItemListBase
116  virtual void initialiseComponents(void);
117 
118 protected:
119  /************************************************************************
120  Implementation functions
121  ************************************************************************/
132  virtual bool testClassName_impl(const String& class_name) const
133  {
134  if (class_name=="ScrolledItemListBase")
135  {
136  return true;
137  }
138  return ItemListBase::testClassName_impl(class_name);
139  }
140 
145  void configureScrollbars(const Size& doc_size);
146 
147  /************************************************************************
148  New event handlers
149  ************************************************************************/
150  virtual void onVertScrollbarModeChanged(WindowEventArgs& e);
151  virtual void onHorzScrollbarModeChanged(WindowEventArgs& e);
152 
153  /************************************************************************
154  Overridden event handlers
155  ************************************************************************/
156  virtual void onMouseWheel(MouseEventArgs& e);
157 
158  /************************************************************************
159  Event subscribers
160  ************************************************************************/
161  bool handle_VScroll(const EventArgs& e);
162  bool handle_HScroll(const EventArgs& e);
163 
164  /************************************************************************
165  Implementation data
166  ************************************************************************/
167  bool d_forceVScroll;
168  bool d_forceHScroll;
169 
170 private:
171  /************************************************************************
172  Static Properties for this class
173  ************************************************************************/
174  static ScrolledItemListBaseProperties::ForceVertScrollbar d_forceVertScrollbarProperty;
175  static ScrolledItemListBaseProperties::ForceHorzScrollbar d_forceHorzScrollbarProperty;
176 
177  void addScrolledItemListBaseProperties(void);
178 };
179 
180 } // end CEGUI namespace
181 
182 #if defined(_MSC_VER)
183 # pragma warning(pop)
184 #endif
185 
186 #endif // end of guard _CEGUIScrolledItemListBase_h_