FXRadioButton.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                  R a d i o   B u t t o n    W i d g e t                       *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1998,2006 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (at your option) any later version.            *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************
00022 * $Id: FXRadioButton.h,v 1.29 2006/01/22 17:58:08 fox Exp $                     *
00023 ********************************************************************************/
00024 #ifndef FXRADIOBUTTON_H
00025 #define FXRADIOBUTTON_H
00026 
00027 #ifndef FXLABEL_H
00028 #include "FXLabel.h"
00029 #endif
00030 
00031 namespace FX {
00032 
00033 
00035 enum {
00036   RADIOBUTTON_AUTOGRAY = 0x00800000,  
00037   RADIOBUTTON_AUTOHIDE = 0x01000000,  
00038   RADIOBUTTON_NORMAL   = JUSTIFY_NORMAL|ICON_BEFORE_TEXT
00039   };
00040 
00041 
00042 
00054 class FXAPI FXRadioButton : public FXLabel {
00055   FXDECLARE(FXRadioButton)
00056 protected:
00057   FXColor  radioColor;  // Color of radio ball
00058   FXColor  diskColor;   // Color of radio disk
00059   FXbool   check;       // Radio state
00060   FXbool   oldcheck;    // Old radio state
00061 protected:
00062   FXRadioButton();
00063 private:
00064   FXRadioButton(const FXRadioButton&);
00065   FXRadioButton &operator=(const FXRadioButton&);
00066 public:
00067   long onPaint(FXObject*,FXSelector,void*);
00068   long onUpdate(FXObject*,FXSelector,void*);
00069   long onEnter(FXObject*,FXSelector,void*);
00070   long onLeave(FXObject*,FXSelector,void*);
00071   long onFocusIn(FXObject*,FXSelector,void*);
00072   long onFocusOut(FXObject*,FXSelector,void*);
00073   long onUngrabbed(FXObject*,FXSelector,void*);
00074   long onLeftBtnPress(FXObject*,FXSelector,void*);
00075   long onLeftBtnRelease(FXObject*,FXSelector,void*);
00076   long onKeyPress(FXObject*,FXSelector,void*);
00077   long onKeyRelease(FXObject*,FXSelector,void*);
00078   long onHotKeyPress(FXObject*,FXSelector,void*);
00079   long onHotKeyRelease(FXObject*,FXSelector,void*);
00080   long onCheck(FXObject*,FXSelector,void*);
00081   long onUncheck(FXObject*,FXSelector,void*);
00082   long onUnknown(FXObject*,FXSelector,void*);
00083   long onCmdSetValue(FXObject*,FXSelector,void*);
00084   long onCmdSetIntValue(FXObject*,FXSelector,void*);
00085   long onCmdGetIntValue(FXObject*,FXSelector,void*);
00086 public:
00087 
00089   FXRadioButton(FXComposite* p,const FXString& text,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=RADIOBUTTON_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
00090 
00092   virtual bool canFocus() const;
00093 
00095   virtual FXint getDefaultWidth();
00096 
00098   virtual FXint getDefaultHeight();
00099 
00101   void setCheck(FXbool s=TRUE,FXbool notify=FALSE);
00102 
00104   FXbool getCheck() const { return check; }
00105 
00107   void setRadioButtonStyle(FXuint style);
00108 
00110   FXuint getRadioButtonStyle() const;
00111 
00113   FXColor getRadioColor() const { return radioColor; }
00114 
00116   void setRadioColor(FXColor clr);
00117 
00119   FXColor getDiskColor() const { return diskColor; }
00120 
00122   void setDiskColor(FXColor clr);
00123 
00125   virtual void save(FXStream& store) const;
00126 
00128   virtual void load(FXStream& store);
00129   };
00130 
00131 }
00132 
00133 #endif

(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:24 2009 for TnFOX by doxygen v1.4.7