]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxMultiSash.py
1 # 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net)
3 # o Updated for wx namespace
5 # 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net)
7 # o wx renamer needs to be applied to multisash lib.
8 # o There appears to be a problem with the image that
9 # the library is trying to use for the alternate cursor
11 # 12/09/2003 - Jeff Grimmett (grimmtooth@softhome.net)
13 # o renamer issue shelved.
15 # 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net)
17 # o wxMultiSash -> MultiSash
21 import wx
.lib
.multisash
as sash
24 #---------------------------------------------------------------------------
27 You can drag the little tab on the vertical sash left to create another view,
28 or you can drag the tab on the horizontal sash to the top to create another
31 The red blocks on the sashes will destroy the view (bottom,left) this block
34 A yellow rectangle also highlights the current selected view.
36 By calling GetSaveData on the multiSash control the control will return its
37 contents and the positions of each sash as a dictionary.
38 Calling SetSaveData with such a dictionary will restore the control to the
39 state it was in when it was saved.
41 If the class, that is used as a view, has GetSaveData/SetSaveData implemented,
42 these will also be called to save/restore their state. Any object can be
43 returned by GetSaveData, as it is just another object in the dictionary.
46 #---------------------------------------------------------------------------
48 class TestWindow(stc
.StyledTextCtrl
):
50 # shared document reference
53 def __init__(self
, parent
):
54 stc
.StyledTextCtrl
.__init
__(self
, parent
, -1, style
=wx
.NO_BORDER
)
55 self
.SetMarginWidth(1,0)
57 if wx
.Platform
== '__WXMSW__':
63 stc
.STC_STYLE_DEFAULT
,
64 wx
.Font(fSize
, wx
.MODERN
, wx
.NORMAL
, wx
.NORMAL
)
68 self
.SetDocPointer(self
.doc
)
70 self
.SetText(sampleText
)
71 TestWindow
.doc
= self
.GetDocPointer()
74 def SutdownDemo(self
):
75 # Reset doc reference in case this demo is run again
79 #---------------------------------------------------------------------------
82 def runTest(frame
, nb
, log
):
83 multi
= sash
.MultiSash(nb
, -1, pos
= (0,0), size
= (640,480))
85 # Use this method to set the default class that will be created when
86 # a new sash is created. The class's constructor needs 1 parameter
87 # which is the parent of the window
88 multi
.SetDefaultChildClass(TestWindow
)
92 #----------------------------------------------------------------------
96 overview
= """<html><body>
97 <h2><center>MultiSash</center></h2>
99 MultiSash allows the user to split a window any number of times
100 either horizontally or vertically, and to close the split off windows
108 if __name__
== '__main__':
111 run
.main(['', os
.path
.basename(sys
.argv
[0])])