]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/ide/activegrid/tool/AboutDialog.py 
   1  #----------------------------------------------------------------------------    3  # Purpose:      AboutBox which has copyright notice, license information, and credits    8  # Copyright:    (c) 2005 ActiveGrid, Inc.   10  # License:      wxWindows License   11  #----------------------------------------------------------------------------   14  from  IDE 
import  ACTIVEGRID_BASE_IDE
,  getSplashBitmap
  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  #----------------------------------------------------------------------------   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/" ),   34  if not  ACTIVEGRID_BASE_IDE
:     # add licenses for database connections only if not the base IDE   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" ),   44  if  wx
. Platform 
==  '__WXMSW__' :   45      licenseData 
+= [( "pywin32" ,  "Python Software Foundation License" ,  "http://sourceforge.net/projects/pywin32/" )]   47  class  AboutDialog ( wx
. Dialog
):   49      def  __init__ ( self
,  parent
):   51          Initializes the about dialog.   53          wx
. Dialog
.__ init
__ ( self
,  parent
, - 1 ,  _ ( "About " ) +  wx
. GetApp (). GetAppName (),  style 
=  wx
. DEFAULT_DIALOG_STYLE
)   55          nb 
=  wx
. Notebook ( self
, - 1 )   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 () +  _ ( " \n Version 0.7 Early Access \n\n Copyright (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" ))   67          licensePage 
=  wx
. Panel ( nb
, - 1 )   68          grid 
=  wx
. grid
. Grid ( licensePage
, - 1 )   69          grid
. CreateGrid ( len ( licenseData
),  2 )   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" ))   79          grid
. SetColLabelSize ( maxHeight 
+  6 )   # add a 6 pixel margin   81          for  row
,  data 
in  enumerate ( licenseData
):   86                  grid
. SetRowLabelValue ( row
,  package
)   88                  grid
. SetCellValue ( row
,  0 ,  license
)   90                  grid
. SetCellValue ( row
,  1 ,  url
)   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" ))  105          creditsPage 
=  wx
. Panel ( nb
, - 1 )  106          sizer 
=  wx
. BoxSizer ( wx
. VERTICAL
)  107          sizer
. Add ( wx
. StaticText ( creditsPage
, - 1 ,  _ ( "ActiveGrid Development Team: \n\n Lawrence Bruhmuller \n Eric Chu \n Matt Fryer \n Joel Hare \n Morgan Hua \n Alan Mullendore \n Jeff Norton \n Kevin Wang \n Peter Yared" )),  0 ,  wx
. ALIGN_LEFT|wx
. ALL
,  10 )  108          creditsPage
. SetSizer ( sizer
)  109          nb
. AddPage ( creditsPage
,  _ ( "Credits" ))  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 )  117          self
. SetAutoLayout ( True )