home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.6)
-
- import wx
- from util.primitives.funcs import do
- from cgui import SimplePanel
- from logging import getLogger
- log = getLogger('uberbook.page')
-
- class Page(SimplePanel):
-
- def __init__(self, parent, panel, size = wx.DefaultSize):
- SimplePanel.__init__(self, parent)
- self.Show(False)
- (do,)((lambda .0: for event, method in .0:
- self.Bind(event, method))(((wx.EVT_CLOSE, self.OnClose),)))
- panel.Reparent(self)
- self.Sizer = wx.BoxSizer(wx.VERTICAL)
- self.Sizer.Add(panel, 1, wx.EXPAND)
- self.panel = panel
- self.name = getattr(panel, 'name', getattr(panel, 'Title', u''))
- skin = skin
- import gui
- self.icon = skin.get('BuddiesPanel.BuddyIcons.NoIcon').WXB
- self.nicon = None
- self.notified = False
- self.tab = None
- panel.update_icon()
- panel.update_title()
-
-
- def Reparent(self, newparent):
- SimplePanel.Reparent(self, newparent)
-
-
- def Content(self):
- return self.Children[0]
-
- Content = property(Content)
-
- def Notebook(self):
- return self.GrandParent
-
- Notebook = property(Notebook)
-
- def SetIcon(self, icon):
- self.icon = icon
- self.Notebook.did_seticon(self.Content, icon)
- tab = self.tab
- if tab:
- if tab.IsShownOnScreen():
- tab.Refresh()
-
- if tab.active and self.icon is not None:
- self.Top.SetFrameIcon(self.icon)
-
-
-
-
- def SetTitle(self, title, window_title = None):
- self.title = title
- self.window_title = window_title
- log.info('%r.SetTitle(%r, %r)', self, title, window_title)
- if not window_title:
- pass
- self.Notebook.did_settitle(self.Content, title)
- tab = self.tab
- if tab:
- log.info('setting title for tab to %r', title)
- tab.SetLabel(title)
-
-
-
- def GetIcon(self):
- return self.icon
-
- Icon = property(GetIcon)
-
- def Display(self):
- self.Parent.active = self
- self.panel.SetFocus()
-
-
- def Hide(self):
- self.tab.active = False
- self.Show(False)
-
-
- def OnClose(self, event):
- if hasattr(self.Children[0], 'on_close'):
- self.Children[0].on_close()
-
- self.Destroy()
-
-
- def __repr__(self):
- return '<Page with %r>' % self.GetChildren()
-
-
-