]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/pen.cpp
fixed 'Select All' context menu in wxTextCtrl with wxTE_RICH style
[wxWidgets.git] / src / msw / pen.cpp
index cd58107ac920e8af06c99847aea9b575545d190e..711ca1b644d10b58f416f8fbfa6566a37923c93e 100644 (file)
@@ -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));
 }