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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXColorWell.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                         C o l o r W e l l   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 FXCOLORWELL_H
00022 #define FXCOLORWELL_H
00023 
00024 #ifndef FXFRAME_H
00025 #include "FXFrame.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00031 // Color Well Styles
00032 enum {
00033   COLORWELL_OPAQUEONLY = 0x00008000,  
00034   COLORWELL_SOURCEONLY = 0x00010000,  
00035   COLORWELL_NORMAL     = FRAME_SUNKEN|FRAME_THICK
00036   };
00037 
00038 
00039 
00051 class FXAPI FXColorWell : public FXFrame {
00052   FXDECLARE(FXColorWell)
00053 protected:
00054   FXColor   wellColor[2];       // Pixel value of RGBA over black and white
00055   FXint     wellSize;           // Well size
00056   FXColor   rgba;               // Color with RGB and Alpha
00057   FXString  tip;                // Tooltip value
00058   FXString  help;               // Help value
00059 protected:
00060   FXColorWell();
00061 private:
00062   FXColorWell(const FXColorWell&);
00063   FXColorWell &operator=(const FXColorWell&);
00064 public:
00065   long onPaint(FXObject*,FXSelector,void*);
00066   long onLeftBtnPress(FXObject*,FXSelector,void*);
00067   long onLeftBtnRelease(FXObject*,FXSelector,void*);
00068   long onKeyPress(FXObject*,FXSelector,void*);
00069   long onKeyRelease(FXObject*,FXSelector,void*);
00070   long onUngrabbed(FXObject*,FXSelector,void*);
00071   long onMotion(FXObject*,FXSelector,void*);
00072   long onBeginDrag(FXObject*,FXSelector,void*);
00073   long onEndDrag(FXObject*,FXSelector,void*);
00074   long onDragged(FXObject*,FXSelector,void*);
00075   long onFocusIn(FXObject*,FXSelector,void*);
00076   long onFocusOut(FXObject*,FXSelector,void*);
00077   long onDNDEnter(FXObject*,FXSelector,void*);
00078   long onDNDLeave(FXObject*,FXSelector,void*);
00079   long onDNDMotion(FXObject*,FXSelector,void*);
00080   long onDNDDrop(FXObject*,FXSelector,void*);
00081   long onDNDRequest(FXObject*,FXSelector,void*);
00082   long onClicked(FXObject*,FXSelector,void*);
00083   long onDoubleClicked(FXObject*,FXSelector,void*);
00084   long onCmdSetValue(FXObject*,FXSelector,void*);
00085   long onCmdSetIntValue(FXObject*,FXSelector,void*);
00086   long onCmdGetIntValue(FXObject*,FXSelector,void*);
00087   long onCmdSetHelp(FXObject*,FXSelector,void*);
00088   long onCmdGetHelp(FXObject*,FXSelector,void*);
00089   long onCmdSetTip(FXObject*,FXSelector,void*);
00090   long onCmdGetTip(FXObject*,FXSelector,void*);
00091   long onQueryHelp(FXObject*,FXSelector,void*);
00092   long onQueryTip(FXObject*,FXSelector,void*);
00093   long onUpdColor(FXObject*,FXSelector,void*);
00094   long onChgColor(FXObject*,FXSelector,void*);
00095   long onCmdColor(FXObject*,FXSelector,void*);
00096 public:
00097   enum {
00098     ID_COLOR=FXFrame::ID_LAST,
00099     ID_LAST
00100     };
00101 public:
00102 
00104   FXColorWell(FXComposite* p,FXColor clr=0,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=COLORWELL_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);
00105 
00107   virtual void create();
00108 
00110   virtual void detach();
00111 
00113   virtual FXint getDefaultWidth();
00114 
00116   virtual FXint getDefaultHeight();
00117 
00119   virtual FXbool canFocus() const;
00120 
00122   virtual void setFocus();
00123 
00125   virtual void killFocus();
00126 
00128   void setRGBA(FXColor clr,FXbool notify=false);
00129 
00131   FXColor getRGBA() const { return rgba; }
00132 
00134   void setHelpText(const FXString& text){ help=text; }
00135 
00137   const FXString& getHelpText() const { return help; }
00138 
00140   void setTipText(const FXString& text){ tip=text; }
00141 
00143   const FXString& getTipText() const { return tip; }
00144 
00146   void setWellSise(FXint ws);
00147 
00149   FXint getWellSize() const { return wellSize; }
00150 
00152   FXbool isOpaqueOnly() const;
00153 
00155   void setOpaqueOnly(FXbool opaque);
00156 
00158   FXbool isSourceOnly() const;
00159 
00161   void setSourceOnly(FXbool srconly);
00162 
00164   virtual void save(FXStream& store) const;
00165 
00167   virtual void load(FXStream& store);
00168 
00170   virtual ~FXColorWell();
00171   };
00172 
00173 }
00174 
00175 #endif

Copyright © 1997-2011 Jeroen van der Zijp