IS_HATCH macro replaced with wxBrush::IsHatch() + source and docs little cleaning.
[wxWidgets.git] / include / wx / msw / brush.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/brush.h
3 // Purpose: wxBrush class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_BRUSH_H_
13 #define _WX_BRUSH_H_
14
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "brush.h"
17 #endif
18
19 #include "wx/gdicmn.h"
20 #include "wx/gdiobj.h"
21 #include "wx/bitmap.h"
22
23 class WXDLLEXPORT wxBrush;
24
25 // ----------------------------------------------------------------------------
26 // wxBrush
27 // ----------------------------------------------------------------------------
28
29 class WXDLLEXPORT wxBrush : public wxGDIObject
30 {
31 public:
32 wxBrush();
33 wxBrush(const wxColour& col, int style = wxSOLID);
34 wxBrush(const wxBitmap& stipple);
35 wxBrush(const wxBrush& brush) : wxGDIObject(brush) { Ref(brush); }
36 virtual ~wxBrush();
37
38 virtual void SetColour(const wxColour& col);
39 virtual void SetColour(unsigned char r, unsigned char g, unsigned char b);
40 virtual void SetStyle(int style);
41 virtual void SetStipple(const wxBitmap& stipple);
42
43 wxBrush& operator=(const wxBrush& brush);
44 bool operator==(const wxBrush& brush) const;
45 bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
46
47 wxColour GetColour() const;
48 int GetStyle() const;
49 wxBitmap *GetStipple() const;
50
51 bool IsHatch() const
52 { return (GetStyle()>=wxBDIAGONAL_HATCH) && (GetStyle()<=wxVERTICAL_HATCH); }
53
54 bool Ok() const { return m_refData != NULL; }
55
56 // return the HBRUSH for this brush
57 virtual WXHANDLE GetResourceHandle() const;
58
59 protected:
60 virtual wxObjectRefData *CreateRefData() const;
61 virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
62
63 private:
64 DECLARE_DYNAMIC_CLASS(wxBrush)
65 };
66
67 #endif
68 // _WX_BRUSH_H_