Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CEGUICheckbox.h

Go to the documentation of this file.
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 CEGUIEXPORT 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 
00145         virtual bool    testClassName_impl(const String& class_name) const
00146         {
00147                 if (class_name==(const utf8*)"Checkbox")        return true;
00148                 return ButtonBase::testClassName_impl(class_name);
00149         }
00150 
00151 
00152         /*************************************************************************
00153                 Implementation Data
00154         *************************************************************************/
00155         bool            d_selected;                                     
00156 
00157 private:
00158         /*************************************************************************
00159                 Static Properties for this class
00160         *************************************************************************/
00161         static CheckboxProperties::Selected     d_selectedProperty;
00162 
00163 
00164         /*************************************************************************
00165                 Private methods
00166         *************************************************************************/
00167         void    addCheckboxProperties(void);
00168 };
00169 
00170 } // End of  CEGUI namespace section
00171 
00172 
00173 #if defined(_MSC_VER)
00174 #       pragma warning(pop)
00175 #endif
00176 
00177 #endif  // end of guard _CEGUICheckbox_h_

Generated on Wed Sep 7 09:56:30 2005 for Crazy Eddies GUI System by  doxygen 1.4.3