wg_radiobutton.h

00001 // wg_radiobutton.h
00002 //
00003 // CRadioButton interface
00004 //
00005 //
00006 // Copyright (c) 2005-2006 Rob Wiskow, Jurgen De Backer
00007 // rob-dev@boxedchaos.com, jurgendb@users.sourceforge.net
00008 //
00009 // This library is free software; you can redistribute it and/or
00010 // modify it under the terms of the GNU Lesser General Public
00011 // License as published by the Free Software Foundation; either
00012 // version 2.1 of the License, or (at your option) any later version.
00013 //
00014 // This library is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00017 // Lesser General Public License for more details.
00018 //
00019 // You should have received a copy of the GNU Lesser General Public
00020 // License along with this library; if not, write to the Free Software
00021 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00022 //
00023 
00024 
00025 #ifndef _WG_RADIOBUTTON_H_
00026 #define _WG_RADIOBUTTON_H_
00027 
00028 #include "wg_window.h"
00029 
00030 
00031 namespace wGui
00032 {
00033 
00035 
00041 
00042 class CRadioButton : public CWindow
00043 {
00044 public:
00048      CRadioButton(const CRect& WindowRect, CWindow* pParent);
00049 
00051      virtual ~CRadioButton(void) { }
00052 
00054      enum EState {
00055           UNCHECKED,  
00056           CHECKED,  
00057           DISABLED  
00058      };
00059 
00062      EState GetState(void) const { return m_eRadioButtonState; }
00063 
00066      void SetState(EState eState);
00067 
00068      // CWindow overrides
00070      virtual void Draw(void) const;
00071 
00077      virtual bool OnMouseButtonDown(CPoint Point, unsigned int Button);
00078 
00084      virtual bool OnMouseButtonUp(CPoint Point, unsigned int Button);
00085 
00086      // CMessageClient overrides
00089      virtual bool HandleMessage(CMessage* pMessage);
00090 
00091 protected:
00092      EState m_eRadioButtonState;  
00093      unsigned int m_MouseButton;  
00094 
00095 private:
00096       void operator=(CRadioButton) { }  
00097 };
00098 
00099 }
00100 
00101 
00102 #include "unit_tests/wg_radiobutton_unittests.h"
00103 
00104 #endif  // _WG_RADIOBUTTON_H_
00105 
00106 

Generated on Wed May 16 23:11:26 2007 for wGui by  doxygen 1.5.1