# wxRegionIterator Class Reference
[Graphics Device Interface (GDI)]

`#include </home/work/projects/wx/2.9/wx/interface/wx/region.h>`

Inheritance diagram for wxRegionIterator:
[legend]

## Detailed Description

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 wxPaintEvent for an example of use.

##

Library: wxCore
Category: Graphics Device Interface (GDI)

Predefined objects/pointers: wxNullRegion

See also:
  wxPaintEvent

## Public Member Functions

| wxRegionIterator ()
| Default constructor.
| wxRegionIterator (const wxRegion &region)
| Creates an iterator object given a region.
wxCoord | GetH () const
| An alias for GetHeight().
wxCoord | GetHeight () const
| Returns the height value for the current region.
wxRect | GetRect () const
| Returns the current rectangle.
wxCoord | GetW () const
| An alias for GetWidth().
wxCoord | GetWidth () const
| Returns the width value for the current region.
wxCoord | GetX () const
| Returns the x value for the current region.
wxCoord | GetY () const
| Returns the y value for the current region.
bool | HaveRects () const
| Returns true if there are still some rectangles; otherwise returns false.
void | Reset ()
| Resets the iterator to the beginning of the rectangles.
void | Reset (const wxRegion &region)
| Resets the iterator to the given region.
wxRegionIterator & | operator++ ()
| Increment operator.
| operator bool () const
| Returns true if there are still some rectangles; otherwise returns false.

List of all members.

## Constructor & Destructor Documentation

wxRegionIterator::wxRegionIterator | ( |  | ) |

Default constructor.

wxRegionIterator::wxRegionIterator | ( | const wxRegion & | region | ) |

Creates an iterator object given a region.

## Member Function Documentation

wxCoord wxRegionIterator::GetH | ( |  | ) | const

An alias for GetHeight().

wxCoord wxRegionIterator::GetHeight | ( |  | ) | const

Returns the height value for the current region.

wxRect wxRegionIterator::GetRect | ( |  | ) | const

Returns the current rectangle.

wxCoord wxRegionIterator::GetW | ( |  | ) | const

An alias for GetWidth().

wxCoord wxRegionIterator::GetWidth | ( |  | ) | const

Returns the width value for the current region.

wxCoord wxRegionIterator::GetX | ( |  | ) | const

Returns the x value for the current region.

wxCoord wxRegionIterator::GetY | ( |  | ) | const

Returns the y value for the current region.

bool wxRegionIterator::HaveRects | ( |  | ) | const

Returns true if there are still some rectangles; otherwise returns false.

wxRegionIterator::operator bool | ( |  | ) | const

Returns true if there are still some rectangles; otherwise returns false.

You can use this to test the iterator object as if it were of type `bool`.

wxRegionIterator& wxRegionIterator::operator++ | ( |  | ) |

Increment operator.

Increments the iterator to the next region.

wxPython Note: A wxPython alias for this operator is called Next.

void wxRegionIterator::Reset | ( |  | ) |

Resets the iterator to the beginning of the rectangles.

void wxRegionIterator::Reset | ( | const wxRegion & | region | ) |

Resets the iterator to the given region.

|  | [ top ]