Add statbox and wrapsizer

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@69622 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2011-10-31 23:42:26 +00:00
parent 88e378b612
commit 87d042dac9
5 changed files with 143 additions and 0 deletions

View File

@@ -78,6 +78,7 @@ INCLUDES = [ 'defs',
'process',
'utils',
'sizer',
'wrapsizer',
'evtloop',
'apptrait',
@@ -103,6 +104,7 @@ INCLUDES = [ 'defs',
# controls
'statbmp',
'stattext',
'statbox',
'control',
'ctrlsub',
'choice',

49
etg/statbox.py Normal file
View File

@@ -0,0 +1,49 @@
#---------------------------------------------------------------------------
# Name: etg/statbox.py
# Author: Robin Dunn
#
# Created: 29-Oct-2011
# Copyright: (c) 2011 by Total Control Software
# License: wxWindows License
#---------------------------------------------------------------------------
import etgtools
import etgtools.tweaker_tools as tools
PACKAGE = "wx"
MODULE = "_core"
NAME = "statbox" # 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 = [ "wxStaticBox",
]
#---------------------------------------------------------------------------
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.
c = module.find('wxStaticBox')
assert isinstance(c, etgtools.ClassDef)
c.find('wxStaticBox.label').default = 'wxEmptyString'
c.find('Create.label').default = 'wxEmptyString'
tools.fixWindowClass(c)
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)
#---------------------------------------------------------------------------
if __name__ == '__main__':
run()

51
etg/wrapsizer.py Normal file
View File

@@ -0,0 +1,51 @@
#---------------------------------------------------------------------------
# Name: etg/wrapsizer.py
# Author: Robin Dunn
#
# Created: 29-Oct-2011
# Copyright: (c) 2011 by Total Control Software
# License: wxWindows License
#---------------------------------------------------------------------------
import etgtools
import etgtools.tweaker_tools as tools
PACKAGE = "wx"
MODULE = "_core"
NAME = "wrapsizer" # 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 = [ "wxWrapSizer",
]
#---------------------------------------------------------------------------
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.
c = module.find('wxWrapSizer')
assert isinstance(c, etgtools.ClassDef)
tools.fixSizerClass(c)
c.find('IsSpaceItem').ignore(False)
c.find('IsSpaceItem').isVirtual = True
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)
#---------------------------------------------------------------------------
if __name__ == '__main__':
run()

21
unittests/test_statbox.py Normal file
View File

@@ -0,0 +1,21 @@
import imp_unittest, unittest
import wtc
import wx
#---------------------------------------------------------------------------
class statbox_Tests(wtc.WidgetTestCase):
def test_statboxCtor(self):
s = wx.StaticBox(self.frame, label='StaticBox')
def test_statboxDefaultCtor(self):
s = wx.StaticBox()
s.Create(self.frame, label='StaticBox')
#---------------------------------------------------------------------------
if __name__ == '__main__':
unittest.main()

View File

@@ -0,0 +1,20 @@
import imp_unittest, unittest
import wtc
import wx
#---------------------------------------------------------------------------
class wrapsizer_Tests(wtc.WidgetTestCase):
def test_wrapsize(self):
ws = wx.WrapSizer()
ws.Add(wx.Panel(self.frame))
ws.Add(wx.Panel(self.frame))
ws.Add(wx.Panel(self.frame))
#---------------------------------------------------------------------------
if __name__ == '__main__':
unittest.main()