#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"
void
wxDC::DoDrawPolyPolygon(int n,
- int start[],
+ int count[],
wxPoint points[],
wxCoord xoffset,
wxCoord yoffset,
int fillStyle)
{
+#ifdef __WXWINCE__
+ wxDCBase::DoDrawPolyPolygon(n, count, points, xoffset, yoffset, fillStyle);
+#else
WXMICROWIN_CHECK_HDC
wxColourChanger cc(*this); // needed for wxSTIPPLE_MASK_OPAQUE handling
int i, cnt;
for (i = cnt = 0; i < n; i++)
- cnt += start[i];
+ cnt += count[i];
// Do things less efficiently if we have offsets
if (xoffset != 0 || yoffset != 0)
CalcBoundingBox(cpoints[i].x, cpoints[i].y);
}
+#ifndef __WXWINCE__
int prev = SetPolyFillMode(GetHdc(),fillStyle==wxODDEVEN_RULE?ALTERNATE:WINDING);
- (void)PolyPolygon(GetHdc(), cpoints, start, n);
+#endif
+ (void)PolyPolygon(GetHdc(), cpoints, count, n);
+#ifndef __WXWINCE__
SetPolyFillMode(GetHdc(),prev);
+#endif
delete[] cpoints;
}
else
for (i = 0; i < cnt; i++)
CalcBoundingBox(points[i].x, points[i].y);
+#ifndef __WXWINCE__
int prev = SetPolyFillMode(GetHdc(),fillStyle==wxODDEVEN_RULE?ALTERNATE:WINDING);
- (void)PolyPolygon(GetHdc(), (POINT*) points, start, n);
+#endif
+ (void)PolyPolygon(GetHdc(), (POINT*) points, count, n);
+#ifndef __WXWINCE__
SetPolyFillMode(GetHdc(),prev);
+#endif
}
+#endif
+ // __WXWINCE__
}
void wxDC::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset)
}
}
+
+// Each element of the array will be the width of the string up to and
+// including the coresoponding character in text.
+
+bool wxDC::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const
+{
+ static int maxLenText = -1;
+ static int maxWidth = -1;
+ int fit = 0;
+ SIZE sz = {0,0};
+ int stlen = text.Length();
+
+ if (maxLenText == -1)
+ {
+ // Win9x and WinNT+ have different limits
+ int version = wxGetOsVersion();
+ 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, // [out] count of chars
+ // that will fit
+ &widths[0], // array to fill
+ &sz))
+ {
+ // API failed
+ wxLogLastError(wxT("GetTextExtentExPoint"));
+ return false;
+ }
+
+ return true;
+}
+
+
+
+
void wxDC::SetMapMode(int mode)
{
WXMICROWIN_CHECK_HDC