Crazy Eddie's GUI System  0.8.4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
ScrolledContainer.h
1 /***********************************************************************
2  created: 1/3/2005
3  author: Paul D Turner
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 _CEGUIScrolledContainer_h_
28 #define _CEGUIScrolledContainer_h_
29 
30 #include "../Window.h"
31 #include "../WindowFactory.h"
32 #include <map>
33 
34 #if defined(_MSC_VER)
35 # pragma warning(push)
36 # pragma warning(disable : 4251)
37 #endif
38 
39 // Start of CEGUI namespace section
40 namespace CEGUI
41 {
47 class CEGUIEXPORT ScrolledContainer : public Window
48 {
49 public:
51  static const String WidgetTypeName;
53  static const String EventNamespace;
66 
68  ScrolledContainer(const String& type, const String& name);
69 
71  ~ScrolledContainer(void);
72 
82  bool isContentPaneAutoSized(void) const;
83 
96  void setContentPaneAutoSized(bool setting);
97 
106  const Rectf& getContentArea(void) const;
107 
123  void setContentArea(const Rectf& area);
124 
134  Rectf getChildExtentsArea(void) const;
135 
136  virtual const CachedRectf& getClientChildContentArea() const;
137  virtual const CachedRectf& getNonClientChildContentArea() const;
138 
139  virtual void notifyScreenAreaChanged(bool recursive);
140 
141 protected:
142  // Overridden from Window.
143  virtual Rectf getUnclippedInnerRect_impl(bool skipAllPixelAlignment) const;
144 
145  Rectf getClientChildContentArea_impl(bool skipAllPixelAlignment) const;
146 
157  virtual void onContentChanged(WindowEventArgs& e);
158 
170  virtual void onAutoSizeSettingChanged(WindowEventArgs& e);
171 
173  bool handleChildSized(const EventArgs& e);
175  bool handleChildMoved(const EventArgs& e);
176 
177  // overridden from Window.
178  void drawSelf(const RenderingContext&) {};
179  Rectf getInnerRectClipper_impl() const;
180 
181  void setArea_impl(const UVector2& pos, const USize& size,
182  bool topLeftSizing = false, bool fireEvents = true);
183  Rectf getHitTestRect_impl() const;
184  void onChildAdded(ElementEventArgs& e);
185  void onChildRemoved(ElementEventArgs& e);
186  void onParentSized(ElementEventArgs& e);
187 
189  typedef std::multimap<Window*, Event::Connection> ConnectionTracker;
196 
197  CachedRectf d_clientChildContentArea;
198 
199 private:
200  void addScrolledContainerProperties(void);
201 };
202 
203 } // End of CEGUI namespace section
204 
205 
206 #if defined(_MSC_VER)
207 # pragma warning(pop)
208 #endif
209 
210 #endif // end of guard _CEGUIScrolledContainer_h_