From dcf382ac31a17d5bf5e65fc73978db32eb6aa28f Mon Sep 17 00:00:00 2001 From: Andrea Gavana Date: Tue, 15 Jan 2013 20:49:52 +0000 Subject: [PATCH] wxPython (Phoenix) AUI: fix wx.PyDeadObjectErrors when restoring a notebook perspective if a notebook tab contains a control - backport of the fixes on Classic (see #14971). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73376 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wx/lib/agw/__init__.py | 2 +- wx/lib/agw/aui/__init__.py | 2 +- wx/lib/agw/aui/tabart.py | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/wx/lib/agw/__init__.py b/wx/lib/agw/__init__.py index 5bffaa8b..1ead5279 100644 --- a/wx/lib/agw/__init__.py +++ b/wx/lib/agw/__init__.py @@ -120,7 +120,7 @@ andrea.gavana@maerskoil.com AGW version: 0.9.7 -Last updated: 26 December 2012, 21.00 GMT +Last updated: 15 January 2013, 21.00 GMT """ diff --git a/wx/lib/agw/aui/__init__.py b/wx/lib/agw/aui/__init__.py index de520381..03ddc591 100644 --- a/wx/lib/agw/aui/__init__.py +++ b/wx/lib/agw/aui/__init__.py @@ -278,7 +278,7 @@ License And Version AUI library is distributed under the wxPython license. -Latest Revision: Andrea Gavana @ 27 Dec 2012, 21.00 GMT +Latest Revision: Andrea Gavana @ 15 Jan 2013, 21.00 GMT Version 1.3. diff --git a/wx/lib/agw/aui/tabart.py b/wx/lib/agw/aui/tabart.py index 3205d2b6..067126f6 100644 --- a/wx/lib/agw/aui/tabart.py +++ b/wx/lib/agw/aui/tabart.py @@ -550,7 +550,7 @@ class AuiDefaultTabArt(object): ypos = drawn_tab_yoff + (drawn_tab_height)/2 - (texty/2) - 1 offset_focus = text_offset - if control is not None: + if control: if control.GetPosition() != wx.Point(text_offset+1, ypos): control.SetPosition(wx.Point(text_offset+1, ypos)) @@ -693,7 +693,7 @@ class AuiDefaultTabArt(object): if agwFlags & AUI_NB_TAB_FIXED_WIDTH: tab_width = self._fixed_tab_width - if control is not None: + if control: tab_width += control.GetSize().GetWidth() + 4 x_extent = tab_width @@ -1266,7 +1266,7 @@ class AuiSimpleTabArt(object): ypos = (tab_y + tab_height)/2 - (texty/2) + 1 - if control is not None: + if control: if control.GetPosition() != wx.Point(text_offset+1, ypos): control.SetPosition(wx.Point(text_offset+1, ypos)) @@ -1382,7 +1382,7 @@ class AuiSimpleTabArt(object): if self._agwFlags & AUI_NB_TAB_FIXED_WIDTH: tab_width = self._fixed_tab_width - if control is not None: + if control: controlW, controlH = control.GetSize() tab_width += controlW + 4 @@ -1794,7 +1794,7 @@ class VC71TabArt(AuiDefaultTabArt): offset_focus = text_offset - if control is not None: + if control: if control.GetPosition() != wx.Point(text_offset+1, ypos): control.SetPosition(wx.Point(text_offset+1, ypos)) @@ -2032,7 +2032,7 @@ class FF2TabArt(AuiDefaultTabArt): offset_focus = text_offset - if control is not None: + if control: if control.GetPosition() != wx.Point(text_offset+1, ypos): control.SetPosition(wx.Point(text_offset+1, ypos)) @@ -2367,7 +2367,7 @@ class VC8TabArt(AuiDefaultTabArt): offset_focus = text_offset - if control is not None: + if control: if control.GetPosition() != wx.Point(text_offset+1, ypos): control.SetPosition(wx.Point(text_offset+1, ypos)) @@ -2728,7 +2728,7 @@ class ChromeTabArt(AuiDefaultTabArt): ypos = drawn_tab_yoff + drawn_tab_height/2 - texty/2 - 1 - if control is not None: + if control: if control.GetPosition() != wx.Point(text_offset+1, ypos): control.SetPosition(wx.Point(text_offset+1, ypos))