.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.RegionIterator:

==========================================================================================================================================
|phoenix_title|  **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 :ref:`wx.PaintEvent`  for an example of use. 









         



.. seealso:: :ref:`wx.PaintEvent`    







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>RegionIterator</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.RegionIterator_inheritance.png" alt="Inheritance diagram of RegionIterator" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.RegionIterator.html" title="wx.RegionIterator" alt="" coords="5,83,143,112"/> <area shape="rect" id="node2" href="wx.Object.html" title="wx.Object" alt="" coords="31,5,117,35"/> </map> 
   </p>
   </div>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.RegionIterator.__init__`                                              Default constructor.
:meth:`~wx.RegionIterator.GetH`                                                  An alias for :meth:`~RegionIterator.GetHeight` .
:meth:`~wx.RegionIterator.GetHeight`                                             Returns the height value for the current region.
:meth:`~wx.RegionIterator.GetRect`                                               Returns the current rectangle.
:meth:`~wx.RegionIterator.GetW`                                                  An alias for :meth:`~RegionIterator.GetWidth` .
:meth:`~wx.RegionIterator.GetWidth`                                              Returns the width value for the current region.
:meth:`~wx.RegionIterator.GetX`                                                  Returns the x value for the current region.
:meth:`~wx.RegionIterator.GetY`                                                  Returns the y value for the current region.
:meth:`~wx.RegionIterator.HaveRects`                                             Returns ``True`` if there are still some rectangles; otherwise returns ``False``.
:meth:`~wx.RegionIterator.Next`                                                  Move the iterator to the next rectangle in the region.
:meth:`~wx.RegionIterator.Reset`                                                 Resets the iterator to the beginning of the rectangles.
:meth:`~wx.RegionIterator.__bool__`                                              Returns ``True`` while there are still rectangles available in the iteration.
:meth:`~wx.RegionIterator.__nonzero__`                                           Returns ``True`` while there are still rectangles available in the iteration.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.RegionIterator.H`                                                     See :meth:`~wx.RegionIterator.GetH`
:attr:`~wx.RegionIterator.Height`                                                See :meth:`~wx.RegionIterator.GetHeight`
:attr:`~wx.RegionIterator.Rect`                                                  See :meth:`~wx.RegionIterator.GetRect`
:attr:`~wx.RegionIterator.W`                                                     See :meth:`~wx.RegionIterator.GetW`
:attr:`~wx.RegionIterator.Width`                                                 See :meth:`~wx.RegionIterator.GetWidth`
:attr:`~wx.RegionIterator.X`                                                     See :meth:`~wx.RegionIterator.GetX`
:attr:`~wx.RegionIterator.Y`                                                     See :meth:`~wx.RegionIterator.GetY`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.RegionIterator(Object)

   **Possible constructors**::

       RegionIterator()
       
       RegionIterator(region)
       
   
   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.



   .. method:: __init__(self, *args, **kw)



      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self)`
      
      Default constructor.                   
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self, region)`
      
      Creates an iterator object given a region.                  
      
      
      :param `region`: 
      :type `region`: wx.Region
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: GetH(self)

      An alias for :meth:`GetHeight` .                  

      :rtype: :ref:`wx.Coord`








   .. method:: GetHeight(self)

      Returns the height value for the current region.                  

      :rtype: :ref:`wx.Coord`








   .. method:: GetRect(self)

      Returns the current rectangle.                  

      :rtype: :ref:`wx.Rect`








   .. method:: GetW(self)

      An alias for :meth:`GetWidth` .                  

      :rtype: :ref:`wx.Coord`








   .. method:: GetWidth(self)

      Returns the width value for the current region.                  

      :rtype: :ref:`wx.Coord`








   .. method:: GetX(self)

      Returns the x value for the current region.                  

      :rtype: :ref:`wx.Coord`








   .. method:: GetY(self)

      Returns the y value for the current region.                  

      :rtype: :ref:`wx.Coord`








   .. method:: HaveRects(self)

      Returns ``True`` if there are still some rectangles; otherwise returns ``False``.                  

      :rtype: `bool`








   .. method:: Next(self)

      Move the iterator to the next rectangle in the region.  





   .. method:: Reset(self, *args, **kw)



      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **Reset** `(self)`
      
      Resets the iterator to the beginning of the rectangles.                   
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **Reset** `(self, region)`
      
      Resets the iterator to the given region.                  
      
      
      :param `region`: 
      :type `region`: wx.Region
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: __bool__(self)

      Returns ``True`` while there are still rectangles available in the iteration. 

      :rtype: `int`








   .. method:: __nonzero__(self)

      Returns ``True`` while there are still rectangles available in the iteration. 

      :rtype: `int`








   .. attribute:: H

      See :meth:`~wx.RegionIterator.GetH`


   .. attribute:: Height

      See :meth:`~wx.RegionIterator.GetHeight`


   .. attribute:: Rect

      See :meth:`~wx.RegionIterator.GetRect`


   .. attribute:: W

      See :meth:`~wx.RegionIterator.GetW`


   .. attribute:: Width

      See :meth:`~wx.RegionIterator.GetWidth`


   .. attribute:: X

      See :meth:`~wx.RegionIterator.GetX`


   .. attribute:: Y

      See :meth:`~wx.RegionIterator.GetY`

