Crazy Eddie's GUI System  0.8.4
ScrolledContainer.h
00001 /***********************************************************************
00002     created:    1/3/2005
00003     author:     Paul D Turner
00004 *************************************************************************/
00005 /***************************************************************************
00006  *   Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team
00007  *
00008  *   Permission is hereby granted, free of charge, to any person obtaining
00009  *   a copy of this software and associated documentation files (the
00010  *   "Software"), to deal in the Software without restriction, including
00011  *   without limitation the rights to use, copy, modify, merge, publish,
00012  *   distribute, sublicense, and/or sell copies of the Software, and to
00013  *   permit persons to whom the Software is furnished to do so, subject to
00014  *   the following conditions:
00015  *
00016  *   The above copyright notice and this permission notice shall be
00017  *   included in all copies or substantial portions of the Software.
00018  *
00019  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00020  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00021  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00022  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
00023  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00024  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00025  *   OTHER DEALINGS IN THE SOFTWARE.
00026  ***************************************************************************/
00027 #ifndef _CEGUIScrolledContainer_h_
00028 #define _CEGUIScrolledContainer_h_
00029 
00030 #include "../Window.h"
00031 #include "../WindowFactory.h"
00032 #include <map>
00033 
00034 #if defined(_MSC_VER)
00035 #   pragma warning(push)
00036 #   pragma warning(disable : 4251)
00037 #endif
00038 
00039 // Start of CEGUI namespace section
00040 namespace CEGUI
00041 {
00047 class CEGUIEXPORT ScrolledContainer : public Window
00048 {
00049 public:
00051     static const String WidgetTypeName;
00053     static const String EventNamespace;
00059     static const String EventContentChanged;
00065     static const String EventAutoSizeSettingChanged;
00066 
00068     ScrolledContainer(const String& type, const String& name);
00069 
00071     ~ScrolledContainer(void);
00072 
00082     bool isContentPaneAutoSized(void) const;
00083 
00096     void setContentPaneAutoSized(bool setting);
00097 
00106     const Rectf& getContentArea(void) const;
00107 
00123     void setContentArea(const Rectf& area);
00124 
00134     Rectf getChildExtentsArea(void) const;
00135     
00136     virtual const CachedRectf& getClientChildContentArea() const;
00137     virtual const CachedRectf& getNonClientChildContentArea() const;
00138 
00139     virtual void notifyScreenAreaChanged(bool recursive);
00140     
00141 protected:
00142     // Overridden from Window.
00143     virtual Rectf getUnclippedInnerRect_impl(bool skipAllPixelAlignment) const;
00144     
00145     Rectf getClientChildContentArea_impl(bool skipAllPixelAlignment) const;
00146     
00157     virtual void onContentChanged(WindowEventArgs& e);
00158 
00170     virtual void onAutoSizeSettingChanged(WindowEventArgs& e);
00171 
00173     bool handleChildSized(const EventArgs& e);
00175     bool handleChildMoved(const EventArgs& e);
00176 
00177     // overridden from Window.
00178     void drawSelf(const RenderingContext&) {};
00179     Rectf getInnerRectClipper_impl() const;
00180 
00181     void setArea_impl(const UVector2& pos, const USize& size,
00182                       bool topLeftSizing = false, bool fireEvents = true);
00183     Rectf getHitTestRect_impl() const;
00184     void onChildAdded(ElementEventArgs& e);
00185     void onChildRemoved(ElementEventArgs& e);
00186     void onParentSized(ElementEventArgs& e);
00187 
00189     typedef std::multimap<Window*, Event::Connection>  ConnectionTracker;
00191     ConnectionTracker d_eventConnections;
00193     Rectf d_contentArea;
00195     bool d_autosizePane;
00196     
00197     CachedRectf d_clientChildContentArea;
00198 
00199 private:
00200     void addScrolledContainerProperties(void);
00201 };
00202 
00203 } // End of  CEGUI namespace section
00204 
00205 
00206 #if defined(_MSC_VER)
00207 #   pragma warning(pop)
00208 #endif
00209 
00210 #endif  // end of guard _CEGUIScrolledContainer_h_
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends