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-04-01 22:17:44 +00:00
// For compilers that support precompilation, includes "wx/wx.h".
# include "wx/wxprec.h"
# ifdef __BORLANDC__
# pragma hdrstop
# endif
# ifndef WX_PRECOMP
# include "wx/wx.h"
# endif
////@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__
2004-12-03 22:06: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-04-07 07:04:50 +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
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
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-04-07 07:04:50 +00:00
itemStaticText3 - > Create ( itemDialog1 , wxID_STATIC , _ ( " BOINC Manager " ) , wxDefaultPosition , wxDefaultSize , wxALIGN_CENTRE ) ;
2005-04-08 22:52:40 +00:00
itemStaticText3 - > SetFont ( wxFont ( 16 , wxDEFAULT , wxNORMAL , wxBOLD , FALSE , _T ( " " ) ) ) ;
itemBoxSizer2 - > Add ( itemStaticText3 , 0 , wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL | wxADJUST_MINSIZE , 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-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-04-07 07:04:50 +00:00
itemStaticText8 - > Create ( itemDialog1 , wxID_STATIC , _ ( " Version: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2005-04-01 22:17:44 +00:00
itemFlexGridSizer7 - > Add ( itemStaticText8 , 0 , wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxADJUST_MINSIZE , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
wxStaticText * itemStaticText9 = new wxStaticText ;
2005-04-07 07:04:50 +00:00
itemStaticText9 - > Create ( itemDialog1 , wxID_STATIC , _T ( " " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2005-04-01 22:17:44 +00:00
itemFlexGridSizer7 - > Add ( itemStaticText9 , 0 , wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxADJUST_MINSIZE , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
wxStaticText * itemStaticText12 = new wxStaticText ;
2005-04-07 07:04:50 +00:00
itemStaticText12 - > Create ( itemDialog1 , wxID_STATIC , _ ( " Copyright: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2005-04-01 22:17:44 +00:00
itemFlexGridSizer7 - > Add ( itemStaticText12 , 0 , wxALIGN_RIGHT | wxALIGN_TOP | wxLEFT | wxRIGHT | wxADJUST_MINSIZE , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
wxStaticText * itemStaticText13 = new wxStaticText ;
2005-04-07 07:04:50 +00:00
itemStaticText13 - > Create ( itemDialog1 , wxID_STATIC , _ ( " (C) 2005 University of California at Berkeley. \n All Rights Reserved. " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2005-04-01 22:17:44 +00:00
itemFlexGridSizer7 - > Add ( itemStaticText13 , 0 , wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxADJUST_MINSIZE , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
wxStaticText * itemStaticText14 = new wxStaticText ;
2005-04-07 07:04:50 +00:00
itemStaticText14 - > Create ( itemDialog1 , wxID_STATIC , _ ( " Berkeley Open Infrastructure for Network Computing " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2005-04-01 22:17:44 +00:00
itemBoxSizer2 - > Add ( itemStaticText14 , 0 , wxALIGN_CENTER_HORIZONTAL | wxALL | wxADJUST_MINSIZE , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
wxStaticText * itemStaticText16 = new wxStaticText ;
2005-04-07 07:04:50 +00:00
itemStaticText16 - > Create ( itemDialog1 , wxID_STATIC , _ ( " http://boinc.berkeley.edu/ " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2005-04-01 22:17:44 +00:00
itemBoxSizer2 - > Add ( itemStaticText16 , 0 , wxALIGN_CENTER_HORIZONTAL | wxALL | wxADJUST_MINSIZE , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
wxStaticLine * itemStaticLine17 = new wxStaticLine ;
2005-04-07 07:04:50 +00:00
itemStaticLine17 - > Create ( itemDialog1 , wxID_STATIC , wxDefaultPosition , wxDefaultSize , wxLI_HORIZONTAL ) ;
2005-04-01 22:17:44 +00:00
itemBoxSizer2 - > Add ( itemStaticLine17 , 0 , wxGROW | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
wxButton * itemButton18 = new wxButton ;
2005-04-07 07:04:50 +00:00
itemButton18 - > Create ( itemDialog1 , wxID_OK , _ ( " &OK " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2005-04-01 22:17:44 +00:00
itemButton18 - > SetDefault ( ) ;
itemBoxSizer2 - > Add ( itemButton18 , 0 , wxALIGN_RIGHT | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
// Set validators
2005-04-07 07:04:50 +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-04-07 07:04:50 +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
}