Crazy Eddie's GUI System  0.8.7
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 
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 
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 
158 
171 
173  bool handleChildSized(const EventArgs& e);
175  bool handleChildMoved(const EventArgs& e);
176 
177  // overridden from Window.
178  void drawSelf(const RenderingContext&) {};
180 
181  void setArea_impl(const UVector2& pos, const USize& size,
182  bool topLeftSizing = false, bool fireEvents = true);
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_
CEGUI::ScrolledContainer::setArea_impl
void setArea_impl(const UVector2 &pos, const USize &size, bool topLeftSizing=false, bool fireEvents=true)
Implementation method to modify element area while correctly applying min / max size processing,...
CEGUI::ScrolledContainer::onAutoSizeSettingChanged
virtual void onAutoSizeSettingChanged(WindowEventArgs &e)
Notification method called whenever the setting that controls whether the content pane is automatical...
CEGUI::ScrolledContainer::getClientChildContentArea
virtual const CachedRectf & getClientChildContentArea() const
Return a Rect that is used by client child elements as content area.
CEGUI::ScrolledContainer::setContentArea
void setContentArea(const Rectf &area)
Set the current content pane area for the ScrolledContainer.
CEGUI::ScrolledContainer::handleChildSized
bool handleChildSized(const EventArgs &e)
handles notifications about child windows being moved.
CEGUI::ElementEventArgs
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: Element.h:211
CEGUI::RenderingContext
struct that holds some context relating to a RenderingSurface object.
Definition: RenderingContext.h:41
CEGUI::ScrolledContainer::WidgetTypeName
static const String WidgetTypeName
Type name for ScrolledContainer.
Definition: ScrolledContainer.h:51
CEGUI::ScrolledContainer::d_eventConnections
ConnectionTracker d_eventConnections
Tracks event connections we make.
Definition: ScrolledContainer.h:191
CEGUI
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
CEGUI::ScrolledContainer::getUnclippedInnerRect_impl
virtual Rectf getUnclippedInnerRect_impl(bool skipAllPixelAlignment) const
Default implementation of function to return Element's inner rect area.
CEGUI::Vector2< UDim >
CEGUI::WindowEventArgs
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: InputEvent.h:252
CEGUI::ScrolledContainer::EventAutoSizeSettingChanged
static const String EventAutoSizeSettingChanged
Definition: ScrolledContainer.h:65
CEGUI::ScrolledContainer::getInnerRectClipper_impl
Rectf getInnerRectClipper_impl() const
Default implementation of function to return Window inner clipper area.
CEGUI::ScrolledContainer::onChildAdded
void onChildAdded(ElementEventArgs &e)
Handler called when a child window is added to this window.
CEGUI::ScrolledContainer::ScrolledContainer
ScrolledContainer(const String &type, const String &name)
Constructor for ScrolledContainer objects.
CEGUI::ScrolledContainer::EventNamespace
static const String EventNamespace
Namespace for global events.
Definition: ScrolledContainer.h:53
CEGUI::ScrolledContainer::handleChildMoved
bool handleChildMoved(const EventArgs &e)
handles notifications about child windows being sized.
CEGUI::ScrolledContainer::onChildRemoved
void onChildRemoved(ElementEventArgs &e)
Handler called when a child window is removed from this window.
CEGUI::ScrolledContainer::getContentArea
const Rectf & getContentArea(void) const
Return the current content pane area for the ScrolledContainer.
CEGUI::ScrolledContainer::getNonClientChildContentArea
virtual const CachedRectf & getNonClientChildContentArea() const
Return a Rect that is used by client child elements as content area.
CEGUI::Window
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:151
CEGUI::ScrolledContainer::getHitTestRect_impl
Rectf getHitTestRect_impl() const
Default implementation of function to return Window hit-test area.
CEGUI::ScrolledContainer::EventContentChanged
static const String EventContentChanged
Definition: ScrolledContainer.h:59
CEGUI::Size< UDim >
CEGUI::ScrolledContainer::notifyScreenAreaChanged
virtual void notifyScreenAreaChanged(bool recursive)
Inform the window, and optionally all children, that screen area rectangles have changed.
CEGUI::ScrolledContainer::drawSelf
void drawSelf(const RenderingContext &)
Perform the actual rendering for this Window.
Definition: ScrolledContainer.h:178
CEGUI::ScrolledContainer::~ScrolledContainer
~ScrolledContainer(void)
Destructor for ScrolledContainer objects.
CEGUI::ScrolledContainer::setContentPaneAutoSized
void setContentPaneAutoSized(bool setting)
Set whether the content pane should be auto-sized.
CEGUI::String
String class used within the GUI system.
Definition: String.h:64
CEGUI::ScrolledContainer::isContentPaneAutoSized
bool isContentPaneAutoSized(void) const
Return whether the content pane is auto sized.
CEGUI::ScrolledContainer::d_autosizePane
bool d_autosizePane
true if the pane auto-sizes itself.
Definition: ScrolledContainer.h:195
CEGUI::ScrolledContainer
Helper container window class which is used in the implementation of the ScrollablePane widget class.
Definition: ScrolledContainer.h:48
CEGUI::ScrolledContainer::onContentChanged
virtual void onContentChanged(WindowEventArgs &e)
Notification method called whenever the content size may have changed.
CEGUI::Rect< float >
CEGUI::ScrolledContainer::d_contentArea
Rectf d_contentArea
Holds extents of the content pane.
Definition: ScrolledContainer.h:193
CEGUI::ScrolledContainer::getChildExtentsArea
Rectf getChildExtentsArea(void) const
Return the current extents of the attached content.
CEGUI::ScrolledContainer::ConnectionTracker
std::multimap< Window *, Event::Connection > ConnectionTracker
type definition for collection used to track event connections.
Definition: ScrolledContainer.h:189
CEGUI::EventArgs
Base class used as the argument to all subscribers Event object.
Definition: EventArgs.h:51
CEGUI::ScrolledContainer::onParentSized
void onParentSized(ElementEventArgs &e)
Handler called when this window's parent window has been resized. If this window is the root / GUI Sh...