diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index ceda5efe8e..f31349b313 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -598,6 +598,10 @@ wxSystemSettings_GetSystemColour = wxSystemSettings_GetColour wxSystemSettings_GetSystemFont = wxSystemSettings_GetFont wxSystemSettings_GetSystemMetric = wxSystemSettings_GetMetric +# workarounds for bad wxRTTI names +wxGauge95 = wxGauge +wxGauge95Ptr = wxGaugePtr + wxPyAssertionError = wxc.wxPyAssertionError diff --git a/wxPython/src/controls.i b/wxPython/src/controls.i index 96ca6cb7b4..d4f7b2b69d 100644 --- a/wxPython/src/controls.i +++ b/wxPython/src/controls.i @@ -1176,6 +1176,12 @@ public: //---------------------------------------------------------------------- //---------------------------------------------------------------------- + +%init %{ + // wxRTTI is screwed up for wxGauge on wxMSW, it uses wxGauge95 class name + wxPyPtrTypeMap_Add("wxGauge", "wxGauge95"); +%} + //---------------------------------------------------------------------- diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index fc42ca8765..33966b1331 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -540,8 +540,8 @@ PyObject* wxPyMake_wxObject(wxObject* source, bool checkEvtHandler) { if (! target) { // Otherwise make it the old fashioned way by making a // new shadow object and putting this pointer in it. - wxClassInfo* info = source->GetClassInfo(); - wxChar* name = (wxChar*)info->GetClassName(); + wxClassInfo* info = source->GetClassInfo(); + wxString name = info->GetClassName(); PyObject* klass = wxPyClassExists(name); while (info && !klass) { name = (wxChar*)info->GetBaseClassName1(); diff --git a/wxPython/src/msw/controls.cpp b/wxPython/src/msw/controls.cpp index d11d7bd0b4..2c7d1a7c44 100644 --- a/wxPython/src/msw/controls.cpp +++ b/wxPython/src/msw/controls.cpp @@ -11952,6 +11952,9 @@ SWIGEXPORT(void) initcontrolsc() { PyDict_SetItemString(d,"cvar", SWIG_globals); SWIG_addvarlink(SWIG_globals,"wxDefaultValidator",_wrap_wxDefaultValidator_get, _wrap_wxDefaultValidator_set); PyDict_SetItemString(d,"wxEVT_COMMAND_TOGGLEBUTTON_CLICKED", PyInt_FromLong((long) wxEVT_COMMAND_TOGGLEBUTTON_CLICKED)); + + // wxRTTI is screwed up for wxGauge on wxMSW, it uses wxGauge95 class name + wxPyPtrTypeMap_Add("wxGauge", "wxGauge95"); { int i; for (i = 0; _swig_mapping[i].n1; i++) diff --git a/wxPython/src/msw/wx.py b/wxPython/src/msw/wx.py index 9d90b890f5..ab3fbc987f 100644 --- a/wxPython/src/msw/wx.py +++ b/wxPython/src/msw/wx.py @@ -1545,6 +1545,9 @@ wxSystemSettings_GetSystemColour = wxSystemSettings_GetColour wxSystemSettings_GetSystemFont = wxSystemSettings_GetFont wxSystemSettings_GetSystemMetric = wxSystemSettings_GetMetric +# workarounds for bad wxRTTI names +wxGauge95 = wxGauge +wxGauge95Ptr = wxGaugePtr wxPyAssertionError = wxc.wxPyAssertionError