2011-01-27 14:36:49 +00:00
|
|
|
// This file is part of BOINC.
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2008 University of California
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
// BOINC 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.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _BOINCSIMPLEFRAME_H_
|
|
|
|
#define _BOINCSIMPLEFRAME_H_
|
|
|
|
|
|
|
|
#include "BOINCBaseFrame.h"
|
|
|
|
|
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
|
|
|
#pragma interface "sg_BoincSimpleFrame.cpp"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class CSimpleTaskPanel;
|
|
|
|
class CSimpleProjectPanel;
|
|
|
|
class CSimpleTaskPanel;
|
|
|
|
class CDlgMessages;
|
|
|
|
|
|
|
|
class CSimpleGUIPanel : public wxPanel
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(CSimpleGUIPanel)
|
|
|
|
|
|
|
|
public:
|
|
|
|
CSimpleGUIPanel();
|
|
|
|
CSimpleGUIPanel(wxWindow* parent);
|
|
|
|
|
|
|
|
~CSimpleGUIPanel();
|
|
|
|
//
|
|
|
|
// My tasks panel (shown when there are active tasks)
|
|
|
|
CSimpleTaskPanel *m_taskPanel;
|
|
|
|
// My projects panel
|
|
|
|
CSimpleProjectPanel *m_projPanel;
|
|
|
|
////////////////////////////;
|
|
|
|
|
|
|
|
void SetBackgroundBitmap();
|
|
|
|
void ReskinInterface();
|
|
|
|
void UpdateProjectView();
|
|
|
|
void OnFrameRender();
|
|
|
|
void OnProjectsAttachToProject();
|
|
|
|
void OnShowNotices(wxCommandEvent& event);
|
2011-10-21 12:17:10 +00:00
|
|
|
void OnSuspendResume(wxCommandEvent& event);
|
2011-01-27 14:36:49 +00:00
|
|
|
void OnHelp( wxCommandEvent& event );
|
|
|
|
void SetDlgOpen(bool newDlgState) { dlgOpen = newDlgState; }
|
|
|
|
bool GetDlgOpen() { return dlgOpen; }
|
|
|
|
wxBitmap *GetBackgroundBitMap() { return &m_bmpBg; }
|
|
|
|
void OnCheckForNewNotices(wxTimerEvent& WXUNUSED(event));
|
|
|
|
void NoticesViewed();
|
|
|
|
|
|
|
|
//////////
|
|
|
|
wxBoxSizer *mainSizer;
|
|
|
|
//////////
|
|
|
|
bool m_bNewNoticeAlert;
|
|
|
|
bool m_bNoticesButtonIsRed;
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void OnPaint(wxPaintEvent& event);
|
|
|
|
void OnEraseBackground(wxEraseEvent& event);
|
|
|
|
#ifdef __WXMAC__
|
2011-11-21 10:05:35 +00:00
|
|
|
int m_iRedRingRadius;
|
2011-01-27 14:36:49 +00:00
|
|
|
#endif
|
|
|
|
wxBitmap m_bmpBg;
|
2013-10-22 10:56:48 +00:00
|
|
|
wxButton *m_NoticesButton;
|
|
|
|
wxButton *m_SuspendResumeButton;
|
|
|
|
wxButton *m_HelpButton;
|
2011-10-21 12:17:10 +00:00
|
|
|
wxString m_sSuspendString;
|
2011-01-27 14:36:49 +00:00
|
|
|
wxString m_sResumeString;
|
|
|
|
int m_oldWorkCount;
|
2011-10-21 12:17:10 +00:00
|
|
|
bool m_bIsSuspended;
|
2011-01-27 14:36:49 +00:00
|
|
|
|
|
|
|
private:
|
2011-11-21 10:05:35 +00:00
|
|
|
int m_irefreshCount;
|
2011-01-27 14:36:49 +00:00
|
|
|
bool dlgOpen;
|
|
|
|
wxTimer* checkForNewNoticesTimer;
|
2011-10-21 12:17:10 +00:00
|
|
|
wxString m_sSuspendButtonToolTip;
|
2011-01-27 14:36:49 +00:00
|
|
|
wxString m_sResumeButtonToolTip;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Define a new frame
|
2011-03-03 11:55:16 +00:00
|
|
|
class CSimpleFrame : public CBOINCBaseFrame
|
2011-01-27 14:36:49 +00:00
|
|
|
{
|
2011-03-03 11:55:16 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(CSimpleFrame)
|
2011-01-27 14:36:49 +00:00
|
|
|
|
|
|
|
public:
|
2011-03-03 11:55:16 +00:00
|
|
|
CSimpleFrame();
|
2014-02-14 21:05:42 +00:00
|
|
|
CSimpleFrame(wxString title, wxIconBundle* icons, wxPoint position, wxSize size);
|
2011-01-27 14:36:49 +00:00
|
|
|
|
2011-03-03 11:55:16 +00:00
|
|
|
~CSimpleFrame();
|
2011-01-27 14:36:49 +00:00
|
|
|
|
|
|
|
void OnChangeGUI( wxCommandEvent& event );
|
2011-10-21 12:17:10 +00:00
|
|
|
void BuildSkinSubmenu( wxMenu *submenu );
|
|
|
|
void OnSelectDefaultSkin( wxCommandEvent& event );
|
|
|
|
void OnSelectSkin( wxCommandEvent& event );
|
2011-01-27 14:36:49 +00:00
|
|
|
void OnPreferences( wxCommandEvent& event );
|
|
|
|
void OnOptions( wxCommandEvent& event );
|
|
|
|
void OnOldSG( wxCommandEvent& event );
|
|
|
|
void OnHelp( wxHelpEvent& event );
|
|
|
|
void OnHelpBOINC( wxCommandEvent& event );
|
|
|
|
void OnHelpAbout( wxCommandEvent& event );
|
|
|
|
|
|
|
|
void OnProjectsAttachToProject();
|
|
|
|
|
|
|
|
void OnConnect(CFrameEvent& event );
|
|
|
|
void OnReloadSkin( CFrameEvent& event );
|
|
|
|
void OnRefreshView( CFrameEvent& event );
|
|
|
|
void OnNotification( CFrameEvent& event );
|
2012-10-17 12:28:48 +00:00
|
|
|
void OnEventLog(wxCommandEvent& event);
|
|
|
|
|
2011-01-27 14:36:49 +00:00
|
|
|
void SetMsgsDlgOpen(CDlgMessages* newDlgPtr) { dlgMsgsPtr = newDlgPtr; }
|
|
|
|
bool isMessagesDlgOpen() { return (dlgMsgsPtr != NULL); }
|
|
|
|
|
|
|
|
bool SaveState();
|
|
|
|
bool RestoreState();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual int _GetCurrentViewPage();
|
|
|
|
|
|
|
|
wxMenuBar* m_pMenubar;
|
2011-10-22 01:00:50 +00:00
|
|
|
wxMenu* m_pSubmenuSkins;
|
2012-10-17 12:28:48 +00:00
|
|
|
wxAcceleratorEntry m_Shortcuts[2];
|
2011-01-27 14:36:49 +00:00
|
|
|
wxAcceleratorTable* m_pAccelTable;
|
|
|
|
|
|
|
|
CSimpleGUIPanel* m_pBackgroundPanel;
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
CDlgMessages* dlgMsgsPtr;
|
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _BOINCSIMPLEFRAME_H_
|
|
|
|
|
|
|
|
|