CEGUIScrolledItemListBase.h

00001 /************************************************************************
00002     filename:   CEGUIIScrolledItemListBase.h
00003     created:    Sat Oct 29 2005
00004     author:     Tomas Lindquist Olsen
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 _CEGUIScrolledItemListBase_h_
00025 #define _CEGUIScrolledItemListBase_h_
00026 
00027 #include "elements/CEGUIItemListBase.h"
00028 #include "elements/CEGUIScrollbar.h"
00029 #include "elements/CEGUIScrolledItemListBaseProperties.h"
00030 
00031 #if defined(_MSC_VER)
00032 #       pragma warning(push)
00033 #       pragma warning(disable : 4251)
00034 #endif
00035 // begin CEGUI namespace
00036 namespace CEGUI
00037 {
00038 
00043 class CEGUIEXPORT ScrolledItemListBase : public ItemListBase
00044 {
00045 public:
00046     static const String EventNamespace; 
00047 
00048     /************************************************************************
00049         Constants
00050     *************************************************************************/
00051     static const String VertScrollbarNameSuffix; 
00052     static const String HorzScrollbarNameSuffix; 
00053     static const String ContentPaneNameSuffix;   
00054 
00055     static const String EventVertScrollbarModeChanged; 
00056     static const String EventHorzScrollbarModeChanged; 
00057 
00058     /************************************************************************
00059         Accessors
00060     *************************************************************************/
00065     bool isVertScrollbarAlwaysShown(void) const {return d_forceVScroll;}
00066 
00071     bool isHorzScrollbarAlwaysShown(void) const {return d_forceHScroll;}
00072 
00077     Scrollbar* getVertScrollbar() const;
00078 
00083     Scrollbar* getHorzScrollbar() const;
00084 
00085     /************************************************************************
00086         Manipulators
00087     *************************************************************************/
00092     void setShowVertScrollbar(bool mode);
00093 
00098     void setShowHorzScrollbar(bool mode);
00099 
00100     /************************************************************************
00101         Object Construction and Destruction
00102     *************************************************************************/
00107     ScrolledItemListBase(const String& type, const String& name);
00108 
00113     virtual ~ScrolledItemListBase(void);
00114 
00115     // overridden from ItemListBase
00116     virtual void initialiseComponents(void);
00117 
00118 protected:
00119     /************************************************************************
00120         Implementation functions
00121     ************************************************************************/
00132     virtual bool testClassName_impl(const String& class_name) const
00133     {
00134         if (class_name=="ScrolledItemListBase")
00135         {
00136             return true;
00137         }
00138         return ItemListBase::testClassName_impl(class_name);
00139     }
00140 
00145     void configureScrollbars(const Size& doc_size);
00146 
00147     /************************************************************************
00148         New event handlers
00149     ************************************************************************/
00150     virtual void onVertScrollbarModeChanged(WindowEventArgs& e);
00151     virtual void onHorzScrollbarModeChanged(WindowEventArgs& e);
00152 
00153     /************************************************************************
00154         Overridden event handlers
00155     ************************************************************************/
00156     virtual void onMouseWheel(MouseEventArgs& e);
00157 
00158     /************************************************************************
00159         Event subscribers
00160     ************************************************************************/
00161     bool handle_VScroll(const EventArgs& e);
00162     bool handle_HScroll(const EventArgs& e);
00163 
00164     /************************************************************************
00165         Implementation data
00166     ************************************************************************/
00167     bool d_forceVScroll;
00168     bool d_forceHScroll;
00169 
00170 private:
00171     /************************************************************************
00172         Static Properties for this class
00173     ************************************************************************/
00174     static ScrolledItemListBaseProperties::ForceVertScrollbar d_forceVertScrollbarProperty;
00175     static ScrolledItemListBaseProperties::ForceHorzScrollbar d_forceHorzScrollbarProperty;
00176 
00177     void addScrolledItemListBaseProperties(void);
00178 };
00179 
00180 } // end CEGUI namespace
00181 
00182 #if defined(_MSC_VER)
00183 #       pragma warning(pop)
00184 #endif
00185 
00186 #endif // end of guard _CEGUIScrolledItemListBase_h_

Generated on Sat Jun 28 14:35:44 2008 for Crazy Eddies GUI System by  doxygen 1.5.4