]> git.saurik.com Git - wxWidgets.git/blob - interface/wx/colourdata.h
Add some missing wxGraphicsContext methods
[wxWidgets.git] / interface / wx / colourdata.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: colourdata.h
3 // Purpose: interface of wxColourData
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxColourData
11
12 This class holds a variety of information related to colour dialogs.
13
14 @library{wxcore}
15 @category{cmndlg,data}
16
17 @see wxColour, wxColourDialog, @ref overview_cmndlg_colour
18 */
19 class wxColourData : public wxObject
20 {
21 public:
22 /// number of custom colours we store
23 enum
24 {
25 NUM_CUSTOM = 16
26 };
27
28 /**
29 Constructor. Initializes the custom colours to @c wxNullColour, the
30 @e data colour setting to black, and the @e choose full setting to
31 @true.
32 */
33 wxColourData();
34
35 /**
36 Destructor.
37 */
38 virtual ~wxColourData();
39
40 /**
41 Under Windows, determines whether the Windows colour dialog will
42 display the full dialog with custom colour selection controls.
43
44 Has no meaning under other platforms.
45
46 The default value is @true.
47 */
48 bool GetChooseFull() const;
49
50 /**
51 Gets the current colour associated with the colour dialog.
52
53 The default colour is black.
54 */
55 wxColour& GetColour();
56
57 /**
58 Returns custom colours associated with the colour dialog.
59
60 @param i
61 An integer between 0 and 15, being any of the 15 custom colours
62 that the user has saved. The default custom colours are invalid
63 colours.
64 */
65 wxColour GetCustomColour(int i) const;
66
67 /**
68 Under Windows, tells the Windows colour dialog to display the full
69 dialog with custom colour selection controls. Under other platforms,
70 has no effect.
71
72 The default value is @true.
73 */
74 void SetChooseFull(bool flag);
75
76 /**
77 Sets the default colour for the colour dialog.
78
79 The default colour is black.
80 */
81 void SetColour(const wxColour& colour);
82
83 /**
84 Sets custom colours for the colour dialog.
85
86 @param i
87 An integer between 0 and 15 for whatever custom colour you want to
88 set. The default custom colours are invalid colours.
89 @param colour
90 The colour to set
91 */
92 void SetCustomColour(int i, const wxColour& colour);
93
94 /**
95 Converts the colours saved in this class in a string form, separating
96 the various colours with a comma.
97 */
98 wxString ToString() const;
99
100 /**
101 Decodes the given string, which should be in the same format returned
102 by ToString(), and sets the internal colours.
103 */
104 bool FromString(const wxString& str);
105
106 /**
107 Assignment operator for the colour data.
108 */
109 wxColourData& operator =(const wxColourData& data);
110 };