From 5f3c5e8bbbb2941cd7bbcf6e4c9d2d2558cbca6c Mon Sep 17 00:00:00 2001 From: Andrea Gavana Date: Thu, 9 Jan 2014 21:10:15 +0000 Subject: [PATCH] AGW on Phoenix: fix wrong rendering of text colour for `CustomTreeCtrl` tree items and correctly cast sip pointers to ints to be able to draw nice panes in `wx.lib.agw.aui`. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75573 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wx/lib/agw/__init__.py | 2 +- wx/lib/agw/aui/__init__.py | 2 +- wx/lib/agw/aui/dockart.py | 6 +++--- wx/lib/agw/customtreectrl.py | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/wx/lib/agw/__init__.py b/wx/lib/agw/__init__.py index 4bdfb856..cb73616d 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: 03 January 2014, 23.00 GMT +Last updated: 09 January 2014, 23.00 GMT """ diff --git a/wx/lib/agw/aui/__init__.py b/wx/lib/agw/aui/__init__.py index acb97ed9..04008340 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 @ 16 Mar 2013, 21.00 GMT +Latest Revision: Andrea Gavana @ 09 Jan 2014, 22.00 GMT Version 1.3. diff --git a/wx/lib/agw/aui/dockart.py b/wx/lib/agw/aui/dockart.py index 584937c1..5ae577cc 100644 --- a/wx/lib/agw/aui/dockart.py +++ b/wx/lib/agw/aui/dockart.py @@ -1066,9 +1066,9 @@ class ModernDockArt(AuiDefaultDockArt): rc.bottom = rect.y + rect.height if active: - winxptheme.DrawThemeBackground(self.hTheme1, dc.GetHandle(), 5, 1, (rc.top, rc.left, rc.right, rc.bottom), None) + winxptheme.DrawThemeBackground(self.hTheme1, int(dc.GetHandle()), 5, 1, (rc.top, rc.left, rc.right, rc.bottom), None) else: - winxptheme.DrawThemeBackground(self.hTheme1, dc.GetHandle(), 5, 2, (rc.top, rc.left, rc.right, rc.bottom), None) + winxptheme.DrawThemeBackground(self.hTheme1, int(dc.GetHandle()), 5, 2, (rc.top, rc.left, rc.right, rc.bottom), None) else: @@ -1181,7 +1181,7 @@ class ModernDockArt(AuiDefaultDockArt): raise Exception("ERROR: Unknown State.") try: - winxptheme.DrawThemeBackground(hTheme, dc.GetHandle(), btntype, state, (rc.top, rc.left, rc.right, rc.bottom), None) + winxptheme.DrawThemeBackground(hTheme, int(dc.GetHandle()), btntype, state, (rc.top, rc.left, rc.right, rc.bottom), None) except TypeError: return diff --git a/wx/lib/agw/customtreectrl.py b/wx/lib/agw/customtreectrl.py index aba50345..aa9148b6 100644 --- a/wx/lib/agw/customtreectrl.py +++ b/wx/lib/agw/customtreectrl.py @@ -3,7 +3,7 @@ # Inspired By And Heavily Based On wxGenericTreeCtrl. # # Andrea Gavana, @ 17 May 2006 -# Latest Revision: 03 Jan 2014, 23.00 GMT +# Latest Revision: 09 Jan 2014, 23.00 GMT # # # TODO List @@ -299,7 +299,7 @@ License And Version :class:`CustomTreeCtrl` is distributed under the wxPython license. -Latest Revision: Andrea Gavana @ 03 Jan 2014, 23.00 GMT +Latest Revision: Andrea Gavana @ 09 Jan 2014, 23.00 GMT Version 2.6 @@ -900,7 +900,7 @@ class TreeItemAttr(object): :return: ``True`` if the text colour attribute has been set, ``False`` otherwise. """ - return self._colText != wx.NullColour + return self._colText != wx.NullColour and self._colText.IsOk() def HasBackgroundColour(self): @@ -910,7 +910,7 @@ class TreeItemAttr(object): :return: ``True`` if the background colour attribute has been set, ``False`` otherwise. """ - return self._colBack != wx.NullColour + return self._colBack != wx.NullColour and self._colBack.IsOk() def HasBorderColour(self): @@ -922,7 +922,7 @@ class TreeItemAttr(object): .. versionadded:: 0.9.6 """ - return self._colBorder != wx.NullColour + return self._colBorder != wx.NullColour and self._colBorder.IsOk() def HasFont(self): @@ -932,7 +932,7 @@ class TreeItemAttr(object): :return: ``True`` if the font attribute has been set, ``False`` otherwise. """ - return self._font != wx.NullFont + return self._font != wx.NullFont and self._font.IsOk() # getters