Crazy Eddie's GUI System  0.8.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
ScrolledContainer.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 "../Window.h"
32 #include "../WindowFactory.h"
33 #include <map>
34 
35 #if defined(_MSC_VER)
36 # pragma warning(push)
37 # pragma warning(disable : 4251)
38 #endif
39 
40 // Start of CEGUI namespace section
41 namespace CEGUI
42 {
48 class CEGUIEXPORT ScrolledContainer : public Window
49 {
50 public:
52  static const String WidgetTypeName;
54  static const String EventNamespace;
67 
69  ScrolledContainer(const String& type, const String& name);
70 
72  ~ScrolledContainer(void);
73 
83  bool isContentPaneAutoSized(void) const;
84 
97  void setContentPaneAutoSized(bool setting);
98 
107  const Rectf& getContentArea(void) const;
108 
124  void setContentArea(const Rectf& area);
125 
135  Rectf getChildExtentsArea(void) const;
136 
137  virtual const CachedRectf& getClientChildContentArea() const;
138  virtual const CachedRectf& getNonClientChildContentArea() const;
139 
140  virtual void notifyScreenAreaChanged(bool recursive);
141 
142 protected:
143  // Overridden from Window.
144  virtual Rectf getUnclippedInnerRect_impl(bool skipAllPixelAlignment) const;
145 
146  Rectf getClientChildContentArea_impl(bool skipAllPixelAlignment) const;
147 
158  virtual void onContentChanged(WindowEventArgs& e);
159 
171  virtual void onAutoSizeSettingChanged(WindowEventArgs& e);
172 
174  bool handleChildSized(const EventArgs& e);
176  bool handleChildMoved(const EventArgs& e);
177 
178  // overridden from Window.
179  void drawSelf(const RenderingContext&) {};
180  Rectf getInnerRectClipper_impl() const;
181 
182  void setArea_impl(const UVector2& pos, const USize& size,
183  bool topLeftSizing = false, bool fireEvents = true);
184  Rectf getHitTestRect_impl() const;
185  void onChildAdded(ElementEventArgs& e);
186  void onChildRemoved(ElementEventArgs& e);
187  void onParentSized(ElementEventArgs& e);
188 
190  typedef std::multimap<Window*, Event::Connection> ConnectionTracker;
197 
198  CachedRectf d_clientChildContentArea;
199 
200 private:
201  void addScrolledContainerProperties(void);
202 };
203 
204 } // End of CEGUI namespace section
205 
206 
207 #if defined(_MSC_VER)
208 # pragma warning(pop)
209 #endif
210 
211 #endif // end of guard _CEGUIScrolledContainer_h_