Crazy Eddie's GUI System  0.8.4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
ScrolledItemListBase.h
1 /************************************************************************
2  created: Sat Oct 29 2005
3  author: Tomas Lindquist Olsen
4 *************************************************************************/
5 /***************************************************************************
6  * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining
9  * a copy of this software and associated documentation files (the
10  * "Software"), to deal in the Software without restriction, including
11  * without limitation the rights to use, copy, modify, merge, publish,
12  * distribute, sublicense, and/or sell copies of the Software, and to
13  * permit persons to whom the Software is furnished to do so, subject to
14  * the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be
17  * included in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  ***************************************************************************/
27 #ifndef _CEGUIScrolledItemListBase_h_
28 #define _CEGUIScrolledItemListBase_h_
29 
30 #include "./ItemListBase.h"
31 #include "./Scrollbar.h"
32 
33 #if defined(_MSC_VER)
34 # pragma warning(push)
35 # pragma warning(disable : 4251)
36 #endif
37 // begin CEGUI namespace
38 namespace CEGUI
39 {
40 
45 class CEGUIEXPORT ScrolledItemListBase : public ItemListBase
46 {
47 public:
48  static const String EventNamespace;
49 
50  /************************************************************************
51  Constants
52  *************************************************************************/
53  static const String VertScrollbarName;
54  static const String HorzScrollbarName;
55  static const String ContentPaneName;
56 
69 
70  /************************************************************************
71  Accessors
72  *************************************************************************/
77  bool isVertScrollbarAlwaysShown(void) const {return d_forceVScroll;}
78 
83  bool isHorzScrollbarAlwaysShown(void) const {return d_forceHScroll;}
84 
89  Scrollbar* getVertScrollbar() const;
90 
95  Scrollbar* getHorzScrollbar() const;
96 
97  /************************************************************************
98  Manipulators
99  *************************************************************************/
104  void setShowVertScrollbar(bool mode);
105 
110  void setShowHorzScrollbar(bool mode);
111 
125  void ensureItemIsVisibleVert(const ItemEntry& item);
126 
140  void ensureItemIsVisibleHorz(const ItemEntry& item);
141 
142  /************************************************************************
143  Object Construction and Destruction
144  *************************************************************************/
149  ScrolledItemListBase(const String& type, const String& name);
150 
155  virtual ~ScrolledItemListBase(void);
156 
157  // overridden from ItemListBase
158  virtual void initialiseComponents(void);
159 
160 protected:
161  /************************************************************************
162  Implementation functions
163  ************************************************************************/
168  void configureScrollbars(const Sizef& doc_size);
169 
170  /************************************************************************
171  New event handlers
172  ************************************************************************/
173  virtual void onVertScrollbarModeChanged(WindowEventArgs& e);
174  virtual void onHorzScrollbarModeChanged(WindowEventArgs& e);
175 
176  /************************************************************************
177  Overridden event handlers
178  ************************************************************************/
179  virtual void onMouseWheel(MouseEventArgs& e);
180 
181  /************************************************************************
182  Event subscribers
183  ************************************************************************/
184  bool handle_VScroll(const EventArgs& e);
185  bool handle_HScroll(const EventArgs& e);
186 
187  /************************************************************************
188  Implementation data
189  ************************************************************************/
190  bool d_forceVScroll;
191  bool d_forceHScroll;
192 
193 private:
194  void addScrolledItemListBaseProperties(void);
195 };
196 
197 } // end CEGUI namespace
198 
199 #if defined(_MSC_VER)
200 # pragma warning(pop)
201 #endif
202 
203 #endif // end of guard _CEGUIScrolledItemListBase_h_