]>
git.saurik.com Git - wxWidgets.git/blob - interface/brush.h
f4752aa3e7d3531c2ab3c8ddbdff610c2f9fc935
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".
58 Colour name. The name will be looked up in the colour database.
66 Transparent (no fill).
76 Uses a bitmap as a stipple.
81 Backward diagonal hatch.
91 Forward diagonal hatch.
109 Pointer or reference to a brush to copy.
112 A bitmap to use for stippling.
114 @remarks If a stipple brush is created, the brush style will be set to
117 @sa wxBrushList, wxColour, wxColourDatabase
120 wxBrush(const wxColour
& colour
, int style
= wxSOLID
);
121 wxBrush(const wxString
& colourName
, int style
);
122 wxBrush(const wxBitmap
& stippleBitmap
);
123 wxBrush(const wxBrush
& brush
);
128 See @ref overview_refcountdestruct "reference-counted object destruction" for
131 @remarks Although all remaining brushes are deleted when the application
132 exits, the application should try to clean up all
133 brushes itself. This is because wxWidgets cannot know
134 if a pointer to the brush object is stored in an
135 application data structure, and there is a risk of
141 Returns a reference to the brush colour.
145 wxColour
GetColour();
148 Gets a pointer to the stipple bitmap. If the brush does not have a wxSTIPPLE
150 this bitmap may be non-@NULL but uninitialised (@ref wxBitmap::isok
151 wxBitmap:IsOk returns @false).
155 wxBitmap
* GetStipple();
158 Returns the brush style, one of:
163 Transparent (no fill).
173 Backward diagonal hatch.
178 Cross-diagonal hatch.
183 Forward diagonal hatch.
190 @b wxHORIZONTAL_HATCH
203 Stippled using a bitmap.
205 @b wxSTIPPLE_MASK_OPAQUE
208 Stippled using a bitmap's mask.
211 @sa SetStyle(), SetColour(), SetStipple()
216 Returns @true if the style of the brush is any of hatched fills.
223 Returns @true if the brush is initialised. It will return @false if the default
224 constructor has been used (for example, the brush is a member of a class, or
225 @NULL has been assigned to it).
227 #define bool IsOk() /* implementation is private */
231 Sets the brush colour using red, green and blue values.
235 void SetColour(wxColour
& colour
);
236 void SetColour(const wxString
& colourName
);
237 void SetColour(unsigned char red
, unsigned char green
,
242 Sets the stipple bitmap.
245 The bitmap to use for stippling.
247 @remarks The style will be set to wxSTIPPLE, unless the bitmap has a mask
248 associated to it, in which case the style will be set
249 to wxSTIPPLE_MASK_OPAQUE.
253 void SetStipple(const wxBitmap
& bitmap
);
256 Sets the brush style.
264 Transparent (no fill).
274 Backward diagonal hatch.
279 Cross-diagonal hatch.
284 Forward diagonal hatch.
304 Stippled using a bitmap.
306 wxSTIPPLE_MASK_OPAQUE
309 Stippled using a bitmap's mask.
313 void SetStyle(int style
);
317 See @ref overview_refcountequality "reference-counted object comparison" for
320 bool operator !=(const wxBrush
& brush
);
323 Assignment operator, using @ref overview_trefcount "reference counting".
325 wxBrush
operator =(const wxBrush
& brush
);
329 See @ref overview_refcountequality "reference-counted object comparison" for
332 bool operator ==(const wxBrush
& brush
);