home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 June / maximum-cd-2009-06.iso / DiscContents / digsby_setup.exe / lib / gui / uberwidgets / uberbook / page.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-02-26  |  3.7 KB  |  99 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. import wx
  5. from util import do
  6. from cgui import SimplePanel
  7. from logging import getLogger
  8. log = getLogger('uberbook.page')
  9.  
  10. class Page(SimplePanel):
  11.     
  12.     def __init__(self, parent, panel, size = wx.DefaultSize):
  13.         SimplePanel.__init__(self, parent)
  14.         self.Show(False)
  15.         (do,)((lambda .0: for event, method in .0:
  16. self.Bind(event, method))(((wx.EVT_CLOSE, self.OnClose),)))
  17.         panel.Reparent(self)
  18.         self.Sizer = wx.BoxSizer(wx.VERTICAL)
  19.         self.Sizer.Add(panel, 1, wx.EXPAND)
  20.         self.panel = panel
  21.         self.name = getattr(panel, 'name', getattr(panel, 'Title', u''))
  22.         skin = skin
  23.         import gui
  24.         self.icon = skin.get('BuddiesPanel.BuddyIcons.NoIcon').WXB
  25.         self.nicon = None
  26.         self.notified = False
  27.         self.tab = None
  28.         panel.update_icon()
  29.         panel.update_title()
  30.  
  31.     
  32.     def Reparent(self, newparent):
  33.         SimplePanel.Reparent(self, newparent)
  34.         self.panel.OnTopChanged()
  35.  
  36.     
  37.     def Content(self):
  38.         return self.Children[0]
  39.  
  40.     Content = property(Content)
  41.     
  42.     def SetIcon(self, icon):
  43.         self.icon = icon
  44.         tab = self.tab
  45.         if tab:
  46.             if tab.IsShownOnScreen():
  47.                 tab.Refresh()
  48.             
  49.             if tab.active:
  50.                 self.Top.SetFrameIcon(self.icon)
  51.             
  52.         
  53.  
  54.     
  55.     def SetTitle(self, title, window_title = None):
  56.         self.title = title
  57.         self.window_title = window_title
  58.         log.info('%r.SetTitle(%r, %r)', self, title, window_title)
  59.         tab = self.tab
  60.         if tab:
  61.             log.info('setting title for tab to %r', title)
  62.             tab.SetLabel(title)
  63.             win_title = None if window_title is not None else title
  64.             if tab.active:
  65.                 if self.Top.titletimer.IsRunning():
  66.                     self.Top.titletimer.title = win_title
  67.                 else:
  68.                     self.Top.SetTitle(win_title)
  69.             
  70.         
  71.  
  72.     
  73.     def GetIcon(self):
  74.         return self.icon
  75.  
  76.     Icon = property(GetIcon)
  77.     
  78.     def Display(self):
  79.         self.Parent.active = self
  80.         self.panel.SetFocus()
  81.  
  82.     
  83.     def Hide(self):
  84.         self.tab.active = False
  85.         self.Show(False)
  86.  
  87.     
  88.     def OnClose(self, event):
  89.         if hasattr(self.Children[0], 'on_close'):
  90.             self.Children[0].on_close()
  91.         
  92.         self.Destroy()
  93.  
  94.     
  95.     def __repr__(self):
  96.         return '<Page with %r>' % self.GetChildren()
  97.  
  98.  
  99.