]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mgl/region.cpp
move Ellipsize() to wxControl so it can be easily used by other controls
[wxWidgets.git] / src / mgl / region.cpp
index 1211a7a954714fc7bbffc37ba49e3b2b0698c6b2..62457373753d764ed9fb77b840be989a0fe22f36 100644 (file)
@@ -57,12 +57,12 @@ public:
 // wxRegion
 //-----------------------------------------------------------------------------
 
-wxObjectRefData *wxRegion::CreateRefData() const
+wxGDIRefData *wxRegion::CreateGDIRefData() const
 {
     return new wxRegionRefData;
 }
 
-wxObjectRefData *wxRegion::CloneRefData(const wxObjectRefData *data) const
+wxGDIRefData *wxRegion::CloneGDIRefData(const wxGDIRefData *data) const
 {
     return new wxRegionRefData(*(wxRegionRefData *)data);
 }
@@ -102,6 +102,24 @@ wxRegion::wxRegion(const MGLRegion& region)
     M_REGION = region;
 }
 
+wxRegion::wxRegion(size_t n, const wxPoint *points, int WXUNUSED(fillStyle))
+{
+    m_refData = new wxRegionRefData;
+    point_t *pts = new point_t[n];
+
+    for (size_t i = 0; i < n; i++)
+    {
+        pts[i].x = points[i].x;
+        pts[i].y = points[i].y;
+    }
+
+    region_t* rgn = MGL_rgnPolygon(n, pts, 1, 0, 0);
+
+    M_REGION = rgn;
+
+    delete [] pts;
+}
+
 wxRegion::~wxRegion()
 {
     // m_refData unrefed in ~wxObject