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

« back to all changes in this revision

Viewing changes to clientgui/sg_BoincSimpleFrame.h

  • Committer: Package Import Robot
  • Author(s): Steffen Moeller
  • Date: 2011-08-08 01:36:51 UTC
  • mfrom: (1.4.3 upstream) (49.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20110808013651-xdekm20jy3acpo7u
Tags: 6.13.1+dfsg-2
* Bringing notify patch to unstable.
* Adjusted build dependency to libjpeg-dev (Closes: #641093)
* Further improvements on stripchart.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// This file is part of BOINC.
 
2
// http://boinc.berkeley.edu
 
3
// Copyright (C) 2008 University of California
 
4
//
 
5
// BOINC is free software; you can redistribute it and/or modify it
 
6
// under the terms of the GNU Lesser General Public License
 
7
// as published by the Free Software Foundation,
 
8
// either version 3 of the License, or (at your option) any later version.
 
9
//
 
10
// BOINC is distributed in the hope that it will be useful,
 
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
13
// See the GNU Lesser General Public License for more details.
 
14
//
 
15
// You should have received a copy of the GNU Lesser General Public License
 
16
// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
 
17
 
 
18
 
 
19
#ifndef _BOINCSIMPLEFRAME_H_
 
20
#define _BOINCSIMPLEFRAME_H_
 
21
 
 
22
#include "BOINCBaseFrame.h"
 
23
 
 
24
#if defined(__GNUG__) && !defined(__APPLE__)
 
25
#pragma interface "sg_BoincSimpleFrame.cpp"
 
26
#endif
 
27
 
 
28
class CSimpleTaskPanel;
 
29
class CSimpleProjectPanel;
 
30
class CSimpleTaskPanel;
 
31
class CDlgMessages;
 
32
 
 
33
class CSimpleGUIPanel : public wxPanel
 
34
{
 
35
    DECLARE_DYNAMIC_CLASS(CSimpleGUIPanel)
 
36
 
 
37
public:
 
38
    CSimpleGUIPanel();
 
39
    CSimpleGUIPanel(wxWindow* parent);
 
40
 
 
41
   ~CSimpleGUIPanel();
 
42
        //
 
43
    // My tasks panel (shown when there are active tasks)
 
44
    CSimpleTaskPanel *m_taskPanel;
 
45
        // My projects panel
 
46
        CSimpleProjectPanel *m_projPanel;
 
47
        ////////////////////////////;
 
48
 
 
49
    void SetBackgroundBitmap();
 
50
    void ReskinInterface();
 
51
        void UpdateProjectView();
 
52
    void OnFrameRender();
 
53
        void OnProjectsAttachToProject();
 
54
    void OnShowNotices(wxCommandEvent& event);
 
55
    void OnPauseResume(wxCommandEvent& event);
 
56
    void OnHelp( wxCommandEvent& event );
 
57
        void SetDlgOpen(bool newDlgState) { dlgOpen = newDlgState; }
 
58
        bool GetDlgOpen() { return dlgOpen; }
 
59
    wxBitmap *GetBackgroundBitMap() { return &m_bmpBg; }
 
60
    void OnCheckForNewNotices(wxTimerEvent& WXUNUSED(event));
 
61
    void NoticesViewed();
 
62
 
 
63
        //////////
 
64
        wxBoxSizer *mainSizer;
 
65
        //////////
 
66
    bool        m_bNewNoticeAlert;
 
67
    bool        m_bNoticesButtonIsRed;
 
68
    DECLARE_EVENT_TABLE()
 
69
 
 
70
protected:
 
71
    void OnPaint(wxPaintEvent& event);
 
72
    void OnEraseBackground(wxEraseEvent& event);
 
73
#ifdef __WXMAC__
 
74
//    void SetupMacAccessibilitySupport();
 
75
//    void RemoveMacAccessibilitySupport();
 
76
    
 
77
//    EventHandlerRef m_pSGAccessibilityEventHandlerRef;
 
78
 
 
79
#endif
 
80
    wxBitmap    m_bmpBg;
 
81
    wxButton    *m_NoticesButton;
 
82
    wxButton    *m_PauseResumeButton;
 
83
    wxButton    *m_HelpButton;
 
84
    wxString    m_sPauseString;
 
85
    wxString    m_sResumeString;
 
86
    int         m_oldWorkCount;
 
87
    bool        m_bisPaused;
 
88
 
 
89
private:
 
90
    int         m_irefreshCount;
 
91
    bool        dlgOpen;
 
92
        wxTimer*    checkForNewNoticesTimer;
 
93
    wxString    m_sPauseButtonToolTip;
 
94
    wxString    m_sResumeButtonToolTip;
 
95
};
 
96
 
 
97
 
 
98
// Define a new frame
 
99
class CSimpleFrame : public CBOINCBaseFrame
 
100
{
 
101
    DECLARE_DYNAMIC_CLASS(CSimpleFrame)
 
102
 
 
103
public:
 
104
    CSimpleFrame();
 
105
    CSimpleFrame(wxString title, wxIcon* icon, wxIcon* icon32, wxPoint position, wxSize size);
 
106
 
 
107
   ~CSimpleFrame();
 
108
 
 
109
    void OnChangeGUI( wxCommandEvent& event );
 
110
    void OnPreferences( wxCommandEvent& event );
 
111
    void OnOptions( wxCommandEvent& event );
 
112
    void OnOldSG( wxCommandEvent& event );
 
113
    void OnHelp( wxHelpEvent& event );
 
114
    void OnHelpBOINC( wxCommandEvent& event );
 
115
    void OnHelpAbout( wxCommandEvent& event );
 
116
 
 
117
    void OnProjectsAttachToProject();
 
118
 
 
119
        void OnConnect(CFrameEvent& event );
 
120
    void OnReloadSkin( CFrameEvent& event );
 
121
    void OnRefreshView( CFrameEvent& event );
 
122
    void OnNotification( CFrameEvent& event );
 
123
 
 
124
        void SetMsgsDlgOpen(CDlgMessages* newDlgPtr) { dlgMsgsPtr = newDlgPtr; }
 
125
    bool isMessagesDlgOpen() { return (dlgMsgsPtr != NULL); }
 
126
 
 
127
    bool SaveState();
 
128
    bool RestoreState();
 
129
 
 
130
protected:
 
131
    virtual int     _GetCurrentViewPage();
 
132
 
 
133
        wxMenuBar*          m_pMenubar;
 
134
    wxAcceleratorEntry  m_Shortcuts[1];
 
135
    wxAcceleratorTable* m_pAccelTable;
 
136
 
 
137
        CSimpleGUIPanel* m_pBackgroundPanel;
 
138
 
 
139
 
 
140
private:
 
141
    CDlgMessages* dlgMsgsPtr;
 
142
 
 
143
    DECLARE_EVENT_TABLE()
 
144
};
 
145
 
 
146
#endif  // _BOINCSIMPLEFRAME_H_
 
147
 
 
148