![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
![]() |
00001 /******************************************************************************** 00002 * * 00003 * C o l o r D i a l o g * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 1998,2009 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 * $Id: FXColorDialog.h,v 1.27 2009/01/06 13:07:22 fox Exp $ * 00022 ********************************************************************************/ 00023 #ifndef FXCOLORDIALOG_H 00024 #define FXCOLORDIALOG_H 00025 00026 #ifndef FXDIALOGBOX_H 00027 #include "FXDialogBox.h" 00028 #endif 00029 00030 namespace FX { 00031 00032 00033 class FXColorSelector; 00034 00035 00036 /** 00037 * The Color dialog is a standard dialog panel used to edit colors. 00038 * Colors can be edited via RGB (Red, Green, Blue additive color model), 00039 * via HSV (Hue, Saturation, Value color modal), via CMY (Cyan, Magenta, 00040 * Yellow subtractive color model), or by name. 00041 * Commonly used colors can be dragged into a number of small color wells 00042 * to be used repeatedly; colors dropped into the small color wells are 00043 * automatically saved into the registry for future use. 00044 */ 00045 class FXAPI FXColorDialog : public FXDialogBox { 00046 FXDECLARE(FXColorDialog) 00047 protected: 00048 FXColorSelector *colorbox; 00049 protected: 00050 FXColorDialog(){} 00051 private: 00052 FXColorDialog(const FXColorDialog&); 00053 FXColorDialog &operator=(const FXColorDialog&); 00054 public: 00055 long onChgColor(FXObject*,FXSelector,void*); 00056 long onCmdColor(FXObject*,FXSelector,void*); 00057 long onCmdSetIntValue(FXObject*,FXSelector,void*); 00058 long onCmdGetIntValue(FXObject*,FXSelector,void*); 00059 public: 00060 enum { 00061 ID_COLORSELECTOR=FXDialogBox::ID_LAST, 00062 ID_LAST 00063 }; 00064 public: 00065 00066 /// Construct color dialog 00067 FXColorDialog(FXWindow* owner,const FXString& name,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0); 00068 00069 /// Set the color 00070 void setRGBA(FXColor clr); 00071 00072 /// Get the color 00073 FXColor getRGBA() const; 00074 00075 /// Return true if only opaque colors allowed 00076 FXbool isOpaqueOnly() const; 00077 00078 /// Change opaque only mode 00079 void setOpaqueOnly(FXbool forceopaque); 00080 00081 /// Save dialog to a stream 00082 virtual void save(FXStream& store) const; 00083 00084 /// Load dialog from a stream 00085 virtual void load(FXStream& store); 00086 00087 /// Destructor 00088 virtual ~FXColorDialog(); 00089 }; 00090 00091 } 00092 00093 #endif
![]() |