X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a660d684eda27638bca0384b2058911a31c8e845..8ea92b4d7792987769774ac381685dae15c70454:/docs/latex/wx/region.tex

diff --git a/docs/latex/wx/region.tex b/docs/latex/wx/region.tex
index 1d3c224ada..61f88b0b8c 100644
--- a/docs/latex/wx/region.tex
+++ b/docs/latex/wx/region.tex
@@ -8,15 +8,23 @@ reference counting, so copying and assignment operations are fast.
 \helpref{wxGDIObject}{wxgdiobject}\\
 \helpref{wxObject}{wxobject}
 
+\wxheading{Include files}
+
+<wx/region.h>
+
+\wxheading{See also}
+
+\helpref{wxRegionIterator}{wxregioniterator}
+
 \latexignore{\rtfignore{\wxheading{Members}}}
 
-\membersection{wxRegion::wxRegion}\label{wxregionconstr}
+\membersection{wxRegion::wxRegion}\label{wxregionctor}
 
 \func{}{wxRegion}{\void}
 
 Default constructor.
 
-\func{}{wxRegion}{\param{long}{ x}, \param{long}{ y}, \param{long}{ width}, \param{long}{ height}}
+\func{}{wxRegion}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{wxCoord}{ width}, \param{wxCoord}{ height}}
 
 Constructs a rectangular region with the given position and size.
 
@@ -32,7 +40,25 @@ Constructs a rectangular region a wxRect object.
 
 Constructs a region by copying another region.
 
-\membersection{wxRegion::\destruct{wxRegion}}
+\func{}{wxRegion}{\param{size\_t}{ n}, \param{const wxPoint }{*points}, \param{int }{fillStyle = wxWINDING\_RULE}}
+
+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},
+                  \param{const wxColour\&}{ transColour},
+		  \param{int}{ tolerance = 0}}
+
+Constructs a region using the non-transparent pixels of a bitmap.  See
+\helpref{Union}{wxregionunion} for more details.
+
+
+\membersection{wxRegion::\destruct{wxRegion}}\label{wxregiondtor}
 
 \func{}{\destruct{wxRegion}}{\void}
 
@@ -69,6 +95,13 @@ The return value is one of wxOutRegion, wxPartRegion and wxInRegion.
 On Windows, only wxOutRegion and wxInRegion are returned; a value wxInRegion then indicates that
 all or some part of the region is contained in this region.
 
+\membersection{wxRegion::ConvertToBitmap}\label{wxregionconverttobitmap}
+
+\constfunc{wxBitmap}{ConvertToBitmap}{}
+
+Convert the region to a black and white bitmap with the white pixels
+being inside the region.
+
 \membersection{wxRegion::GetBox}\label{wxregiongetbox}
 
 \constfunc{void}{GetBox}{\param{long\& }{x}, \param{long\& }{y}, \param{long\& }{width}, \param{long\& }{height}}
@@ -81,7 +114,7 @@ Returns the outer bounds of the region.
 
 \membersection{wxRegion::Intersect}\label{wxregionintersect}
 
-\func{bool}{Intersect}{\param{long}{ x}, \param{long}{ y}, \param{long}{ width}, \param{long}{ height}}
+\func{bool}{Intersect}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{wxCoord}{ width}, \param{wxCoord}{ height}}
 
 Finds the intersection of this region and another, rectangular region, specified using position and size.
 
@@ -95,7 +128,7 @@ Finds the intersection of this region and another region.
 
 \wxheading{Return value}
 
-TRUE if successful, FALSE otherwise.
+{\tt true} if successful, {\tt false} otherwise.
 
 \wxheading{Remarks}
 
@@ -106,9 +139,9 @@ is stored in this region.
 
 \constfunc{bool}{IsEmpty}{\void}
 
-\func{bool}{IsEmpty}{\void}
+Returns {\tt true} if the region is empty, {\tt false} otherwise.
 
-Returns TRUE if the region is empty, FALSE otherwise.
+\membersection{wxRegion::Subtract}\label{wxregionsubtract}
 
 \func{bool}{Subtract}{\param{const wxRect\&}{ rect}}
 
@@ -120,16 +153,27 @@ Subtracts a region from this region.
 
 \wxheading{Return value}
 
-TRUE if successful, FALSE otherwise.
+{\tt true} if successful, {\tt false} otherwise.
 
 \wxheading{Remarks}
 
 This operation combines the parts of 'this' region that are not part of the second region.
 The result is stored in this region.
 
+\membersection{wxRegion::Offset}\label{wxregionoffset}
+
+\func{bool}{Offset}{\param{wxCoord}{ x}, \param{wxCoord}{ y}}
+
+Moves the region by the specified offsets in horizontal and vertical
+directions.
+
+\wxheading{Return value}
+
+{\tt true} if successful, {\tt false} otherwise (the region is unchanged then).
+
 \membersection{wxRegion::Union}\label{wxregionunion}
 
-\func{bool}{Union}{\param{long}{ x}, \param{long}{ y}, \param{long}{ width}, \param{long}{ height}}
+\func{bool}{Union}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{wxCoord}{ width}, \param{wxCoord}{ height}}
 
 Finds the union of this region and another, rectangular region, specified using position and size.
 
