]>
Commit | Line | Data |
---|---|---|
1c976bff RD |
1 | |
2 | import wx | |
3 | import wx.aui | |
4 | ||
5 | ||
6 | text = """\ | |
7 | Hello! | |
8 | ||
9 | Welcome to this little demo of draggable tabs using the wx.aui module. | |
10 | ||
11 | To try it out, drag a tab from the top of the window all the way to | |
12 | the bottom. After releasing the mouse, the tab will dock at the | |
13 | hinted position. Then try it again with the remaining tabs in various | |
14 | other positions. Finally, try dragging a tab to an existing tab ctrl. | |
15 | You'll soon see that very complex tab layouts may be achieved. | |
16 | """ | |
17 | ||
18 | #---------------------------------------------------------------------- | |
19 | ||
20 | class TestPanel(wx.Panel): | |
21 | def __init__(self, parent, log): | |
22 | self.log = log | |
23 | wx.Panel.__init__(self, parent, -1) | |
24 | ||
25 | self.nb = wx.aui.AuiMultiNotebook(self) | |
26 | page = wx.TextCtrl(self.nb, -1, text, style=wx.TE_MULTILINE) | |
27 | self.nb.AddPage(page, "Welcome") | |
28 | ||
29 | for num in range(1, 5): | |
30 | page = wx.TextCtrl(self.nb, -1, "This is page %d" % num , | |
31 | style=wx.TE_MULTILINE) | |
32 | self.nb.AddPage(page, "Tab Number %d" % num) | |
33 | ||
34 | sizer = wx.BoxSizer() | |
35 | sizer.Add(self.nb, 1, wx.EXPAND) | |
36 | self.SetSizer(sizer) | |
37 | ||
38 | #---------------------------------------------------------------------- | |
39 | ||
40 | def runTest(frame, nb, log): | |
41 | win = TestPanel(nb, log) | |
42 | return win | |
43 | ||
44 | #---------------------------------------------------------------------- | |
45 | ||
46 | ||
47 | ||
48 | overview = """<html><body> | |
49 | <h2><center>Say something nice here</center></h2> | |
50 | ||
51 | </body></html> | |
52 | """ | |
53 | ||
54 | ||
55 | ||
56 | if __name__ == '__main__': | |
57 | import sys,os | |
58 | import run | |
59 | run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:]) | |
60 |