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
40namespace CEGUI
41{
47class CEGUIEXPORT ScrolledContainer : public Window
48{
49public:
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
138
139 virtual void notifyScreenAreaChanged(bool recursive);
140
141protected:
142 // Overridden from Window.
143 virtual Rectf getUnclippedInnerRect_impl(bool skipAllPixelAlignment) const;
144
145 Rectf getClientChildContentArea_impl(bool skipAllPixelAlignment) const;
146
158
171
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, std::less<Window*>
197
198 CachedRectf d_clientChildContentArea;
199
200private:
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_
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: Element.h:211
A tiny wrapper to hide some of the dirty work of rect caching.
Definition: Element.h:315
Base class used as the argument to all subscribers Event object.
Definition: EventArgs.h:51
Helper container window class which is used in the implementation of the ScrollablePane widget class.
Definition: ScrolledContainer.h:48
std::multimap< Window *, Event::Connection, std::less< Window * > CEGUI_MULTIMAP_ALLOC(Window *, Event::Connection)> ConnectionTracker
type definition for collection used to track event connections.
Definition: ScrolledContainer.h:190
virtual const CachedRectf & getClientChildContentArea() const
Return a Rect that is used by client child elements as content area.
const Rectf & getContentArea(void) const
Return the current content pane area for the ScrolledContainer.
virtual const CachedRectf & getNonClientChildContentArea() const
Return a Rect that is used by client child elements as content area.
Rectf d_contentArea
Holds extents of the content pane.
Definition: ScrolledContainer.h:194
ConnectionTracker d_eventConnections
Tracks event connections we make.
Definition: ScrolledContainer.h:192
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,...
Rectf getHitTestRect_impl() const
Default implementation of function to return Window hit-test area.
Rectf getChildExtentsArea(void) const
Return the current extents of the attached content.
bool d_autosizePane
true if the pane auto-sizes itself.
Definition: ScrolledContainer.h:196
void onChildAdded(ElementEventArgs &e)
Handler called when a child window is added to this window.
virtual void notifyScreenAreaChanged(bool recursive)
Inform the window, and optionally all children, that screen area rectangles have changed.
static const String WidgetTypeName
Type name for ScrolledContainer.
Definition: ScrolledContainer.h:51
void setContentArea(const Rectf &area)
Set the current content pane area for the ScrolledContainer.
static const String EventContentChanged
Definition: ScrolledContainer.h:59
static const String EventNamespace
Namespace for global events.
Definition: ScrolledContainer.h:53
bool handleChildMoved(const EventArgs &e)
handles notifications about child windows being sized.
bool handleChildSized(const EventArgs &e)
handles notifications about child windows being moved.
virtual Rectf getUnclippedInnerRect_impl(bool skipAllPixelAlignment) const
Default implementation of function to return Element's inner rect area.
void setContentPaneAutoSized(bool setting)
Set whether the content pane should be auto-sized.
virtual void onContentChanged(WindowEventArgs &e)
Notification method called whenever the content size may have changed.
ScrolledContainer(const String &type, const String &name)
Constructor for ScrolledContainer objects.
virtual void onAutoSizeSettingChanged(WindowEventArgs &e)
Notification method called whenever the setting that controls whether the content pane is automatical...
void onParentSized(ElementEventArgs &e)
Handler called when this window's parent window has been resized. If this window is the root / GUI Sh...
void drawSelf(const RenderingContext &)
Perform the actual rendering for this Window.
Definition: ScrolledContainer.h:178
Rectf getInnerRectClipper_impl() const
Default implementation of function to return Window inner clipper area.
bool isContentPaneAutoSized(void) const
Return whether the content pane is auto sized.
void onChildRemoved(ElementEventArgs &e)
Handler called when a child window is removed from this window.
static const String EventAutoSizeSettingChanged
Definition: ScrolledContainer.h:65
~ScrolledContainer(void)
Destructor for ScrolledContainer objects.
String class used within the GUI system.
Definition: String.h:64
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: InputEvent.h:252
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:151
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
struct that holds some context relating to a RenderingSurface object.
Definition: RenderingContext.h:41