Crazy Eddie's GUI System  0.8.5
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;
191  ConnectionTracker d_eventConnections;
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_
static const String WidgetTypeName
Type name for ScrolledContainer.
Definition: ScrolledContainer.h:51
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
Base class used as the argument to all subscribers Event object.
Definition: EventArgs.h:49
struct that holds some context relating to a RenderingSurface object.
Definition: RenderingContext.h:39
Class that holds the size (width & height) of something.
Definition: ForwardRefs.h:112
static const String EventAutoSizeSettingChanged
Definition: ScrolledContainer.h:65
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:149
std::multimap< Window *, Event::Connection > ConnectionTracker
type definition for collection used to track event connections.
Definition: ScrolledContainer.h:189
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: Element.h:210
static const String EventNamespace
Namespace for global events.
Definition: ScrolledContainer.h:53
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: InputEvent.h:251
static const String EventContentChanged
Definition: ScrolledContainer.h:59
bool d_autosizePane
true if the pane auto-sizes itself.
Definition: ScrolledContainer.h:195
void drawSelf(const RenderingContext &)
Perform the actual rendering for this Window.
Definition: ScrolledContainer.h:178
Helper container window class which is used in the implementation of the ScrollablePane widget class...
Definition: ScrolledContainer.h:47
Rectf d_contentArea
Holds extents of the content pane.
Definition: ScrolledContainer.h:193
String class used within the GUI system.
Definition: String.h:62
ConnectionTracker d_eventConnections
Tracks event connections we make.
Definition: ScrolledContainer.h:191