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

FXColorDialog.h
Go to the documentation of this file.
1 /********************************************************************************
2 * *
3 * C o l o r D i a l o g *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1998,2006 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Lesser General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2.1 of the License, or (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
21 *********************************************************************************
22 * $Id: FXColorDialog.h,v 1.20 2006/01/22 17:57:59 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXCOLORDIALOG_H
25 #define FXCOLORDIALOG_H
26 
27 #ifndef FXDIALOGBOX_H
28 #include "FXDialogBox.h"
29 #endif
30 
31 namespace FX {
32 
33 
34 class FXColorSelector;
35 
36 
37 /**
38 * The Color dialog is a standard dialog panel used to edit colors.
39 * Colors can be edited via RGB (Red, Green, Blue additive color model),
40 * via HSV (Hue, Saturation, Value color modal), via CMY (Cyan, Magenta,
41 * Yellow subtractive color model), or by name.
42 * Commonly used colors can be dragged into a number of small color wells
43 * to be used repeatedly; colors dropped into the small color wells are
44 * automatically saved into the registry for future use.
45 */
48 protected:
49  FXColorSelector *colorbox;
50 protected:
51  FXColorDialog(){}
52 private:
54  FXColorDialog &operator=(const FXColorDialog&);
55 public:
56  long onChgColor(FXObject*,FXSelector,void*);
57  long onCmdColor(FXObject*,FXSelector,void*);
58 public:
59  enum {
60  ID_COLORSELECTOR=FXDialogBox::ID_LAST,
61  ID_LAST
62  };
63 public:
64 
65  /// Construct color dialog
66  FXColorDialog(FXWindow* owner,const FXString& name,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
67 
68  /// Set the color
69  void setRGBA(FXColor clr);
70 
71  /// Get the color
72  FXColor getRGBA() const;
73 
74  /// Return true if only opaque colors allowed
75  FXbool isOpaqueOnly() const;
76 
77  /// Change opaque only mode
78  void setOpaqueOnly(FXbool forceopaque);
79 
80  /// Save dialog to a stream
81  virtual void save(FXStream& store) const;
82 
83  /// Load dialog from a stream
84  virtual void load(FXStream& store);
85 
86  /// Destructor
87  virtual ~FXColorDialog();
88  };
89 
90 }
91 
92 #endif
DialogBox window.
Definition: FXDialogBox.h:40
The Color dialog is a standard dialog panel used to edit colors.
Definition: FXColorDialog.h:46
Base class for all windows.
Definition: FXWindow.h:115
unsigned int FXuint
Definition: fxdefs.h:396
FXuint FXSelector
Association key.
Definition: FXObject.h:53
#define FXAPI
Definition: fxdefs.h:122
FXuchar FXbool
Definition: fxdefs.h:393
FXuint FXColor
Definition: fxdefs.h:454
FXString name(const FXString &file)
Return name and extension part of the path name.
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:99
Definition: FX4Splitter.h:31
int FXint
Definition: fxdefs.h:397
Color selection widget.
Definition: FXColorSelector.h:49
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:166
Definition: FXDialogBox.h:51
#define FXDECLARE(classname)
Macro to set up class declaration.
Definition: FXObject.h:92
FXString provides essential string manipulation capabilities.
Definition: FXString.h:33

Copyright © 1997-2005 Jeroen van der Zijp