~ubuntu-branches/ubuntu/quantal/boinc/quantal

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
// 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);
    void OnPauseResume(wxCommandEvent& event);
    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__
//    void SetupMacAccessibilitySupport();
//    void RemoveMacAccessibilitySupport();
    
//    EventHandlerRef m_pSGAccessibilityEventHandlerRef;

#endif
    wxBitmap    m_bmpBg;
    wxButton    *m_NoticesButton;
    wxButton    *m_PauseResumeButton;
    wxButton    *m_HelpButton;
    wxString    m_sPauseString;
    wxString    m_sResumeString;
    int         m_oldWorkCount;
    bool        m_bisPaused;

private:
    int		m_irefreshCount;
    bool        dlgOpen;
	wxTimer*    checkForNewNoticesTimer;
    wxString    m_sPauseButtonToolTip;
    wxString    m_sResumeButtonToolTip;
};


// Define a new frame
class CSimpleFrame : public CBOINCBaseFrame
{
    DECLARE_DYNAMIC_CLASS(CSimpleFrame)

public:
    CSimpleFrame();
    CSimpleFrame(wxString title, wxIcon* icon, wxIcon* icon32, wxPoint position, wxSize size);

   ~CSimpleFrame();

    void OnChangeGUI( wxCommandEvent& event );
    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 );

	void SetMsgsDlgOpen(CDlgMessages* newDlgPtr) { dlgMsgsPtr = newDlgPtr; }
    bool isMessagesDlgOpen() { return (dlgMsgsPtr != NULL); }

    bool SaveState();
    bool RestoreState();

protected:
    virtual int     _GetCurrentViewPage();

	wxMenuBar*          m_pMenubar;
    wxAcceleratorEntry  m_Shortcuts[1];
    wxAcceleratorTable* m_pAccelTable;

	CSimpleGUIPanel* m_pBackgroundPanel;


private:
    CDlgMessages* dlgMsgsPtr;

    DECLARE_EVENT_TABLE()
};

#endif  // _BOINCSIMPLEFRAME_H_