]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/colour.tex
Added 'Include files' section to class references
[wxWidgets.git] / docs / latex / wx / colour.tex
1 \section{\class{wxColour}}\label{wxcolour}
2
3 A colour is an object representing a combination of Red, Green, and Blue (RGB) intensity values,
4 and is used to determine drawing colours. See the
5 entry for \helpref{wxColourDatabase}{wxcolourdatabase} for how a pointer to a predefined,
6 named colour may be returned instead of creating a new colour.
7
8 Valid RGB values are in the range 0 to 255.
9
10 \wxheading{Derived from}
11
12 \helpref{wxObject}{wxobject}
13
14 \wxheading{Include files}
15
16 <wx/colour.h>
17
18 \wxheading{See also}
19
20 \helpref{wxColourDatabase}{wxcolourdatabase}, \helpref{wxPen}{wxpen}, \helpref{wxBrush}{wxbrush},\rtfsp
21 \helpref{wxColourDialog}{wxcolourdialog}
22
23 \latexignore{\rtfignore{\wxheading{Members}}}
24
25 \membersection{wxColour::wxColour}\label{wxcolourconstr}
26
27 \func{}{wxColour}{\void}
28
29 Default constructor.
30
31 \func{}{wxColour}{\param{const unsigned char}{ red}, \param{const unsigned char}{ green}, \param{const unsigned char}{ blue}}
32
33 Constructs a colour from red, green and blue values.
34
35 \func{}{wxColour}{\param{const wxString\& }{colourNname}}
36
37 Constructs a colour object using a colour name
38 listed in {\bf wxTheColourDatabase}.
39
40 \func{}{wxColour}{\param{const wxColour\&}{ colour}}
41
42 Copy constructor.
43
44 \wxheading{Parameters}
45
46 \docparam{red}{The red value.}
47
48 \docparam{green}{The green value.}
49
50 \docparam{blue}{The blue value.}
51
52 \docparam{colourName}{The colour name.}
53
54 \docparam{colour}{The colour to copy.}
55
56 \wxheading{See also}
57
58 \helpref{wxColourDatabase}{wxcolourdatabase}
59
60 \membersection{wxColour::Blue}\label{wxcolourblue}
61
62 \constfunc{unsigned char}{Blue}{\void}
63
64 Returns the blue intensity.
65
66 \membersection{wxColour::GetPixel}\label{wxcolourgetpixel}
67
68 \constfunc{long}{GetPixel}{\void}
69
70 Returns a pixel value which is platform-dependent. On Windows, a COLORREF is returned.
71 On X, an allocated pixel value is returned.
72
73 -1 is returned if the pixel is invalid (on X, unallocated).
74
75 \membersection{wxColour::Green}\label{wxcolourgreen}
76
77 \constfunc{unsigned char}{Green}{\void}
78
79 Returns the green intensity.
80
81 \membersection{wxColour::Ok}\label{wxcolourok}
82
83 \constfunc{bool}{Ok}{\void}
84
85 Returns TRUE if the colour object is valid (the colour has been initialised with RGB values).
86
87 \membersection{wxColour::Red}\label{wxcolourred}
88
89 \constfunc{unsigned char}{Red}{\void}
90
91 Returns the red intensity.
92
93 \membersection{wxColour::Set}\label{wxcolourset}
94
95 \func{void}{Set}{\param{const unsigned char}{ red}, \param{const unsigned char}{ green}, \param{const unsigned char}{ blue}}
96
97 Sets the RGB intensity values.
98
99 \membersection{wxColour::operator $=$}\label{wxcolourassign}
100
101 \func{wxColour\&}{operator $=$}{\param{const wxColour\&}{ colour}}
102
103 Assignment operator, taking another colour object.
104
105 \func{wxColour\&}{operator $=$}{\param{const wxString\&}{ colourName}}
106
107 Assignment operator, using a colour name to be found in the colour database.
108
109 \wxheading{See also}
110
111 \helpref{wxColourDatabase}{wxcolourdatabase}
112
113 \membersection{wxColour::operator $==$}\label{wxcolourequality}
114
115 \func{bool}{operator $==$}{\param{const wxColour\&}{ colour}}
116
117 Tests the equality of two colours by comparing individual red, green blue colours.
118
119 \membersection{wxColour::operator $!=$}\label{wxcolourinequality}
120
121 \func{bool}{operator $!=$}{\param{const wxColour\&}{ colour}}
122
123 Tests the inequality of two colours by comparing individual red, green blue colours.
124
125 \section{\class{wxColourData}}\label{wxcolourdata}
126
127 This class holds a variety of information related to colour dialogs.
128
129 \wxheading{Derived from}
130
131 \helpref{wxObject}{wxobject}
132
133 \wxheading{Include files}
134
135 <wx/cmndata.h>
136
137 \wxheading{See also}
138
139 \helpref{wxColour}{wxcolour}, \helpref{wxColourDialog}{wxcolourdialog}, \helpref{wxColourDialog overview}{wxcolourdialogoverview}
140
141 \latexignore{\rtfignore{\wxheading{Members}}}
142
143 \membersection{wxColourData::wxColourData}\label{wxcolourdataconstr}
144
145 \func{}{wxColourData}{\void}
146
147 Constructor. Initializes the custom colours to white, the {\it data colour} setting
148 to black, and the {\it choose full} setting to TRUE.
149
150 \membersection{wxColourData::\destruct{wxColourData}}
151
152 \func{}{\destruct{wxColourData}}{\void}
153
154 Destructor.
155
156 \membersection{wxColourData::GetChooseFull}\label{wxcolourdatagetchoosefull}
157
158 \constfunc{bool}{GetChooseFull}{\void}
159
160 Under Windows, determines whether the Windows colour dialog will display the full dialog
161 with custom colour selection controls. Has no meaning under other platforms.
162
163 The default value is TRUE.
164
165 \membersection{wxColourData::GetColour}\label{wxcolourdatagetcolour}
166
167 \constfunc{wxColour\&}{GetColour}{\void}
168
169 Gets the current colour associated with the colour dialog.
170
171 The default colour is black.
172
173 \membersection{wxColourData::GetCustomColour}\label{wxcolourdatagetcustomcolour}
174
175 \constfunc{wxColour\&}{GetCustomColour}{\param{int}{ i}}
176
177 Gets the {\it i}th custom colour associated with the colour dialog. {\it i} should
178 be an integer between 0 and 15.
179
180 The default custom colours are all white.
181
182 \membersection{wxColourData::SetChooseFull}\label{wxcolourdatasetchoosefull}
183
184 \func{void}{SetChooseFull}{\param{const bool }{flag}}
185
186 Under Windows, tells the Windows colour dialog to display the full dialog
187 with custom colour selection controls. Under other platforms, has no effect.
188
189 The default value is TRUE.
190
191 \membersection{wxColourData::SetColour}\label{wxcolourdatasetcolour}
192
193 \func{void}{SetColour}{\param{const wxColour\&}{ colour}}
194
195 Sets the default colour for the colour dialog.
196
197 The default colour is black.
198
199 \membersection{wxColourData::SetCustomColour}\label{wxcolourdatasetcustomcolour}
200
201 \func{void}{SetColour}{\param{int}{ i}, \param{const wxColour\&}{ colour}}
202
203 Sets the {\it i}th custom colour for the colour dialog. {\it i} should
204 be an integer between 0 and 15.
205
206 The default custom colours are all white.
207
208 \membersection{wxColourData::operator $=$}\label{wxcolourdataassign}
209
210 \func{void}{operator $=$}{\param{const wxColourData\&}{ data}}
211
212 Assingment operator for the colour data.
213
214 \section{\class{wxColourDatabase}}\label{wxcolourdatabase}
215
216 wxWindows maintains a database of standard RGB colours for a predefined
217 set of named colours (such as ``BLACK'', ``LIGHT GREY''). The
218 application may add to this set if desired by using {\it Append}. There
219 is only one instance of this class: {\bf wxTheColourDatabase}.
220
221 \wxheading{Derived from}
222
223 \helpref{wxList}{wxlist}\\
224 \helpref{wxObject}{wxobject}
225
226 \wxheading{Include files}
227
228 <wx/gdicmn.h>
229
230 \wxheading{Remarks}
231
232 The colours in the standard database are as follows:
233
234 AQUAMARINE, BLACK, BLUE, BLUE VIOLET, BROWN, CADET BLUE, CORAL,
235 CORNFLOWER BLUE, CYAN, DARK GREY, DARK GREEN, DARK OLIVE GREEN, DARK
236 ORCHID, DARK SLATE BLUE, DARK SLATE GREY DARK TURQUOISE, DIM GREY,
237 FIREBRICK, FOREST GREEN, GOLD, GOLDENROD, GREY, GREEN, GREEN YELLOW,
238 INDIAN RED, KHAKI, LIGHT BLUE, LIGHT GREY, LIGHT STEEL BLUE, LIME GREEN,
239 MAGENTA, MAROON, MEDIUM AQUAMARINE, MEDIUM BLUE, MEDIUM FOREST GREEN,
240 MEDIUM GOLDENROD, MEDIUM ORCHID, MEDIUM SEA GREEN, MEDIUM SLATE BLUE,
241 MEDIUM SPRING GREEN, MEDIUM TURQUOISE, MEDIUM VIOLET RED, MIDNIGHT BLUE,
242 NAVY, ORANGE, ORANGE RED, ORCHID, PALE GREEN, PINK, PLUM, PURPLE, RED,
243 SALMON, SEA GREEN, SIENNA, SKY BLUE, SLATE BLUE, SPRING GREEN, STEEL
244 BLUE, TAN, THISTLE, TURQUOISE, VIOLET, VIOLET RED, WHEAT, WHITE, YELLOW,
245 YELLOW GREEN.
246
247 \wxheading{See also}
248
249 \helpref{wxColour}{wxcolour}
250
251 \latexignore{\rtfignore{\wxheading{Members}}}
252
253 \membersection{wxColourDatabase::wxColourDatabase}\label{wxcolourdatabaseconstr}
254
255 \func{}{wxColourDatabase}{\void}
256
257 Constructs the colour database.
258
259 \membersection{wxColourDatabase::FindColour}\label{wxcolourdatabasefindcolour}
260
261 \func{wxColour*}{FindColour}{\param{const wxString\& }{colourName}}
262
263 Finds a colour given the name. Returns NULL if not found.
264
265 \membersection{wxColourDatabase::FindName}\label{wxcolourdatabasefindname}
266
267 \constfunc{wxString}{FindName}{\param{const wxColour\&}{ colour}}
268
269 Finds a colour name given the colour. Returns NULL if not found.
270
271 \membersection{wxColourDatabase::Initialize}\label{wxcolourdatabaseinitialize}
272
273 \func{void}{Initialize}{\void}
274
275 Initializes the database with a number of stock colours. Called by wxWindows
276 on start-up.
277
278