Crazy Eddies GUI System: CEGUIScrolledItemListBase.h Source File

Crazy Eddies GUI System 0.7.6

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

CEGUIScrolledItemListBase.h

    00001 /************************************************************************
    00002     filename:   CEGUIIScrolledItemListBase.h
    00003     created:    Sat Oct 29 2005
    00004     author:     Tomas Lindquist Olsen
    00005 *************************************************************************/
    00006 /***************************************************************************
    00007  *   Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team
    00008  *
    00009  *   Permission is hereby granted, free of charge, to any person obtaining
    00010  *   a copy of this software and associated documentation files (the
    00011  *   "Software"), to deal in the Software without restriction, including
    00012  *   without limitation the rights to use, copy, modify, merge, publish,
    00013  *   distribute, sublicense, and/or sell copies of the Software, and to
    00014  *   permit persons to whom the Software is furnished to do so, subject to
    00015  *   the following conditions:
    00016  *
    00017  *   The above copyright notice and this permission notice shall be
    00018  *   included in all copies or substantial portions of the Software.
    00019  *
    00020  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    00021  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    00022  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    00023  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
    00024  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
    00025  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
    00026  *   OTHER DEALINGS IN THE SOFTWARE.
    00027  ***************************************************************************/
    00028 #ifndef _CEGUIScrolledItemListBase_h_
    00029 #define _CEGUIScrolledItemListBase_h_
    00030
    00031 #include "CEGUIItemListBase.h"
    00032 #include "CEGUIScrollbar.h"
    00033 #include "CEGUIScrolledItemListBaseProperties.h"
    00034
    00035 #if defined(_MSC_VER)
    00036 #       pragma warning(push)
    00037 #       pragma warning(disable : 4251)
    00038 #endif
    00039 // begin CEGUI namespace
    00040 namespace CEGUI
    00041 {
    00042
    00047 class CEGUIEXPORT ScrolledItemListBase : public ItemListBase
    00048 {
    00049 public:
    00050     static const String EventNamespace;
    00051
    00052     /************************************************************************
    00053         Constants
    00054     *************************************************************************/
    00055     static const String VertScrollbarNameSuffix;
    00056     static const String HorzScrollbarNameSuffix;
    00057     static const String ContentPaneNameSuffix;
    00058
    00064     static const String EventVertScrollbarModeChanged;
    00070     static const String EventHorzScrollbarModeChanged;
    00071
    00072     /************************************************************************
    00073         Accessors
    00074     *************************************************************************/
    00079     bool isVertScrollbarAlwaysShown(void) const {return d_forceVScroll;}
    00080
    00085     bool isHorzScrollbarAlwaysShown(void) const {return d_forceHScroll;}
    00086
    00091     Scrollbar* getVertScrollbar() const;
    00092
    00097     Scrollbar* getHorzScrollbar() const;
    00098
    00099     /************************************************************************
    00100         Manipulators
    00101     *************************************************************************/
    00106     void setShowVertScrollbar(bool mode);
    00107
    00112     void setShowHorzScrollbar(bool mode);
    00113
    00127     void ensureItemIsVisibleVert(const ItemEntry& item);
    00128
    00142     void ensureItemIsVisibleHorz(const ItemEntry& item);
    00143
    00144     /************************************************************************
    00145         Object Construction and Destruction
    00146     *************************************************************************/
    00151     ScrolledItemListBase(const String& type, const String& name);
    00152
    00157     virtual ~ScrolledItemListBase(void);
    00158
    00159     // overridden from ItemListBase
    00160     virtual void initialiseComponents(void);
    00161
    00162 protected:
    00163     /************************************************************************
    00164         Implementation functions
    00165     ************************************************************************/
    00176     virtual bool testClassName_impl(const String& class_name) const
    00177     {
    00178         if (class_name=="ScrolledItemListBase")
    00179         {
    00180             return true;
    00181         }
    00182         return ItemListBase::testClassName_impl(class_name);
    00183     }
    00184
    00189     void configureScrollbars(const Size& doc_size);
    00190
    00191     /************************************************************************
    00192         New event handlers
    00193     ************************************************************************/
    00194     virtual void onVertScrollbarModeChanged(WindowEventArgs& e);
    00195     virtual void onHorzScrollbarModeChanged(WindowEventArgs& e);
    00196
    00197     /************************************************************************
    00198         Overridden event handlers
    00199     ************************************************************************/
    00200     virtual void onMouseWheel(MouseEventArgs& e);
    00201
    00202     /************************************************************************
    00203         Event subscribers
    00204     ************************************************************************/
    00205     bool handle_VScroll(const EventArgs& e);
    00206     bool handle_HScroll(const EventArgs& e);
    00207
    00208     /************************************************************************
    00209         Implementation data
    00210     ************************************************************************/
    00211     bool d_forceVScroll;
    00212     bool d_forceHScroll;
    00213
    00214 private:
    00215     /************************************************************************
    00216         Static Properties for this class
    00217     ************************************************************************/
    00218     static ScrolledItemListBaseProperties::ForceVertScrollbar d_forceVertScrollbarProperty;
    00219     static ScrolledItemListBaseProperties::ForceHorzScrollbar d_forceHorzScrollbarProperty;
    00220
    00221     void addScrolledItemListBaseProperties(void);
    00222 };
    00223
    00224 } // end CEGUI namespace
    00225
    00226 #if defined(_MSC_VER)
    00227 #       pragma warning(pop)
    00228 #endif
    00229
    00230 #endif // end of guard _CEGUIScrolledItemListBase_h_