+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% 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
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},
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.
-
/////////////////////////////////////////////////////////////////////////////
-// Name: region.h
+// Name: wx/mgl/region.h
// Purpose: wxRegion class
// Author: Vaclav Slavik
// Created: 2001/03/12
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);
}
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);
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