Move fixDialogProperty to tweaker_tools, and use it on more property classes

This commit is contained in:
Robin Dunn
2020-04-23 15:13:40 -07:00
parent 42ff98a5e7
commit 06b08ecc05
3 changed files with 20 additions and 10 deletions

View File

@@ -40,8 +40,12 @@ def run():
# Tweak the parsed meta objects in the module object as needed for
# customizing the generated code and docstrings.
c = module.find('wxMultiChoiceProperty')
c = module.find('wxFontProperty')
assert isinstance(c, etgtools.ClassDef)
tools.fixDialogProperty(c)
c = module.find('wxMultiChoiceProperty')
tools.fixDialogProperty(c)
# Fix up the ctor taking a wxArrayString to be the one with the easier and
# expected API

View File

@@ -39,11 +39,6 @@ ITEMS = [ 'wxPGInDialogValidator',
#---------------------------------------------------------------------------
def _fixDialogProperty(klass):
m = klass.find('DisplayEditorDialog')
m.ignore(False)
m.find('value').inOut = True
def run():
# Parse the XML file(s) building a collection of Extractor objects
@@ -92,16 +87,16 @@ def run():
c.detailedDoc = []
c = module.find('wxLongStringProperty')
_fixDialogProperty(c)
tools.fixDialogProperty(c)
c = module.find('wxDirProperty')
_fixDialogProperty(c)
tools.fixDialogProperty(c)
c = module.find('wxFileProperty')
_fixDialogProperty(c)
tools.fixDialogProperty(c)
c = module.find('wxArrayStringProperty')
_fixDialogProperty(c)
tools.fixDialogProperty(c)
c.find('GenerateValueAsString').ignore(False)
c = module.find('wxPGArrayEditorDialog')

View File

@@ -408,6 +408,17 @@ def fixTextClipboardMethods(klass):
except extractors.ExtractorError:
pass
def fixDialogProperty(klass):
"""
Fix classes derived from EditorDialogProperty to ensure that their
DisplayEditorDialog method is visible.
"""
m = klass.find('DisplayEditorDialog')
m.ignore(False)
m.find('value').inOut = True
def removeVirtuals(klass):
"""
Sometimes methods are marked as virtual but probably don't ever need to be