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

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. from gui.textutil import GetMultilineTextSize
  5. from cgui import SimplePanel
  6. from gui.textutil import CopyFont
  7. import sys
  8. import wx
  9. from gui import skin
  10. from util import program_dir
  11. PADDING = 10
  12.  
  13. class AboutPanel(SimplePanel):
  14.     
  15.     def __init__(self, parent):
  16.         SimplePanel.__init__(self, parent)
  17.         self.copyrightfont = self.Font
  18.         self.buildfont = CopyFont(self.copyrightfont, pointSize = 12)
  19.         imgpath = program_dir() / 'res' / 'AppDefaults' / 'digsbybig.png'
  20.         bmp = self.bmp = wx.Bitmap(imgpath)
  21.         build = self.build = _('Digsby - Build %s') % getattr(sys, 'REVISION', 'unknown')
  22.         copyright = self.copyright = _('Copyright (c) 2008 dotSyntax, LLC.\nAll Rights Reserved.')
  23.         buildsize = GetMultilineTextSize(build, self.buildfont)
  24.         copyrightsize = GetMultilineTextSize(copyright, self.copyrightfont)
  25.         width = max(bmp.Width, copyrightsize.width, buildsize.width) + 2 * PADDING
  26.         height = bmp.Height + copyrightsize.height + buildsize.height + 4 * PADDING
  27.         self.MinSize = self.Size = wx.Size(width, height)
  28.         self.bmppos = wx.Size(width / 2 - bmp.Width / 2, PADDING)
  29.         self.buildrect = wx.Rect(width / 2 - buildsize.width / 2, 2 * PADDING + bmp.Height, *buildsize)
  30.         self.copyrightrect = wx.Rect(width / 2 - copyrightsize.width / 2, self.buildrect.Bottom + PADDING, *copyrightsize)
  31.         Bind = self.Bind
  32.         Bind(wx.EVT_PAINT, self.OnPaint)
  33.  
  34.     
  35.     def OnPaint(self, event):
  36.         dc = wx.PaintDC(self)
  37.         rect = self.ClientRect
  38.         dc.Brush = wx.WHITE_BRUSH
  39.         dc.Pen = wx.TRANSPARENT_PEN
  40.         dc.DrawRectangleRect(rect)
  41.         dc.DrawBitmap(self.bmp, *self.bmppos)
  42.         dc.Font = self.buildfont
  43.         dc.SetTextForeground(wx.Color(0, 150, 0))
  44.         dc.DrawLabel(self.build, self.buildrect, wx.ALIGN_CENTRE_HORIZONTAL | wx.ALIGN_CENTRE_VERTICAL)
  45.         dc.Font = self.copyrightfont
  46.         dc.SetTextForeground(wx.BLACK)
  47.         dc.DrawLabel(self.copyright, self.copyrightrect, wx.ALIGN_CENTRE_HORIZONTAL | wx.ALIGN_CENTRE_VERTICAL)
  48.  
  49.  
  50.  
  51. class AboutDialog(wx.Dialog):
  52.     
  53.     def __init__(self, parent = None):
  54.         wx.Dialog.__init__(self, parent, title = _('About Digsby'), size = (240, 285), style = wx.DEFAULT_DIALOG_STYLE | wx.STAY_ON_TOP)
  55.         self.SetFrameIcon(skin.get('AppDefaults.TaskbarIcon'))
  56.         s = self.Sizer = wx.BoxSizer(wx.VERTICAL)
  57.         s.Add(AboutPanel(self))
  58.         self.dontcrash_button = wx.Button(self, -1)
  59.         self.dontcrash_button.SetDefault()
  60.         self.dontcrash_button.Hide()
  61.         self.Fit()
  62.  
  63.  
  64. if __name__ == '__main__':
  65.     from tests.testapp import testapp
  66.     a = testapp('../../../', username = 'aaron')
  67.     AboutDialog().Show()
  68.     a.MainLoop()
  69.  
  70.