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

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. from peak.util.imports import lazyModule, whenImported
  5. wx = lazyModule('wx')
  6. os = lazyModule('os')
  7. wintypes = lazyModule('ctypes.wintypes')
  8.  
  9. def browse(url):
  10.     
  11.     def go():
  12.         os.startfile(url)
  13.  
  14.     if False and pref('browser.threaded', type = bool, default = False):
  15.         t = Thread(target = go)
  16.         t.setDaemon(True)
  17.         t.start()
  18.     else:
  19.         
  20.         try:
  21.             go()
  22.         except WindowsError:
  23.             pass
  24.  
  25.  
  26. wx.LaunchDefaultBrowser = browse
  27.  
  28. def wxRectToRECT(rect):
  29.     r = wintypes.RECT()
  30.     r.left = rect.X
  31.     r.top = rect.Y
  32.     r.right = rect.X + rect.Width
  33.     r.bottom = rect.Y + rect.Height
  34.     return r
  35.  
  36.  
  37. def wxRectFromRECT(rect):
  38.     return wx.Rect(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top)
  39.  
  40.  
  41. def GetRECT(win):
  42.     return wxRectToRECT(win.Rect)
  43.  
  44.  
  45. def GetLRECT(win):
  46.     return wxRectToRECT(wx.RectS(win.GetSize()))
  47.  
  48.  
  49. def _monkeypatch(*a, **k):
  50.     WindowClass = None if wx.WXPY else wx.Window
  51.     WindowClass.GetRECT = GetRECT
  52.     WindowClass.RECT = property(GetRECT)
  53.     WindowClass.GetLRECT = GetLRECT
  54.     WindowClass.LRECT = property(GetLRECT)
  55.     wx.Rect.FromRECT = staticmethod(wxRectFromRECT)
  56.     wx.Rect.RECT = property(wxRectToRECT)
  57.  
  58. whenImported('wx', _monkeypatch)
  59.