2005-01-20 23:22:22 +00:00
// Berkeley Open Infrastructure for Network Computing
// http://boinc.berkeley.edu
// Copyright (C) 2005 University of California
2004-05-17 22:15:10 +00:00
//
2005-01-20 23:22:22 +00:00
// This is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation;
// either version 2.1 of the License, or (at your option) any later version.
2004-04-10 09:11:03 +00:00
//
2005-01-20 23:22:22 +00:00
// This software is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
2004-05-17 22:15:10 +00:00
//
2005-01-20 23:22:22 +00:00
// To view the GNU Lesser General Public License visit
// http://www.gnu.org/copyleft/lesser.html
// or write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2005-04-01 22:17:44 +00:00
//
2004-04-10 09:11:03 +00:00
# if defined(__GNUG__) && !defined(__APPLE__)
# pragma implementation "DlgAbout.h"
# endif
2005-07-06 09:14:43 +00:00
# include "stdwx.h"
# include "BOINCGUIApp.h"
2005-04-01 22:17:44 +00:00
////@begin includes
////@end includes
2004-04-10 09:11:03 +00:00
# include "DlgAbout.h"
2004-11-11 03:32:57 +00:00
# ifdef __WXMSW__
2005-10-03 23:14:39 +00:00
# include "../version.h"
2004-11-11 03:32:57 +00:00
# else
# include "config.h"
# endif
2004-10-22 22:55:29 +00:00
2005-04-01 22:17:44 +00:00
////@begin XPM images
2004-04-10 20:25:27 +00:00
# include "res/boincsm.xpm"
2005-04-01 22:17:44 +00:00
////@end XPM images
/*!
* CDlgAbout type definition
*/
2004-04-10 09:11:03 +00:00
2005-04-07 07:04:50 +00:00
IMPLEMENT_DYNAMIC_CLASS ( CDlgAbout , wxDialog )
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
/*!
* CDlgAbout event table definition
*/
2004-04-10 09:11:03 +00:00
2005-04-07 07:04:50 +00:00
BEGIN_EVENT_TABLE ( CDlgAbout , wxDialog )
2005-04-01 22:17:44 +00:00
////@begin CDlgAbout event table entries
////@end CDlgAbout event table entries
2004-04-10 09:11:03 +00:00
END_EVENT_TABLE ( )
2005-04-01 22:17:44 +00:00
/*!
* CDlgAbout constructors
*/
2004-04-10 09:11:03 +00:00
2005-04-07 07:04:50 +00:00
CDlgAbout : : CDlgAbout ( ) { }
2004-04-10 09:11:03 +00:00
2005-04-07 07:04:50 +00:00
CDlgAbout : : CDlgAbout ( wxWindow * parent , wxWindowID id , const wxString & caption , const wxPoint & pos , const wxSize & size , long style ) {
2004-04-10 09:11:03 +00:00
Create ( parent , id , caption , pos , size , style ) ;
}
2005-04-01 22:17:44 +00:00
/*!
* CDlgHelpAbout creator
*/
2004-04-10 09:11:03 +00:00
2005-04-07 07:04:50 +00:00
bool CDlgAbout : : Create ( wxWindow * parent , wxWindowID id , const wxString & caption , const wxPoint & pos , const wxSize & size , long style ) {
2005-04-01 22:17:44 +00:00
////@begin CDlgAbout member initialisation
m_strVersion = BOINC_VERSION_STRING ;
////@end CDlgAbout member initialisation
////@begin CDlgAbout creation
SetExtraStyle ( GetExtraStyle ( ) | wxWS_EX_BLOCK_EVENTS ) ;
2005-07-21 23:06:02 +00:00
wxDialog : : Create ( parent , id , caption , pos , size , style ) ;
2004-04-10 09:11:03 +00:00
CreateControls ( ) ;
GetSizer ( ) - > Fit ( this ) ;
GetSizer ( ) - > SetSizeHints ( this ) ;
Centre ( ) ;
2005-04-01 22:17:44 +00:00
////@end CDlgAbout creation
2004-04-10 09:11:03 +00:00
return TRUE ;
}
2005-04-01 22:17:44 +00:00
/*!
* Control creation for CDlgHelpAbout
*/
2004-04-10 09:11:03 +00:00
2005-04-07 07:04:50 +00:00
void CDlgAbout : : CreateControls ( ) {
2005-04-01 22:17:44 +00:00
////@begin CDlgAbout content construction
CDlgAbout * itemDialog1 = this ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
wxBoxSizer * itemBoxSizer2 = new wxBoxSizer ( wxVERTICAL ) ;
itemDialog1 - > SetSizer ( itemBoxSizer2 ) ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
wxStaticText * itemStaticText3 = new wxStaticText ;
2005-07-21 23:06:02 +00:00
itemStaticText3 - > Create ( itemDialog1 , wxID_STATIC , _ ( " BOINC Manager " ) , wxDefaultPosition , wxDefaultSize , wxALIGN_CENTRE ) ;
itemStaticText3 - > SetFont ( wxFont ( 24 , wxDEFAULT , wxNORMAL , wxBOLD , FALSE , _T ( " " ) ) ) ;
itemBoxSizer2 - > Add ( itemStaticText3 , 0 , wxALIGN_CENTER_HORIZONTAL | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
wxBoxSizer * itemBoxSizer4 = new wxBoxSizer ( wxHORIZONTAL ) ;
itemBoxSizer2 - > Add ( itemBoxSizer4 , 0 , wxALIGN_CENTER_HORIZONTAL | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
wxBoxSizer * itemBoxSizer5 = new wxBoxSizer ( wxVERTICAL ) ;
itemBoxSizer4 - > Add ( itemBoxSizer5 , 0 , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-07-21 23:06:02 +00:00
wxBitmap itemStaticBitmap6Bitmap ( itemDialog1 - > GetBitmapResource ( wxT ( " res/boincsm.xpm " ) ) ) ;
wxStaticBitmap * itemStaticBitmap6 = new wxStaticBitmap ;
itemStaticBitmap6 - > Create ( itemDialog1 , wxID_STATIC , itemStaticBitmap6Bitmap , wxDefaultPosition , wxSize ( 50 , 50 ) , 0 ) ;
itemBoxSizer5 - > Add ( itemStaticBitmap6 , 0 , wxALIGN_LEFT | wxALL , 5 ) ;
2005-04-01 22:17:44 +00:00
wxFlexGridSizer * itemFlexGridSizer7 = new wxFlexGridSizer ( 0 , 2 , 0 , 0 ) ;
itemBoxSizer4 - > Add ( itemFlexGridSizer7 , 0 , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
wxStaticText * itemStaticText8 = new wxStaticText ;
2005-07-21 23:06:02 +00:00
itemStaticText8 - > Create ( itemDialog1 , wxID_STATIC , _ ( " Version: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemFlexGridSizer7 - > Add ( itemStaticText8 , 0 , wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
wxStaticText * itemStaticText9 = new wxStaticText ;
2005-07-21 23:06:02 +00:00
itemStaticText9 - > Create ( itemDialog1 , wxID_STATIC , _T ( " " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemFlexGridSizer7 - > Add ( itemStaticText9 , 0 , wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT , 5 ) ;
wxStaticText * itemStaticText10 = new wxStaticText ;
itemStaticText10 - > Create ( itemDialog1 , wxID_STATIC , _ ( " Copyright: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemFlexGridSizer7 - > Add ( itemStaticText10 , 0 , wxALIGN_RIGHT | wxALIGN_TOP | wxLEFT | wxRIGHT , 5 ) ;
wxStaticText * itemStaticText11 = new wxStaticText ;
itemStaticText11 - > Create ( itemDialog1 , wxID_STATIC , _ ( " (C) 2005 University of California at Berkeley. \n All Rights Reserved. " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemFlexGridSizer7 - > Add ( itemStaticText11 , 0 , wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
wxStaticText * itemStaticText12 = new wxStaticText ;
2005-07-21 23:06:02 +00:00
itemStaticText12 - > Create ( itemDialog1 , wxID_STATIC , _ ( " Berkeley Open Infrastructure for Network Computing " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemBoxSizer2 - > Add ( itemStaticText12 , 0 , wxALIGN_CENTER_HORIZONTAL | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
wxStaticText * itemStaticText13 = new wxStaticText ;
2005-07-21 23:06:02 +00:00
itemStaticText13 - > Create ( itemDialog1 , wxID_STATIC , _ ( " A software platform for distributed computing using volunteered computer resources " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemBoxSizer2 - > Add ( itemStaticText13 , 0 , wxALIGN_CENTER_HORIZONTAL | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-07-21 23:06:02 +00:00
wxHyperLink * itemHyperLink14 = new wxHyperLink ;
2005-07-22 06:56:34 +00:00
itemHyperLink14 - > Create ( itemDialog1 , ID_ABOUTBOINCLINK , wxT ( " http://boinc.berkeley.edu/ " ) , wxDefaultPosition , wxDefaultSize , wxNO_BORDER ) ;
2005-07-21 23:06:02 +00:00
itemBoxSizer2 - > Add ( itemHyperLink14 , 0 , wxALIGN_CENTER_HORIZONTAL | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-07-21 23:06:02 +00:00
wxStaticLine * itemStaticLine15 = new wxStaticLine ;
itemStaticLine15 - > Create ( itemDialog1 , wxID_STATIC , wxDefaultPosition , wxDefaultSize , wxLI_HORIZONTAL ) ;
itemBoxSizer2 - > Add ( itemStaticLine15 , 0 , wxGROW | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-07-21 23:06:02 +00:00
wxButton * itemButton16 = new wxButton ;
itemButton16 - > Create ( itemDialog1 , wxID_OK , _ ( " &OK " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemButton16 - > SetDefault ( ) ;
itemBoxSizer2 - > Add ( itemButton16 , 0 , wxALIGN_RIGHT | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
// Set validators
2005-07-21 23:06:02 +00:00
itemStaticText9 - > SetValidator ( wxGenericValidator ( & m_strVersion ) ) ;
2005-04-01 22:17:44 +00:00
////@end CDlgAbout content construction
2004-04-10 09:11:03 +00:00
}
2005-04-01 22:17:44 +00:00
/*!
* Should we show tooltips ?
*/
2004-04-10 09:11:03 +00:00
2005-04-07 07:04:50 +00:00
bool CDlgAbout : : ShowToolTips ( ) {
2004-04-10 09:11:03 +00:00
return TRUE ;
}
2004-04-11 05:09:18 +00:00
2005-04-01 22:17:44 +00:00
/*!
* Get bitmap resources
*/
2004-12-08 00:40:19 +00:00
2005-04-07 07:04:50 +00:00
wxBitmap CDlgAbout : : GetBitmapResource ( const wxString & name ) {
2005-04-01 22:17:44 +00:00
// Bitmap retrieval
////@begin CDlgAbout bitmap retrieval
2005-07-21 23:06:02 +00:00
if ( name = = wxT ( " res/boincsm.xpm " ) )
{
2005-04-01 22:17:44 +00:00
wxBitmap bitmap ( boincsm_xpm ) ;
return bitmap ;
}
return wxNullBitmap ;
////@end CDlgAbout bitmap retrieval
}
/*!
* Get icon resources
*/
2005-04-10 19:01:23 +00:00
wxIcon CDlgAbout : : GetIconResource ( const wxString & ) {
2005-04-01 22:17:44 +00:00
// Icon retrieval
////@begin CDlgAbout icon retrieval
return wxNullIcon ;
////@end CDlgAbout icon retrieval
}
2005-09-13 09:01:56 +00:00
const char * BOINC_RCSID_b40c2996e6 = " $Id$ " ;