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.new(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(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 Wed Sep 09 02:21:20 +0100 2009]