00001 /************************************************************************ 00002 filename: CEGUICheckbox.h 00003 created: 13/4/2004 00004 author: Paul D Turner 00005 00006 purpose: Interface to base class for Checkbox Widget 00007 *************************************************************************/ 00008 /************************************************************************* 00009 Crazy Eddie's GUI System (http://www.cegui.org.uk) 00010 Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk) 00011 00012 This library is free software; you can redistribute it and/or 00013 modify it under the terms of the GNU Lesser General Public 00014 License as published by the Free Software Foundation; either 00015 version 2.1 of the License, or (at your option) any later version. 00016 00017 This library is distributed in the hope that it will be useful, 00018 but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00020 Lesser General Public License for more details. 00021 00022 You should have received a copy of the GNU Lesser General Public 00023 License along with this library; if not, write to the Free Software 00024 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00025 *************************************************************************/ 00026 #ifndef _CEGUICheckbox_h_ 00027 #define _CEGUICheckbox_h_ 00028 00029 #include "CEGUIBase.h" 00030 #include "elements/CEGUIButtonBase.h" 00031 #include "elements/CEGUICheckboxProperties.h" 00032 00033 00034 #if defined(_MSC_VER) 00035 # pragma warning(push) 00036 # pragma warning(disable : 4251) 00037 #endif 00038 00039 00040 // Start of CEGUI namespace section 00041 namespace CEGUI 00042 { 00043 00048 class CEGUIBASE_API Checkbox : public ButtonBase 00049 { 00050 public: 00051 static const String EventNamespace; 00052 00053 /************************************************************************* 00054 Event name constants 00055 *************************************************************************/ 00056 // generated internally by Window 00057 static const String EventCheckStateChanged; 00058 00059 00060 /************************************************************************* 00061 Accessor Functions 00062 *************************************************************************/ 00071 bool isSelected(void) const {return d_selected;} 00072 00073 00074 /************************************************************************* 00075 Manipulator Functions 00076 *************************************************************************/ 00088 void setSelected(bool select); 00089 00090 00091 /************************************************************************* 00092 Construction / Destruction 00093 *************************************************************************/ 00098 Checkbox(const String& type, const String& name); 00099 00100 00105 virtual ~Checkbox(void); 00106 00107 00108 protected: 00109 /************************************************************************* 00110 New event handlers 00111 *************************************************************************/ 00116 virtual void onSelectStateChange(WindowEventArgs& e); 00117 00118 00119 /************************************************************************* 00120 Overridden event handlers 00121 *************************************************************************/ 00122 virtual void onMouseButtonUp(MouseEventArgs& e); 00123 00124 00125 /************************************************************************* 00126 Implementation Functions 00127 *************************************************************************/ 00132 void addCheckboxEvents(void); 00133 00134 00135 /************************************************************************* 00136 Implementation Data 00137 *************************************************************************/ 00138 bool d_selected; 00139 00140 private: 00141 /************************************************************************* 00142 Static Properties for this class 00143 *************************************************************************/ 00144 static CheckboxProperties::Selected d_selectedProperty; 00145 00146 00147 /************************************************************************* 00148 Private methods 00149 *************************************************************************/ 00150 void addCheckboxProperties(void); 00151 }; 00152 00153 } // End of CEGUI namespace section 00154 00155 00156 #if defined(_MSC_VER) 00157 # pragma warning(pop) 00158 #endif 00159 00160 #endif // end of guard _CEGUICheckbox_h_