Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

/home/jeroen/FOX/fox/fox-1.7.33/include/FXCheckButton.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                    C h e c k   B u t t o n   W i d g e t                      *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1998,2012 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (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                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 ********************************************************************************/
00021 #ifndef FXCHECKBUTTON_H
00022 #define FXCHECKBUTTON_H
00023 
00024 #ifndef FXLABEL_H
00025 #include "FXLabel.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00032 enum {
00033   CHECKBUTTON_AUTOGRAY = 0x00800000,    
00034   CHECKBUTTON_AUTOHIDE = 0x01000000,    
00035   CHECKBUTTON_PLUS     = 0x02000000,    
00036   CHECKBUTTON_NORMAL   = JUSTIFY_NORMAL|ICON_BEFORE_TEXT
00037   };
00038 
00039 
00054 class FXAPI FXCheckButton : public FXLabel {
00055   FXDECLARE(FXCheckButton)
00056 protected:
00057   FXColor  checkColor;  // Color of check mark
00058   FXColor  boxColor;    // Color of check box
00059   FXuchar  check;       // Check state
00060   FXuchar  oldcheck;    // Old check state
00061 protected:
00062   FXCheckButton();
00063 private:
00064   FXCheckButton(const FXCheckButton&);
00065   FXCheckButton &operator=(const FXCheckButton&);
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   FXCheckButton(FXComposite* p,const FXString& text,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=CHECKBUTTON_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 FXbool canFocus() const;
00093 
00095   virtual FXint getDefaultWidth();
00096 
00098   virtual FXint getDefaultHeight();
00099 
00101   void setCheck(FXuchar state=TRUE,FXbool notify=false);
00102 
00104   FXuchar getCheck() const { return check; }
00105 
00107   void setCheckButtonStyle(FXuint style);
00108 
00110   FXuint getCheckButtonStyle() const;
00111 
00113   FXColor getBoxColor() const { return boxColor; }
00114 
00116   void setBoxColor(FXColor clr);
00117 
00119   FXColor getCheckColor() const { return checkColor; }
00120 
00122   void setCheckColor(FXColor clr);
00123 
00125   virtual void save(FXStream& store) const;
00126 
00128   virtual void load(FXStream& store);
00129   };
00130 
00131 }
00132 
00133 #endif

Copyright © 1997-2011 Jeroen van der Zijp