Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# OgrePopupMenuGuiElement.h

Go to the documentation of this file.

    00001 /*
    00002 -----------------------------------------------------------------------------
    00003 This source file is part of OGRE
    00004     (Object-oriented Graphics Rendering Engine)
    00005 For the latest info, see http://www.ogre3d.org/
    00006
    00007 Copyright © 2000-2003 The OGRE Team
    00008 Also see acknowledgements in Readme.html
    00009
    00010 This program is free software; you can redistribute it and/or modify it under
    00011 the terms of the GNU Lesser General Public License as published by the Free Software
    00012 Foundation; either version 2 of the License, or (at your option) any later
    00013 version.
    00014
    00015 This program is distributed in the hope that it will be useful, but WITHOUT
    00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    00018
    00019 You should have received a copy of the GNU Lesser General Public License along with
    00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
    00022 http://www.gnu.org/copyleft/lesser.txt.
    00023 -----------------------------------------------------------------------------
    00024 */
    00025 #ifndef __PopupMenuGuiElement_H__
    00026 #define __PopupMenuGuiElement_H__
    00027
    00028 #include "OgreGuiElementPrerequisites.h"
    00029 #include "OgreListSelectionTarget.h"
    00030 #include "OgrePanelGuiElement.h"
    00031 #include "OgreListChanger.h"
    00032 #include "OgreGuiPressable.h"
    00033 #include "OgreStringResource.h"
    00034
    00035 namespace Ogre {
    00036
    00037
    00038     typedef std::list<Resource*> ResourceList;
    00039
    00059     class _OgreGuiElementExport PopupMenuGuiElement : public PanelGuiElement, public ListSelectionTarget, public ListChanger, public GuiPressable, public MouseMotionListener
    00060     {
    00061     public :
    00062 //      void addBaseParameters(void);
    00063
    00064         PopupMenuGuiElement(const String& name);
    00065         virtual ~PopupMenuGuiElement();
    00066
    00068         class CmdItemTemplate : public ParamCommand
    00069         {
    00070         public:
    00071             String doGet(const void* target) const;
    00072             void doSet(void* target, const String& val);
    00073         };
    00075         class CmdVSpacing : public ParamCommand
    00076         {
    00077         public:
    00078             String doGet(const void* target) const;
    00079             void doSet(void* target, const String& val);
    00080         };
    00082         class CmdHSpacing : public ParamCommand
    00083         {
    00084         public:
    00085             String doGet(const void* target) const;
    00086             void doSet(void* target, const String& val);
    00087         };
    00089         class CmdItemPanelMaterial : public ParamCommand
    00090         {
    00091         public:
    00092             String doGet(const void* target) const;
    00093             void doSet(void* target, const String& val);
    00094         };
    00095
    00097         class CmdItemPanelMaterialSelected : public ParamCommand
    00098         {
    00099         public:
    00100             String doGet(const void* target) const;
    00101             void doSet(void* target, const String& val);
    00102         };
    00103
    00104         void setItemTemplateName(const String& val);
    00105         void addListItem(Resource* r);
    00106         void removeListItem(Resource* r);
    00107         String getItemTemplateName() const;
    00108         String getVSpacing() const;
    00109         String getHSpacing() const;
    00110         void setVSpacing(const String& val);
    00111         void setHSpacing(const String& val);
    00112
    00113         String getItemPanelMaterial() const;
    00114         String getItemPanelMaterialSelected() const;
    00115         void setItemPanelMaterial(const String& val);
    00116         void setItemPanelMaterialSelected(const String& val);
    00117         Resource* getSelectedItem();
    00118
    00119         void setSelectedItem(Resource* r, bool on);
    00120         void setSelectedItem(Resource* r);
    00121         ResourceListConstIterator getConstIterator() const;
    00122         ResourceListConstIterator getConstEndIterator() const;
    00123         Resource* popFront() ;
    00124         size_t getListSize() const;
    00125
    00126     protected:
    00127         void setSelectedItem(GuiElement* item, bool on);
    00128         void setSelectedItem(GuiElement* item);
    00129
    00130         void mouseMoved(MouseEvent* e);
    00131         void mouseDragged(MouseEvent* e);
    00132         void mouseExited(void);
    00133         void mousePressed(void);
    00134         void mouseReleased(void);
    00135
    00136         void addBaseParameters(void);
    00137         String getListItemName(Resource* r);
    00138         String getListItemPanelName(Resource* r);
    00139
    00140         void addMenuItem(Resource* r);
    00141         void removeMenuItem(Resource* r);
    00142
    00143         static CmdItemTemplate msCmdItemTemplate;
    00144         static CmdVSpacing msCmdVSpacing;
    00145         static CmdHSpacing msCmdHSpacing;
    00146         static CmdItemPanelMaterial msCmdItemPanelMaterial;
    00147         static CmdItemPanelMaterialSelected msCmdItemPanelMaterialSelected;
    00148         static String msTypeName;
    00149
    00150         void layoutItems();
    00151         Real mVSpacing;
    00152         Real mHSpacing;
    00153
    00154         ushort mPixelVSpacing;
    00155         ushort mPixelHSpacing;
    00156         String mItemTemplateName;
    00157         String mItemPanelMaterial;
    00158         String mItemPanelMaterialSelected;
    00159
    00160
    00161         ResourceList mResourceList;
    00162         StringResource *mSelectedMenuItem;
    00163         StringResource *mSeparatormenuItem;
    00164
    00165         GuiElement* mSelectedElement;
    00166
    00167         String mSelectedString;
    00168     };
    00169 }
    00170
    00171 #endif  // __PopupMenuGuiElement_H__

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:48:39 2004