From 99d7c1a52e411e9789d86c98cb8204a303f3de18 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 26 Jun 2020 21:51:35 -0700 Subject: [PATCH 1/4] Update wxWidgets to latest commit --- ext/wxWidgets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/wxWidgets b/ext/wxWidgets index a2a38971..f09365af 160000 --- a/ext/wxWidgets +++ b/ext/wxWidgets @@ -1 +1 @@ -Subproject commit a2a3897124dab93e11fb834205ee150121df3faf +Subproject commit f09365afbce2a73547e10bf2089ea5f122834d4e From c369038ad43503b5f03762a71795cb2d3f614aa0 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 26 Jun 2020 22:35:51 -0700 Subject: [PATCH 2/4] Tweaks needed for new wxWidgets changes --- etg/_xrc.py | 3 +++ etg/grid.py | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/etg/_xrc.py b/etg/_xrc.py index fb957707..201a7482 100644 --- a/etg/_xrc.py +++ b/etg/_xrc.py @@ -65,6 +65,7 @@ def run(): wxXmlResource::Get()->InitAllHandlers(); """) + module.addHeaderCode('#include ') module.addHeaderCode('#include ') module.addHeaderCode('#include ') module.addHeaderCode('#include "wxpybuffer.h"') @@ -72,6 +73,7 @@ def run(): module.insertItem(0, etgtools.WigCode("""\ // forward declarations class wxAnimation; + class wxAnimationCtrl; """)) #----------------------------------------------------------------- @@ -147,6 +149,7 @@ def run(): # Just ignore it for now. c.find('GetFilePath').ignore() + c.find('GetAnimation.ctrl').type = 'wxAnimationCtrl *' #----------------------------------------------------------------- module.addPyFunction('EmptyXmlResource', '(flags=XRC_USE_LOCALE, domain="")', diff --git a/etg/grid.py b/etg/grid.py index 65ffd7f4..85945785 100644 --- a/etg/grid.py +++ b/etg/grid.py @@ -606,6 +606,31 @@ def run(): c.find('GetGridWindowOffset').findOverload('int &x').ignore() + + # Custom code to deal with the wxGridBlockCoordsVector return type of these + # methods. It's a wxVector, which we'll just convert to a list. + # TODO: There are starting to be enough of these that we ought to either + # wrap wxVector, or add something in tweaker_tools to make adding code + # like this easier and more automated. + code = """\ + wxPyThreadBlocker blocker; + PyObject* result = PyList_New(0); + wxGridBlockCoordsVector vector = self->{method}(); + for (size_t idx=0; idx < vector.size(); idx++) {{ + PyObject* obj; + wxGridBlockCoords* item = new wxGridBlockCoords(vector[idx]); + obj = wxPyConstructObject((void*)item, "wxGridBlockCoords", true); + PyList_Append(result, obj); + Py_DECREF(obj); + }} + return result; + """ + c.find('GetSelectedRowBlocks').type = 'PyObject*' + c.find('GetSelectedRowBlocks').setCppCode(code.format(method='GetSelectedRowBlocks')) + c.find('GetSelectedColBlocks').type = 'PyObject*' + c.find('GetSelectedColBlocks').setCppCode(code.format(method='GetSelectedColBlocks')) + + #----------------------------------------------------------------- c = module.find('wxGridUpdateLocker') c.addPrivateCopyCtor() From 56dc1f699e0729dbbf6097dc3633d65d9ca67dbd Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 29 Jun 2020 10:08:26 -0700 Subject: [PATCH 3/4] Update changelog for recent changes --- CHANGES.rst | 9 +++++++++ etg/grid.py | 7 ++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index f92931a8..d8161400 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -49,6 +49,15 @@ New and improved in this release: agw version) Pane has been closed (after it has been closed, not when it is about to be closed, which is when EVT_AUI_PANE_CLOSE is sent.) (PR#1628) +* Exposed the wx.DC methods GetGraphicsContext and SetGraphicsContext. Depending + on the platform and the type of the DC, there may be a wx.GraphicsContext used + for the implementation of the DC. If so, the GetGraphicsContext method enables + access to it. Be sure to check that the return value is not None before trying + to use it. + +* Simplified the implementation of the wx.App.InitLocale method. See the + MigrationGuide for more information. + diff --git a/etg/grid.py b/etg/grid.py index 85945785..ce1cf02d 100644 --- a/etg/grid.py +++ b/etg/grid.py @@ -609,9 +609,10 @@ def run(): # Custom code to deal with the wxGridBlockCoordsVector return type of these # methods. It's a wxVector, which we'll just convert to a list. - # TODO: There are starting to be enough of these that we ought to either - # wrap wxVector, or add something in tweaker_tools to make adding code - # like this easier and more automated. + + # TODO: There are a few of these now to we ought to either wrap wxVector, or add + # something in tweaker_tools to make adding code like this easier and more + # automated. code = """\ wxPyThreadBlocker blocker; PyObject* result = PyList_New(0); From de1c8b42d830d8daf17ec6442ef1318bf73a6a47 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 29 Jun 2020 10:16:42 -0700 Subject: [PATCH 4/4] Update wxWidgets to latest commit --- ext/wxWidgets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/wxWidgets b/ext/wxWidgets index f09365af..c43af017 160000 --- a/ext/wxWidgets +++ b/ext/wxWidgets @@ -1 +1 @@ -Subproject commit f09365afbce2a73547e10bf2089ea5f122834d4e +Subproject commit c43af017c930063fde972d5b7e01db51e409b899