@@ -141,9 +185,24 @@ Finds the union of this region and another, rectangular region.
 
 Finds the union of this region and another region.
 
+\func{bool}{Union}{\param{const wxBitmap\&}{ bmp}}
+
+Finds the union of this region and the the non-transparent pixels of a
+bitmap. Bitmap's mask is used to determine transparency. If the bitmap doesn't
+have a mask, solid rectangle of bitmap's dimensions is used.
+
+\func{bool}{Union}{\param{const wxBitmap\&}{ bmp},
+                  \param{const wxColour\&}{ transColour},
+		  \param{int}{ tolerance = 0}}
+
+Finds the union of this region and the the non-transparent pixels of a
+bitmap. Colour to be treated as transparent is specified in the
+\arg{transColour} argument, along with an
+optional colour tolerance value.
+
 \wxheading{Return value}
 
-TRUE if successful, FALSE otherwise.
+{\tt true} if successful, {\tt false} otherwise.
 
 \wxheading{Remarks}
 
@@ -152,7 +211,7 @@ The result is stored in this region.
 
 \membersection{wxRegion::Xor}\label{wxregionxor}
 
-\func{bool}{Xor}{\param{long}{ x}, \param{long}{ y}, \param{long}{ width}, \param{long}{ height}}
+\func{bool}{Xor}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{wxCoord}{ width}, \param{wxCoord}{ height}}
 
 Finds the Xor of this region and another, rectangular region, specified using position and size.
 
@@ -166,7 +225,7 @@ Finds the Xor of this region and another region.
 
 \wxheading{Return value}
 
-TRUE if successful, FALSE otherwise.
+{\tt true} if successful, {\tt false} otherwise.
 
 \wxheading{Remarks}
 
@@ -179,4 +238,111 @@ for any overlapping areas. The result is stored in this region.
 
 Copies {\it region} by reference counting.
 
+\section{\class{wxRegionIterator}}\label{wxregioniterator}
+
+This class is used to iterate through the rectangles in a region,
+typically when examining the damaged regions of a window within an OnPaint call.
+
+To use it, construct an iterator object on the stack and loop through the
+regions, testing the object and incrementing the iterator at the end of the loop.
+
+See \helpref{wxPaintEvent}{wxpaintevent} for an example of use.
+
+\wxheading{Derived from}
+
+\helpref{wxObject}{wxobject}
+
+\wxheading{Include files}
+
+<wx/region.h>
+
+\wxheading{See also}
+
+\helpref{wxPaintEvent}{wxpaintevent}
+
+\latexignore{\rtfignore{\wxheading{Members}}}
+
+\membersection{wxRegionIterator::wxRegionIterator}\label{wxregioniteratorctor}
+
+\func{}{wxRegionIterator}{\void}
+
+Default constructor.
+
+\func{}{wxRegionIterator}{\param{const wxRegion\&}{ region}}
+
+Creates an iterator object given a region.
+
+\membersection{wxRegionIterator::GetX}\label{wxregioniteratorgetx}
+
+\constfunc{wxCoord}{GetX}{\void}
+
+Returns the x value for the current region.
+
+\membersection{wxRegionIterator::GetY}\label{wxregioniteratorgety}
+
+\constfunc{wxCoord}{GetY}{\void}
+
+Returns the y value for the current region.
+
+\membersection{wxRegionIterator::GetW}\label{wxregioniteratorgetw}
+
+\constfunc{wxCoord}{GetW}{\void}
+
+An alias for GetWidth.
+
+\membersection{wxRegionIterator::GetWidth}\label{wxregioniteratorgetwidth}
+
+\constfunc{wxCoord}{GetWidth}{\void}
+
+Returns the width value for the current region.
+
+\membersection{wxRegionIterator::GetH}\label{wxregioniteratorgeth}
+
+\constfunc{wxCoord}{GetH}{\void}
+
+An alias for GetHeight.
+
+\membersection{wxRegionIterator::GetHeight}\label{wxregioniteratorgetheight}
+
+\constfunc{wxCoord}{GetWidth}{\void}
+
+Returns the width value for the current region.
+
+\membersection{wxRegionIterator::GetRect}\label{wxregioniteratorgetrect}
+
+\constfunc{wxRect}{GetRect}{\void}
+
+Returns the current rectangle.
+
+\membersection{wxRegionIterator::HaveRects}\label{wxregioniteratorhaverects}
+
+\constfunc{bool}{HaveRects}{\void}
+
+Returns {\tt true} if there are still some rectangles; otherwise returns {\tt false}.
+
+\membersection{wxRegionIterator::Reset}\label{wxregioniteratorreset}
+
+\func{void}{Reset}{\void}
+
+Resets the iterator to the beginning of the rectangles.
+
+\func{void}{Reset}{\param{const wxRegion\&}{ region}}
+
+Resets the iterator to the given region.
+
+\membersection{wxRegionIterator::operator $++$}\label{wxregioniteratorinc}
+
+\func{void}{operator $++$}{\void}
+
+Increment operator. Increments the iterator to the next region.
+
+\pythonnote{A wxPython alias for this operator is called {\tt Next}.}
+
+\membersection{wxRegionIterator::operator bool}\label{wxregioniteratorbool}
+
+\constfunc{}{operator bool}{\void}
+
+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.
 
