X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8c58338193e8e4219138b9de02d36c4fc4a96feb..2e771cb838a8d22a73d5316e9fecde25ede316a4:/src/msw/pen.cpp?ds=sidebyside diff --git a/src/msw/pen.cpp b/src/msw/pen.cpp index cd58107ac9..711ca1b644 100644 --- a/src/msw/pen.cpp +++ b/src/msw/pen.cpp @@ -206,18 +206,10 @@ wxPenRefData::~wxPenRefData() // wxPenRefData HPEN management // ---------------------------------------------------------------------------- -#ifdef wxHAVE_EXT_CREATE_PEN - static int ConvertPenStyle(int style) { switch ( style ) { - case wxDOT: - return PS_DOT; - - case wxDOT_DASH: - return PS_DASHDOT; - case wxSHORT_DASH: case wxLONG_DASH: return PS_DASH; @@ -225,13 +217,20 @@ static int ConvertPenStyle(int style) case wxTRANSPARENT: return PS_NULL; - case wxUSER_DASH: - return PS_USERSTYLE; - default: wxFAIL_MSG( _T("unknown pen style") ); // fall through +#ifdef wxHAVE_EXT_CREATE_PEN + case wxDOT: + return PS_DOT; + + case wxDOT_DASH: + return PS_DASHDOT; + + case wxUSER_DASH: + return PS_USERSTYLE; + case wxSTIPPLE: case wxBDIAGONAL_HATCH: case wxCROSSDIAG_HATCH: @@ -240,10 +239,14 @@ static int ConvertPenStyle(int style) case wxHORIZONTAL_HATCH: case wxVERTICAL_HATCH: case wxSOLID: +#endif // wxHAVE_EXT_CREATE_PEN + return PS_SOLID; } } +#ifdef wxHAVE_EXT_CREATE_PEN + static int ConvertJoinStyle(int join) { switch( join ) @@ -335,7 +338,7 @@ bool wxPenRefData::Alloc() { case wxSTIPPLE: lb.lbStyle = BS_PATTERN; - lb.lbHatch = (LONG)m_stipple.GetHBITMAP(); + lb.lbHatch = wxPtrToUInt(m_stipple.GetHBITMAP()); break; case wxBDIAGONAL_HATCH: @@ -466,12 +469,12 @@ bool wxPen::IsFree() const return M_PENDATA && !M_PENDATA->HasHPEN(); } -wxObjectRefData* wxPen::CreateRefData() const +wxGDIRefData* wxPen::CreateGDIRefData() const { return new wxPenRefData; } -wxObjectRefData* wxPen::CloneRefData(const wxObjectRefData* data) const +wxGDIRefData* wxPen::CloneGDIRefData(const wxGDIRefData* data) const { return new wxPenRefData(*wx_static_cast(const wxPenRefData*, data)); }