00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OGRE 00004 (Object-oriented Graphics Rendering Engine) 00005 For the latest info, see http://ogre.sourceforge.net/ 00006 00007 Copyright © 2000-2002 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 __ListGuiElement_H__ 00026 #define __ListGuiElement_H__ 00027 00028 #include "OgreGuiElementPrerequisites.h" 00029 #include "OgreListSelectionTarget.h" 00030 #include "OgreBorderPanelGuiElement.h" 00031 #include "OgreListChanger.h" 00032 #include "OgreEventListeners.h" 00033 00034 namespace Ogre { 00035 00036 00037 typedef std::list<Resource*> ResourceList; 00038 00058 class _OgreGuiElementExport ListGuiElement : public PanelGuiElement, public ListSelectionTarget, public ListChanger, public MouseListener 00059 { 00060 public : 00061 // void addBaseParameters(void); 00062 00063 ListGuiElement(const String& name); 00064 00066 class CmdItemTemplate : public ParamCommand 00067 { 00068 public: 00069 String doGet(void* target); 00070 void doSet(void* target, const String& val); 00071 }; 00073 class CmdVSpacing : public ParamCommand 00074 { 00075 public: 00076 String doGet(void* target); 00077 void doSet(void* target, const String& val); 00078 }; 00080 class CmdHSpacing : public ParamCommand 00081 { 00082 public: 00083 String doGet(void* target); 00084 void doSet(void* target, const String& val); 00085 }; 00087 class CmdItemPanelMaterial : public ParamCommand 00088 { 00089 public: 00090 String doGet(void* target); 00091 void doSet(void* target, const String& val); 00092 }; 00093 00095 class CmdItemPanelMaterialSelected : public ParamCommand 00096 { 00097 public: 00098 String doGet(void* target); 00099 void doSet(void* target, const String& val); 00100 }; 00101 00102 00103 00104 00105 void setItemTemplateName(const String& val); 00106 void addListItem(Resource* r); 00107 void removeListItem(Resource* r); 00108 String getItemTemplateName(); 00109 String getVSpacing(); 00110 String getHSpacing(); 00111 void setVSpacing(const String& val); 00112 void setHSpacing(const String& val); 00113 00114 void mouseClicked(MouseEvent* e) {}; 00115 void mouseEntered(MouseEvent* e) {}; 00116 void mouseExited(MouseEvent* e) {}; 00117 void mousePressed(MouseEvent* e) ; 00118 void mouseReleased(MouseEvent* e) {}; 00119 00120 String getItemPanelMaterial(); 00121 String getItemPanelMaterialSelected(); 00122 void setItemPanelMaterial(const String& val); 00123 void setItemPanelMaterialSelected(const String& val); 00124 00125 protected: 00126 void setSelectedItem(GuiElement* item, bool on); 00127 00128 void addBaseParameters(void); 00129 String getListItemName(Resource* r); 00130 String getListItemPanelName(Resource* r); 00131 00132 static CmdItemTemplate msCmdItemTemplate; 00133 static CmdVSpacing msCmdVSpacing; 00134 static CmdHSpacing msCmdHSpacing; 00135 static CmdItemPanelMaterial msCmdItemPanelMaterial; 00136 static CmdItemPanelMaterialSelected msCmdItemPanelMaterialSelected; 00137 static String msTypeName; 00138 00139 void layoutItems(); 00140 Real mVSpacing; 00141 Real mHSpacing; 00142 00143 ushort mPixelVSpacing; 00144 ushort mPixelHSpacing; 00145 String mItemTemplateName; 00146 String mItemPanelMaterial; 00147 String mItemPanelMaterialSelected; 00148 00149 00150 ResourceList mResourceList; 00151 00152 GuiElement* mSelectedElement; 00153 }; 00154 00155 } 00156 00157 00158 #endif // __ListGuiElement_H__
Copyright © 2002 by The OGRE Team