2005-03-11 22:10:56 +00:00
|
|
|
// Berkeley Open Infrastructure for Network Computing
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2005 University of California
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
// 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
|
|
|
//
|
2005-03-11 22:10:56 +00:00
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
|
|
|
#pragma implementation "DlgAccountManager.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
|
|
|
|
|
2005-03-11 22:10:56 +00:00
|
|
|
#include "DlgAccountManager.h"
|
|
|
|
|
2005-04-01 22:17:44 +00:00
|
|
|
////@begin XPM images
|
|
|
|
|
|
|
|
////@end XPM images
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* CDlgAccountManager type definition
|
|
|
|
*/
|
2005-03-11 22:10:56 +00:00
|
|
|
|
2005-04-10 19:01:23 +00:00
|
|
|
IMPLEMENT_DYNAMIC_CLASS(CDlgAccountManager, wxDialog)
|
2005-03-11 22:10:56 +00:00
|
|
|
|
2005-04-01 22:17:44 +00:00
|
|
|
/*!
|
|
|
|
* CDlgAccountManager event table definition
|
|
|
|
*/
|
|
|
|
|
2005-04-10 19:01:23 +00:00
|
|
|
BEGIN_EVENT_TABLE(CDlgAccountManager, wxDialog)
|
2005-04-01 22:17:44 +00:00
|
|
|
|
|
|
|
////@begin CDlgAccountManager event table entries
|
|
|
|
////@end CDlgAccountManager event table entries
|
|
|
|
|
2005-03-11 22:10:56 +00:00
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
2005-04-01 22:17:44 +00:00
|
|
|
/*!
|
|
|
|
* CDlgAccountManager constructors
|
|
|
|
*/
|
|
|
|
|
2005-04-10 19:01:23 +00:00
|
|
|
CDlgAccountManager::CDlgAccountManager()
|
2005-03-11 22:10:56 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2005-04-10 19:01:23 +00:00
|
|
|
CDlgAccountManager::CDlgAccountManager(wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style)
|
2005-03-11 22:10:56 +00:00
|
|
|
{
|
|
|
|
Create(parent, id, caption, pos, size, style);
|
|
|
|
}
|
|
|
|
|
2005-04-01 22:17:44 +00:00
|
|
|
/*!
|
|
|
|
* CDlgAccountManager creator
|
|
|
|
*/
|
|
|
|
|
2005-04-10 19:01:23 +00:00
|
|
|
bool CDlgAccountManager::Create(wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style)
|
2005-03-11 22:10:56 +00:00
|
|
|
{
|
|
|
|
////@begin CDlgAccountManager member initialisation
|
|
|
|
m_AcctManagerUsernameCtrl = NULL;
|
|
|
|
m_AcctManagerPasswordCtrl = NULL;
|
|
|
|
////@end CDlgAccountManager member initialisation
|
|
|
|
|
|
|
|
////@begin CDlgAccountManager creation
|
|
|
|
SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
|
2005-04-10 19:01:23 +00:00
|
|
|
wxDialog::Create(parent, id, caption, pos, size, style);
|
2005-03-11 22:10:56 +00:00
|
|
|
|
|
|
|
CreateControls();
|
|
|
|
GetSizer()->Fit(this);
|
|
|
|
GetSizer()->SetSizeHints(this);
|
|
|
|
Centre();
|
|
|
|
////@end CDlgAccountManager creation
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2005-04-01 22:17:44 +00:00
|
|
|
/*!
|
|
|
|
* Control creation for CDlgAccountManager
|
|
|
|
*/
|
|
|
|
|
2005-03-11 22:10:56 +00:00
|
|
|
void CDlgAccountManager::CreateControls()
|
|
|
|
{
|
|
|
|
////@begin CDlgAccountManager content construction
|
|
|
|
|
|
|
|
CDlgAccountManager* itemDialog1 = this;
|
|
|
|
|
|
|
|
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
|
|
|
|
itemDialog1->SetSizer(itemBoxSizer2);
|
|
|
|
|
|
|
|
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
|
|
|
|
|
|
|
|
wxFlexGridSizer* itemFlexGridSizer4 = new wxFlexGridSizer(2, 2, 0, 0);
|
|
|
|
itemBoxSizer3->Add(itemFlexGridSizer4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
|
|
|
|
|
|
|
wxStaticText* itemStaticText5 = new wxStaticText;
|
2005-04-10 19:01:23 +00:00
|
|
|
itemStaticText5->Create(itemDialog1, wxID_STATIC, _("Username:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
|
2005-03-11 22:10:56 +00:00
|
|
|
itemFlexGridSizer4->Add(itemStaticText5, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
|
|
|
|
|
|
|
|
m_AcctManagerUsernameCtrl = new wxTextCtrl;
|
2005-04-10 19:01:23 +00:00
|
|
|
m_AcctManagerUsernameCtrl->Create(itemDialog1, ID_ACCTMANAGERUSERNAME, _T(""), wxDefaultPosition, wxSize(200, -1), 0);
|
2005-03-11 22:10:56 +00:00
|
|
|
itemFlexGridSizer4->Add(m_AcctManagerUsernameCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
|
|
|
|
|
|
|
wxStaticText* itemStaticText7 = new wxStaticText;
|
2005-04-10 19:01:23 +00:00
|
|
|
itemStaticText7->Create(itemDialog1, wxID_STATIC, _("Password:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
|
2005-03-11 22:10:56 +00:00
|
|
|
itemFlexGridSizer4->Add(itemStaticText7, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
|
|
|
|
|
|
|
|
m_AcctManagerPasswordCtrl = new wxTextCtrl;
|
2005-04-10 19:01:23 +00:00
|
|
|
m_AcctManagerPasswordCtrl->Create(itemDialog1, ID_ACCTMANAGERPASSWORD, _T(""), wxDefaultPosition, wxSize(200, -1), wxTE_PASSWORD);
|
2005-03-11 22:10:56 +00:00
|
|
|
itemFlexGridSizer4->Add(m_AcctManagerPasswordCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
|
|
|
|
|
|
|
wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL);
|
|
|
|
itemBoxSizer3->Add(itemBoxSizer9, 0, wxALIGN_TOP|wxALL, 5);
|
|
|
|
|
|
|
|
wxButton* itemButton10 = new wxButton;
|
2005-04-10 19:01:23 +00:00
|
|
|
itemButton10->Create(itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0);
|
2005-03-11 22:10:56 +00:00
|
|
|
itemButton10->SetDefault();
|
|
|
|
itemBoxSizer9->Add(itemButton10, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
|
|
|
|
|
|
|
|
wxButton* itemButton11 = new wxButton;
|
2005-04-10 19:01:23 +00:00
|
|
|
itemButton11->Create(itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0);
|
2005-03-11 22:10:56 +00:00
|
|
|
itemBoxSizer9->Add(itemButton11, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
|
|
|
|
|
2005-04-01 22:17:44 +00:00
|
|
|
|
|
|
|
// Set validators
|
2005-04-10 19:01:23 +00:00
|
|
|
m_AcctManagerUsernameCtrl->SetValidator(wxGenericValidator(& m_strAcctManagerUsername));
|
|
|
|
m_AcctManagerPasswordCtrl->SetValidator(wxGenericValidator(& m_strAcctManagerPassword));
|
2005-03-11 22:10:56 +00:00
|
|
|
////@end CDlgAccountManager content construction
|
|
|
|
}
|
|
|
|
|
2005-04-01 22:17:44 +00:00
|
|
|
/*!
|
|
|
|
* Should we show tooltips?
|
|
|
|
*/
|
|
|
|
|
2005-04-10 19:01:23 +00:00
|
|
|
bool CDlgAccountManager::ShowToolTips() {
|
2005-03-11 22:10:56 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2005-04-01 22:17:44 +00:00
|
|
|
/*!
|
|
|
|
* Get bitmap resources
|
|
|
|
*/
|
|
|
|
|
2005-04-10 19:01:23 +00:00
|
|
|
wxBitmap CDlgAccountManager::GetBitmapResource(const wxString&) {
|
2005-03-11 22:10:56 +00:00
|
|
|
// Bitmap retrieval
|
|
|
|
////@begin CDlgAccountManager bitmap retrieval
|
|
|
|
return wxNullBitmap;
|
|
|
|
////@end CDlgAccountManager bitmap retrieval
|
|
|
|
}
|
|
|
|
|
2005-04-01 22:17:44 +00:00
|
|
|
/*!
|
|
|
|
* Get icon resources
|
|
|
|
*/
|
|
|
|
|
2005-04-10 19:01:23 +00:00
|
|
|
wxIcon CDlgAccountManager::GetIconResource(const wxString&) {
|
2005-03-11 22:10:56 +00:00
|
|
|
// Icon retrieval
|
|
|
|
////@begin CDlgAccountManager icon retrieval
|
|
|
|
return wxNullIcon;
|
|
|
|
////@end CDlgAccountManager icon retrieval
|
|
|
|
}
|