home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.5)
-
- from gui.textutil import GetMultilineTextSize
- from cgui import SimplePanel
- from gui.textutil import CopyFont
- import sys
- import wx
- from gui import skin
- from util import program_dir
- PADDING = 10
-
- class AboutPanel(SimplePanel):
-
- def __init__(self, parent):
- SimplePanel.__init__(self, parent)
- self.copyrightfont = self.Font
- self.buildfont = CopyFont(self.copyrightfont, pointSize = 12)
- imgpath = program_dir() / 'res' / 'AppDefaults' / 'digsbybig.png'
- bmp = self.bmp = wx.Bitmap(imgpath)
- build = self.build = _('Digsby - Build %s') % getattr(sys, 'REVISION', 'unknown')
- copyright = self.copyright = _('Copyright (c) 2008 dotSyntax, LLC.\nAll Rights Reserved.')
- buildsize = GetMultilineTextSize(build, self.buildfont)
- copyrightsize = GetMultilineTextSize(copyright, self.copyrightfont)
- width = max(bmp.Width, copyrightsize.width, buildsize.width) + 2 * PADDING
- height = bmp.Height + copyrightsize.height + buildsize.height + 4 * PADDING
- self.MinSize = self.Size = wx.Size(width, height)
- self.bmppos = wx.Size(width / 2 - bmp.Width / 2, PADDING)
- self.buildrect = wx.Rect(width / 2 - buildsize.width / 2, 2 * PADDING + bmp.Height, *buildsize)
- self.copyrightrect = wx.Rect(width / 2 - copyrightsize.width / 2, self.buildrect.Bottom + PADDING, *copyrightsize)
- Bind = self.Bind
- Bind(wx.EVT_PAINT, self.OnPaint)
-
-
- def OnPaint(self, event):
- dc = wx.PaintDC(self)
- rect = self.ClientRect
- dc.Brush = wx.WHITE_BRUSH
- dc.Pen = wx.TRANSPARENT_PEN
- dc.DrawRectangleRect(rect)
- dc.DrawBitmap(self.bmp, *self.bmppos)
- dc.Font = self.buildfont
- dc.SetTextForeground(wx.Color(0, 150, 0))
- dc.DrawLabel(self.build, self.buildrect, wx.ALIGN_CENTRE_HORIZONTAL | wx.ALIGN_CENTRE_VERTICAL)
- dc.Font = self.copyrightfont
- dc.SetTextForeground(wx.BLACK)
- dc.DrawLabel(self.copyright, self.copyrightrect, wx.ALIGN_CENTRE_HORIZONTAL | wx.ALIGN_CENTRE_VERTICAL)
-
-
-
- class AboutDialog(wx.Dialog):
-
- def __init__(self, parent = None):
- wx.Dialog.__init__(self, parent, title = _('About Digsby'), size = (240, 285), style = wx.DEFAULT_DIALOG_STYLE | wx.STAY_ON_TOP)
- self.SetFrameIcon(skin.get('AppDefaults.TaskbarIcon'))
- s = self.Sizer = wx.BoxSizer(wx.VERTICAL)
- s.Add(AboutPanel(self))
- self.dontcrash_button = wx.Button(self, -1)
- self.dontcrash_button.SetDefault()
- self.dontcrash_button.Hide()
- self.Fit()
-
-
- if __name__ == '__main__':
- from tests.testapp import testapp
- a = testapp('../../../', username = 'aaron')
- AboutDialog().Show()
- a.MainLoop()
-
-