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