Files
Phoenix/etg/sizer.py
Robin Dunn d949d1dad1 * Update version number
* Since they are almost always needed for window classes, move the calls to
  removeVirtuals and addWindowVirtuals into the fixWindowClass and
  fixTopLevelWindowClass functions.

* Add wxWithImages to the interface headers and create wrappers for it and use
  it as a base of wxBoockCtrlBase.

* Add a new wx.deprecated() function that can handle properties and classes in
  addition to callables. It issues a custom warning, wxPyDeprecationWarning
  since the stock DeprecationWarning is filtered out by default in Python 2.7.

* Deprecate PyWindow and similar aliases

* Deprecate wx.Window.SetDimensions


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@69050 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-09-11 00:33:10 +00:00

82 lines
2.6 KiB
Python

#---------------------------------------------------------------------------
# Name: etg/sizer.py
# Author: Kevin Ollivier
#
# Created: 26-Aug-2011
# Copyright: (c) 2011 by Wide Open Technologies
# License: wxWindows License
#---------------------------------------------------------------------------
import etgtools
import etgtools.tweaker_tools as tools
PACKAGE = "wx"
MODULE = "_core"
NAME = "sizer" # 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 = [ 'wxBoxSizer',
'wxFlexGridSizer',
'wxGridSizer',
'wxSizer',
'wxSizerFlags',
'wxSizerItem',
'wxStdDialogButtonSizer',
]
#---------------------------------------------------------------------------
def run():
# Parse the XML file(s) building a collection of Extractor objects
module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING)
etgtools.parseDoxyXML(module, ITEMS)
c = module.find('wxSizer')
for func in c.findAll('Add') + c.findAll('Insert') + c.findAll('Prepend'):
sizer = func.findItem('sizer')
if sizer:
sizer.transfer = True
c.find('GetChildren').overloads = []
# Needs wxWin 2.6 compatibility to run
c.find('Remove').findOverload('(wxWindow *window)').ignore()
c = module.find('wxSizerItem')
gud = c.find('GetUserData')
gud.type = 'wxPyUserData*'
gud.setCppCode('sipRes = dynamic_cast<wxPyUserData*>(sipCpp->GetUserData());')
sud = c.find('SetUserData')
sud.find('userData').transfer = True
sud.find('userData').type = 'wxPyUserData*'
sud.setCppCode('sipCpp->SetUserData(dynamic_cast<wxObject*>(userData));')
c.addPrivateCopyCtor()
c = module.find('wxFlexGridSizer')
c.addPrivateCopyCtor()
c = module.find('wxStdDialogButtonSizer')
c.addPrivateCopyCtor()
c.addPrivateAssignOp()
module.addPyCode("PySizer = wx.deprecated(Sizer)")
module.addItem(tools.wxListWrapperTemplate('wxSizerItemList', 'wxSizerItem'))
#-----------------------------------------------------------------
# Tweak the parsed meta objects in the module object as needed for
# customizing the generated code and docstrings.
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addGetterSetterProps(module)
tools.runGenerators(module)
#---------------------------------------------------------------------------
if __name__ == '__main__':
run()