]> git.saurik.com Git - wxWidgets.git/commitdiff
Add wxRegion ctor from array of points to wxMGL.
authorWłodzimierz Skiba <abx@abx.art.pl>
Fri, 10 Nov 2006 19:58:43 +0000 (19:58 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Fri, 10 Nov 2006 19:58:43 +0000 (19:58 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43286 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/region.tex
include/wx/mgl/region.h
src/aui/auibook.cpp
src/mgl/region.cpp

index 5b2cb77be198dd881aede12eeee5ad9af457c111..e65055db7917d160f52a0eb8afd7ee1b5f1401e1 100644 (file)
@@ -1,3 +1,13 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Name:        region.tex
+%% Purpose:     wxRegion documentation
+%% Author:      wxTeam
+%% Created:
+%% RCS-ID:      $Id$
+%% Copyright:   (c) wxTeam
+%% License:     wxWindows license
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 \section{\class{wxRegion}}\label{wxregion}
 
 A wxRegion represents a simple or complex region on a device context or window. It uses
@@ -47,8 +57,6 @@ Constructs a region corresponding to the polygon made of {\it n} points in the
 provided array. {\it fillStyle} parameter may have values
 {\tt wxWINDING\_RULE} or {\tt wxODDEVEN\_RULE}.
 
-{\bf NB:} This constructor is only implemented for Win32 and GTK+ wxWidgets ports.
-
 \func{}{wxRegion}{\param{const wxBitmap\&}{ bmp}}
 
 \func{}{wxRegion}{\param{const wxBitmap\&}{ bmp},
@@ -384,4 +392,3 @@ Increment operator. Increments the iterator to the next region.
 Returns {\tt true} if there are still some rectangles; otherwise returns {\tt false}.
 
 You can use this to test the iterator object as if it were of type bool.
-
index 1bfd468fe5820738cc718dbdc52373ccf0e4c716..35f3137f340ebc01a751c7d728cb8a1d134470a0 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        region.h
+// Name:        wx/mgl/region.h
 // Purpose:     wxRegion class
 // Author:      Vaclav Slavik
 // Created:     2001/03/12
@@ -23,12 +23,13 @@ public:
     wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight);
     wxRegion(const wxRect& rect);
     wxRegion(const MGLRegion& region);
-    wxRegion( const wxBitmap& bmp)
+    wxRegion(size_t n, const wxPoint *points, int fillStyle = wxODDEVEN_RULE );
+    wxRegion(const wxBitmap& bmp)
     {
         Union(bmp);
     }
-    wxRegion( const wxBitmap& bmp,
-              const wxColour& transColour, int tolerance = 0)
+    wxRegion(const wxBitmap& bmp,
+             const wxColour& transColour, int tolerance = 0)
     {
         Union(bmp, transColour, tolerance);
     }
index 7a0386ece72324e5fd13579aa368bfbe138f4107..5516db55c7201e9afc1f5dd0a51b3694319c71a8 100644 (file)
@@ -408,11 +408,11 @@ void wxAuiDefaultTabArt::DrawTab(wxDC& dc,
     clip_points[5] = wxPoint(tab_x+clip_width+1, tab_y+tab_height-3);
 
     // FIXME: these ports don't provide wxRegion ctor from array of points
-#if !defined(__WXMGL__) && !defined(__WXDFB__)
+#if !defined(__WXDFB__)
     // set the clipping region for the tab --
     wxRegion clipping_region(WXSIZEOF(clip_points), clip_points);
     dc.SetClippingRegion(clipping_region);
-#endif // !wxMGL && !wxDFB
+#endif // !wxDFB
 
     wxPoint border_points[6];
     border_points[0] = wxPoint(tab_x,             tab_y+tab_height-4);
index 1211a7a954714fc7bbffc37ba49e3b2b0698c6b2..2604513a1eba60c5de1eedf5116e95dc3b14fd53 100644 (file)
@@ -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