mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-04 19:10:09 +01:00
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:
1
TODO.txt
1
TODO.txt
@@ -137,7 +137,6 @@ other dev stuff
|
||||
|
||||
* taskbar
|
||||
* print (as in print framework classes)
|
||||
* mdi (die mdi! die!)
|
||||
* cshelp
|
||||
* dragimag
|
||||
* datectrl
|
||||
|
||||
@@ -168,6 +168,7 @@ INCLUDES = [ # core
|
||||
'colordlg',
|
||||
'choicdlg',
|
||||
'fdrepdlg',
|
||||
'mdi',
|
||||
|
||||
# misc
|
||||
'utils',
|
||||
|
||||
64
etg/mdi.py
Normal file
64
etg/mdi.py
Normal 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
40
unittests/test_mdi.py
Normal 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()
|
||||
Reference in New Issue
Block a user