]>
git.saurik.com Git - wxWidgets.git/blob - interface/brush.h
b94094f5ba1c78d1af195188acc5650a11c3ae0c
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxBrush class
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
45 wxBrushList, wxDC, wxDC::SetBrush
47 class wxBrush
: public wxGDIObject
52 Copy constructor, uses @ref overview_trefcount "reference counting".
57 Colour name. The name will be looked up in the colour database.
71 Transparent (no fill).
93 Uses a bitmap as a stipple.
104 Backward diagonal hatch.
115 Cross-diagonal hatch.
126 Forward diagonal hatch.
161 Pointer or reference to a brush to copy.
163 A bitmap to use for stippling.
165 @remarks If a stipple brush is created, the brush style will be set to
168 @see wxBrushList, wxColour, wxColourDatabase
171 wxBrush(const wxColour
& colour
, int style
= wxSOLID
);
172 wxBrush(const wxString
& colourName
, int style
);
173 wxBrush(const wxBitmap
& stippleBitmap
);
174 wxBrush(const wxBrush
& brush
);
179 See @ref overview_refcountdestruct "reference-counted object destruction" for
182 @remarks Although all remaining brushes are deleted when the application
183 exits, the application should try to clean up all
184 brushes itself. This is because wxWidgets cannot know
185 if a pointer to the brush object is stored in an
186 application data structure, and there is a risk of
192 Returns a reference to the brush colour.
196 wxColour
GetColour();
199 Gets a pointer to the stipple bitmap. If the brush does not have a wxSTIPPLE
201 this bitmap may be non-@NULL but uninitialised (@ref wxBitmap::isok
202 wxBitmap:IsOk returns @false).
206 wxBitmap
* GetStipple();
209 Returns the brush style, one of:
213 Transparent (no fill).
221 Backward diagonal hatch.
225 Cross-diagonal hatch.
229 Forward diagonal hatch.
235 @b wxHORIZONTAL_HATCH
245 Stippled using a bitmap.
247 @b wxSTIPPLE_MASK_OPAQUE
249 Stippled using a bitmap's mask.
251 @see SetStyle(), SetColour(), SetStipple()
256 Returns @true if the style of the brush is any of hatched fills.
263 Returns @true if the brush is initialised. It will return @false if the default
264 constructor has been used (for example, the brush is a member of a class, or
265 @NULL has been assigned to it).
271 Sets the brush colour using red, green and blue values.
275 void SetColour(wxColour
& colour
);
276 void SetColour(const wxString
& colourName
);
277 void SetColour(unsigned char red
, unsigned char green
,
282 Sets the stipple bitmap.
285 The bitmap to use for stippling.
287 @remarks The style will be set to wxSTIPPLE, unless the bitmap has a mask
288 associated to it, in which case the style will be set
289 to wxSTIPPLE_MASK_OPAQUE.
293 void SetStipple(const wxBitmap
& bitmap
);
296 Sets the brush style.
311 Transparent (no fill).
333 Backward diagonal hatch.
344 Cross-diagonal hatch.
355 Forward diagonal hatch.
399 Stippled using a bitmap.
405 wxSTIPPLE_MASK_OPAQUE
410 Stippled using a bitmap's mask.
414 void SetStyle(int style
);
418 See @ref overview_refcountequality "reference-counted object comparison" for
421 bool operator !=(const wxBrush
& brush
);
424 Assignment operator, using @ref overview_trefcount "reference counting".
426 wxBrush
operator =(const wxBrush
& brush
);
430 See @ref overview_refcountequality "reference-counted object comparison" for
433 bool operator ==(const wxBrush
& brush
);