]> git.saurik.com Git - wxWidgets.git/blame - utils/wxPython/demo/wxNotebook.py
Fixes to avoid an endless event looping for wxGTK
[wxWidgets.git] / utils / wxPython / demo / wxNotebook.py
CommitLineData
cf694132
RD
1
2from wxPython.wx import *
f0261a72 3
cf694132 4import ColorPanel
f0261a72
RD
5import wxGrid
6import wxListCtrl
7import wxScrolledWindow
cf694132
RD
8
9#----------------------------------------------------------------------------
10
11def runTest(frame, nb, log):
12
f0261a72 13 testWin = wxNotebook(nb, -1, style=wxNB_BOTTOM)
cf694132
RD
14
15 win = ColorPanel.ColoredPanel(testWin, wxBLUE)
16 testWin.AddPage(win, "Blue")
17 st = wxStaticText(win, -1,
f0261a72
RD
18 "You can put nearly any type of window here,\n"
19 "and the tabs can be on any side... (look below.)",
cf694132
RD
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
f0261a72
RD
27 win = wxScrolledWindow.MyCanvas(testWin)
28 testWin.AddPage(win, 'ScrolledWindow')
29
cf694132
RD
30 win = ColorPanel.ColoredPanel(testWin, wxGREEN)
31 testWin.AddPage(win, "Green")
32
f0261a72
RD
33 win = wxGrid.TestGrid(testWin, log)
34 testWin.AddPage(win, "Grid")
35
36 win = wxListCtrl.TestListCtrlPanel(testWin, log)
37 testWin.AddPage(win, 'List')
38
cf694132
RD
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
72overview = """\
73This class represents a notebook control, which manages multiple windows with associated tabs.
74
75To 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
77wxNotebook()
78-------------------------
79
80Default constructor.
81
82wxNotebook(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size, long style = 0, const wxString& name = "notebook")
83
84Constructs a notebook control.
85
86Parameters
87-------------------
88
89parent = The parent window. Must be non-NULL.
90
91id = The window identifier.
92
93pos = The window position.
94
95size = The window size.
96
97style = The window style. Its value is a bit list of zero or more of wxTC_MULTILINE, wxTC_RIGHTJUSTIFY, wxTC_FIXEDWIDTH and wxTC_OWNERDRAW.
98"""