mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-15 17:20:07 +01:00
Move fixDialogProperty to tweaker_tools, and use it on more property classes
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user