.. 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
Inheritance diagram for class RegionIterator:
| |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:`

` **__init__** `(self)` Default constructor. :html:`

` **__init__** `(self, region)` Creates an iterator object given a region. :param `region`: :type `region`: wx.Region :html:`

` .. method:: GetH(self) An alias for :meth:`GetHeight` . :rtype: `wx.Coord` .. method:: GetHeight(self) Returns the height value for the current region. :rtype: `wx.Coord` .. method:: GetRect(self) Returns the current rectangle. :rtype: :ref:`wx.Rect` .. method:: GetW(self) An alias for :meth:`GetWidth` . :rtype: `wx.Coord` .. method:: GetWidth(self) Returns the width value for the current region. :rtype: `wx.Coord` .. method:: GetX(self) Returns the x value for the current region. :rtype: `wx.Coord` .. method:: GetY(self) Returns the y value for the current region. :rtype: `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:`

` **Reset** `(self)` Resets the iterator to the beginning of the rectangles. :html:`

` **Reset** `(self, region)` Resets the iterator to the given region. :param `region`: :type `region`: wx.Region :html:`

` .. 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`