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
|
2004-05-17 22:15:10 +00:00
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-04-11 04:37:10 +00:00
|
|
|
#ifndef _MAINFRAME_H_
|
|
|
|
#define _MAINFRAME_H_
|
|
|
|
|
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
|
|
|
#pragma interface "MainFrame.cpp"
|
|
|
|
#endif
|
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2005-03-10 05:07:01 +00:00
|
|
|
class CStatusBar : public wxStatusBar
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(CStatusBar)
|
|
|
|
|
|
|
|
public:
|
|
|
|
CStatusBar();
|
|
|
|
CStatusBar(wxWindow *parent);
|
|
|
|
~CStatusBar();
|
|
|
|
|
|
|
|
void OnSize(wxSizeEvent& event);
|
|
|
|
|
|
|
|
wxStaticBitmap* m_pbmpConnected;
|
|
|
|
wxStaticText* m_ptxtConnected;
|
|
|
|
wxStaticBitmap* m_pbmpDisconnect;
|
|
|
|
wxStaticText* m_ptxtDisconnect;
|
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
2005-04-08 04:23:37 +00:00
|
|
|
class CMainFrameEvent;
|
2005-03-10 05:07:01 +00:00
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
class CMainFrame : public wxFrame
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(CMainFrame)
|
|
|
|
|
|
|
|
public:
|
|
|
|
CMainFrame();
|
|
|
|
CMainFrame(wxString strTitle);
|
|
|
|
|
|
|
|
~CMainFrame(void);
|
|
|
|
|
2004-10-24 07:38:38 +00:00
|
|
|
void OnHide( wxCommandEvent& event );
|
|
|
|
void OnActivitySelection( wxCommandEvent& event );
|
|
|
|
void OnNetworkSelection( wxCommandEvent& event );
|
2004-10-27 23:19:50 +00:00
|
|
|
void OnRunBenchmarks( wxCommandEvent& event );
|
2004-10-28 07:03:06 +00:00
|
|
|
void OnSelectComputer( wxCommandEvent& event );
|
2004-10-21 14:29:59 +00:00
|
|
|
void OnExit( wxCommandEvent& event );
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2005-03-11 22:10:56 +00:00
|
|
|
void OnToolsUpdateAccounts( wxCommandEvent& event );
|
2004-10-21 14:29:59 +00:00
|
|
|
void OnToolsOptions( wxCommandEvent& event );
|
2005-05-05 06:07:14 +00:00
|
|
|
|
|
|
|
void OnHelpBOINCManager( wxHelpEvent& event );
|
|
|
|
void OnHelpBOINCWebsite( wxCommandEvent& event );
|
|
|
|
void OnHelpAbout( wxCommandEvent& event );
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-10-24 07:38:38 +00:00
|
|
|
void OnClose( wxCloseEvent& event );
|
2004-12-02 07:43:47 +00:00
|
|
|
|
2005-03-07 23:52:28 +00:00
|
|
|
void OnRefreshState( wxTimerEvent& event );
|
2004-10-28 22:51:38 +00:00
|
|
|
void OnFrameRender( wxTimerEvent& event );
|
2004-10-21 14:29:59 +00:00
|
|
|
void OnListPanelRender( wxTimerEvent& event );
|
2005-04-10 02:24:08 +00:00
|
|
|
void OnDocumentPoll( wxTimerEvent& event );
|
2004-12-10 20:46:43 +00:00
|
|
|
|
|
|
|
void OnNotebookSelectionChanged( wxNotebookEvent& event );
|
2004-05-21 06:27:15 +00:00
|
|
|
|
2005-04-08 04:23:37 +00:00
|
|
|
void OnConnect( CMainFrameEvent& event );
|
|
|
|
void OnConnectError( CMainFrameEvent& event );
|
2005-04-08 21:18:30 +00:00
|
|
|
void OnConnectErrorAuthentication( CMainFrameEvent& event );
|
2005-04-08 04:23:37 +00:00
|
|
|
void OnInitialized( CMainFrameEvent& event );
|
|
|
|
void OnRefreshView( CMainFrameEvent& event );
|
|
|
|
|
2005-04-08 06:24:58 +00:00
|
|
|
void UpdateStatusText( const wxChar* szStatus );
|
|
|
|
|
2005-04-08 04:23:37 +00:00
|
|
|
void FireConnect();
|
|
|
|
void FireConnectError();
|
2005-04-08 21:18:30 +00:00
|
|
|
void FireConnectErrorAuthentication();
|
2005-04-08 04:23:37 +00:00
|
|
|
void FireRefreshView();
|
2005-04-08 06:24:58 +00:00
|
|
|
|
|
|
|
void ExecuteBrowserLink( const wxString& strLink );
|
2005-04-08 04:23:37 +00:00
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
private:
|
|
|
|
|
|
|
|
wxMenuBar* m_pMenubar;
|
|
|
|
wxNotebook* m_pNotebook;
|
2005-03-10 05:07:01 +00:00
|
|
|
CStatusBar* m_pStatusbar;
|
2005-03-07 23:52:28 +00:00
|
|
|
wxTimer* m_pRefreshStateTimer;
|
2004-10-28 22:51:38 +00:00
|
|
|
wxTimer* m_pFrameRenderTimer;
|
2004-09-25 21:33:24 +00:00
|
|
|
wxTimer* m_pFrameListPanelRenderTimer;
|
2005-04-10 02:24:08 +00:00
|
|
|
wxTimer* m_pDocumentPollTimer;
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-10-28 22:51:38 +00:00
|
|
|
wxString m_strBaseTitle;
|
2004-10-28 07:03:06 +00:00
|
|
|
|
2005-02-07 04:47:18 +00:00
|
|
|
wxInt32 m_iSelectedLanguage;
|
2005-03-30 09:24:31 +00:00
|
|
|
wxArrayString m_aSelectedComputerMRU;
|
2005-02-07 04:47:18 +00:00
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
|
|
|
|
bool CreateMenu();
|
|
|
|
bool DeleteMenu();
|
|
|
|
|
|
|
|
bool CreateNotebook();
|
2004-05-27 06:17:58 +00:00
|
|
|
template < class T >
|
|
|
|
bool CreateNotebookPage( T pwndNewNotebookPage );
|
2004-04-10 09:11:03 +00:00
|
|
|
bool DeleteNotebook();
|
|
|
|
|
|
|
|
bool CreateStatusbar();
|
|
|
|
bool DeleteStatusbar();
|
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
bool SaveState();
|
|
|
|
bool RestoreState();
|
2004-05-27 06:17:58 +00:00
|
|
|
|
2005-04-08 04:23:37 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
2004-05-21 06:27:15 +00:00
|
|
|
|
2005-03-31 23:54:12 +00:00
|
|
|
|
2005-04-08 04:23:37 +00:00
|
|
|
class CMainFrameEvent : public wxEvent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CMainFrameEvent(wxEventType evtType, CMainFrame *frame)
|
|
|
|
: wxEvent(-1, evtType)
|
|
|
|
{
|
|
|
|
SetEventObject(frame);
|
|
|
|
}
|
2004-10-26 01:59:44 +00:00
|
|
|
|
2005-04-08 04:23:37 +00:00
|
|
|
virtual wxEvent *Clone() const { return new CMainFrameEvent(*this); }
|
2004-04-10 09:11:03 +00:00
|
|
|
};
|
2004-04-11 04:37:10 +00:00
|
|
|
|
|
|
|
|
2005-04-08 04:23:37 +00:00
|
|
|
BEGIN_DECLARE_EVENT_TYPES()
|
|
|
|
DECLARE_EVENT_TYPE( wxEVT_MAINFRAME_CONNECT, 10000 )
|
|
|
|
DECLARE_EVENT_TYPE( wxEVT_MAINFRAME_CONNECT_ERROR, 10001 )
|
2005-04-08 21:18:30 +00:00
|
|
|
DECLARE_EVENT_TYPE( wxEVT_MAINFRAME_CONNECT_ERROR_AUTHENTICATION, 10002 )
|
|
|
|
DECLARE_EVENT_TYPE( wxEVT_MAINFRAME_INITIALIZED, 10003 )
|
|
|
|
DECLARE_EVENT_TYPE( wxEVT_MAINFRAME_REFRESHVIEW, 10004 )
|
2005-04-08 04:23:37 +00:00
|
|
|
END_DECLARE_EVENT_TYPES()
|
|
|
|
|
|
|
|
#define EVT_MAINFRAME_CONNECT(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_MAINFRAME_CONNECT, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL),
|
|
|
|
#define EVT_MAINFRAME_CONNECT_ERROR(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_MAINFRAME_CONNECT_ERROR, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL),
|
2005-04-08 21:18:30 +00:00
|
|
|
#define EVT_MAINFRAME_CONNECT_ERROR_AUTHENTICATION(fn) \
|
|
|
|
DECLARE_EVENT_TABLE_ENTRY(wxEVT_MAINFRAME_CONNECT_ERROR_AUTHENTICATION, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL),
|
2005-04-08 04:23:37 +00:00
|
|
|
#define EVT_MAINFRAME_INITIALIZED(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_MAINFRAME_INITIALIZED, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL),
|
|
|
|
#define EVT_MAINFRAME_REFRESH(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_MAINFRAME_REFRESHVIEW, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL),
|
|
|
|
|
|
|
|
|
2004-04-11 05:09:18 +00:00
|
|
|
#endif
|
|
|
|
|