Copy methods from wxGenericProgressDialog to wxProgressDialog.

This is needed because some of the methods are non-virtual, and they are reimplemented in the MSW version of wxProgressDialog. In order for those methods to be called they need to have wrappers generated.
This commit is contained in:
Robin Dunn
2018-01-22 11:52:36 -08:00
parent 0981cd9da5
commit fcf0d8cc17
2 changed files with 16 additions and 2 deletions

View File

@@ -106,7 +106,8 @@ Changes in this release include the following:
* Fix displaying '&' in the label of wx.RadioBox on GTK. (#39)
* Fix problems of the wrong C++ method being called in wx.ProgressDialog on MS
Windows. (#701)

View File

@@ -9,6 +9,7 @@
import etgtools
import etgtools.tweaker_tools as tools
import copy
PACKAGE = "wx"
MODULE = "_core"
@@ -34,7 +35,7 @@ def run():
module.addHeaderCode("#include <wx/progdlg.h>")
c = module.find('wxGenericProgressDialog')
c = gpd = module.find('wxGenericProgressDialog')
assert isinstance(c, etgtools.ClassDef)
tools.fixWindowClass(c)#, False)
@@ -47,6 +48,18 @@ def run():
c = module.find('wxProgressDialog')
tools.fixWindowClass(c)
# Copy methods from the generic to the native class. This is needed
# because none of the methods are declared in the interface files, and
# since on MSW some non-virtual methods are reimplemented in
# wxProgressDialogs they will not be called if SIP doesn't know about
# them. We'll copy all of them and let the C++ compiler sort things out.
for item in gpd:
if (isinstance(item, etgtools.MethodDef) and
not item.isCtor and
not item.isDtor):
c.addItem(copy.deepcopy(item))
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)