Class: Wx::RegionIterator
- Defined in:
- lib/wx/doc/gen/region_iterator.rb,
lib/wx/doc/region_iterator.rb
Overview
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.
Category: Graphics Device Interface (GDI) Predefined objects/pointers: NullRegion
Class Method Summary collapse
-
.for_region(region) {|region_it| ... } ⇒ Object
Creates a Wx::RegionIterator and passes that to the given block.
-
.iterate(region) {|region_it| ... } ⇒ Object
Creates a Wx::RegionIterator and iterates each rectangle in the region executing the given block for each iteration passing the region iterator.
Instance Method Summary collapse
-
#each ⇒ Object
If a block is given the given block is called for each rectangle in the region passing the rectangle.
-
#get_h ⇒ Integer
(also: #h)
An alias for #get_height.
-
#get_height ⇒ Integer
(also: #height)
Returns the height value for the current region.
-
#get_rect ⇒ Wx::Rect
(also: #rect)
Returns the current rectangle.
-
#get_w ⇒ Integer
(also: #w)
An alias for #get_width.
-
#get_width ⇒ Integer
(also: #width)
Returns the width value for the current region.
-
#get_x ⇒ Integer
(also: #x)
Returns the x value for the current region.
-
#get_y ⇒ Integer
(also: #y)
Returns the y value for the current region.
-
#have_rects ⇒ Boolean
Returns true if there are still some rectangles; otherwise returns false.
- #have_rects? ⇒ Object
-
#initialize(*args) ⇒ RegionIterator
constructor
A new instance of RegionIterator.
-
#next_rect ⇒ void
Moves to the next rectangle of the iterated region.
-
#reset ⇒ void
Resets the iterator to the beginning of the rectangles.
Methods inherited from Object
#clone, #dup, #is_same_as, #un_share
Constructor Details
#initialize ⇒ Wx::RegionIterator #initialize(region) ⇒ Wx::RegionIterator
Returns a new instance of RegionIterator.
28 |
# File 'lib/wx/doc/gen/region_iterator.rb', line 28 def initialize(*args) end |
Class Method Details
.for_region(region) {|region_it| ... } ⇒ Object
Creates a Wx::RegionIterator and passes that to the given block. Removes the iterator after the block finishes.
16 |
# File 'lib/wx/doc/region_iterator.rb', line 16 def self.for_region(region) end |
.iterate(region) {|region_it| ... } ⇒ Object
Creates a Wx::RegionIterator and iterates each rectangle in the region executing the given block for each iteration passing the region iterator.
22 |
# File 'lib/wx/doc/region_iterator.rb', line 22 def self.iterate(region) end |
Instance Method Details
#each {|rect| ... } ⇒ ::Object #each ⇒ Enumerator
If a block is given the given block is called for each rectangle in the region passing the rectangle. If no block is given an Enumerator is returned.
37 |
# File 'lib/wx/doc/region_iterator.rb', line 37 def each; end |
#get_h ⇒ Integer Also known as: h
An alias for #get_height.
32 |
# File 'lib/wx/doc/gen/region_iterator.rb', line 32 def get_h; end |
#get_height ⇒ Integer Also known as: height
Returns the height value for the current region.
37 |
# File 'lib/wx/doc/gen/region_iterator.rb', line 37 def get_height; end |
#get_rect ⇒ Wx::Rect Also known as: rect
Returns the current rectangle.
42 |
# File 'lib/wx/doc/gen/region_iterator.rb', line 42 def get_rect; end |
#get_w ⇒ Integer Also known as: w
An alias for #get_width.
47 |
# File 'lib/wx/doc/gen/region_iterator.rb', line 47 def get_w; end |
#get_width ⇒ Integer Also known as: width
Returns the width value for the current region.
52 |
# File 'lib/wx/doc/gen/region_iterator.rb', line 52 def get_width; end |
#get_x ⇒ Integer Also known as: x
Returns the x value for the current region.
57 |
# File 'lib/wx/doc/gen/region_iterator.rb', line 57 def get_x; end |
#get_y ⇒ Integer Also known as: y
Returns the y value for the current region.
62 |
# File 'lib/wx/doc/gen/region_iterator.rb', line 62 def get_y; end |
#have_rects ⇒ Boolean
Returns true if there are still some rectangles; otherwise returns false.
67 |
# File 'lib/wx/doc/gen/region_iterator.rb', line 67 def have_rects; end |
#have_rects? ⇒ Object
24 |
# File 'lib/wx/doc/region_iterator.rb', line 24 alias :have_rects? :have_rects |
#next_rect ⇒ void
This method returns an undefined value.
Moves to the next rectangle of the iterated region.
28 |
# File 'lib/wx/doc/region_iterator.rb', line 28 def next_rect; end |
#reset ⇒ void
This method returns an undefined value.
Resets the iterator to the beginning of the rectangles.
71 |
# File 'lib/wx/doc/gen/region_iterator.rb', line 71 def reset; end |