]>
Commit | Line | Data |
---|---|---|
1 | ||
2 | from wxPython.wx import * | |
3 | ||
4 | import ColorPanel | |
5 | import wxGrid | |
6 | import wxListCtrl | |
7 | import wxScrolledWindow | |
8 | ||
9 | #---------------------------------------------------------------------------- | |
10 | ||
11 | class 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 | ||
65 | def 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 | ||
82 | overview = """\ | |
83 | This class represents a notebook control, which manages multiple windows with associated tabs. | |
84 | ||
85 | To 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 | """ |