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