home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 October / maximum-cd-2011-10.iso / DiscContents / digsby_setup.exe / lib / gui / uberwidgets / uberbook / page.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2011-06-22  |  3.8 KB  |  100 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.6)
  3.  
  4. import wx
  5. from util.primitives.funcs 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.  
  35.     
  36.     def Content(self):
  37.         return self.Children[0]
  38.  
  39.     Content = property(Content)
  40.     
  41.     def Notebook(self):
  42.         return self.GrandParent
  43.  
  44.     Notebook = property(Notebook)
  45.     
  46.     def SetIcon(self, icon):
  47.         self.icon = icon
  48.         self.Notebook.did_seticon(self.Content, icon)
  49.         tab = self.tab
  50.         if tab:
  51.             if tab.IsShownOnScreen():
  52.                 tab.Refresh()
  53.             
  54.             if tab.active and self.icon is not None:
  55.                 self.Top.SetFrameIcon(self.icon)
  56.             
  57.         
  58.  
  59.     
  60.     def SetTitle(self, title, window_title = None):
  61.         self.title = title
  62.         self.window_title = window_title
  63.         log.info('%r.SetTitle(%r, %r)', self, title, window_title)
  64.         if not window_title:
  65.             pass
  66.         self.Notebook.did_settitle(self.Content, title)
  67.         tab = self.tab
  68.         if tab:
  69.             log.info('setting title for tab to %r', title)
  70.             tab.SetLabel(title)
  71.         
  72.  
  73.     
  74.     def GetIcon(self):
  75.         return self.icon
  76.  
  77.     Icon = property(GetIcon)
  78.     
  79.     def Display(self):
  80.         self.Parent.active = self
  81.         self.panel.SetFocus()
  82.  
  83.     
  84.     def Hide(self):
  85.         self.tab.active = False
  86.         self.Show(False)
  87.  
  88.     
  89.     def OnClose(self, event):
  90.         if hasattr(self.Children[0], 'on_close'):
  91.             self.Children[0].on_close()
  92.         
  93.         self.Destroy()
  94.  
  95.     
  96.     def __repr__(self):
  97.         return '<Page with %r>' % self.GetChildren()
  98.  
  99.  
  100.