home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 February / maximum-cd-2011-02.iso / DiscContents / digsby_setup85.exe / lib / gui / uberwidgets / uberbook / tab.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-11-24  |  20.6 KB  |  588 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.6)
  3.  
  4. import wx
  5. import sys
  6. from util.primitives.funcs import do, Delegate
  7. from util.introspect import debug_property
  8. from common import pref, profile, prefprop
  9. from gui.uberwidgets.UberButton import UberButton
  10. from gui.uberwidgets.UberEvents import TabNotifiedEvent
  11. from gui.textutil import default_font
  12. from gui.windowfx import ApplySmokeAndMirrors
  13. from gui import skin
  14. from gui.skin.skinobjects import Margins
  15. from logging import getLogger
  16. log = getLogger('tab')
  17. from wx import EmptyBitmap, Size, ImageFromBitmap, WHITE_BRUSH, TRANSPARENT_PEN, BitmapFromImage, BLACK, NullBitmap, RectS, ClientDC, MemoryDC, Rect, PaintDC, BufferedPaintDC, GetMousePosition, ALIGN_LEFT, ALIGN_CENTER_VERTICAL, GetTopLevelParent, Mask, Point
  18.  
  19. class MultiTab(object):
  20.     
  21.     def __init__(self, tabs):
  22.         self.tabwidth = max((lambda .0: for tab in .0:
  23. tab.Size.width)(tabs))
  24.         self.tabheight = tabs[0].Size.height
  25.         self.Size = Size(self.tabwidth + 14 * len(tabs), self.tabheight + 14 * len(tabs))
  26.         self.tabs = tabs
  27.  
  28.     
  29.     def OnPaint(self, otherdc, otherwindow):
  30.         size = self.Size
  31.         bitmap = EmptyBitmap(*size)
  32.         mdc = MemoryDC()
  33.         tab = self.tabs[0].states[self.tabs[0].mode][0].GetBitmap(Size(self.tabwidth, self.tabheight))
  34.         tab = ImageFromBitmap(tab)
  35.         tab.ConvertAlphaToMask()
  36.         tab = BitmapFromImage(tab)
  37.         mdc.SelectObject(tab)
  38.         mdc.Brush = WHITE_BRUSH
  39.         mdc.Pen = TRANSPARENT_PEN
  40.         mdc.DrawRectangle(0, 0, self.tabwidth, self.tabheight)
  41.         mdc.SelectObject(bitmap)
  42.         for i, tabobj in enumerate(self.tabs):
  43.             s = 14 * i
  44.             rect = Rect(s, s, self.tabwidth, self.tabheight)
  45.             mdc.DrawBitmap(tab, s, s, True)
  46.             tabobj.OnPaint(forcedrect = rect, otherdc = otherdc)
  47.         
  48.         mdc.SelectObject(NullBitmap)
  49.         bitmap.SetMask(Mask(bitmap, BLACK))
  50.         ApplySmokeAndMirrors(otherwindow, bitmap)
  51.  
  52.  
  53.  
  54. class NotifiedTimer(wx.Timer):
  55.     
  56.     def __init__(self, tab):
  57.         wx.Timer.__init__(self)
  58.         self.drawnotified = False
  59.         self.tab = tab
  60.         self.click = 0
  61.  
  62.     
  63.     def Start(self):
  64.         self.click = 0
  65.         if not self.IsRunning():
  66.             wx.Timer.Start(self, pref('tabs.notify_duration', 1000))
  67.         
  68.  
  69.     
  70.     def Notify(self):
  71.         self.drawnotified = not (self.drawnotified)
  72.         self.RefreshTab()
  73.         self.click += 1
  74.         if self.click >= pref('tabs.notify_count', 10):
  75.             self.drawnotified = True
  76.             wx.Timer.Stop(self)
  77.         
  78.  
  79.     
  80.     def Stop(self):
  81.         self.drawnotified = False
  82.         self.RefreshTab()
  83.         wx.Timer.Stop(self)
  84.  
  85.     
  86.     def RefreshTab(self):
  87.         if not wx.IsDestroyed(self.tab):
  88.             self.tab.Refresh()
  89.         
  90.  
  91.  
  92. from gui.uberwidgets import UberWidget
  93.  
  94. class Tab(wx.Window, UberWidget):
  95.     NORMAL = 0
  96.     ACTIVE = 1
  97.     HOVER = 2
  98.     ACTIVE_HOVER = 3
  99.     NOTIFIED = 4
  100.     
  101.     def __init__(self, parent, page, _id = -1, skinkey = ''):
  102.         wx.Window.__init__(self, parent, id = _id)
  103.         self.Show(False)
  104.         self.events = [
  105.             (wx.EVT_PAINT, self.OnPaint),
  106.             (wx.EVT_ERASE_BACKGROUND, (lambda e: pass)),
  107.             (wx.EVT_ENTER_WINDOW, self.OnMouseEnter),
  108.             (wx.EVT_LEAVE_WINDOW, self.OnMouseLeave),
  109.             (wx.EVT_RIGHT_DOWN, self.OnRightDown),
  110.             (wx.EVT_LEFT_DOWN, self.OnLeftDown),
  111.             (wx.EVT_MIDDLE_UP, self.OnMidUp),
  112.             (wx.EVT_LEFT_UP, self.OnLeftUp),
  113.             (wx.EVT_BUTTON, self.OnButton),
  114.             (wx.EVT_MOTION, self.OnMotion),
  115.             (wx.EVT_CLOSE, self.OnClose),
  116.             (wx.EVT_SIZE, self.OnSize)]
  117.         (do,)((lambda .0: for event, method in .0:
  118. self.Bind(event, method))(self.events))
  119.         if sys.DEV and not isinstance(page.name, unicode):
  120.             msg = ('please only use unicode for labels: %r', page.name)
  121.             if pref('errors.nonunicode_buddy_names', type = bool, default = False):
  122.                 raise TypeError(msg)
  123.             pref('errors.nonunicode_buddy_names', type = bool, default = False)
  124.             log.warning(msg)
  125.         
  126.         self.page = page
  127.         self.page.tab = self
  128.         if sys.DEV and not isinstance(page.title, unicode):
  129.             msg = ('please only use unicode for labels: %r', page.title)
  130.             if pref('errors.nonunicode_buddy_names', type = bool, default = False):
  131.                 raise TypeError(msg)
  132.             pref('errors.nonunicode_buddy_names', type = bool, default = False)
  133.             log.warning(msg)
  134.         
  135.         self.label1 = self.page.title
  136.         self.row = None
  137.         self.notified = page.notified
  138.         self.drawnotified = NotifiedTimer(self)
  139.         self.focus = False
  140.         self.alignment = wx.ALIGN_LEFT
  141.         self._active = False
  142.         self.clickage = False
  143.         self.OnActive = Delegate()
  144.         self.fontcolors = ([
  145.             None] * 5, [
  146.             None] * 5)
  147.         self.states = ([
  148.             None] * 5, [
  149.             None] * 5)
  150.         self.state = 0
  151.         self.mode = pref('tabs.side_tabs', False)
  152.         self.SetSkinKey(skinkey, True)
  153.         self.mark = None
  154.         self.bufferbitmap = None
  155.         self.previewtabs = None
  156.         if self.notified:
  157.             self.drawnotified.Start()
  158.         
  159.         profile.prefs.link('tabs.style', self.OnPrefChange, False)
  160.         profile.prefs.link('tabs.flip', self.OnPrefChange, False)
  161.         profile.prefs.link('tabs.max_width', self.OnPrefChange, False)
  162.  
  163.     
  164.     def OnPrefChange(self, val):
  165.         self.Calcumalate()
  166.  
  167.     
  168.     def UpdateSkin(self):
  169.         key = self.skinkey
  170.         
  171.         s = lambda k, default = sentinel, mode = (0,): skin.get('%s%s.%s' % ('side' * mode, key, k), default)
  172.         self.mode = pref('tabs.side_tabs', False)
  173.         self.maxtabwidth = s('maxwidth', pref('tabs.max_width', 100))
  174.         padd = s('padding', (lambda : Point(0, 0)))
  175.         marg = s('margins', (lambda : Margins([
  176. 0,
  177. 0,
  178. 0,
  179. 0])))
  180.         icsz = s('iconsize', 16)
  181.         font = s('font', (lambda : default_font()))
  182.         spad = s('padding', padd, 1)
  183.         smar = s('margins', marg, 1)
  184.         sico = s('iconsize', icsz, 1)
  185.         sfnt = s('font', font, 1)
  186.         self.padding = (padd, spad)
  187.         self.margins = (marg, smar)
  188.         self.iconsize = (icsz, sico)
  189.         self.font = (font, sfnt)
  190.         states = self.states
  191.         states[0][0] = s('backgrounds.normal')
  192.         states[0][1] = s('backgrounds.active')
  193.         states[0][2] = s('backgrounds.hover', states[0][0])
  194.         states[0][3] = s('backgrounds.activehover', states[0][2])
  195.         states[0][4] = s('backgrounds.notify', states[0][0])
  196.         states[1][0] = s('backgrounds.normal', states[0][0], 1)
  197.         states[1][1] = s('backgrounds.active', states[0][1], 1)
  198.         states[1][2] = s('backgrounds.hover', states[0][2], 1)
  199.         states[1][3] = s('backgrounds.activehover', states[0][3], 1)
  200.         states[1][4] = s('backgrounds.notify', states[0][4], 1)
  201.         fc = self.fontcolors
  202.         fc[0][0] = s('fontcolors.normal', BLACK)
  203.         fc[0][1] = s('fontcolors.active', BLACK)
  204.         fc[0][2] = s('fontcolors.hover', fc[0][0])
  205.         fc[0][3] = s('fontcolors.activehover', fc[0][2])
  206.         fc[0][4] = s('fontcolors.notify', fc[0][0])
  207.         fc[1][0] = s('fontcolors.normal', fc[0][0], 1)
  208.         fc[1][1] = s('fontcolors.active', fc[0][1], 1)
  209.         fc[1][2] = s('fontcolors.hover', fc[1][0], 1)
  210.         fc[1][3] = s('fontcolors.activehover', fc[1][2], 1)
  211.         fc[1][4] = s('fontcolors.notify', fc[1][0], 1)
  212.         if pref('tabs.style', 2) and not hasattr(self, 'closebutton'):
  213.             self.GenCloseButton()
  214.         
  215.         if hasattr(self, 'closebutton'):
  216.             self.closebutton.SetSkinKey(self.Parent.closebuttonskin)
  217.             self.closebutton.SetIcon(self.Parent.closeicon)
  218.         
  219.         self.Calcumalate()
  220.         self.Refresh(False)
  221.  
  222.     
  223.     def UpdateMode(self):
  224.         self.mode = pref('tabs.side_tabs', False)
  225.         self.closebutton.SetSkinKey(self.Parent.closebuttonskin, True)
  226.         self.closebutton.SetIcon(self.Parent.closeicon)
  227.         self.Calcumalate()
  228.         self.Refresh(False)
  229.  
  230.     
  231.     def OnSize(self, event):
  232.         self.Refresh(False)
  233.  
  234.     
  235.     def __repr__(self):
  236.         return '<Tab %r>' % self.label1
  237.  
  238.     
  239.     def GenCloseButton(self):
  240.         self.closebutton = UberButton(self, skin = self.Parent.closebuttonskin, icon = self.Parent.closeicon, size = (self.iconsize[self.mode], self.iconsize[self.mode]))
  241.         if pref('tabs.style', 2) == 2:
  242.             self.closebutton.Show(False)
  243.         
  244.  
  245.     
  246.     def Icon(self):
  247.         return self.page.Icon.Resized(self.iconsize[self.mode]).WXB
  248.  
  249.     Icon = debug_property(Icon)
  250.     
  251.     def Calcumalate(self):
  252.         dc = ClientDC(self)
  253.         dc.Font = self.font[self.mode]
  254.         xpad = self.padding[self.mode].x
  255.         xcurser = xpad + self.margins[self.mode].left
  256.         ypad = self.padding[self.mode].y
  257.         flip = pref('tabs.flip', False)
  258.         style = pref('tabs.style', 2)
  259.         icon = self.Icon
  260.         iconsize = self.iconsize[self.mode]
  261.         label1 = self.label1
  262.         if isinstance(label1, str):
  263.             label1 = label1.decode('fuzzy utf8')
  264.         
  265.         txtwh = dc.GetTextExtent(label1)[0]
  266.         ycurser = self.txtht = dc.Font.Height
  267.         if (icon or style) and ycurser < iconsize:
  268.             ycurser = iconsize
  269.         
  270.         ycurser += 2 * ypad + self.margins[self.mode].y
  271.         if not flip:
  272.             self.iconcurser = Point(xcurser, (ycurser - self.margins[self.mode].y) / 2 + self.margins[self.mode].top - iconsize / 2)
  273.         
  274.         if (style == 2 or not flip or style == 1) and flip:
  275.             self.closebutton.Size = Size(iconsize, iconsize)
  276.             if not self.iconcurser:
  277.                 pass
  278.             self.buttoncurser = Point(xcurser, (ycurser - self.margins[self.mode].y) / 2 + self.margins[self.mode].top - iconsize / 2)
  279.         
  280.         if not icon or not flip:
  281.             if (style == 2 or not flip or style == 1) and flip:
  282.                 xcurser += iconsize + xpad
  283.             
  284.         self.label1curser = Point(xcurser, (ycurser - self.margins[self.mode].y) / 2 + self.margins[self.mode].top - self.txtht / 2)
  285.         xcurser += txtwh + xpad
  286.         if not icon or flip:
  287.             if (style == 1 or not flip or style == 2) and flip:
  288.                 xcurser += iconsize + xpad
  289.             
  290.         xcurser += self.margins[self.mode].right
  291.         maxwidth = self.maxtabwidth
  292.         if maxwidth and maxwidth < xcurser:
  293.             xcurser = maxwidth
  294.         
  295.         self.gensize = (xcurser, ycurser)
  296.         self.SetMinSize(self.gensize)
  297.         if style == 1 and style == 2:
  298.             pass
  299.         self.closebutton.Show(self.Rect.Contains(self.Parent.ScreenToClient(GetMousePosition())))
  300.  
  301.     
  302.     def OnPaint(self, event = None, forcedrect = None, otherdc = None, otherwindow = None):
  303.         size = None if forcedrect else self.Size
  304.         if not forcedrect:
  305.             pass
  306.         rect = RectS(size)
  307.         iconsize = self.iconsize[self.mode]
  308.         cliptangle = self.Rect
  309.         (sx, sy) = self.Rect.Position
  310.         (sw, sh) = size
  311.         ph = self.Parent.Size.height - 16
  312.         sidetabs = pref('tabs.side_tabs', False)
  313.         style = pref('tabs.style', 2)
  314.         flip = pref('tabs.flip', False)
  315.         if sidetabs and event and sy + sh > ph:
  316.             cliptangle = Rect(sx, sy, sw, ph - sy)
  317.             cdc = PaintDC(self)
  318.             cdc.SetClippingRegion(0, 0, cliptangle.width, cliptangle.height)
  319.             buffer = EmptyBitmap(*self.Size)
  320.             dc = MemoryDC()
  321.             dc.SelectObject(buffer)
  322.         else:
  323.             cdc = None
  324.             if not otherdc:
  325.                 pass
  326.             dc = BufferedPaintDC(self)
  327.         state = None if not (self.active) and self.notified and self.drawnotified.drawnotified else self.state
  328.         bg = None[self.states[self.mode] if event else 0]
  329.         bg.Draw(dc, rect)
  330.         if event or otherwindow:
  331.             if not otherwindow:
  332.                 pass
  333.             ApplySmokeAndMirrors(self, bg.GetBitmap(rect.Size))
  334.         
  335.         icon = self.Icon
  336.         iconoffsetx = (iconsize - icon.Size.width) // 2
  337.         iconoffsety = (iconsize - icon.Size.height) // 2
  338.         xpad = self.padding[self.mode].x
  339.         if icon and flip:
  340.             self.iconcurser = Point(size.width - (iconsize + xpad + self.margins[self.mode].right), (size.height - self.margins[self.mode].y) / 2 + self.margins[self.mode].top - iconsize // 2)
  341.         
  342.         if (style == 1 or not flip or style == 2) and flip:
  343.             self.buttoncurser = Point(size.width - (iconsize + xpad + self.margins[self.mode].right), (size.height - self.margins[self.mode].y) / 2 + self.margins[self.mode].top - iconsize // 2)
  344.         
  345.         if icon:
  346.             if style != 2 or not (self.focus) or not event:
  347.                 dc.DrawBitmap(icon, rect.x + self.iconcurser.x + iconoffsetx, rect.y + self.iconcurser.y + iconoffsety, True)
  348.             
  349.         filled = xpad + self.margins[self.mode].x
  350.         if style:
  351.             filled += self.closebutton.Size.width + xpad
  352.         
  353.         if icon and style != 2:
  354.             filled += iconsize + xpad
  355.         
  356.         dc.SetFont(self.font[self.mode])
  357.         dc.SetTextForeground(self.fontcolors[self.mode][state])
  358.         txtrct = Rect(rect.x + self.label1curser.x, rect.y + self.label1curser.y, size.width - filled - xpad, self.txtht)
  359.         dc.DrawTruncatedText(self.label1, txtrct, alignment = ALIGN_LEFT | ALIGN_CENTER_VERTICAL)
  360.         if event:
  361.             if style:
  362.                 self.closebutton.SetPosition(self.buttoncurser)
  363.             
  364.             if cdc:
  365.                 dc.SelectObject(NullBitmap)
  366.                 cdc.DrawBitmap(buffer, 0, 0, True)
  367.             
  368.         
  369.  
  370.     
  371.     def GetActive(self):
  372.         
  373.         try:
  374.             return self._active
  375.         except AttributeError:
  376.             return False
  377.  
  378.  
  379.     
  380.     def SetActive(self, switch = None):
  381.         self._active = None if switch is None else switch
  382.         if self._active:
  383.             self.state = None if self.focus else Tab.ACTIVE
  384.             self.page.Display()
  385.         elif self.focus:
  386.             pass
  387.         
  388.         self.state = Tab.NORMAL
  389.         win = GetTopLevelParent(self)
  390.         page = self.page
  391.         icon = page.icon
  392.         title = None if page.window_title is not None else page.title
  393.         if title is not None:
  394.             win.Title = title
  395.         
  396.         if icon is not None:
  397.             win.SetFrameIcon(icon)
  398.         
  399.         self.SetNotify(False)
  400.         self.OnActive()
  401.         if self.Parent.side_tabs:
  402.             self.Parent.ReVgenerate()
  403.         else:
  404.             self.Parent.Regenerate()
  405.         self.Notebook.did_activate(page)
  406.         self.Refresh(False)
  407.  
  408.     active = property(GetActive, SetActive)
  409.     left_down_activates = prefprop('messaging.tabs.left_down_activates', False)
  410.     
  411.     def OnLeftDown(self, event):
  412.         if hasattr(self, 'closebutton') and self.closebutton.hovered:
  413.             self.closebutton.OnLeftDown(event)
  414.         else:
  415.             self.mark = event.Position
  416.             if self.left_down_activates:
  417.                 self.active = True
  418.             
  419.         event.Skip()
  420.  
  421.     
  422.     def OnLeftUp(self, event):
  423.         self.mark = None
  424.         if not self.focus and event.LeftIsDown():
  425.             if self.focus:
  426.                 self.active = True
  427.             
  428.             self.OnMouseEnter(event)
  429.             self.OnMotion(event)
  430.         
  431.         event.Skip()
  432.  
  433.     
  434.     def OnMidUp(self, event):
  435.         self.CloseTab()
  436.  
  437.     
  438.     def OnRightDown(self, event):
  439.         pass
  440.  
  441.     
  442.     def OnMouseEnter(self, event):
  443.         cliptangle = RectS(self.Size)
  444.         sy = self.Rect.y
  445.         (sw, sh) = cliptangle.Size
  446.         ph = self.Parent.Size.height - 16
  447.         if sy + sh > ph and pref('tabs.side_tabs', False):
  448.             cliptangle = Rect(0, 0, sw, ph - sy)
  449.         
  450.         if cliptangle.Contains(event.Position):
  451.             if not self.HasCapture():
  452.                 self.CaptureMouse()
  453.             
  454.             if not event.LeftIsDown():
  455.                 self.focus = True
  456.                 self.state = None if not self.active else 3
  457.                 if pref('tabs.style', 2) == 2:
  458.                     self.closebutton.Show(True)
  459.                 
  460.                 self.Refresh(False)
  461.             
  462.         
  463.  
  464.     
  465.     def OnMouseLeave(self, event = None):
  466.         cliptangle = RectS(self.Size)
  467.         sy = self.Rect.y
  468.         (sw, sh) = self.Size
  469.         ph = self.Parent.Size.height - 16
  470.         if sy + sh > ph and pref('tabs.side_tabs', False):
  471.             cliptangle = Rect(0, 0, sw, ph - sy)
  472.         
  473.         if not hasattr(self, 'closebutton') and not event or not self.closebutton.Rect.Contains(event.Position) or not cliptangle.Contains(event.Position):
  474.             self.ReleaseAllCapture()
  475.             if not (self.Parent.dragorigin) and event and self.focus and event.LeftIsDown():
  476.                 pass
  477.             None if not (self.closebutton) or not (self.closebutton.hovered) else not (self.closebutton.hovered)
  478.             if self.focus:
  479.                 self.focus = False
  480.                 self.state = None if self._active else 0
  481.                 if pref('tabs.style', 2) == 2:
  482.                     self.closebutton.Show(False)
  483.                 
  484.             
  485.         
  486.         self.mark = None
  487.         self.Refresh(False)
  488.  
  489.     
  490.     def OnMotion(self, event):
  491.         if not self.focus and event.LeftIsDown():
  492.             self.OnMouseEnter(event)
  493.         
  494.         position = self.Parent.ScreenToClient(self.ClientToScreen(event.Position))
  495.         mouseisin = self.Rect.Contains(position)
  496.         if mouseisin and event.LeftIsDown() and self.Manager.source:
  497.             self.Parent.DragCalc(self.Parent.ScreenToClient(GetMousePosition()))
  498.         elif mouseisin and self.mark:
  499.             if abs(event.Position.x - self.mark.x) > 5 or abs(event.Position.y - self.mark.y) > 5:
  500.                 self.OnMouseLeave(event)
  501.             elif self.HasCapture() and mouseisin and hasattr(self, 'closebutton'):
  502.                 if self.closebutton.Rect.Contains(event.Position):
  503.                     self.closebutton.OnMouseIn(event)
  504.                 elif self.closebutton.hovered:
  505.                     self.closebutton.OnMouseOut(event)
  506.                 
  507.             elif self.HasCapture() and not mouseisin:
  508.                 self.OnMouseLeave(event)
  509.             
  510.  
  511.     
  512.     def Notebook(self):
  513.         return self.GrandParent
  514.  
  515.     Notebook = property(Notebook)
  516.     
  517.     def Manager(self):
  518.         return self.Notebook.manager
  519.  
  520.     Manager = property(Manager)
  521.     
  522.     def OnButton(self, event = None):
  523.         while self.closebutton.HasCapture():
  524.             self.closebutton.ReleaseMouse()
  525.         wx.CallAfter(self.Close)
  526.         wx.CallAfter(self.page.Close)
  527.  
  528.     CloseTab = OnButton
  529.     
  530.     def OnClose(self, event = None):
  531.         self.SetEvtHandlerEnabled(False)
  532.         while self.HasCapture():
  533.             self.ReleaseMouse()
  534.         if self.active:
  535.             self.Parent.SetNextActive(self)
  536.         
  537.         if self in self.Parent:
  538.             self.Parent.Remove(self)
  539.         
  540.         if self.previewtabs:
  541.             self.previewtabs.Stop()
  542.             self.previewtabs = None
  543.         
  544.         if self.closebutton is not None and not wx.IsDestroyed(self.closebutton):
  545.             self.closebutton.Close()
  546.             self.closebutton = None
  547.         
  548.         if getattr(self, 'page', None):
  549.             self.Notebook.did_remove(self.page.panel)
  550.         
  551.         if not wx.IsDestroyed(self):
  552.             self.Show(False)
  553.             self.Destroy()
  554.         
  555.         return True
  556.  
  557.     
  558.     def SetLabel(self, label1 = None, windowtitle = None):
  559.         if label1 and label1 != self.label1:
  560.             self.label1 = label1
  561.             self.Calcumalate()
  562.             if not self.Parent.side_tabs:
  563.                 self.Parent.Regenerate()
  564.             
  565.         
  566.  
  567.     
  568.     def GetIcon(self):
  569.         icon = self.page.icon
  570.         if icon is not None:
  571.             return icon.ResizedSmaller(self.iconsize[self.mode])
  572.  
  573.     Icon = property(GetIcon)
  574.     
  575.     def SetNotify(self, switch):
  576.         self.notified = switch
  577.         if switch:
  578.             self.drawnotified.Start()
  579.         else:
  580.             self.drawnotified.Stop()
  581.         self.Parent.UpdateNotify()
  582.         self.page.notified = switch
  583.         self.Top.ProcessEvent(TabNotifiedEvent(tab = self))
  584.         import hooks
  585.         hooks.notify('digsby.overlay_icon_updated', self.page.Content)
  586.  
  587.  
  588.