Add MDI windows

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71107 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2012-04-05 19:01:25 +00:00
parent 7b1a32fd70
commit b73709d7be
4 changed files with 105 additions and 1 deletions

View File

@@ -137,7 +137,6 @@ other dev stuff
* taskbar
* print (as in print framework classes)
* mdi (die mdi! die!)
* cshelp
* dragimag
* datectrl

View File

@@ -168,6 +168,7 @@ INCLUDES = [ # core
'colordlg',
'choicdlg',
'fdrepdlg',
'mdi',
# misc
'utils',

64
etg/mdi.py Normal file
View File

@@ -0,0 +1,64 @@
#---------------------------------------------------------------------------
# Name: etg/mdi.py
# Author: Robin Dunn
#
# Created: 05-Apr-2012
# Copyright: (c) 2012 by Total Control Software
# License: wxWindows License
#---------------------------------------------------------------------------
import etgtools
import etgtools.tweaker_tools as tools
PACKAGE = "wx"
MODULE = "_core"
NAME = "mdi" # 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 = [ "wxMDIClientWindow",
"wxMDIParentFrame",
"wxMDIChildFrame",
]
#---------------------------------------------------------------------------
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('wxMDIClientWindow')
assert isinstance(c, etgtools.ClassDef)
tools.fixWindowClass(c)
c.find('CreateClient').isVirtual = True
c = module.find('wxMDIParentFrame')
tools.fixTopLevelWindowClass(c)
c.find('OnCreateClient').isVirtual = True
m = c.find('GetClientWindow')
assert isinstance(m, etgtools.MethodDef)
m.type = 'wxMDIClientWindow *'
m.setCppCode("return static_cast<wxMDIClientWindow*>(self->GetClientWindow());")
c = module.find('wxMDIChildFrame')
tools.fixTopLevelWindowClass(c)
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)
#---------------------------------------------------------------------------
if __name__ == '__main__':
run()

40
unittests/test_mdi.py Normal file
View File

@@ -0,0 +1,40 @@
import imp_unittest, unittest
import wtc
import wx
#---------------------------------------------------------------------------
class mdi_Tests(wtc.WidgetTestCase):
def test_mdiParentFrame1(self):
f = wx.MDIParentFrame(None, title="MDI Parent")
f.Close()
def test_mdiParentFrame2(self):
f = wx.MDIParentFrame()
f.Create(None, title="MDI Parent")
f.Close()
def test_mdiClientWindow(self):
f = wx.MDIParentFrame(None, title="MDI Parent")
cw = f.GetClientWindow()
self.assertTrue(isinstance(cw, wx.MDIClientWindow))
f.Close()
def test_mdiChildFrame1(self):
f = wx.MDIParentFrame(None, title="MDI Parent")
c = wx.MDIChildFrame(f, title="MDI Child")
f.Close()
def test_mdiChildFrame2(self):
f = wx.MDIParentFrame(None, title="MDI Parent")
c = wx.MDIChildFrame()
c.Create(f, title="MDI Child")
f.Close()
#---------------------------------------------------------------------------
if __name__ == '__main__':
unittest.main()