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

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