Ignore some overloads which can't be disambiguated by the wrappers.

(Typically methods that only differ by constness in C++.)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@74132 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2013-06-08 23:29:16 +00:00
parent ce4424c4ea
commit 7dcb3c3dfb
2 changed files with 116 additions and 3 deletions

View File

@@ -138,7 +138,11 @@ other dev stuff
* Reimplement the classes in the valgen, valnum and valtext headers as
Python code, and make them visible in the core wx namespace?
* It would be nice to have a way to automatically ignore one overload if it
only differs from another overload by constness. See etg/richtextbuffer.py
for why.

View File

@@ -68,13 +68,122 @@ def run():
# Tweak the parsed meta objects in the module object as needed for
# customizing the generated code and docstrings.
module.addItem(
tools.wxArrayWrapperTemplate('wxRichTextRangeArray', 'wxRichTextRange', module))
module.addItem(
tools.wxArrayWrapperTemplate('wxRichTextAttrArray', 'wxRichTextAttr', module))
module.addItem(
tools.wxArrayWrapperTemplate('wxRichTextVariantArray', 'wxVariant', module))
module.find('wxRICHTEXT_ALL').ignore()
module.find('wxRICHTEXT_NONE').ignore()
module.find('wxRICHTEXT_NO_SELECTION').ignore()
module.addPyCode("""\
RICHTEXT_ALL = RichTextRange(-2, -2)
RICHTEXT_NONE = RichTextRange(-1, -1)
RICHTEXT_NO_SELECTION = RichTextRange(-2, -2)
""")
#-------------------------------------------------------
c = module.find('wxTextAttrDimension')
assert isinstance(c, etgtools.ClassDef)
c.find('SetValue').findOverload('units').ignore()
module.addItem(
tools.wxArrayWrapperTemplate('wxRichTextRangeArray', 'wxRichTextRange', module))
#-------------------------------------------------------
c = module.find('wxTextAttrDimensions')
# There are const and non-const versions of each of these, get rid of one
# of each pair.
c.find('GetLeft').ignore()
c.find('GetRight').ignore()
c.find('GetTop').ignore()
c.find('GetBottom').ignore()
#-------------------------------------------------------
c = module.find('wxTextAttrSize')
c.find('GetWidth').ignore()
c.find('GetHeight').ignore()
c.find('SetWidth').findOverload('units').ignore()
c.find('SetHeight').findOverload('units').ignore()
#-------------------------------------------------------
c = module.find('wxTextAttrBorder')
c.find('GetWidth').ignore()
#-------------------------------------------------------
c = module.find('wxTextAttrBorders')
c.find('GetLeft').ignore()
c.find('GetRight').ignore()
c.find('GetTop').ignore()
c.find('GetBottom').ignore()
#-------------------------------------------------------
c = module.find('wxTextBoxAttr')
c.find('GetMargins').ignore()
c.find('GetLeftMargin').ignore()
c.find('GetRightMargin').ignore()
c.find('GetTopMargin').ignore()
c.find('GetBottomMargin').ignore()
c.find('GetPosition').ignore()
c.find('GetLeft').ignore()
c.find('GetRight').ignore()
c.find('GetTop').ignore()
c.find('GetBottom').ignore()
c.find('GetPadding').ignore()
c.find('GetLeftPadding').ignore()
c.find('GetRightPadding').ignore()
c.find('GetTopPadding').ignore()
c.find('GetBottomPadding').ignore()
c.find('GetBorder').ignore()
c.find('GetLeftBorder').ignore()
c.find('GetRightBorder').ignore()
c.find('GetTopBorder').ignore()
c.find('GetBottomBorder').ignore()
c.find('GetOutline').ignore()
c.find('GetLeftOutline').ignore()
c.find('GetRightOutline').ignore()
c.find('GetTopOutline').ignore()
c.find('GetBottomOutline').ignore()
c.find('GetSize').ignore()
c.find('GetMinSize').ignore()
c.find('GetMaxSize').ignore()
c.find('GetWidth').ignore()
c.find('GetHeight').ignore()
#-------------------------------------------------------
c = module.find('wxRichTextAttr')
c.find('GetTextBoxAttr').ignore()
#-------------------------------------------------------
c = module.find('wxRichTextProperties')
c.find('operator[]').ignore()
c.find('GetProperties').ignore()
c.find('SetProperty').findOverload('bool').ignore()
#-------------------------------------------------------
c = module.find('wxRichTextSelection')
c.find('GetRanges').ignore()
#-------------------------------------------------------
#-------------------------------------------------------
#-------------------------------------------------------
#-----------------------------------------------------------------
tools.doCommonTweaks(module)