]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dc.cpp
GetSubcontrols now const
[wxWidgets.git] / src / msw / dc.cpp
index 4871d1f8ded777c5bd88d379742d1e9219f82071..26143fcf664196a24d5551942e05b64061203ff2 100644 (file)
@@ -41,6 +41,7 @@
 #endif
 
 #include "wx/msw/private.h" // needs to be before #include <commdlg.h>
+#include "wx/msw/missing.h" // needs to be before #include <commdlg.h>
 
 #include "wx/sysopt.h"
 #include "wx/dcprint.h"
@@ -785,6 +786,9 @@ wxDC::DoDrawPolyPolygon(int n,
                         wxCoord yoffset,
                         int fillStyle)
 {
+#ifdef __WXWINCE__
+    wxDCBase::DoDrawPolyPolygon(n, start, points, xoffset, yoffset, fillStyle);
+#else    
     WXMICROWIN_CHECK_HDC
 
     wxColourChanger cc(*this); // needed for wxSTIPPLE_MASK_OPAQUE handling
@@ -803,9 +807,13 @@ wxDC::DoDrawPolyPolygon(int n,
 
             CalcBoundingBox(cpoints[i].x, cpoints[i].y);
         }
+#ifndef __WXWINCE__
         int prev = SetPolyFillMode(GetHdc(),fillStyle==wxODDEVEN_RULE?ALTERNATE:WINDING);
+#endif        
         (void)PolyPolygon(GetHdc(), cpoints, start, n);
+#ifndef __WXWINCE__
         SetPolyFillMode(GetHdc(),prev);
+#endif        
         delete[] cpoints;
     }
     else
@@ -813,10 +821,16 @@ wxDC::DoDrawPolyPolygon(int n,
         for (i = 0; i < cnt; i++)
             CalcBoundingBox(points[i].x, points[i].y);
 
+#ifndef __WXWINCE__
         int prev = SetPolyFillMode(GetHdc(),fillStyle==wxODDEVEN_RULE?ALTERNATE:WINDING);
+#endif        
         (void)PolyPolygon(GetHdc(), (POINT*) points, start, n);
+#ifndef __WXWINCE__
         SetPolyFillMode(GetHdc(),prev);
+#endif        
     }
+#endif
+  // __WXWINCE__
 }
 
 void wxDC::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset)
@@ -1613,7 +1627,7 @@ void wxDC::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
 
 
 // Each element of the array will be the width of the string up to and
-// including the coresoponding character in text.  
+// including the coresoponding character in text.
 
 bool wxDC::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const
 {
@@ -1630,22 +1644,24 @@ bool wxDC::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) con
         maxLenText = version == wxWINDOWS_NT ? 65535 : 8192;
         maxWidth =   version == wxWINDOWS_NT ? INT_MAX : 32767;
     }
-        
+
     widths.Empty();
     widths.Add(0, stlen);  // fill the array with zeros
-    
+
     if (!::GetTextExtentExPoint(GetHdc(),
                                 text.c_str(),           // string to check
                                 wxMin(stlen, maxLenText),
-                                maxWidth, 
-                                &fit,                   // receives count of chars
+                                maxWidth,
+                                &fit,                   // [out] count of chars
                                                         // that will fit
-                                widths.begin(),         // array to fill
-                                &sz)) {
+                                &widths[0],             // array to fill
+                                &sz))
+    {
         // API failed
         wxLogLastError(wxT("GetTextExtentExPoint"));
-        return false;        
-    } 
+        return false;
+    }
+
     return true;
 }