X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/510bb7480c5138dd5127ed3d8b1d9cbab39983c9..1f780e48af479e7bf9a07eaaa1ab6b41f1ffb17b:/wxPython/samples/ide/activegrid/tool/TabbedView.py diff --git a/wxPython/samples/ide/activegrid/tool/TabbedView.py b/wxPython/samples/ide/activegrid/tool/TabbedView.py new file mode 100644 index 0000000000..6ac51bfbc0 --- /dev/null +++ b/wxPython/samples/ide/activegrid/tool/TabbedView.py @@ -0,0 +1,48 @@ +#---------------------------------------------------------------------------- +# Name: TabbedView.py +# Purpose: +# +# Author: Peter Yared +# +# Created: 8/17/04 +# CVS-ID: $Id$ +# Copyright: (c) 2004-2005 ActiveGrid, Inc. +# License: wxWindows License +#---------------------------------------------------------------------------- + +import wx +import wx.lib.docview + +class TabbedView(dict, wx.lib.docview.View): + + #---------------------------------------------------------------------------- + # Overridden methods + #---------------------------------------------------------------------------- + + def __init__(self): + wx.lib.docview.View.__init__(self) + self._views = {} + self._currentView = None + + + def OnCreate(self, doc, flags): + frame = wx.GetApp().CreateDocumentFrame(self, doc, flags) + sizer = wx.BoxSizer() + self._notebook = wx.Notebook(frame, -1, style = wx.NB_BOTTOM) + self.Activate() + return True + + + def AddView(self, viewName, view): + self._notebook.AddPage(wx.Panel(self._notebook, -1), viewName) + self._currentView = view + self._views[viewName] = view + + + def __getattr__(self, attrname): + return getattr(self._currentView, attrname) + + + def SetView(self, viewName): + self._currentview = self._views[viewName] +