1 /////////////////////////////////////////////////////////////////////////////
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "brush.h"
20 #if !USE_SHARED_LIBRARIES
21 IMPLEMENT_DYNAMIC_CLASS(wxBrush
, wxGDIObject
)
24 wxBrushRefData::wxBrushRefData()
27 m_isMacTheme
= false ;
28 m_isMacThemeBackground
= false ;
31 wxBrushRefData::wxBrushRefData(const wxBrushRefData
& data
)
33 m_style
= data
.m_style
;
34 m_stipple
= data
.m_stipple
;
35 m_colour
= data
.m_colour
;
36 m_isMacTheme
= data
.m_isMacTheme
;
37 m_macThemeBrush
= data
.m_macThemeBrush
;
40 wxBrushRefData::~wxBrushRefData()
53 wxBrush::wxBrush(const wxColour
& col
, int Style
)
55 m_refData
= new wxBrushRefData
;
57 M_BRUSHDATA
->m_colour
= col
;
58 M_BRUSHDATA
->m_style
= Style
;
63 wxBrush::wxBrush(const wxBitmap
& stipple
)
65 m_refData
= new wxBrushRefData
;
67 M_BRUSHDATA
->m_style
= wxSTIPPLE
;
68 M_BRUSHDATA
->m_stipple
= stipple
;
73 wxBrush::wxBrush(ThemeBrush macThemeBrush
)
75 m_refData
= new wxBrushRefData
;
77 M_BRUSHDATA
->m_isMacTheme
= true;
78 M_BRUSHDATA
->m_macThemeBrush
= macThemeBrush
;
82 void wxBrush::Unshare()
84 // Don't change shared data
87 m_refData
= new wxBrushRefData();
91 wxBrushRefData
* ref
= new wxBrushRefData(*(wxBrushRefData
*)m_refData
);
97 void wxBrush::SetColour(const wxColour
& col
)
100 M_BRUSHDATA
->m_isMacTheme
= false;
101 M_BRUSHDATA
->m_isMacThemeBackground
= false ;
102 M_BRUSHDATA
->m_colour
= col
;
107 void wxBrush::SetColour(unsigned char r
, unsigned char g
, unsigned char b
)
111 M_BRUSHDATA
->m_isMacTheme
= false;
112 M_BRUSHDATA
->m_isMacThemeBackground
= false ;
113 M_BRUSHDATA
->m_colour
.Set(r
, g
, b
);
118 void wxBrush::SetStyle(int Style
)
122 M_BRUSHDATA
->m_isMacTheme
= false;
123 M_BRUSHDATA
->m_isMacThemeBackground
= false ;
124 M_BRUSHDATA
->m_style
= Style
;
129 void wxBrush::SetStipple(const wxBitmap
& Stipple
)
133 M_BRUSHDATA
->m_stipple
= Stipple
;
138 void wxBrush::SetMacTheme(ThemeBrush macThemeBrush
)
142 M_BRUSHDATA
->m_isMacTheme
= true;
143 M_BRUSHDATA
->m_isMacThemeBackground
= false ;
144 M_BRUSHDATA
->m_macThemeBrush
= macThemeBrush
;
149 void wxBrush::SetMacThemeBackground(ThemeBackgroundKind macThemeBackground
)
153 M_BRUSHDATA
->m_isMacTheme
= false;
154 M_BRUSHDATA
->m_isMacThemeBackground
= true ;
155 M_BRUSHDATA
->m_macThemeBackground
= macThemeBackground
;
160 bool wxBrush::RealizeResource()