2008-08-06 18:36:30 +00:00
|
|
|
// This file is part of BOINC.
|
2005-09-26 11:29:28 +00:00
|
|
|
// http://boinc.berkeley.edu
|
2008-08-06 18:36:30 +00:00
|
|
|
// Copyright (C) 2008 University of California
|
2005-09-26 11:29:28 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC 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 3 of the License, or (at your option) any later version.
|
2005-09-26 11:29:28 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
2005-09-26 11:29:28 +00:00
|
|
|
// 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.
|
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2005-09-26 11:29:28 +00:00
|
|
|
//
|
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
2005-09-27 03:17:49 +00:00
|
|
|
#pragma implementation "BOINCBaseWizard.h"
|
2005-09-26 11:29:28 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "stdwx.h"
|
2006-10-20 15:00:14 +00:00
|
|
|
#include "diagnostics.h"
|
|
|
|
#include "util.h"
|
|
|
|
#include "mfile.h"
|
|
|
|
#include "miofile.h"
|
|
|
|
#include "parse.h"
|
|
|
|
#include "error_numbers.h"
|
2005-09-26 11:29:28 +00:00
|
|
|
#include "wizardex.h"
|
|
|
|
#include "error_numbers.h"
|
|
|
|
#include "BOINCGUIApp.h"
|
2006-10-20 15:00:14 +00:00
|
|
|
#include "SkinManager.h"
|
|
|
|
#include "MainDocument.h"
|
2005-09-26 11:29:28 +00:00
|
|
|
#include "BOINCBaseWizard.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* CBOINCBaseWizard type definition
|
|
|
|
*/
|
|
|
|
|
|
|
|
IMPLEMENT_DYNAMIC_CLASS( CBOINCBaseWizard, wxWizardEx )
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* CBOINCBaseWizard constructors
|
|
|
|
*/
|
|
|
|
|
|
|
|
CBOINCBaseWizard::CBOINCBaseWizard() :
|
|
|
|
wxWizardEx()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-11-17 19:19:50 +00:00
|
|
|
CBOINCBaseWizard::CBOINCBaseWizard(wxWindow *parent, int id, const wxString& title, const wxPoint& pos, long style) :
|
|
|
|
wxWizardEx(parent, id, title, pos, style)
|
2005-09-26 11:29:28 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Determine if the wizard page has a previous page
|
|
|
|
*/
|
|
|
|
wxWizardPageEx* CBOINCBaseWizard::PopPageTransition()
|
|
|
|
{
|
|
|
|
return _PopPageTransition();
|
|
|
|
}
|
|
|
|
|
|
|
|
wxWizardPageEx* CBOINCBaseWizard::_PopPageTransition()
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Remove the page transition to the stack
|
|
|
|
*/
|
|
|
|
wxWizardPageEx* CBOINCBaseWizard::PushPageTransition( wxWizardPageEx* pCurrentPage, unsigned long ulPageID )
|
|
|
|
{
|
|
|
|
return _PushPageTransition( pCurrentPage, ulPageID );
|
|
|
|
}
|
|
|
|
|
2006-07-21 08:23:26 +00:00
|
|
|
wxWizardPageEx* CBOINCBaseWizard::_PushPageTransition( wxWizardPageEx* WXUNUSED(pCurrentPage), unsigned long WXUNUSED(ulPageID) )
|
2005-09-26 11:29:28 +00:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Process Cancel Event
|
|
|
|
*/
|
2005-09-27 03:17:49 +00:00
|
|
|
bool CBOINCBaseWizard::IsCancelInProgress() const
|
|
|
|
{
|
|
|
|
return m_bCancelInProgress;
|
|
|
|
}
|
|
|
|
|
2005-09-26 11:29:28 +00:00
|
|
|
void CBOINCBaseWizard::ProcessCancelEvent( wxWizardExEvent& event )
|
|
|
|
{
|
|
|
|
_ProcessCancelEvent( event );
|
|
|
|
}
|
|
|
|
|
2006-07-21 08:23:26 +00:00
|
|
|
void CBOINCBaseWizard::_ProcessCancelEvent( wxWizardExEvent& WXUNUSED(event) )
|
2005-09-26 11:29:28 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Button Controls
|
|
|
|
*/
|
|
|
|
|
2005-09-27 03:17:49 +00:00
|
|
|
wxButton* CBOINCBaseWizard::GetNextButton() const {
|
|
|
|
return m_btnNext;
|
|
|
|
}
|
|
|
|
|
2005-09-26 11:29:28 +00:00
|
|
|
void CBOINCBaseWizard::SimulateNextButton() {
|
|
|
|
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, m_btnNext->GetId());
|
|
|
|
event.SetEventObject(GetNextButton());
|
|
|
|
AddPendingEvent(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CBOINCBaseWizard::EnableNextButton() {
|
|
|
|
m_btnNext->Enable();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CBOINCBaseWizard::DisableNextButton() {
|
|
|
|
m_btnNext->Disable();
|
|
|
|
}
|
|
|
|
|
2005-09-27 03:17:49 +00:00
|
|
|
wxButton* CBOINCBaseWizard::GetBackButton() const {
|
|
|
|
return m_btnPrev;
|
|
|
|
}
|
|
|
|
|
2005-09-26 11:29:28 +00:00
|
|
|
void CBOINCBaseWizard::SimulateBackButton() {
|
|
|
|
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, m_btnPrev->GetId());
|
|
|
|
event.SetEventObject(GetNextButton());
|
|
|
|
AddPendingEvent(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CBOINCBaseWizard::EnableBackButton() {
|
|
|
|
m_btnPrev->Enable();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CBOINCBaseWizard::DisableBackButton() {
|
|
|
|
m_btnPrev->Disable();
|
|
|
|
}
|
|
|
|
|
2008-09-19 20:19:52 +00:00
|
|
|
wxButton* CBOINCBaseWizard::GetCancelButton() const {
|
|
|
|
return m_btnCancel;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CBOINCBaseWizard::SimulateCancelButton() {
|
|
|
|
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, m_btnCancel->GetId());
|
|
|
|
event.SetEventObject(GetCancelButton());
|
|
|
|
AddPendingEvent(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CBOINCBaseWizard::EnableCancelButton() {
|
|
|
|
m_btnCancel->Enable();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CBOINCBaseWizard::DisableCancelButton() {
|
|
|
|
m_btnCancel->Disable();
|
|
|
|
}
|
|
|
|
|