diff --git a/CHANGES.rst b/CHANGES.rst index 468a711d..0348feff 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,6 +8,7 @@ wxPython Changelog ================== + 4.1.0 ----- * (not yet released) @@ -29,6 +30,27 @@ Other changes in this release: +4.0.2 +----- +* (not yet released) + +PyPI: https://pypi.python.org/pypi/wxPython/4.0.2 +Extras: https://extras.wxPython.org/wxPython4/extras/ +Pip: ``pip install wxPython==4.0.2`` + +Changes in this release include the following: + +* Fixed wx.html2.EVT_WEBVIEW_NAVIGATING event not being sent on some versions + of Linux. (#741) + +* wx.Sizers can now be used as an iterator to iterate over the items within + the sizer. (#738) + +* Fix Python3 division in ThumbnailCtrl. (#746) + + + + 4.0.1 "Lemonade" ---------------- * 2-Feb-2018 diff --git a/build.py b/build.py index 41ed39ac..8fc83da4 100755 --- a/build.py +++ b/build.py @@ -1731,6 +1731,8 @@ def cmd_clean_vagrant(options, args): if os.path.exists(d): shutil.rmtree(d) +def cmd_clean_all(options, args): + cmd_cleanall(options, args) def cmd_cleanall(options, args): # These take care of all the object, lib, shared lib files created by the diff --git a/etg/sizer.py b/etg/sizer.py index 3bee2a4b..bed628b2 100644 --- a/etg/sizer.py +++ b/etg/sizer.py @@ -154,8 +154,12 @@ def run(): import wx.siplib return not wx.siplib.isdeleted(self) """) - c.addPyCode('Sizer.__bool__ = Sizer.__nonzero__') # For Python 3 + c.addPyMethod('__iter__', '(self)', + doc = "A Py convenience method that allows Sizers to act as iterables that will yield their wx.SizerItems.", + body = "for item in self.GetChildren(): yield item") + + c.addPyCode('Sizer.__bool__ = Sizer.__nonzero__') # For Python 3 #--------------------------------------------- diff --git a/unittests/test_sizer.py b/unittests/test_sizer.py index abd0a36f..7703c972 100644 --- a/unittests/test_sizer.py +++ b/unittests/test_sizer.py @@ -71,6 +71,15 @@ class sizer_Tests(wtc.WidgetTestCase): self.assertTrue(items[1].IsSpacer()) self.assertTrue(items[2].Border == 5) + def test_iter(self): + bs = wx.BoxSizer() + widgetlist = [wx.Panel(self.frame) for _ in range(5)] + + sizeritems = [x for x in bs] + for item in sizeritems: + self.assertTrue(isinstance(item, wx.SizerItem)) + + self.assertTrue([x.GetWidget() for x in bs] == widgetlist) def test_sizerSpacers1(self): bs = wx.BoxSizer() diff --git a/wx/lib/agw/thumbnailctrl.py b/wx/lib/agw/thumbnailctrl.py index 5e950f78..7d97cb05 100644 --- a/wx/lib/agw/thumbnailctrl.py +++ b/wx/lib/agw/thumbnailctrl.py @@ -1790,7 +1790,7 @@ class ScrolledThumbnail(wx.ScrolledWindow): :param `y`: the mouse `y` position. """ - col = (x - self._tBorder)/(self._tWidth + self._tBorder) + col = (x - self._tBorder)//(self._tWidth + self._tBorder) if col >= self._cols: col = self._cols - 1 @@ -1942,7 +1942,7 @@ class ScrolledThumbnail(wx.ScrolledWindow): return # get row - row = self.GetSelection()/self._cols + row = self.GetSelection()//self._cols # calc position to scroll view paintRect = self.GetPaintRect() @@ -2586,4 +2586,3 @@ class ScrolledThumbnail(wx.ScrolledWindow): self.Refresh() -