]> git.saurik.com Git - wxWidgets.git/blob - interface/brush.h
Added class groups example to Doxygen and added parent "Functions and Macros", and...
[wxWidgets.git] / interface / brush.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: brush.h
3 // Purpose: interface of wxBrush
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxBrush
11 @ingroup group_class_gdi
12 @wxheader{brush.h}
13
14 A brush is a drawing tool for filling in areas. It is used for painting
15 the background of rectangles, ellipses, etc. It has a colour and a
16 style.
17
18 @library{wxcore}
19 @category{gdi}
20
21 @stdobjects
22 ::Objects:, ::wxNullBrush, ::Pointers:, ::wxBLUE_BRUSH, ::wxGREEN_BRUSH,
23 ::wxWHITE_BRUSH, ::wxBLACK_BRUSH, ::wxGREY_BRUSH, ::wxMEDIUM_GREY_BRUSH, ::wxLIGHT_GREY_BRUSH, ::wxTRANSPARENT_BRUSH, ::wxCYAN_BRUSH, ::wxRED_BRUSH,
24
25 @see wxBrushList, wxDC, wxDC::SetBrush
26 */
27 class wxBrush : public wxGDIObject
28 {
29 public:
30 //@{
31 /**
32 Copy constructor, uses @ref overview_trefcount "reference counting".
33
34 @param colour
35 Colour object.
36 @param colourName
37 Colour name. The name will be looked up in the colour database.
38 @param style
39 One of:
40
41
42
43
44
45
46 wxTRANSPARENT
47
48
49
50
51 Transparent (no fill).
52
53
54
55
56
57 wxSOLID
58
59
60
61
62 Solid.
63
64
65
66
67
68 wxSTIPPLE
69
70
71
72
73 Uses a bitmap as a stipple.
74
75
76
77
78
79 wxBDIAGONAL_HATCH
80
81
82
83
84 Backward diagonal hatch.
85
86
87
88
89
90 wxCROSSDIAG_HATCH
91
92
93
94
95 Cross-diagonal hatch.
96
97
98
99
100
101 wxFDIAGONAL_HATCH
102
103
104
105
106 Forward diagonal hatch.
107
108
109
110
111
112 wxCROSS_HATCH
113
114
115
116
117 Cross hatch.
118
119
120
121
122
123 wxHORIZONTAL_HATCH
124
125
126
127
128 Horizontal hatch.
129
130
131
132
133
134 wxVERTICAL_HATCH
135
136
137
138
139 Vertical hatch.
140 @param brush
141 Pointer or reference to a brush to copy.
142 @param stippleBitmap
143 A bitmap to use for stippling.
144
145 @remarks If a stipple brush is created, the brush style will be set to
146 wxSTIPPLE.
147
148 @see wxBrushList, wxColour, wxColourDatabase
149 */
150 wxBrush();
151 wxBrush(const wxColour& colour, int style = wxSOLID);
152 wxBrush(const wxString& colourName, int style);
153 wxBrush(const wxBitmap& stippleBitmap);
154 wxBrush(const wxBrush& brush);
155 //@}
156
157 /**
158 Destructor.
159 See @ref overview_refcountdestruct "reference-counted object destruction" for
160 more info.
161
162 @remarks Although all remaining brushes are deleted when the application
163 exits, the application should try to clean up all
164 brushes itself. This is because wxWidgets cannot know
165 if a pointer to the brush object is stored in an
166 application data structure, and there is a risk of
167 double deletion.
168 */
169 ~wxBrush();
170
171 /**
172 Returns a reference to the brush colour.
173
174 @see SetColour()
175 */
176 wxColour GetColour() const;
177
178 /**
179 Gets a pointer to the stipple bitmap. If the brush does not have a wxSTIPPLE
180 style,
181 this bitmap may be non-@NULL but uninitialised (@ref wxBitmap::isok
182 wxBitmap:IsOk returns @false).
183
184 @see SetStipple()
185 */
186 wxBitmap* GetStipple() const;
187
188 /**
189 Returns the brush style, one of:
190
191 @b wxTRANSPARENT
192
193 Transparent (no fill).
194
195 @b wxSOLID
196
197 Solid.
198
199 @b wxBDIAGONAL_HATCH
200
201 Backward diagonal hatch.
202
203 @b wxCROSSDIAG_HATCH
204
205 Cross-diagonal hatch.
206
207 @b wxFDIAGONAL_HATCH
208
209 Forward diagonal hatch.
210
211 @b wxCROSS_HATCH
212
213 Cross hatch.
214
215 @b wxHORIZONTAL_HATCH
216
217 Horizontal hatch.
218
219 @b wxVERTICAL_HATCH
220
221 Vertical hatch.
222
223 @b wxSTIPPLE
224
225 Stippled using a bitmap.
226
227 @b wxSTIPPLE_MASK_OPAQUE
228
229 Stippled using a bitmap's mask.
230
231 @see SetStyle(), SetColour(), SetStipple()
232 */
233 int GetStyle() const;
234
235 /**
236 Returns @true if the style of the brush is any of hatched fills.
237
238 @see GetStyle()
239 */
240 bool IsHatch() const;
241
242 /**
243 Returns @true if the brush is initialised. It will return @false if the default
244 constructor has been used (for example, the brush is a member of a class, or
245 @NULL has been assigned to it).
246 */
247 bool IsOk() const;
248
249 //@{
250 /**
251 Sets the brush colour using red, green and blue values.
252
253 @see GetColour()
254 */
255 void SetColour(wxColour& colour);
256 void SetColour(const wxString& colourName);
257 void SetColour(unsigned char red, unsigned char green,
258 unsigned char blue);
259 //@}
260
261 /**
262 Sets the stipple bitmap.
263
264 @param bitmap
265 The bitmap to use for stippling.
266
267 @remarks The style will be set to wxSTIPPLE, unless the bitmap has a mask
268 associated to it, in which case the style will be set
269 to wxSTIPPLE_MASK_OPAQUE.
270
271 @see wxBitmap
272 */
273 void SetStipple(const wxBitmap& bitmap);
274
275 /**
276 Sets the brush style.
277
278 @param style
279 One of:
280
281
282
283
284
285
286 wxTRANSPARENT
287
288
289
290
291 Transparent (no fill).
292
293
294
295
296
297 wxSOLID
298
299
300
301
302 Solid.
303
304
305
306
307
308 wxBDIAGONAL_HATCH
309
310
311
312
313 Backward diagonal hatch.
314
315
316
317
318
319 wxCROSSDIAG_HATCH
320
321
322
323
324 Cross-diagonal hatch.
325
326
327
328
329
330 wxFDIAGONAL_HATCH
331
332
333
334
335 Forward diagonal hatch.
336
337
338
339
340
341 wxCROSS_HATCH
342
343
344
345
346 Cross hatch.
347
348
349
350
351
352 wxHORIZONTAL_HATCH
353
354
355
356
357 Horizontal hatch.
358
359
360
361
362
363 wxVERTICAL_HATCH
364
365
366
367
368 Vertical hatch.
369
370
371
372
373
374 wxSTIPPLE
375
376
377
378
379 Stippled using a bitmap.
380
381
382
383
384
385 wxSTIPPLE_MASK_OPAQUE
386
387
388
389
390 Stippled using a bitmap's mask.
391
392 @see GetStyle()
393 */
394 void SetStyle(int style);
395
396 /**
397 Inequality operator.
398 See @ref overview_refcountequality "reference-counted object comparison" for
399 more info.
400 */
401 bool operator !=(const wxBrush& brush);
402
403 /**
404 Assignment operator, using @ref overview_trefcount "reference counting".
405 */
406 wxBrush operator =(const wxBrush& brush);
407
408 /**
409 Equality operator.
410 See @ref overview_refcountequality "reference-counted object comparison" for
411 more info.
412 */
413 bool operator ==(const wxBrush& brush);
414 };
415
416
417 /**
418 FIXME
419 */
420 wxBrush Objects:
421 ;
422
423 /**
424 FIXME
425 */
426 wxBrush wxNullBrush;
427
428 /**
429 FIXME
430 */
431 wxBrush Pointers:
432 ;
433
434 /**
435 FIXME
436 */
437 wxBrush wxBLUE_BRUSH;
438
439 /**
440 FIXME
441 */
442 wxBrush wxGREEN_BRUSH;
443
444 /**
445 FIXME
446 */
447 wxBrush wxWHITE_BRUSH;
448
449 /**
450 FIXME
451 */
452 wxBrush wxBLACK_BRUSH;
453
454 /**
455 FIXME
456 */
457 wxBrush wxGREY_BRUSH;
458
459 /**
460 FIXME
461 */
462 wxBrush wxMEDIUM_GREY_BRUSH;
463
464 /**
465 FIXME
466 */
467 wxBrush wxLIGHT_GREY_BRUSH;
468
469 /**
470 FIXME
471 */
472 wxBrush wxTRANSPARENT_BRUSH;
473
474 /**
475 FIXME
476 */
477 wxBrush wxCYAN_BRUSH;
478
479 /**
480 FIXME
481 */
482 wxBrush wxRED_BRUSH;
483
484