Add wx.ClassInfo wrapper and expose getter in wx.Object

This commit is contained in:
Robin Dunn
2018-03-09 12:24:14 -08:00
parent 198ef5186e
commit 5505161843
3 changed files with 16 additions and 4 deletions

View File

@@ -79,6 +79,12 @@ Changes in this release include the following:
derived classes on Windows. This was due to an optimization that wasn't
compatible with how the classes are wrapped. (#774)
* Added wrappers for wx.ClassInfo and exposed wx.Object.GetClassInfo. This
class is part of wxWidgets' internal type information system abd although
it is not very useful for Python applications but it is useful for debugging
some internal wxPython issues.

View File

@@ -599,6 +599,7 @@
"Choice":"wx.",
"ChoiceNameStr":"wx.",
"Choicebook":"wx.",
"ClassInfo":"wx.",
"ClientDC":"wx.",
"ClientDataContainer":"wx.",
"ClientDisplayRect":"wx.",
@@ -2434,6 +2435,7 @@
"OS_WINDOWS_MICRO":"wx.",
"OS_WINDOWS_NT":"wx.",
"Object":"wx.",
"ObjectConstructorFn":"wx.",
"ObjectRefData":"wx.",
"OperatingSystemId":"wx.",
"Orientation":"wx.",

View File

@@ -20,7 +20,7 @@ DOCSTRING = ""
ITEMS = [
'wxRefCounter',
'wxObject',
# 'wxClassInfo',
'wxClassInfo',
]
#---------------------------------------------------------------------------
@@ -38,9 +38,13 @@ def run():
module.find('wxCreateDynamicObject').ignore()
#module.find('wxClassInfo').abstract = True
#module.find('wxClassInfo.wxClassInfo').ignore()
#--------------------------------------------------
c = module.find('wxClassInfo')
assert isinstance(c, etgtools.ClassDef)
module.insertItemBefore(c, etgtools.TypedefDef(type='void*', name='wxObjectConstructorFn'))
module.find('wxClassInfo').abstract = True
module.find('wxClassInfo.wxClassInfo').ignore()
#--------------------------------------------------
@@ -55,7 +59,6 @@ def run():
c = module.find('wxObject')
c.find('operator delete').ignore()
c.find('operator new').ignore()
c.find('GetClassInfo').ignore()
c.find('IsKindOf').ignore()
# EXPERIMENTAL: By turning off the virtualness of the wxObject dtor, and
@@ -72,6 +75,7 @@ def run():
# those classes with custom C++ code. (See wxFont and wxAcceleratorTable
# for examples.)
c.find('~wxObject').isVirtual = False
c.find('GetClassInfo').isVirtual = False
c.addCppMethod('const wxChar*', 'GetClassName', '()',
body='return self->GetClassInfo()->GetClassName();',