.\" This is a wxWidgets manpage page generated from the XML docs .TH wxBrush 3wx 2005-02-15 "wxWidgets" "wxWidgets class documentation" .SH NAME wxBrush \- Used for filling areas on a device context .SH DESCRIPTION A brush is a drawing tool for filling in areas. It is used for painting the background of rectangles, ellipses, etc. It has a colour and a style. .SH REMARKS On a monochrome display, wxWidgets shows all brushes as white unless the colour is really black. Do not initialize objects on the stack before the program commences, since other required structures may not have been set up yet. Instead, define global pointers to objects and create them in wxApp::OnInit or when required. An application may wish to create brushes with different characteristics dynamically, and there is the consequent danger that a large number of duplicate brushes will be created. Therefore an application may wish to get a pointer to a brush by using the global list of brushes wxTheBrushList , and calling the member function FindOrCreateBrush . wxBrush uses a reference counting system, so assignments between brushes are very cheap. You can therefore use actual wxBrush objects instead of pointers without efficiency problems. Once one wxBrush object changes its data it will create its own brush data internally so that other brushes, which previously shared the data using the reference counting, are not affected. .SH "PARENTS" wxGDIObject wxObject .SH "INCLUDE FILES" wx/brush.h .SH MEMBERS .SS wxBrush () Default constructor. The brush will be uninitialised, and wxBrush::Ok will return false. .SS wxBrush (const wxColour& colourint style = wxSOLID) Constructs a brush from a colour object and style. .SS wxBrush (const wxString& colourNameint style) Constructs a brush from a colour name and style. .SS wxBrush (const wxBitmap& stippleBitmap) Constructs a stippled brush using a bitmap. .SS wxBrush (const wxBrush& brush) .SS ~wxBrush () Destructor. .SS wxColour& GetColour () Returns a reference to the brush colour. .SS wxBitmap * GetStipple () Gets a pointer to the stipple bitmap. If the brush does not have a wxSTIPPLE style, this bitmap may be non-NULL but uninitialised ( wxBitmap::Ok returns false). .SS int GetStyle () .SS bool IsHatch () Returns true if the style of the brush is any of hatched fills. .SS bool Ok () Returns true if the brush is initialised. It will return false if the default constructor has been used (for example, the brush is a member of a class, or NULL has been assigned to it). .SS void SetColour (wxColour& colour) Sets the brush colour using a reference to a colour object. .SS void SetColour (const wxString& colourName) Sets the brush colour using a colour name from the colour database. .SS void SetColour (unsigned char redunsigned char greenunsigned char blue) Sets the brush colour using red, green and blue values. .SS void SetStipple (const wxBitmap& bitmap) Sets the stipple bitmap. .SS void SetStyle (int style) Sets the brush style. .SS wxBrush& operator = (const wxBrush& brush) Assignment operator, using reference counting. Returns a reference to `this'. .SS bool operator == (const wxBrush& brush) Equality operator. Two brushes are equal if they contain pointers to the same underlying brush data. It does not compare each attribute, so two independently-created brushes using the same parameters will fail the test. .SS bool operator != (const wxBrush& brush) Inequality operator. Two brushes are not equal if they contain pointers to different underlying brush data. It does not compare each attribute. .SH "SEE ALSO" wxGDIObject wxObject wxBrushList wxDC wxDC::SetBrush .SH "AUTHORS" Documentation content by Julian Smart, Robert Roebling, Vadim Zeitlin, Robin Dunn, et al Conversion to manpage format by Arnout Engelen (http://bzzt.net), bugreports welcome.