Tweaks needed for new wxWidgets changes

This commit is contained in:
Robin Dunn
2020-06-26 22:35:51 -07:00
parent 99d7c1a52e
commit c369038ad4
2 changed files with 28 additions and 0 deletions

View File

@@ -65,6 +65,7 @@ def run():
wxXmlResource::Get()->InitAllHandlers();
""")
module.addHeaderCode('#include <wx/animate.h>')
module.addHeaderCode('#include <wx/xrc/xmlres.h>')
module.addHeaderCode('#include <wx/fs_mem.h>')
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="")',

View File

@@ -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()