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-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 __ButtonGuiElement_H__ 00026 #define __ButtonGuiElement_H__ 00027 00028 #include "OgreGuiElementPrerequisites.h" 00029 #include "OgrePanelGuiElement.h" 00030 #include "OgreGuiPressable.h" 00031 00032 namespace Ogre { 00033 00034 00054 class _OgreGuiElementExport ButtonGuiElement : public PanelGuiElement, public GuiPressable 00055 { 00056 protected: 00057 bool mButtonDown; 00058 00059 String mDownMaterialName; 00060 String mUpMaterialName; 00061 String mHiliteDownMaterialName; 00062 String mHiliteUpMaterialName; 00063 String mDisabledMaterialName; 00064 00065 ColourValue mCaptionColour; 00066 ColourValue mCaptionDisabledColour; 00067 bool mSetCaptionColor; 00068 bool mSetCaptionDisabledColor; 00069 00070 static String msTypeName; 00071 GuiElement* mInsideObject; 00072 00073 void changeChild(GuiElement* e, Real add); 00074 00075 public : 00076 const String& getTypeName(void) const; 00077 void addBaseParameters(void); 00078 00079 ButtonGuiElement(const String& name); 00080 ~ButtonGuiElement() {} 00081 00082 void processEvent(InputEvent* e); 00083 00084 void updateMaterials(bool init = false); 00085 00086 00088 void setDownMaterialName(const String& name); 00090 const String& getDownMaterialName(void) const; 00091 00093 void setUpMaterialName(const String& name); 00095 const String& getUpMaterialName(void) const; 00096 00098 void setHiliteDownMaterialName(const String& name); 00100 const String& getHiliteDownMaterialName(void) const; 00101 00103 void setHiliteUpMaterialName(const String& name); 00105 const String& getHiliteUpMaterialName(void) const; 00106 00108 void setDisabledMaterialName(const String& name); 00110 const String& getDisabledMaterialName(void) const; 00111 00113 void setCaptionColour(const ColourValue& col); 00115 ColourValue getCaptionColour(void) const; 00116 00118 void setCaptionDisabledColour(const ColourValue& col); 00120 ColourValue getCaptionDisabledColour(void) const; 00121 00122 void setButtonCaption(const String& templateName, const String& name); 00123 String getButtonCaption() const; 00124 00126 class CmdButtonDownMaterial : public ParamCommand 00127 { 00128 public: 00129 String doGet(const void* target) const; 00130 void doSet(void* target, const String& val); 00131 }; 00132 00134 class CmdButtonUpMaterial : public ParamCommand 00135 { 00136 public: 00137 String doGet(const void* target) const; 00138 void doSet(void* target, const String& val); 00139 }; 00140 00142 class CmdButtonHiliteDownMaterial : public ParamCommand 00143 { 00144 public: 00145 String doGet(const void* target) const; 00146 void doSet(void* target, const String& val); 00147 }; 00148 00150 class CmdButtonHiliteUpMaterial : public ParamCommand 00151 { 00152 public: 00153 String doGet(const void* target) const; 00154 void doSet(void* target, const String& val); 00155 }; 00156 00158 class CmdButtonDisabledMaterial : public ParamCommand 00159 { 00160 public: 00161 String doGet(const void* target) const; 00162 void doSet(void* target, const String& val); 00163 }; 00165 class CmdCaptionColour : public ParamCommand 00166 { 00167 public: 00168 String doGet(const void* target) const; 00169 void doSet(void* target, const String& val); 00170 }; 00172 class CmdCaptionDisabledColour : public ParamCommand 00173 { 00174 public: 00175 String doGet(const void* target) const; 00176 void doSet(void* target, const String& val); 00177 }; 00178 00180 class CmdButtonCaption : public ParamCommand 00181 { 00182 public: 00183 String doGet(const void* target) const; 00184 void doSet(void* target, const String& val); 00185 }; 00186 00187 static CmdButtonDownMaterial msCmdButtonDownMaterial; 00188 static CmdButtonUpMaterial msCmdButtonUpMaterial; 00189 static CmdButtonHiliteDownMaterial msCmdButtonHiliteDownMaterial; 00190 static CmdButtonHiliteUpMaterial msCmdButtonHiliteUpMaterial; 00191 static CmdButtonDisabledMaterial msCmdButtonDisabledMaterial; 00192 static CmdCaptionColour msCmdCaptionColour; 00193 static CmdCaptionDisabledColour msCmdCaptionDisabledColour; 00194 static CmdButtonCaption msCmdButtonCaption; 00195 }; 00196 } 00197 00198 00199 #endif // __ButtonGuiElement_H__
Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:48:16 2004