mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-07 12:30:07 +01:00
trim trailing space etg directory
This commit is contained in:
40
etg/menu.py
40
etg/menu.py
@@ -17,8 +17,8 @@ NAME = "menu" # Base name of the file to generate to for this script
|
||||
DOCSTRING = ""
|
||||
|
||||
# The classes and/or the basename of the Doxygen XML files to be processed by
|
||||
# this script.
|
||||
ITEMS = [ 'wxMenu', 'wxMenuBar' ]
|
||||
# this script.
|
||||
ITEMS = [ 'wxMenu', 'wxMenuBar' ]
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
@@ -26,7 +26,7 @@ def run():
|
||||
# Parse the XML file(s) building a collection of Extractor objects
|
||||
module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING)
|
||||
etgtools.parseDoxyXML(module, ITEMS)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
# Tweak the parsed meta objects in the module object as needed for
|
||||
# customizing the generated code and docstrings.
|
||||
@@ -36,7 +36,7 @@ def run():
|
||||
arg_def = method.findItem(arg)
|
||||
if arg_def:
|
||||
arg_def.transfer = True
|
||||
|
||||
|
||||
for method in c.findAll('Remove') + c.findAll('Replace'):
|
||||
method.transferBack = True
|
||||
|
||||
@@ -48,21 +48,21 @@ def run():
|
||||
addTransferAnnotations(c, 'menuItem')
|
||||
addTransferAnnotations(c, 'subMenu')
|
||||
c.find('AppendSubMenu.submenu').transfer = True
|
||||
|
||||
|
||||
# We only need one of these overloads, the non-const/const is not enough
|
||||
# to distinguish a unique Python signature.
|
||||
c.find('GetMenuItems').overloads = []
|
||||
|
||||
|
||||
# Ensure that no copy is made of the list object, so we only wrap the
|
||||
# existing object and keep it owned by C++
|
||||
c.find('GetMenuItems').noCopy = True
|
||||
|
||||
|
||||
|
||||
|
||||
c.addPyMethod('AppendMenu', '(self, id, item, subMenu, help="")', deprecated='Use Append instead.',
|
||||
body='return self.Append(id, item, subMenu, help)')
|
||||
c.addPyMethod('AppendItem', '(self, menuItem)', deprecated='Use Append instead.',
|
||||
body='return self.Append(menuItem)')
|
||||
|
||||
|
||||
c.addPyMethod('InsertMenu', '(self, pos, id, item, subMenu, help="")', deprecated='Use Insert instead.',
|
||||
body='return self.Insert(pos, id, item, subMenu, help)')
|
||||
c.addPyMethod('InsertItem', '(self, pos, menuItem)', deprecated='Use Insert instead.',
|
||||
@@ -99,7 +99,7 @@ def run():
|
||||
tools.removeVirtuals(c)
|
||||
addTransferAnnotations(c, 'menu')
|
||||
c.find('wxMenuBar').findOverload('wxMenu *menus[], const wxString titles[], long style=0)').ignore()
|
||||
|
||||
|
||||
c.find('FindItem.menu').out = True
|
||||
c.addCppMethod('wxMenuItem*', 'FindItemById', '(int id)', isConst=True,
|
||||
doc="""\
|
||||
@@ -108,7 +108,7 @@ def run():
|
||||
Finds the menu item object associated with the given menu item identifier.""",
|
||||
body="""\
|
||||
return self->FindItem(id);""")
|
||||
|
||||
|
||||
|
||||
mac_scmb = c.find('MacSetCommonMenuBar')
|
||||
mac_scmb.setCppCode("""\
|
||||
@@ -116,7 +116,7 @@ def run():
|
||||
wxMenuBar::MacSetCommonMenuBar(menubar);
|
||||
#endif
|
||||
""")
|
||||
|
||||
|
||||
mac_gcmb = c.find('MacGetCommonMenuBar')
|
||||
mac_gcmb.setCppCode("""\
|
||||
#ifdef __WXMAC__
|
||||
@@ -134,23 +134,23 @@ def run():
|
||||
return NULL;
|
||||
#endif
|
||||
""")
|
||||
|
||||
|
||||
# don't transfer on other platforms, as this is a no-op there.
|
||||
import sys
|
||||
if sys.platform.startswith('darwin'):
|
||||
mac_scmb.find('menubar').transfer = True
|
||||
|
||||
|
||||
c.find('FindItem.menu').out = True
|
||||
|
||||
|
||||
c.addPyMethod('GetMenus', '(self)',
|
||||
c.addPyMethod('GetMenus', '(self)',
|
||||
doc="""\
|
||||
GetMenus() -> (menu, label)\n
|
||||
Return a list of (menu, label) items for the menus in the :class:`MenuBar`.""",
|
||||
body="""\
|
||||
return [(self.GetMenu(i), self.GetLabelTop(i)) for i in range(self.GetMenuCount())]
|
||||
""")
|
||||
c.addPyMethod('SetMenus', '(self, items)',
|
||||
""")
|
||||
c.addPyMethod('SetMenus', '(self, items)',
|
||||
doc="""\
|
||||
SetMenus()\n
|
||||
Clear and add new menus to the :class:`MenuBar` from a list of (menu, label) items.""",
|
||||
@@ -161,15 +161,15 @@ def run():
|
||||
self.Append(m, l)
|
||||
""")
|
||||
c.addPyProperty('Menus GetMenus SetMenus')
|
||||
|
||||
|
||||
|
||||
module.addItem(tools.wxListWrapperTemplate('wxMenuList', 'wxMenu', module))
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
tools.doCommonTweaks(module)
|
||||
tools.runGenerators(module)
|
||||
|
||||
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
if __name__ == '__main__':
|
||||
run()
|
||||
|
||||
Reference in New Issue
Block a user