1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxBrush
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 A brush is a drawing tool for filling in areas. It is used for painting
14 the background of rectangles, ellipses, etc. It has a colour and a
21 ::Objects:, ::wxNullBrush, ::Pointers:, ::wxBLUE_BRUSH, ::wxGREEN_BRUSH,
22 ::wxWHITE_BRUSH, ::wxBLACK_BRUSH, ::wxGREY_BRUSH, ::wxMEDIUM_GREY_BRUSH, ::wxLIGHT_GREY_BRUSH, ::wxTRANSPARENT_BRUSH, ::wxCYAN_BRUSH, ::wxRED_BRUSH,
24 @see wxBrushList, wxDC, wxDC::SetBrush
26 class wxBrush
: public wxGDIObject
31 Copy constructor, uses @ref overview_trefcount "reference counting".
36 Colour name. The name will be looked up in the colour database.
50 Transparent (no fill).
72 Uses a bitmap as a stipple.
83 Backward diagonal hatch.
105 Forward diagonal hatch.
140 Pointer or reference to a brush to copy.
142 A bitmap to use for stippling.
144 @remarks If a stipple brush is created, the brush style will be set to
147 @see wxBrushList, wxColour, wxColourDatabase
150 wxBrush(const wxColour
& colour
, int style
= wxSOLID
);
151 wxBrush(const wxString
& colourName
, int style
);
152 wxBrush(const wxBitmap
& stippleBitmap
);
153 wxBrush(const wxBrush
& brush
);
158 See @ref overview_refcountdestruct "reference-counted object destruction" for
161 @remarks Although all remaining brushes are deleted when the application
162 exits, the application should try to clean up all
163 brushes itself. This is because wxWidgets cannot know
164 if a pointer to the brush object is stored in an
165 application data structure, and there is a risk of
171 Returns a reference to the brush colour.
175 wxColour
GetColour() const;
178 Gets a pointer to the stipple bitmap. If the brush does not have a wxSTIPPLE
180 this bitmap may be non-@NULL but uninitialised (@ref wxBitmap::isok
181 wxBitmap:IsOk returns @false).
185 wxBitmap
* GetStipple() const;
188 Returns the brush style, one of:
192 Transparent (no fill).
200 Backward diagonal hatch.
204 Cross-diagonal hatch.
208 Forward diagonal hatch.
214 @b wxHORIZONTAL_HATCH
224 Stippled using a bitmap.
226 @b wxSTIPPLE_MASK_OPAQUE
228 Stippled using a bitmap's mask.
230 @see SetStyle(), SetColour(), SetStipple()
232 int GetStyle() const;
235 Returns @true if the style of the brush is any of hatched fills.
239 bool IsHatch() const;
242 Returns @true if the brush is initialised. It will return @false if the default
243 constructor has been used (for example, the brush is a member of a class, or
244 @NULL has been assigned to it).
250 Sets the brush colour using red, green and blue values.
254 void SetColour(wxColour
& colour
);
255 void SetColour(const wxString
& colourName
);
256 void SetColour(unsigned char red
, unsigned char green
,
261 Sets the stipple bitmap.
264 The bitmap to use for stippling.
266 @remarks The style will be set to wxSTIPPLE, unless the bitmap has a mask
267 associated to it, in which case the style will be set
268 to wxSTIPPLE_MASK_OPAQUE.
272 void SetStipple(const wxBitmap
& bitmap
);
275 Sets the brush style.
290 Transparent (no fill).
312 Backward diagonal hatch.
323 Cross-diagonal hatch.
334 Forward diagonal hatch.
378 Stippled using a bitmap.
384 wxSTIPPLE_MASK_OPAQUE
389 Stippled using a bitmap's mask.
393 void SetStyle(int style
);
397 See @ref overview_refcountequality "reference-counted object comparison" for
400 bool operator !=(const wxBrush
& brush
);
403 Assignment operator, using @ref overview_trefcount "reference counting".
405 wxBrush
operator =(const wxBrush
& brush
);
409 See @ref overview_refcountequality "reference-counted object comparison" for
412 bool operator ==(const wxBrush
& brush
);
436 wxBrush wxBLUE_BRUSH
;
441 wxBrush wxGREEN_BRUSH
;
446 wxBrush wxWHITE_BRUSH
;
451 wxBrush wxBLACK_BRUSH
;
456 wxBrush wxGREY_BRUSH
;
461 wxBrush wxMEDIUM_GREY_BRUSH
;
466 wxBrush wxLIGHT_GREY_BRUSH
;
471 wxBrush wxTRANSPARENT_BRUSH
;
476 wxBrush wxCYAN_BRUSH
;