]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/pen.cpp
1 /////////////////////////////////////////////////////////////////////////////
8 // Copyright: (c) AUTHOR
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
)
36 m_style
= data
.m_style
;
37 m_width
= data
.m_width
;
40 m_nbDash
= data
.m_nbDash
;
42 m_colour
= data
.m_colour
;
45 wxPenRefData::~wxPenRefData()
59 // Should implement Create
60 wxPen::wxPen(const wxColour
& col
, int Width
, int Style
)
62 m_refData
= new wxPenRefData
;
64 M_PENDATA
->m_colour
= col
;
65 M_PENDATA
->m_width
= Width
;
66 M_PENDATA
->m_style
= Style
;
67 M_PENDATA
->m_join
= wxJOIN_ROUND
;
68 M_PENDATA
->m_cap
= wxCAP_ROUND
;
69 M_PENDATA
->m_nbDash
= 0 ;
70 M_PENDATA
->m_dash
= 0 ;
75 wxPen::wxPen(const wxBitmap
& stipple
, int Width
)
77 m_refData
= new wxPenRefData
;
79 M_PENDATA
->m_stipple
= stipple
;
80 M_PENDATA
->m_width
= Width
;
81 M_PENDATA
->m_style
= wxSTIPPLE
;
82 M_PENDATA
->m_join
= wxJOIN_ROUND
;
83 M_PENDATA
->m_cap
= wxCAP_ROUND
;
84 M_PENDATA
->m_nbDash
= 0 ;
85 M_PENDATA
->m_dash
= 0 ;
92 // Don't change shared data
95 m_refData
= new wxPenRefData();
99 wxPenRefData
* ref
= new wxPenRefData(*(wxPenRefData
*)m_refData
);
105 void wxPen::SetColour(const wxColour
& col
)
109 M_PENDATA
->m_colour
= col
;
114 void wxPen::SetColour(unsigned char r
, unsigned char g
, unsigned char b
)
118 M_PENDATA
->m_colour
.Set(r
, g
, b
);
123 void wxPen::SetWidth(int Width
)
127 M_PENDATA
->m_width
= Width
;
132 void wxPen::SetStyle(int Style
)
136 M_PENDATA
->m_style
= Style
;
141 void wxPen::SetStipple(const wxBitmap
& Stipple
)
145 M_PENDATA
->m_stipple
= Stipple
;
146 M_PENDATA
->m_style
= wxSTIPPLE
;
151 void wxPen::SetDashes(int nb_dashes
, const wxDash
*Dash
)
155 M_PENDATA
->m_nbDash
= nb_dashes
;
156 M_PENDATA
->m_dash
= (wxDash
*)Dash
;
161 void wxPen::SetJoin(int Join
)
165 M_PENDATA
->m_join
= Join
;
170 void wxPen::SetCap(int Cap
)
174 M_PENDATA
->m_cap
= Cap
;
179 bool wxPen::RealizeResource()
181 // nothing to do here for mac