]> git.saurik.com Git - wxWidgets.git/blame_incremental - utils/wxPython/demo/wxNotebook.py
wxHandleFatalExceptions() added, documented
[wxWidgets.git] / utils / wxPython / demo / wxNotebook.py
... / ...
CommitLineData
1
2from wxPython.wx import *
3
4import ColorPanel
5import wxGrid
6import wxListCtrl
7import wxScrolledWindow
8
9#----------------------------------------------------------------------------
10
11class TestNB(wxNotebook):
12 def __init__(self, parent, id, log):
13 wxNotebook.__init__(self, parent, id, style=wxNB_BOTTOM)
14 self.log = log
15
16 win = ColorPanel.ColoredPanel(self, wxBLUE)
17 self.AddPage(win, "Blue")
18 st = wxStaticText(win, -1,
19 "You can put nearly any type of window here,\n"
20 "and the tabs can be on any side... (look below.)",
21 wxPoint(10, 10))
22 st.SetForegroundColour(wxWHITE)
23 st.SetBackgroundColour(wxBLUE)
24
25 win = ColorPanel.ColoredPanel(self, wxRED)
26 self.AddPage(win, "Red")
27
28 win = wxScrolledWindow.MyCanvas(self)
29 self.AddPage(win, 'ScrolledWindow')
30
31 win = ColorPanel.ColoredPanel(self, wxGREEN)
32 self.AddPage(win, "Green")
33
34 win = wxGrid.TestGrid(self, log)
35 self.AddPage(win, "Grid")
36
37 win = wxListCtrl.TestListCtrlPanel(self, log)
38 self.AddPage(win, 'List')
39
40 win = ColorPanel.ColoredPanel(self, wxCYAN)
41 self.AddPage(win, "Cyan")
42
43 win = ColorPanel.ColoredPanel(self, wxWHITE)
44 self.AddPage(win, "White")
45
46 win = ColorPanel.ColoredPanel(self, wxBLACK)
47 self.AddPage(win, "Black")
48
49 win = ColorPanel.ColoredPanel(self, wxNamedColour('MIDNIGHT BLUE'))
50 self.AddPage(win, "MIDNIGHT BLUE")
51
52 win = ColorPanel.ColoredPanel(self, wxNamedColour('INDIAN RED'))
53 self.AddPage(win, "INDIAN RED")
54
55 EVT_NOTEBOOK_PAGE_CHANGED(self, self.GetId(), self.OnPageChanged)
56
57
58 def OnPageChanged(self, event):
59 self.log.write('OnPageChanged\n')
60 event.Skip()
61
62
63#----------------------------------------------------------------------------
64
65def runTest(frame, nb, log):
66 testWin = TestNB(nb, -1, log)
67 return testWin
68
69#----------------------------------------------------------------------------
70
71
72
73
74
75
76
77
78
79
80
81
82overview = """\
83This class represents a notebook control, which manages multiple windows with associated tabs.
84
85To use the class, create a wxNotebook object and call AddPage or InsertPage, passing a window to be used as the page. Do not explicitly delete the window for a page that is currently managed by wxNotebook.
86
87"""