1#--------------------------------------------------------------------------- 2# Name: etg/layout.py 3# Author: Robin Dunn 4# 5# Created: 30-Nov-2010 6# Copyright: (c) 2010-2018 by Total Control Software 7# License: wxWindows License 8#--------------------------------------------------------------------------- 9 10import etgtools 11import etgtools.tweaker_tools as tools 12 13PACKAGE = "wx" 14MODULE = "_core" 15NAME = "layout" # Base name of the file to generate to for this script 16DOCSTRING = "" 17 18# The classes and/or the basename of the Doxygen XML files to be processed by 19# this script. 20ITEMS = [ 'wxIndividualLayoutConstraint', 21 'wxLayoutConstraints' 22 ] 23 24#--------------------------------------------------------------------------- 25 26def run(): 27 # Parse the XML file(s) building a collection of Extractor objects 28 module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING) 29 etgtools.parseDoxyXML(module, ITEMS) 30 31 #----------------------------------------------------------------- 32 # Tweak the parsed meta objects in the module object as needed for 33 # customizing the generated code and docstrings. 34 35 36 c = module.find('wxIndividualLayoutConstraint') 37 assert isinstance(c, etgtools.ClassDef) 38 39 c.find('GetOtherWindow').setCppCode('return (wxWindow*)self->GetOtherWindow();') 40 41 c.addProperty('Done GetDone SetDone') 42 c.addProperty('Margin GetMargin SetMargin') 43 c.addProperty('MyEdge GetMyEdge') 44 c.addProperty('OtherEdge GetOtherEdge') 45 c.addProperty('OtherWindow GetOtherWindow') 46 c.addProperty('Percent GetPercent') 47 c.addProperty('Relationship GetRelationship SetRelationship') 48 c.addProperty('Value GetValue SetValue') 49 50 51 #----------------------------------------------------------------- 52 tools.doCommonTweaks(module) 53 tools.runGenerators(module) 54 55 56#--------------------------------------------------------------------------- 57if __name__ == '__main__': 58 run() 59 60