]> git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/ide/activegrid/tool/AboutDialog.py
Applied patch [ 1212020 ] MediaCtrl DirectShow drawing and sample
[wxWidgets.git] / wxPython / samples / ide / activegrid / tool / AboutDialog.py
1 #----------------------------------------------------------------------------
2 # Name: AboutDialog.py
3 # Purpose: AboutBox which has copyright notice, license information, and credits
4 #
5 # Author: Morgan Hua
6 #
7 # Created: 3/22/05
8 # Copyright: (c) 2005 ActiveGrid, Inc.
9 # CVS-ID: $Id$
10 # License: wxWindows License
11 #----------------------------------------------------------------------------
12
13 import wx
14 from IDE import ACTIVEGRID_BASE_IDE, getSplashBitmap
15 _ = wx.GetTranslation
16
17 #----------------------------------------------------------------------------
18 # Package License Data for AboutDialog
19 # Package, License, URL
20 # If no information is available, put a None as a place holder.
21 #----------------------------------------------------------------------------
22
23
24 licenseData = [
25 ("ActiveGrid", "ASL 2.0", "http://apache.org/licenses/LICENSE-2.0"),
26 ("Python 2.3", "Python Software Foundation License", "http://www.python.org/2.3/license.html"),
27 ("wxPython 2.5", "wxWidgets 2 - LGPL", "http://wxwidgets.org/newlicen.htm"),
28 ("wxWidgets", "wxWindows Library License 3", "http://www.wxwidgets.org/manuals/2.5.4/wx_wxlicense.html"),
29 ("pychecker", "MetaSlash - BSD", "http://pychecker.sourceforge.net/COPYRIGHT"),
30 ("process.py", "See file", "http://starship.python.net/~tmick/"),
31 ("pysvn", "Apache License", "http://pysvn.tigris.org/"),
32 ]
33
34 if not ACTIVEGRID_BASE_IDE: # add licenses for database connections only if not the base IDE
35 licenseData += [
36 ("pydb2", "LGPL", "http://sourceforge.net/projects/pydb2"),
37 ("pysqlite", "Python License (CNRI)", "http://sourceforge.net/projects/pysqlite"),
38 ("mysql-python", "GPL, Python License (CNRI), Zope Public License", "http://sourceforge.net/projects/mysql-python"),
39 ("cx_Oracle", "Computronix", "http://http://www.computronix.com/download/License(cxOracle).txt"),
40 ("SQLite", "Public Domain", "http://www.sqlite.org/copyright.html"),
41 ("PyGreSQL", "BSD", "http://www.pygresql.org"),
42 ]
43
44 if wx.Platform == '__WXMSW__':
45 licenseData += [("pywin32", "Python Software Foundation License", "http://sourceforge.net/projects/pywin32/")]
46
47 class AboutDialog(wx.Dialog):
48
49 def __init__(self, parent):
50 """
51 Initializes the about dialog.
52 """
53 wx.Dialog.__init__(self, parent, -1, _("About ") + wx.GetApp().GetAppName(), style = wx.DEFAULT_DIALOG_STYLE)
54
55 nb = wx.Notebook(self, -1)
56
57 aboutPage = wx.Panel(nb, -1)
58 sizer = wx.BoxSizer(wx.VERTICAL)
59 splash_bmp = getSplashBitmap()
60 image = wx.StaticBitmap(aboutPage, -1, splash_bmp, (0,0), (splash_bmp.GetWidth(), splash_bmp.GetHeight()))
61 sizer.Add(image, 0, wx.ALIGN_CENTER|wx.ALL, 0)
62 sizer.Add(wx.StaticText(aboutPage, -1, wx.GetApp().GetAppName() + _("\nVersion 0.6 Early Access\n\nCopyright (c) 2003-2005 ActiveGrid Incorporated and Contributors. All rights reserved.")), 0, wx.ALIGN_LEFT|wx.ALL, 10)
63 sizer.Add(wx.StaticText(aboutPage, -1, _("http://www.activegrid.com")), 0, wx.ALIGN_LEFT|wx.LEFT|wx.BOTTOM, 10)
64 aboutPage.SetSizer(sizer)
65 nb.AddPage(aboutPage, _("Copyright"))
66
67 licensePage = wx.Panel(nb, -1)
68 grid = wx.grid.Grid(licensePage, -1)
69 grid.CreateGrid(len(licenseData), 2)
70
71 dc = wx.ClientDC(grid)
72 dc.SetFont(grid.GetLabelFont())
73 grid.SetColLabelValue(0, _("License"))
74 grid.SetColLabelValue(1, _("URL"))
75 w, maxHeight = dc.GetTextExtent(_("License"))
76 w, h = dc.GetTextExtent(_("URL"))
77 if h > maxHeight:
78 maxHeight = h
79 grid.SetColLabelSize(maxHeight + 6) # add a 6 pixel margin
80
81 for row, data in enumerate(licenseData):
82 package = data[0]
83 license = data[1]
84 url = data[2]
85 if package:
86 grid.SetRowLabelValue(row, package)
87 if license:
88 grid.SetCellValue(row, 0, license)
89 if url:
90 grid.SetCellValue(row, 1, url)
91
92 grid.EnableEditing(False)
93 grid.EnableDragGridSize(False)
94 grid.EnableDragColSize(False)
95 grid.EnableDragRowSize(False)
96 grid.SetRowLabelAlignment(wx.ALIGN_LEFT, wx.ALIGN_CENTRE)
97 grid.SetLabelBackgroundColour(wx.WHITE)
98 grid.AutoSizeColumn(0, 100)
99 grid.AutoSizeColumn(1, 100)
100 sizer = wx.BoxSizer(wx.VERTICAL)
101 sizer.Add(grid, 1, wx.EXPAND|wx.ALL, 10)
102 licensePage.SetSizer(sizer)
103 nb.AddPage(licensePage, _("Licenses"))
104
105 creditsPage = wx.Panel(nb, -1)
106 sizer = wx.BoxSizer(wx.VERTICAL)
107 sizer.Add(wx.StaticText(creditsPage, -1, _("ActiveGrid Development Team:\n\nLawrence Bruhmuller\nEric Chu\nMatt Fryer\nJoel Hare\nMorgan Hua\nAlan Mullendore\nJeff Norton\nKevin Wang\nPeter Yared")), 0, wx.ALIGN_LEFT|wx.ALL, 10)
108 creditsPage.SetSizer(sizer)
109 nb.AddPage(creditsPage, _("Credits"))
110
111 sizer = wx.BoxSizer(wx.VERTICAL)
112 sizer.Add(nb, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
113 btn = wx.Button(self, wx.ID_OK)
114 sizer.Add(btn, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
115
116 self.SetSizer(sizer)
117 self.SetAutoLayout(True)
118 sizer.Fit(self)
119
120