Crazy Eddie's GUI System  0.8.4
ScrolledItemListBase.h
00001 /************************************************************************
00002     created:    Sat Oct 29 2005
00003     author:     Tomas Lindquist Olsen
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 _CEGUIScrolledItemListBase_h_
00028 #define _CEGUIScrolledItemListBase_h_
00029 
00030 #include "./ItemListBase.h"
00031 #include "./Scrollbar.h"
00032 
00033 #if defined(_MSC_VER)
00034 #       pragma warning(push)
00035 #       pragma warning(disable : 4251)
00036 #endif
00037 // begin CEGUI namespace
00038 namespace CEGUI
00039 {
00040 
00045 class CEGUIEXPORT ScrolledItemListBase : public ItemListBase
00046 {
00047 public:
00048     static const String EventNamespace; 
00049 
00050     /************************************************************************
00051         Constants
00052     *************************************************************************/
00053     static const String VertScrollbarName; 
00054     static const String HorzScrollbarName; 
00055     static const String ContentPaneName;   
00056 
00062     static const String EventVertScrollbarModeChanged;
00068     static const String EventHorzScrollbarModeChanged;
00069 
00070     /************************************************************************
00071         Accessors
00072     *************************************************************************/
00077     bool isVertScrollbarAlwaysShown(void) const {return d_forceVScroll;}
00078 
00083     bool isHorzScrollbarAlwaysShown(void) const {return d_forceHScroll;}
00084 
00089     Scrollbar* getVertScrollbar() const;
00090 
00095     Scrollbar* getHorzScrollbar() const;
00096 
00097     /************************************************************************
00098         Manipulators
00099     *************************************************************************/
00104     void setShowVertScrollbar(bool mode);
00105 
00110     void setShowHorzScrollbar(bool mode);
00111 
00125     void ensureItemIsVisibleVert(const ItemEntry& item);
00126 
00140     void ensureItemIsVisibleHorz(const ItemEntry& item);
00141 
00142     /************************************************************************
00143         Object Construction and Destruction
00144     *************************************************************************/
00149     ScrolledItemListBase(const String& type, const String& name);
00150 
00155     virtual ~ScrolledItemListBase(void);
00156 
00157     // overridden from ItemListBase
00158     virtual void initialiseComponents(void);
00159 
00160 protected:
00161     /************************************************************************
00162         Implementation functions
00163     ************************************************************************/
00168     void configureScrollbars(const Sizef& doc_size);
00169 
00170     /************************************************************************
00171         New event handlers
00172     ************************************************************************/
00173     virtual void onVertScrollbarModeChanged(WindowEventArgs& e);
00174     virtual void onHorzScrollbarModeChanged(WindowEventArgs& e);
00175 
00176     /************************************************************************
00177         Overridden event handlers
00178     ************************************************************************/
00179     virtual void onMouseWheel(MouseEventArgs& e);
00180 
00181     /************************************************************************
00182         Event subscribers
00183     ************************************************************************/
00184     bool handle_VScroll(const EventArgs& e);
00185     bool handle_HScroll(const EventArgs& e);
00186 
00187     /************************************************************************
00188         Implementation data
00189     ************************************************************************/
00190     bool d_forceVScroll;
00191     bool d_forceHScroll;
00192 
00193 private:
00194     void addScrolledItemListBaseProperties(void);
00195 };
00196 
00197 } // end CEGUI namespace
00198 
00199 #if defined(_MSC_VER)
00200 #       pragma warning(pop)
00201 #endif
00202 
00203 #endif // end of guard _CEGUIScrolledItemListBase_h_
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends