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/_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..ce1cf02d 100644 --- a/etg/grid.py +++ b/etg/grid.py @@ -606,6 +606,32 @@ 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 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); + 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() diff --git a/ext/wxWidgets b/ext/wxWidgets index a2a38971..c43af017 160000 --- a/ext/wxWidgets +++ b/ext/wxWidgets @@ -1 +1 @@ -Subproject commit a2a3897124dab93e11fb834205ee150121df3faf +Subproject commit c43af017c930063fde972d5b7e01db51e409b899