![]() |
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,2002 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: FXColorDialog.h,v 1.13 2002/01/18 22:42:51 jeroen Exp $ * 00023 ********************************************************************************/ 00024 #ifndef FXCOLORDIALOG_H 00025 #define FXCOLORDIALOG_H 00026 00027 #ifndef FXDIALOGBOX_H 00028 #include "FXDialogBox.h" 00029 #endif 00030 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 substractive 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 public: 00058 enum { 00059 ID_COLORSELECTOR=FXDialogBox::ID_LAST, 00060 ID_LAST 00061 }; 00062 public: 00063 00064 /// Construct color dialog 00065 FXColorDialog(FXWindow* owner,const FXString& name,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0); 00066 00067 /// Set the color 00068 void setRGBA(FXColor clr); 00069 00070 /// Get the color 00071 FXColor getRGBA() const; 00072 00073 /// Return true if only opaque colors allowed 00074 FXbool isOpaqueOnly() const; 00075 00076 /// Change opaque only mode 00077 void setOpaqueOnly(FXbool forceopaque); 00078 00079 /// Save dialog to a stream 00080 virtual void save(FXStream& store) const; 00081 00082 /// Load dialog from a stream 00083 virtual void load(FXStream& store); 00084 00085 /// Destructor 00086 virtual ~FXColorDialog(); 00087 }; 00088 00089 00090 #endif