]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/classic/pen.cpp
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "pen.h"
20 #if !USE_SHARED_LIBRARIES
21 IMPLEMENT_DYNAMIC_CLASS(wxPen
, wxGDIObject
)
24 wxPenRefData::wxPenRefData()
28 m_join
= wxJOIN_ROUND
;
34 wxPenRefData::wxPenRefData(const wxPenRefData
& data
)
37 m_style
= data
.m_style
;
38 m_width
= data
.m_width
;
41 m_nbDash
= data
.m_nbDash
;
43 m_colour
= data
.m_colour
;
46 wxPenRefData::~wxPenRefData()
60 // Should implement Create
61 wxPen::wxPen(const wxColour
& col
, int Width
, int Style
)
63 m_refData
= new wxPenRefData
;
65 M_PENDATA
->m_colour
= col
;
66 M_PENDATA
->m_width
= Width
;
67 M_PENDATA
->m_style
= Style
;
68 M_PENDATA
->m_join
= wxJOIN_ROUND
;
69 M_PENDATA
->m_cap
= wxCAP_ROUND
;
70 M_PENDATA
->m_nbDash
= 0 ;
71 M_PENDATA
->m_dash
= 0 ;
76 wxPen::wxPen(const wxBitmap
& stipple
, int Width
)
78 m_refData
= new wxPenRefData
;
80 M_PENDATA
->m_stipple
= stipple
;
81 M_PENDATA
->m_width
= Width
;
82 M_PENDATA
->m_style
= wxSTIPPLE
;
83 M_PENDATA
->m_join
= wxJOIN_ROUND
;
84 M_PENDATA
->m_cap
= wxCAP_ROUND
;
85 M_PENDATA
->m_nbDash
= 0 ;
86 M_PENDATA
->m_dash
= 0 ;
93 // Don't change shared data
96 m_refData
= new wxPenRefData();
100 wxPenRefData
* ref
= new wxPenRefData(*(wxPenRefData
*)m_refData
);
106 void wxPen::SetColour(const wxColour
& col
)
110 M_PENDATA
->m_colour
= col
;
115 void wxPen::SetColour(unsigned char r
, unsigned char g
, unsigned char b
)
119 M_PENDATA
->m_colour
.Set(r
, g
, b
);
124 void wxPen::SetWidth(int Width
)
128 M_PENDATA
->m_width
= Width
;
133 void wxPen::SetStyle(int Style
)
137 M_PENDATA
->m_style
= Style
;
142 void wxPen::SetStipple(const wxBitmap
& Stipple
)
146 M_PENDATA
->m_stipple
= Stipple
;
147 M_PENDATA
->m_style
= wxSTIPPLE
;
152 void wxPen::SetDashes(int nb_dashes
, const wxDash
*Dash
)
156 M_PENDATA
->m_nbDash
= nb_dashes
;
157 M_PENDATA
->m_dash
= (wxDash
*)Dash
;
162 void wxPen::SetJoin(int Join
)
166 M_PENDATA
->m_join
= Join
;
171 void wxPen::SetCap(int Cap
)
175 M_PENDATA
->m_cap
= Cap
;
180 bool wxPen::RealizeResource()
182 // nothing to do here for mac