diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index b20cce579f..9cc1b6e2a1 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -599,8 +599,7 @@ wxSystemSettings_GetSystemFont = wxSystemSettings_GetFont wxSystemSettings_GetSystemMetric = wxSystemSettings_GetMetric # workarounds for bad wxRTTI names -wxGauge95 = wxGauge -wxGauge95Ptr = wxGaugePtr +__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge' wxPyAssertionError = wxc.wxPyAssertionError diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index 721f22917d..fa7706d490 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -507,12 +507,18 @@ void wxPyPtrTypeMap_Add(const char* commonName, const char* ptrName) { PyObject* wxPyClassExists(const wxString& className) { + PyObject* item; + wxString name(className); + char buff[64]; // should always be big enough... + if (!className) return NULL; - char buff[64]; // should always be big enough... + if ((item = PyDict_GetItemString(wxPyPtrTypeMap, (char*)(const char*)name.mbc_str())) != NULL) { + name = wxString(PyString_AsString(item), *wxConvCurrent); + } - sprintf(buff, "%sPtr", (const char*)className.mbc_str()); + sprintf(buff, "%sPtr", (const char*)name.mbc_str()); PyObject* classobj = PyDict_GetItemString(wxPython_dict, buff); return classobj; // returns NULL if not found diff --git a/wxPython/src/msw/wx.py b/wxPython/src/msw/wx.py index 15fcbd4e27..d9af616a52 100644 --- a/wxPython/src/msw/wx.py +++ b/wxPython/src/msw/wx.py @@ -1546,8 +1546,7 @@ wxSystemSettings_GetSystemFont = wxSystemSettings_GetFont wxSystemSettings_GetSystemMetric = wxSystemSettings_GetMetric # workarounds for bad wxRTTI names -wxGauge95 = wxGauge -wxGauge95Ptr = wxGaugePtr +__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge' wxPyAssertionError = wxc.wxPyAssertionError