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-03-30 05:44:12 +00:00
//
2004-04-10 09:11:03 +00:00
# if defined(__GNUG__) && !defined(__APPLE__)
# pragma implementation "DlgAttachProject.h"
# endif
2005-03-30 05:44:12 +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 "DlgAttachProject.h"
2004-09-22 21:53:07 +00:00
# include "ValidateURL.h"
# include "ValidateAccountKey.h"
2004-04-10 09:11:03 +00:00
2005-03-30 05:44:12 +00:00
////@begin XPM images
////@end XPM images
2004-04-10 09:11:03 +00:00
2005-03-30 05:44:12 +00:00
/*!
* CDlgAttachProject type definition
*/
IMPLEMENT_DYNAMIC_CLASS ( CDlgAttachProject , wxDialog )
/*!
* CDlgAttachProject event table definition
*/
2004-04-10 09:11:03 +00:00
BEGIN_EVENT_TABLE ( CDlgAttachProject , wxDialog )
2005-03-30 05:44:12 +00:00
////@begin CDlgAttachProject event table entries
////@end CDlgAttachProject event table entries
2004-04-10 09:11:03 +00:00
END_EVENT_TABLE ( )
2005-03-30 05:44:12 +00:00
/*!
* CDlgAttachProject constructors
*/
2004-04-10 09:11:03 +00:00
CDlgAttachProject : : CDlgAttachProject ( )
{
}
CDlgAttachProject : : CDlgAttachProject ( wxWindow * parent , wxWindowID id , const wxString & caption , const wxPoint & pos , const wxSize & size , long style )
{
Create ( parent , id , caption , pos , size , style ) ;
}
2005-03-30 05:44:12 +00:00
/*!
* CDlgAttachProject creator
*/
2004-04-10 09:11:03 +00:00
bool CDlgAttachProject : : Create ( wxWindow * parent , wxWindowID id , const wxString & caption , const wxPoint & pos , const wxSize & size , long style )
{
2005-03-30 05:44:12 +00:00
////@begin CDlgAttachProject member initialisation
2004-04-10 09:11:03 +00:00
m_ProjectAddressCtrl = NULL ;
m_ProjectAccountKeyCtrl = NULL ;
2005-03-30 05:44:12 +00:00
////@end CDlgAttachProject member initialisation
2004-04-10 09:11:03 +00:00
2005-03-30 05:44:12 +00:00
////@begin CDlgAttachProject creation
SetExtraStyle ( GetExtraStyle ( ) | wxWS_EX_BLOCK_EVENTS ) ;
2004-04-10 09:11:03 +00:00
wxDialog : : Create ( parent , id , caption , pos , size , style ) ;
CreateControls ( ) ;
GetSizer ( ) - > Fit ( this ) ;
GetSizer ( ) - > SetSizeHints ( this ) ;
Centre ( ) ;
2005-03-30 05:44:12 +00:00
////@end CDlgAttachProject creation
2004-04-10 09:11:03 +00:00
return TRUE ;
}
2005-03-30 05:44:12 +00:00
/*!
* Control creation for CDlgAttachProject
*/
2004-04-10 09:11:03 +00:00
void CDlgAttachProject : : CreateControls ( )
{
2005-03-30 05:44:12 +00:00
////@begin CDlgAttachProject content construction
2004-04-10 09:11:03 +00:00
2005-03-29 23:51:43 +00:00
CDlgAttachProject * itemDialog1 = this ;
2004-04-10 09:11:03 +00:00
2005-03-29 23:51:43 +00:00
wxBoxSizer * itemBoxSizer2 = new wxBoxSizer ( wxVERTICAL ) ;
itemDialog1 - > SetSizer ( itemBoxSizer2 ) ;
2004-04-10 09:11:03 +00:00
2005-03-29 23:51:43 +00:00
wxFlexGridSizer * itemFlexGridSizer3 = new wxFlexGridSizer ( 1 , 2 , 0 , 0 ) ;
itemBoxSizer2 - > Add ( itemFlexGridSizer3 , 0 , wxALIGN_CENTER_HORIZONTAL | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-03-29 23:51:43 +00:00
wxBoxSizer * itemBoxSizer4 = new wxBoxSizer ( wxVERTICAL ) ;
itemFlexGridSizer3 - > Add ( itemBoxSizer4 , 0 , wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-03-30 05:44:12 +00:00
wxFlexGridSizer * itemFlexGridSizer5 = new wxFlexGridSizer ( 2 , 2 , 0 , 0 ) ;
itemBoxSizer4 - > Add ( itemFlexGridSizer5 , 0 , wxALIGN_CENTER_HORIZONTAL | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-03-30 05:44:12 +00:00
wxStaticText * itemStaticText6 = new wxStaticText ;
itemStaticText6 - > Create ( itemDialog1 , wxID_STATIC , _ ( " URL: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemFlexGridSizer5 - > Add ( itemStaticText6 , 0 , wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxALL | wxADJUST_MINSIZE , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-03-29 23:51:43 +00:00
m_ProjectAddressCtrl = new wxTextCtrl ;
m_ProjectAddressCtrl - > Create ( itemDialog1 , ID_PROJECTADDRESS , _T ( " " ) , wxDefaultPosition , wxSize ( 200 , - 1 ) , 0 ) ;
2005-03-30 05:44:12 +00:00
itemFlexGridSizer5 - > Add ( m_ProjectAddressCtrl , 0 , wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-03-30 05:44:12 +00:00
wxStaticText * itemStaticText8 = new wxStaticText ;
itemStaticText8 - > Create ( itemDialog1 , wxID_STATIC , _ ( " Account Key: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemFlexGridSizer5 - > Add ( itemStaticText8 , 0 , wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxALL | wxADJUST_MINSIZE , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-03-29 23:51:43 +00:00
m_ProjectAccountKeyCtrl = new wxTextCtrl ;
m_ProjectAccountKeyCtrl - > Create ( itemDialog1 , ID_PROJECTACCOUNTKEY , _T ( " " ) , wxDefaultPosition , wxSize ( 200 , - 1 ) , 0 ) ;
2005-03-30 05:44:12 +00:00
itemFlexGridSizer5 - > Add ( m_ProjectAccountKeyCtrl , 0 , wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-03-30 05:44:12 +00:00
wxStaticText * itemStaticText10 = new wxStaticText ;
itemStaticText10 - > Create ( itemDialog1 , wxID_STATIC , _ ( " These are emailed to you when you create an account. \n Go to project web sites to create accounts. \n Visit http://boinc.berkeley.edu for a list of projects. " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemBoxSizer4 - > Add ( itemStaticText10 , 0 , wxALIGN_CENTER_HORIZONTAL | wxALL | wxADJUST_MINSIZE , 5 ) ;
2005-03-29 23:51:43 +00:00
2005-03-30 06:52:13 +00:00
wxBoxSizer * itemBoxSizer11 = new wxBoxSizer ( wxVERTICAL ) ;
itemFlexGridSizer3 - > Add ( itemBoxSizer11 , 0 , wxALIGN_CENTER_HORIZONTAL | wxALIGN_TOP | wxALL , 5 ) ;
2005-03-29 23:51:43 +00:00
2005-03-30 06:52:13 +00:00
wxButton * itemButton12 = new wxButton ;
itemButton12 - > Create ( itemDialog1 , wxID_OK , _ ( " &OK " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemButton12 - > SetDefault ( ) ;
itemBoxSizer11 - > Add ( itemButton12 , 0 , wxALIGN_CENTER_HORIZONTAL | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-03-30 05:44:12 +00:00
wxButton * itemButton13 = new wxButton ;
2005-03-30 06:52:13 +00:00
itemButton13 - > Create ( itemDialog1 , wxID_CANCEL , _ ( " &Cancel " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemBoxSizer11 - > Add ( itemButton13 , 0 , wxALIGN_CENTER_HORIZONTAL | wxALL , 5 ) ;
2005-03-30 05:44:12 +00:00
// Set validators
m_ProjectAddressCtrl - > SetValidator ( CValidateURL ( & m_strProjectAddress ) ) ;
m_ProjectAccountKeyCtrl - > SetValidator ( CValidateAccountKey ( & m_strProjectAccountKey ) ) ;
////@end CDlgAttachProject content construction
2004-04-10 09:11:03 +00:00
}
2005-03-30 05:44:12 +00:00
/*!
* Should we show tooltips ?
*/
2004-04-10 09:11:03 +00:00
bool CDlgAttachProject : : ShowToolTips ( )
{
return TRUE ;
}
2004-04-11 05:09:18 +00:00
2005-03-30 05:44:12 +00:00
/*!
* Get bitmap resources
*/
2004-12-08 00:40:19 +00:00
2005-04-15 19:33:47 +00:00
wxBitmap CDlgAttachProject : : GetBitmapResource ( const wxString & )
2005-03-30 05:44:12 +00:00
{
// Bitmap retrieval
////@begin CDlgAttachProject bitmap retrieval
return wxNullBitmap ;
////@end CDlgAttachProject bitmap retrieval
}
/*!
* Get icon resources
*/
2005-04-15 19:33:47 +00:00
wxIcon CDlgAttachProject : : GetIconResource ( const wxString & )
2005-03-30 05:44:12 +00:00
{
// Icon retrieval
////@begin CDlgAttachProject icon retrieval
return wxNullIcon ;
////@end CDlgAttachProject icon retrieval
}