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 "DlgConnection.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 "DlgConnection.h"
|
|
|
|
|
2005-04-01 22:17:44 +00:00
|
|
|
////@begin XPM images
|
|
|
|
|
|
|
|
////@end XPM images
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* CDlgConnection type definition
|
|
|
|
*/
|
|
|
|
|
|
|
|
IMPLEMENT_DYNAMIC_CLASS( CDlgConnection, wxDialog )
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2005-04-01 22:17:44 +00:00
|
|
|
/*!
|
|
|
|
* CDlgConnection event table definition
|
|
|
|
*/
|
2004-04-10 09:11:03 +00:00
|
|
|
|
|
|
|
BEGIN_EVENT_TABLE( CDlgConnection, wxDialog )
|
|
|
|
|
2005-04-01 22:17:44 +00:00
|
|
|
////@begin CDlgConnection event table entries
|
|
|
|
////@end CDlgConnection event table entries
|
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
2005-04-01 22:17:44 +00:00
|
|
|
/*!
|
|
|
|
* CDlgConnection constructors
|
|
|
|
*/
|
2004-04-10 09:11:03 +00:00
|
|
|
|
|
|
|
CDlgConnection::CDlgConnection( )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
CDlgConnection::CDlgConnection( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
|
|
|
|
{
|
|
|
|
Create(parent, id, caption, pos, size, style);
|
|
|
|
}
|
|
|
|
|
2005-04-01 22:17:44 +00:00
|
|
|
/*!
|
|
|
|
* CDlgConnection creator
|
|
|
|
*/
|
2004-04-10 09:11:03 +00:00
|
|
|
|
|
|
|
bool CDlgConnection::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 CDlgConnection member initialisation
|
|
|
|
////@end CDlgConnection member initialisation
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2005-04-01 22:17:44 +00:00
|
|
|
////@begin CDlgConnection 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-04-01 22:17:44 +00:00
|
|
|
////@end CDlgConnection creation
|
2004-04-10 09:11:03 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2005-04-01 22:17:44 +00:00
|
|
|
/*!
|
|
|
|
* Control creation for CDlgConnection
|
|
|
|
*/
|
2004-04-10 09:11:03 +00:00
|
|
|
|
|
|
|
void CDlgConnection::CreateControls()
|
|
|
|
{
|
2005-04-01 22:17:44 +00:00
|
|
|
////@begin CDlgConnection content construction
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2005-04-01 22:17:44 +00:00
|
|
|
CDlgConnection* 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
|
|
|
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
itemBoxSizer2->Add(itemBoxSizer3, 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(wxVERTICAL);
|
|
|
|
itemBoxSizer3->Add(itemBoxSizer4, 0, wxALIGN_TOP|wxALL, 5);
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2005-04-01 22:17:44 +00:00
|
|
|
wxStaticText* itemStaticText5 = new wxStaticText;
|
|
|
|
itemStaticText5->Create( itemDialog1, wxID_STATIC, _("BOINC needs to connect to the network.\nMay it do so now?"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
|
|
itemBoxSizer4->Add(itemStaticText5, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5);
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2005-04-01 22:17:44 +00:00
|
|
|
wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxVERTICAL);
|
|
|
|
itemBoxSizer3->Add(itemBoxSizer6, 0, wxALIGN_TOP|wxALL, 5);
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2005-04-01 22:17:44 +00:00
|
|
|
wxButton* itemButton7 = new wxButton;
|
|
|
|
itemButton7->Create( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
|
|
itemButton7->SetDefault();
|
|
|
|
itemBoxSizer6->Add(itemButton7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
|
|
|
|
|
|
|
|
wxButton* itemButton8 = new wxButton;
|
|
|
|
itemButton8->Create( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
|
|
itemBoxSizer6->Add(itemButton8, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
|
|
|
|
|
|
|
|
////@end CDlgConnection 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
|
|
|
|
|
|
|
bool CDlgConnection::ShowToolTips()
|
|
|
|
{
|
|
|
|
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-15 19:33:47 +00:00
|
|
|
wxBitmap CDlgConnection::GetBitmapResource( const wxString& )
|
2005-04-01 22:17:44 +00:00
|
|
|
{
|
|
|
|
// Bitmap retrieval
|
|
|
|
////@begin CDlgConnection bitmap retrieval
|
|
|
|
return wxNullBitmap;
|
|
|
|
////@end CDlgConnection bitmap retrieval
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Get icon resources
|
|
|
|
*/
|
|
|
|
|
2005-04-15 19:33:47 +00:00
|
|
|
wxIcon CDlgConnection::GetIconResource( const wxString& )
|
2005-04-01 22:17:44 +00:00
|
|
|
{
|
|
|
|
// Icon retrieval
|
|
|
|
////@begin CDlgConnection icon retrieval
|
|
|
|
return wxNullIcon;
|
|
|
|
////@end CDlgConnection icon retrieval
|
|
|
|
}
|