]>
Commit | Line | Data |
---|---|---|
52479aef | 1 | ///////////////////////////////////////////////////////////////////////////// |
46562151 | 2 | // Name: wx/mac/classic/brush.h |
52479aef SC |
3 | // Purpose: wxBrush class |
4 | // Author: Stefan Csomor | |
5 | // Modified by: | |
6 | // Created: 1998-01-01 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Stefan Csomor | |
65571936 | 9 | // Licence: wxWindows licence |
52479aef SC |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_BRUSH_H_ | |
13 | #define _WX_BRUSH_H_ | |
14 | ||
52479aef SC |
15 | #include "wx/gdicmn.h" |
16 | #include "wx/gdiobj.h" | |
17 | #include "wx/bitmap.h" | |
18 | ||
19 | class WXDLLEXPORT wxBrush; | |
20 | ||
ab9d0a8c | 21 | typedef enum |
52479aef | 22 | { |
ab9d0a8c WS |
23 | kwxMacBrushColour , |
24 | kwxMacBrushTheme , | |
25 | kwxMacBrushThemeBackground | |
52479aef SC |
26 | } wxMacBrushKind ; |
27 | ||
28 | // Brush | |
cb9d5bd0 | 29 | class WXDLLEXPORT wxBrush: public wxBrushBase |
52479aef | 30 | { |
ab9d0a8c | 31 | DECLARE_DYNAMIC_CLASS(wxBrush) |
52479aef SC |
32 | |
33 | public: | |
ab9d0a8c WS |
34 | wxBrush(); |
35 | wxBrush(short macThemeBrush ) ; | |
36 | wxBrush(const wxColour& col, int style = wxSOLID); | |
37 | wxBrush(const wxBitmap& stipple); | |
ab9d0a8c WS |
38 | ~wxBrush(); |
39 | ||
40 | virtual void SetColour(const wxColour& col) ; | |
1a1498c0 | 41 | virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) ; |
ab9d0a8c WS |
42 | virtual void SetStyle(int style) ; |
43 | virtual void SetStipple(const wxBitmap& stipple) ; | |
44 | virtual void SetMacTheme(short macThemeBrush) ; | |
45 | virtual void SetMacThemeBackground(unsigned long macThemeBackground , WXRECTPTR extent) ; | |
46 | ||
fbfb8bcc | 47 | bool operator == (const wxBrush& brush) const |
ab9d0a8c | 48 | { return m_refData == brush.m_refData; } |
fbfb8bcc | 49 | bool operator != (const wxBrush& brush) const |
ab9d0a8c WS |
50 | { return m_refData != brush.m_refData; } |
51 | ||
52 | wxMacBrushKind MacGetBrushKind() const ; | |
53 | ||
54 | unsigned long GetMacThemeBackground(WXRECTPTR extent) const ; | |
55 | short GetMacTheme() const ; | |
56 | wxColour& GetColour() const ; | |
cb9d5bd0 | 57 | virtual int GetStyle() const ; |
ab9d0a8c WS |
58 | wxBitmap *GetStipple() const ; |
59 | ||
ab9d0a8c | 60 | virtual bool Ok() const { return (m_refData != NULL) ; } |
52479aef SC |
61 | |
62 | // Implementation | |
63 | ||
ab9d0a8c WS |
64 | // Useful helper: create the brush resource |
65 | bool RealizeResource(); | |
52479aef | 66 | |
ab9d0a8c WS |
67 | // When setting properties, we must make sure we're not changing |
68 | // another object | |
69 | void Unshare(); | |
52479aef SC |
70 | }; |
71 | ||
72 | #endif | |
73 | // _WX_BRUSH_H_ |