2002-04-18 01:43:08 -04:00
|
|
|
|
2003-12-08 20:23:28 -05:00
|
|
|
import wx
|
2005-12-30 18:02:03 -05:00
|
|
|
import os
|
|
|
|
import sys
|
2002-04-18 01:43:08 -04:00
|
|
|
|
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
2003-12-08 20:23:28 -05:00
|
|
|
class TestPanel(wx.Panel):
|
2002-04-18 01:43:08 -04:00
|
|
|
def __init__(self, parent, log):
|
|
|
|
self.log = log
|
2003-12-08 20:23:28 -05:00
|
|
|
wx.Panel.__init__(self, parent, -1)
|
2002-04-18 01:43:08 -04:00
|
|
|
|
2003-12-08 20:23:28 -05:00
|
|
|
b1 = wx.Button(self, -1, "MDI demo")
|
|
|
|
self.Bind(wx.EVT_BUTTON, self.ShowMDIDemo, b1)
|
2002-04-18 01:43:08 -04:00
|
|
|
|
2003-12-08 20:23:28 -05:00
|
|
|
b2 = wx.Button(self, -1, "MDI with SashWindows demo")
|
2003-12-29 20:06:02 -05:00
|
|
|
self.Bind(wx.EVT_BUTTON, self.ShowMDISashDemo, b2)
|
2002-04-18 01:43:08 -04:00
|
|
|
|
2003-12-08 20:23:28 -05:00
|
|
|
box = wx.BoxSizer(wx.VERTICAL)
|
2003-11-12 16:34:20 -05:00
|
|
|
box.Add((20, 30))
|
2003-12-08 20:23:28 -05:00
|
|
|
box.Add(b1, 0, wx.ALIGN_CENTER|wx.ALL, 15)
|
|
|
|
box.Add(b2, 0, wx.ALIGN_CENTER|wx.ALL, 15)
|
2003-03-25 01:35:27 -05:00
|
|
|
self.SetAutoLayout(True)
|
2002-04-18 01:43:08 -04:00
|
|
|
self.SetSizer(box)
|
|
|
|
|
|
|
|
|
2005-12-30 18:02:03 -05:00
|
|
|
# These are spawned as new processes because on Mac there can be
|
|
|
|
# some problems related to having regular frames and MDI frames in
|
|
|
|
# the same app.
|
2002-04-18 01:43:08 -04:00
|
|
|
def ShowMDIDemo(self, evt):
|
2005-12-30 18:02:03 -05:00
|
|
|
os.spawnl(os.P_NOWAIT, sys.executable, sys.executable, "MDIDemo.py")
|
2002-04-18 01:43:08 -04:00
|
|
|
|
|
|
|
def ShowMDISashDemo(self, evt):
|
2005-12-30 18:02:03 -05:00
|
|
|
os.spawnl(os.P_NOWAIT, sys.executable, sys.executable, "MDISashDemo.py")
|
2002-04-18 01:43:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
|
|
|
def runTest(frame, nb, log):
|
|
|
|
win = TestPanel(nb, log)
|
|
|
|
return win
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
overview = """<html><body>
|
|
|
|
<h2><center>Multiple Document Interface</center></h2>
|
|
|
|
|
|
|
|
Although Microsoft has deprecated the MDI model, wxWindows still supports
|
2003-12-08 20:23:28 -05:00
|
|
|
it. Here are a couple samples of how to use it - one straightforward, the other
|
|
|
|
showing how the MDI interface can be integrated into a SashWindow interface.
|
2002-04-18 01:43:08 -04:00
|
|
|
|
|
|
|
</body></html>
|
|
|
|
"""
|
2003-07-02 19:13:10 -04:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
import sys,os
|
|
|
|
import run
|
2004-03-04 19:06:33 -05:00
|
|
|
run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
|