Crazy Eddies GUI System  0.7.1
CEGUIScrolledContainer.h
1 /***********************************************************************
2  filename: CEGUIScrolledContainer.h
3  created: 1/3/2005
4  author: Paul D Turner
5 *************************************************************************/
6 /***************************************************************************
7  * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team
8  *
9  * Permission is hereby granted, free of charge, to any person obtaining
10  * a copy of this software and associated documentation files (the
11  * "Software"), to deal in the Software without restriction, including
12  * without limitation the rights to use, copy, modify, merge, publish,
13  * distribute, sublicense, and/or sell copies of the Software, and to
14  * permit persons to whom the Software is furnished to do so, subject to
15  * the following conditions:
16  *
17  * The above copyright notice and this permission notice shall be
18  * included in all copies or substantial portions of the Software.
19  *
20  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26  * OTHER DEALINGS IN THE SOFTWARE.
27  ***************************************************************************/
28 #ifndef _CEGUIScrolledContainer_h_
29 #define _CEGUIScrolledContainer_h_
30 
31 #include "../CEGUIWindow.h"
32 #include "../CEGUIWindowFactory.h"
33 #include "CEGUIScrolledContainerProperties.h"
34 #include <map>
35 
36 #if defined(_MSC_VER)
37 # pragma warning(push)
38 # pragma warning(disable : 4251)
39 #endif
40 
41 // Start of CEGUI namespace section
42 namespace CEGUI
43 {
49 class CEGUIEXPORT ScrolledContainer : public Window
50 {
51 public:
53  static const String WidgetTypeName;
55  static const String EventNamespace;
60 
62  ScrolledContainer(const String& type, const String& name);
63 
65  ~ScrolledContainer(void);
66 
76  bool isContentPaneAutoSized(void) const;
77 
90  void setContentPaneAutoSized(bool setting);
91 
100  const Rect& getContentArea(void) const;
101 
117  void setContentArea(const Rect& area);
118 
128  Rect getChildExtentsArea(void) const;
129 
130  // Overridden from Window.
131  Rect getUnclippedInnerRect_impl(void) const;
132 
133 protected:
145  virtual bool testClassName_impl(const String& class_name) const
146  {
147  if (class_name=="ScrolledContainer")
148  return true;
149 
150  return Window::testClassName_impl(class_name);
151  }
152 
163  virtual void onContentChanged(WindowEventArgs& e);
164 
176  virtual void onAutoSizeSettingChanged(WindowEventArgs& e);
177 
179  bool handleChildSized(const EventArgs& e);
181  bool handleChildMoved(const EventArgs& e);
182 
183  // overridden from Window.
184  void drawSelf(const RenderingContext&) {};
185  Rect getInnerRectClipper_impl() const;
186  Rect getHitTestRect_impl() const;
187  void onChildAdded(WindowEventArgs& e);
188  void onChildRemoved(WindowEventArgs& e);
189  void onParentSized(WindowEventArgs& e);
190 
192  typedef std::multimap<Window*, Event::Connection> ConnectionTracker;
199 
200 private:
201  static ScrolledContainerProperties::ContentPaneAutoSized d_autoSizedProperty;
202  static ScrolledContainerProperties::ContentArea d_contentAreaProperty;
203  static ScrolledContainerProperties::ChildExtentsArea d_childExtentsAreaProperty;
204 
205  void addScrolledContainerProperties(void);
206 };
207 
208 } // End of CEGUI namespace section
209 
210 
211 #if defined(_MSC_VER)
212 # pragma warning(pop)
213 #endif
214 
215 #endif // end of guard _CEGUIScrolledContainer_h_