1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxBrush
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
11 @ingroup group_class_gdi
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
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,
25 @see wxBrushList, wxDC, wxDC::SetBrush
27 class wxBrush
: public wxGDIObject
32 Copy constructor, uses @ref overview_trefcount "reference counting".
37 Colour name. The name will be looked up in the colour database.
51 Transparent (no fill).
73 Uses a bitmap as a stipple.
84 Backward diagonal hatch.
106 Forward diagonal hatch.
141 Pointer or reference to a brush to copy.
143 A bitmap to use for stippling.
145 @remarks If a stipple brush is created, the brush style will be set to
148 @see wxBrushList, wxColour, wxColourDatabase
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
);
159 See @ref overview_refcountdestruct "reference-counted object destruction" for
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
172 Returns a reference to the brush colour.
176 wxColour
GetColour() const;
179 Gets a pointer to the stipple bitmap. If the brush does not have a wxSTIPPLE
181 this bitmap may be non-@NULL but uninitialised (@ref wxBitmap::isok
182 wxBitmap:IsOk returns @false).
186 wxBitmap
* GetStipple() const;
189 Returns the brush style, one of:
193 Transparent (no fill).
201 Backward diagonal hatch.
205 Cross-diagonal hatch.
209 Forward diagonal hatch.
215 @b wxHORIZONTAL_HATCH
225 Stippled using a bitmap.
227 @b wxSTIPPLE_MASK_OPAQUE
229 Stippled using a bitmap's mask.
231 @see SetStyle(), SetColour(), SetStipple()
233 int GetStyle() const;
236 Returns @true if the style of the brush is any of hatched fills.
240 bool IsHatch() const;
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).
251 Sets the brush colour using red, green and blue values.
255 void SetColour(wxColour
& colour
);
256 void SetColour(const wxString
& colourName
);
257 void SetColour(unsigned char red
, unsigned char green
,
262 Sets the stipple bitmap.
265 The bitmap to use for stippling.
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.
273 void SetStipple(const wxBitmap
& bitmap
);
276 Sets the brush style.
291 Transparent (no fill).
313 Backward diagonal hatch.
324 Cross-diagonal hatch.
335 Forward diagonal hatch.
379 Stippled using a bitmap.
385 wxSTIPPLE_MASK_OPAQUE
390 Stippled using a bitmap's mask.
394 void SetStyle(int style
);
398 See @ref overview_refcountequality "reference-counted object comparison" for
401 bool operator !=(const wxBrush
& brush
);
404 Assignment operator, using @ref overview_trefcount "reference counting".
406 wxBrush
operator =(const wxBrush
& brush
);
410 See @ref overview_refcountequality "reference-counted object comparison" for
413 bool operator ==(const wxBrush
& brush
);
437 wxBrush wxBLUE_BRUSH
;
442 wxBrush wxGREEN_BRUSH
;
447 wxBrush wxWHITE_BRUSH
;
452 wxBrush wxBLACK_BRUSH
;
457 wxBrush wxGREY_BRUSH
;
462 wxBrush wxMEDIUM_GREY_BRUSH
;
467 wxBrush wxLIGHT_GREY_BRUSH
;
472 wxBrush wxTRANSPARENT_BRUSH
;
477 wxBrush wxCYAN_BRUSH
;