]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/demo/wxNotebook.py
Fixes to avoid an endless event looping for wxGTK
[wxWidgets.git] / utils / wxPython / demo / wxNotebook.py
1
2 from wxPython.wx import *
3
4 import ColorPanel
5 import wxGrid
6 import wxListCtrl
7 import wxScrolledWindow
8
9 #----------------------------------------------------------------------------
10
11 def runTest(frame, nb, log):
12
13 testWin = wxNotebook(nb, -1, style=wxNB_BOTTOM)
14
15 win = ColorPanel.ColoredPanel(testWin, wxBLUE)
16 testWin.AddPage(win, "Blue")
17 st = wxStaticText(win, -1,
18 "You can put nearly any type of window here,\n"
19 "and the tabs can be on any side... (look below.)",
20 wxPoint(10, 10))
21 st.SetForegroundColour(wxWHITE)
22 st.SetBackgroundColour(wxBLUE)
23
24 win = ColorPanel.ColoredPanel(testWin, wxRED)
25 testWin.AddPage(win, "Red")
26
27 win = wxScrolledWindow.MyCanvas(testWin)
28 testWin.AddPage(win, 'ScrolledWindow')
29
30 win = ColorPanel.ColoredPanel(testWin, wxGREEN)
31 testWin.AddPage(win, "Green")
32
33 win = wxGrid.TestGrid(testWin, log)
34 testWin.AddPage(win, "Grid")
35
36 win = wxListCtrl.TestListCtrlPanel(testWin, log)
37 testWin.AddPage(win, 'List')
38
39 win = ColorPanel.ColoredPanel(testWin, wxCYAN)
40 testWin.AddPage(win, "Cyan")
41
42 win = ColorPanel.ColoredPanel(testWin, wxWHITE)
43 testWin.AddPage(win, "White")
44
45 win = ColorPanel.ColoredPanel(testWin, wxBLACK)
46 testWin.AddPage(win, "Black")
47
48 win = ColorPanel.ColoredPanel(testWin, wxNamedColour('MIDNIGHT BLUE'))
49 testWin.AddPage(win, "MIDNIGHT BLUE")
50
51 win = ColorPanel.ColoredPanel(testWin, wxNamedColour('INDIAN RED'))
52 testWin.AddPage(win, "INDIAN RED")
53
54 return testWin
55
56 #----------------------------------------------------------------------------
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72 overview = """\
73 This class represents a notebook control, which manages multiple windows with associated tabs.
74
75 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.
76
77 wxNotebook()
78 -------------------------
79
80 Default constructor.
81
82 wxNotebook(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size, long style = 0, const wxString& name = "notebook")
83
84 Constructs a notebook control.
85
86 Parameters
87 -------------------
88
89 parent = The parent window. Must be non-NULL.
90
91 id = The window identifier.
92
93 pos = The window position.
94
95 size = The window size.
96
97 style = The window style. Its value is a bit list of zero or more of wxTC_MULTILINE, wxTC_RIGHTJUSTIFY, wxTC_FIXEDWIDTH and wxTC_OWNERDRAW.
98 """