Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CEGUIScrolledContainer.h

Go to the documentation of this file.
00001 /************************************************************************
00002         filename:       CEGUIScrolledContainer.h
00003         created:        1/3/2005
00004         author:         Paul D Turner
00005 *************************************************************************/
00006 /*************************************************************************
00007     Crazy Eddie's GUI System (http://www.cegui.org.uk)
00008     Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
00009 
00010     This library is free software; you can redistribute it and/or
00011     modify it under the terms of the GNU Lesser General Public
00012     License as published by the Free Software Foundation; either
00013     version 2.1 of the License, or (at your option) any later version.
00014 
00015     This library is distributed in the hope that it will be useful,
00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018     Lesser General Public License for more details.
00019 
00020     You should have received a copy of the GNU Lesser General Public
00021     License along with this library; if not, write to the Free Software
00022     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023 *************************************************************************/
00024 #ifndef _CEGUIScrolledContainer_h_
00025 #define _CEGUIScrolledContainer_h_
00026 
00027 #include "CEGUIWindow.h"
00028 #include "CEGUIWindowFactory.h"
00029 #include "elements/CEGUIScrolledContainerProperties.h"
00030 #include <map>
00031 
00032 #if defined(_MSC_VER)
00033 #       pragma warning(push)
00034 #       pragma warning(disable : 4251)
00035 #endif
00036 
00037 // Start of CEGUI namespace section
00038 namespace CEGUI
00039 {
00045     class CEGUIEXPORT ScrolledContainer : public Window
00046     {
00047     public:
00048         /*************************************************************************
00049             Constants
00050         *************************************************************************/
00051         static const String WidgetTypeName;     
00052         static const String EventNamespace;     
00053         static const String EventContentChanged;    
00054         static const String EventAutoSizeSettingChanged;    
00055 
00056         /*************************************************************************
00057                 Object construction and destruction
00058         *************************************************************************/
00063         ScrolledContainer(const String& type, const String& name);
00064 
00069         ~ScrolledContainer(void);
00070 
00071         /*************************************************************************
00072                 Public interface methods
00073         *************************************************************************/
00082         bool isContentPaneAutoSized(void) const;
00083 
00095         void setContentPaneAutoSized(bool setting);
00096 
00105         const Rect& getContentArea(void) const;
00106 
00122         void setContentArea(const Rect& area);
00123 
00133         Rect getChildExtentsArea(void) const;
00134 
00135     protected:
00136         /*************************************************************************
00137                 Implementation methods
00138         *************************************************************************/
00143         void addScrolledContainerEvents(void);
00144 
00145 
00156                 virtual bool    testClassName_impl(const String& class_name) const
00157                 {
00158                         if (class_name==(const utf8*)"ScrolledContainer")       return true;
00159                         return Window::testClassName_impl(class_name);
00160                 }
00161 
00162         /*************************************************************************
00163                 Implementation of abstract methods from Window
00164         *************************************************************************/
00165         void drawSelf(float z) {};
00166 
00167         /*************************************************************************
00168                 Event trigger methods.
00169         *************************************************************************/
00180         virtual void onContentChanged(WindowEventArgs& e);
00181 
00193         virtual void onAutoSizeSettingChanged(WindowEventArgs& e);
00194 
00195         /*************************************************************************
00196                 Event callbacks
00197         *************************************************************************/
00202         bool handleChildSized(const EventArgs& e);
00203 
00208         bool handleChildMoved(const EventArgs& e);
00209 
00210         /*************************************************************************
00211                 Overridden from Window.
00212         *************************************************************************/
00213         Rect getUnclippedInnerRect(void) const;
00214         void onChildAdded(WindowEventArgs& e);
00215         void onChildRemoved(WindowEventArgs& e);
00216         void onParentSized(WindowEventArgs& e);
00217 
00218         /*************************************************************************
00219                 Data fields
00220         *************************************************************************/
00221         typedef std::multimap<Window*, Event::Connection>  ConnectionTracker;
00222         ConnectionTracker d_eventConnections;   
00223         Rect d_contentArea;     
00224         bool d_autosizePane;    
00225 
00226     private:
00227             /*************************************************************************
00228                     Static Properties for this class
00229             *************************************************************************/
00230             static ScrolledContainerProperties::ContentPaneAutoSized    d_autoSizedProperty;
00231             static ScrolledContainerProperties::ContentArea             d_contentAreaProperty;
00232             static ScrolledContainerProperties::ChildExtentsArea        d_childExtentsAreaProperty;
00233 
00234             /*************************************************************************
00235                     Private methods
00236             *************************************************************************/
00237             void addScrolledContainerProperties(void);
00238     };
00239 
00244     class ScrolledContainerFactory : public WindowFactory
00245     {
00246     public:
00247         ScrolledContainerFactory(void) : WindowFactory(ScrolledContainer::WidgetTypeName) { }
00248         ~ScrolledContainerFactory(void){}
00249 
00250         Window* createWindow(const String& name)
00251         {
00252             ScrolledContainer* wnd = new ScrolledContainer(d_type, name);
00253             return wnd;
00254         }
00255 
00256         void destroyWindow(Window* window)
00257         {
00258             if (window->getType() == d_type)
00259                 delete window;
00260         }
00261 
00262     };
00263 
00264 } // End of  CEGUI namespace section
00265 
00266 
00267 #if defined(_MSC_VER)
00268 #       pragma warning(pop)
00269 #endif
00270 
00271 #endif  // end of guard _CEGUIScrolledContainer_h_

Generated on Wed Sep 7 09:56:33 2005 for Crazy Eddies GUI System by  doxygen 1.4.3