From: Jaakko Salli Date: Sun, 13 Jun 2010 08:46:30 +0000 (+0000) Subject: Documented pythonic iterators X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/863d1ce7c2736b7a1cceb56a547741ac2f3993d2?ds=inline Documented pythonic iterators git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64576 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/doxygen/overviews/propgrid.h b/docs/doxygen/overviews/propgrid.h index 4cd1a7a452..75565ee9d5 100644 --- a/docs/doxygen/overviews/propgrid.h +++ b/docs/doxygen/overviews/propgrid.h @@ -555,8 +555,17 @@ This example reverse-iterates through all visible items: @endcode -wxPython Note: Instead of ++ operator, use Next() method, and instead of +@beginWxPythonOnly +PropertyGridInterface has some useful pythonic iterators as attributes. +@c Properties lets you iterate through all items that are not category +captions or private children. @c Items lets you iterate through everything +except private children. Also, there are GetPyIterator() and GetPyVIterator(), +which return pythonic iterators instead of normal wxPropertyGridIterator. + +If you need to use C++ style iterators in wxPython code, note that +Instead of ++ operator, use Next() method, and instead of * operator, use GetProperty() method. +@endWxPythonOnly GetIterator() only works with wxPropertyGrid and the individual pages of wxPropertyGridManager. In order to iterate through an arbitrary diff --git a/interface/wx/propgrid/propgridiface.h b/interface/wx/propgrid/propgridiface.h index efd9067b68..07e4098def 100644 --- a/interface/wx/propgrid/propgridiface.h +++ b/interface/wx/propgrid/propgridiface.h @@ -226,8 +226,12 @@ public: is used. @beginWxPythonOnly - wxPython Note: Instead of ++ operator, use Next() method, and - instead of * operator, use GetProperty() method. + Instead of ++ operator, use Next() method, and instead of * operator, + use GetProperty() method. There is also GetPyIterator() method (which + takes the same arguments but instead returns a pythonic iterator), + @c Properties attribute which is an iterator over all non-category, + non-private properties, and finally @c Items attribute which is an + iterator over all items except private child properties. @endWxPythonOnly */ wxPropertyGridIterator GetIterator( int flags = wxPG_ITERATE_DEFAULT, @@ -249,8 +253,12 @@ public: iteration will instead begin from bottommost valid item. @beginWxPythonOnly - wxPython Note: Instead of ++ operator, use Next() method, and - instead of * operator, use GetProperty() method. + Instead of ++ operator, use Next() method, and instead of * operator, + use GetProperty() method. There is also GetPyIterator() method (which + takes the same arguments but instead returns a pythonic iterator), + @c Properties attribute which is an iterator over all non-category, + non-private properties, and finally @c Items attribute which is an + iterator over all items except private child properties. @endWxPythonOnly */ wxPropertyGridIterator GetIterator( int flags, int startPos ); @@ -457,8 +465,14 @@ public: @param flags See @ref propgrid_iterator_flags. - wxPython Note: Instead of ++ operator, use Next() method, and - instead of * operator, use GetProperty() method. + @beginWxPythonOnly + Instead of ++ operator, use Next() method, and instead of * operator, + use GetProperty() method. There is also GetPyVIterator() method (which + takes the same arguments but instead returns a pythonic iterator), + @c Properties attribute which is an iterator over all non-category, + non-private properties, and finally @c Items attribute which is an + iterator over all items except private child properties. + @endWxPythonOnly */ virtual wxPGVIterator GetVIterator( int flags ) const;