1999-04-29 23:29:54 -04:00
|
|
|
|
|
|
|
from wxPython.wx import *
|
1999-10-06 02:22:25 -04:00
|
|
|
|
1999-04-29 23:29:54 -04:00
|
|
|
import ColorPanel
|
2000-07-15 15:51:35 -04:00
|
|
|
import GridSimple
|
1999-10-06 02:22:25 -04:00
|
|
|
import wxListCtrl
|
|
|
|
import wxScrolledWindow
|
1999-04-29 23:29:54 -04:00
|
|
|
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
|
2000-01-31 16:07:04 -05:00
|
|
|
class TestNB(wxNotebook):
|
|
|
|
def __init__(self, parent, id, log):
|
|
|
|
wxNotebook.__init__(self, parent, id, style=wxNB_BOTTOM)
|
|
|
|
self.log = log
|
1999-04-29 23:29:54 -04:00
|
|
|
|
2000-01-31 16:07:04 -05:00
|
|
|
win = ColorPanel.ColoredPanel(self, wxBLUE)
|
|
|
|
self.AddPage(win, "Blue")
|
|
|
|
st = wxStaticText(win, -1,
|
|
|
|
"You can put nearly any type of window here,\n"
|
|
|
|
"and the tabs can be on any side... (look below.)",
|
|
|
|
wxPoint(10, 10))
|
|
|
|
st.SetForegroundColour(wxWHITE)
|
|
|
|
st.SetBackgroundColour(wxBLUE)
|
1999-04-29 23:29:54 -04:00
|
|
|
|
2000-01-31 16:07:04 -05:00
|
|
|
win = ColorPanel.ColoredPanel(self, wxRED)
|
|
|
|
self.AddPage(win, "Red")
|
1999-04-29 23:29:54 -04:00
|
|
|
|
2000-01-31 16:07:04 -05:00
|
|
|
win = wxScrolledWindow.MyCanvas(self)
|
|
|
|
self.AddPage(win, 'ScrolledWindow')
|
1999-04-29 23:29:54 -04:00
|
|
|
|
2000-01-31 16:07:04 -05:00
|
|
|
win = ColorPanel.ColoredPanel(self, wxGREEN)
|
|
|
|
self.AddPage(win, "Green")
|
1999-10-06 02:22:25 -04:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
win = GridSimple.SimpleGrid(self, log)
|
2000-01-31 16:07:04 -05:00
|
|
|
self.AddPage(win, "Grid")
|
1999-04-29 23:29:54 -04:00
|
|
|
|
2000-01-31 16:07:04 -05:00
|
|
|
win = wxListCtrl.TestListCtrlPanel(self, log)
|
|
|
|
self.AddPage(win, 'List')
|
1999-10-06 02:22:25 -04:00
|
|
|
|
2000-01-31 16:07:04 -05:00
|
|
|
win = ColorPanel.ColoredPanel(self, wxCYAN)
|
|
|
|
self.AddPage(win, "Cyan")
|
1999-10-06 02:22:25 -04:00
|
|
|
|
2000-01-31 16:07:04 -05:00
|
|
|
win = ColorPanel.ColoredPanel(self, wxWHITE)
|
|
|
|
self.AddPage(win, "White")
|
1999-04-29 23:29:54 -04:00
|
|
|
|
2000-01-31 16:07:04 -05:00
|
|
|
win = ColorPanel.ColoredPanel(self, wxBLACK)
|
|
|
|
self.AddPage(win, "Black")
|
1999-04-29 23:29:54 -04:00
|
|
|
|
2000-01-31 16:07:04 -05:00
|
|
|
win = ColorPanel.ColoredPanel(self, wxNamedColour('MIDNIGHT BLUE'))
|
|
|
|
self.AddPage(win, "MIDNIGHT BLUE")
|
1999-04-29 23:29:54 -04:00
|
|
|
|
2000-01-31 16:07:04 -05:00
|
|
|
win = ColorPanel.ColoredPanel(self, wxNamedColour('INDIAN RED'))
|
|
|
|
self.AddPage(win, "INDIAN RED")
|
1999-04-29 23:29:54 -04:00
|
|
|
|
2000-01-31 16:07:04 -05:00
|
|
|
EVT_NOTEBOOK_PAGE_CHANGED(self, self.GetId(), self.OnPageChanged)
|
1999-04-29 23:29:54 -04:00
|
|
|
|
|
|
|
|
2000-01-31 16:07:04 -05:00
|
|
|
def OnPageChanged(self, event):
|
|
|
|
self.log.write('OnPageChanged\n')
|
|
|
|
event.Skip()
|
1999-04-29 23:29:54 -04:00
|
|
|
|
|
|
|
|
2000-01-31 16:07:04 -05:00
|
|
|
#----------------------------------------------------------------------------
|
1999-04-29 23:29:54 -04:00
|
|
|
|
2000-01-31 16:07:04 -05:00
|
|
|
def runTest(frame, nb, log):
|
|
|
|
testWin = TestNB(nb, -1, log)
|
|
|
|
return testWin
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------
|
1999-04-29 23:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
overview = """\
|
|
|
|
This class represents a notebook control, which manages multiple windows with associated tabs.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
"""
|