wxRuby Documentation Home

# Wx::RegionIterator

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

## Derived from

Object

## See also

PaintEvent

## Methods

- RegionIterator.new
- RegionIterator#get_x
- RegionIterator#get_y
- RegionIterator#get_w
- RegionIterator#get_height
- RegionIterator#get_h
- RegionIterator#get_rect
- RegionIterator#get_width
- RegionIterator#have_rects
- RegionIterator#reset
- wxRegionIterator::operator bool

### RegionIterator.new

RegionIterator.new(%(arg-type)Region% region)

Creates an iterator object given a region.

### RegionIterator#get_x

Integer get_x()

Returns the x value for the current region.

### RegionIterator#get_y

Integer get_y()

Returns the y value for the current region.

### RegionIterator#get_w

Integer get_w()

An alias for GetWidth.

### RegionIterator#get_height

Integer get_height()

Returns the height value for the current region.

### RegionIterator#get_h

Integer get_h()

An alias for GetHeight.

### RegionIterator#get_rect

Rect get_rect()

Returns the current rectangle.

### RegionIterator#get_width

Integer get_width()

Returns the width value for the current region.

### RegionIterator#have_rects

Boolean have_rects()

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

### RegionIterator#reset

reset()

Resets the iterator to the beginning of the rectangles.

reset(%(arg-type)Region% region)

Resets the iterator to the given region.

### RegionIterator#++

operator $++$()

Increment operator. Increments the iterator to the next region.

### RegionIterator::operator bool

operator bool()

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.

[This page automatically generated from the Textile source at 2023-06-09 00:45:31 +0000]