Crazy Eddies GUI System  0.7.9
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
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;
68 
70  ScrolledContainer(const String& type, const String& name);
71 
73  ~ScrolledContainer(void);
74 
84  bool isContentPaneAutoSized(void) const;
85 
98  void setContentPaneAutoSized(bool setting);
99 
108  const Rect& getContentArea(void) const;
109 
125  void setContentArea(const Rect& area);
126 
136  Rect getChildExtentsArea(void) const;
137 
138  // Overridden from Window.
139  Rect getUnclippedInnerRect_impl(void) const;
140 
141 protected:
153  virtual bool testClassName_impl(const String& class_name) const
154  {
155  if (class_name=="ScrolledContainer")
156  return true;
157 
158  return Window::testClassName_impl(class_name);
159  }
160 
171  virtual void onContentChanged(WindowEventArgs& e);
172 
184  virtual void onAutoSizeSettingChanged(WindowEventArgs& e);
185 
187  bool handleChildSized(const EventArgs& e);
189  bool handleChildMoved(const EventArgs& e);
190 
191  // overridden from Window.
192  void drawSelf(const RenderingContext&) {};
193  Rect getInnerRectClipper_impl() const;
194  Rect getNonClientChildWindowContentArea_impl() const;
195  Rect getClientChildWindowContentArea_impl() const;
196 
197  Rect getHitTestRect_impl() const;
198  void onChildAdded(WindowEventArgs& e);
199  void onChildRemoved(WindowEventArgs& e);
200  void onParentSized(WindowEventArgs& e);
201 
203  typedef std::multimap<Window*, Event::Connection> ConnectionTracker;
210 
211 private:
212  static ScrolledContainerProperties::ContentPaneAutoSized d_autoSizedProperty;
213  static ScrolledContainerProperties::ContentArea d_contentAreaProperty;
214  static ScrolledContainerProperties::ChildExtentsArea d_childExtentsAreaProperty;
215 
216  void addScrolledContainerProperties(void);
217 };
218 
219 } // End of CEGUI namespace section
220 
221 
222 #if defined(_MSC_VER)
223 # pragma warning(pop)
224 #endif
225 
226 #endif // end of guard _CEGUIScrolledContainer_h_