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_
static const String WidgetTypeName
Type name for ScrolledContainer.
Definition: CEGUIScrolledContainer.h:53
Property to access the current content pane area rectangle (as window relative pixels).
Definition: CEGUIScrolledContainerProperties.h:83
Base class used as the argument to all subscribers Event object.
Definition: CEGUIEventArgs.h:52
struct that holds some context relating to a RenderingSurface object.
Definition: CEGUIRenderingContext.h:40
virtual bool testClassName_impl(const String &class_name) const
Return whether this window was inherited from the given class name at some point in the inheritance h...
Definition: CEGUIScrolledContainer.h:153
virtual bool testClassName_impl(const String &class_name) const
Return whether this window was inherited from the given class name at some point in the inheritance h...
Definition: CEGUIWindow.h:3928
Property offering read-only access to the current content extents rectangle (as window relative pixel...
Definition: CEGUIScrolledContainerProperties.h:110
static const String EventAutoSizeSettingChanged
Definition: CEGUIScrolledContainer.h:67
Rect d_contentArea
Holds extents of the content pane.
Definition: CEGUIScrolledContainer.h:207
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: CEGUIWindow.h:138
Property to access the setting which controls whether the content pane is automatically resized accor...
Definition: CEGUIScrolledContainerProperties.h:56
std::multimap< Window *, Event::Connection > ConnectionTracker
type definition for collection used to track event connections.
Definition: CEGUIScrolledContainer.h:203
static const String EventNamespace
Namespace for global events.
Definition: CEGUIScrolledContainer.h:55
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: CEGUIInputEvent.h:245
static const String EventContentChanged
Definition: CEGUIScrolledContainer.h:61
bool d_autosizePane
true if the pane auto-sizes itself.
Definition: CEGUIScrolledContainer.h:209
void drawSelf(const RenderingContext &)
Perform the actual rendering for this Window.
Definition: CEGUIScrolledContainer.h:192
Helper container window class which is used in the implementation of the ScrollablePane widget class...
Definition: CEGUIScrolledContainer.h:49
Class encapsulating operations on a Rectangle.
Definition: CEGUIRect.h:44
String class used within the GUI system.
Definition: CEGUIString.h:57
ConnectionTracker d_eventConnections
Tracks event connections we make.
Definition: CEGUIScrolledContainer.h:205