~ubuntu-branches/ubuntu/precise/boinc/precise

« back to all changes in this revision

Viewing changes to clientgui/AdvancedFrame.h

Tags: 6.12.8+dfsg-1
* New upstream release.
* Simplified debian/rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Berkeley Open Infrastructure for Network Computing
2
 
// http://boinc.berkeley.edu
3
 
// Copyright (C) 2005 University of California
4
 
//
5
 
// This is free software; you can redistribute it and/or
6
 
// modify it under the terms of the GNU Lesser General Public
7
 
// License as published by the Free Software Foundation;
8
 
// either version 2.1 of the License, or (at your option) any later version.
9
 
//
10
 
// This software 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
 
// To view the GNU Lesser General Public License visit
16
 
// http://www.gnu.org/copyleft/lesser.html
17
 
// or write to the Free Software Foundation, Inc.,
18
 
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19
 
 
20
 
 
21
 
#ifndef _ADVANCEDFRAME_H_
22
 
#define _ADVANCEDFRAME_H_
23
 
 
24
 
#if defined(__GNUG__) && !defined(__APPLE__)
25
 
#pragma interface "AdvancedFrame.cpp"
26
 
#endif
27
 
 
28
 
class CStatusBar : public wxStatusBar
29
 
{
30
 
    DECLARE_DYNAMIC_CLASS(CStatusBar)
31
 
 
32
 
public:
33
 
    CStatusBar();
34
 
    CStatusBar(wxWindow *parent);
35
 
    ~CStatusBar();
36
 
 
37
 
    void OnSize(wxSizeEvent& event);
38
 
 
39
 
    wxStaticBitmap* m_pbmpConnected;
40
 
    wxStaticText*   m_ptxtConnected;
41
 
    wxStaticBitmap* m_pbmpDisconnect;
42
 
    wxStaticText*   m_ptxtDisconnect;
43
 
 
44
 
private:
45
 
    DECLARE_EVENT_TABLE()
46
 
};
47
 
 
48
 
 
49
 
class CAdvancedFrame : public CBOINCBaseFrame
50
 
{
51
 
    DECLARE_DYNAMIC_CLASS(CAdvancedFrame)
52
 
 
53
 
public:
54
 
    CAdvancedFrame();
55
 
    CAdvancedFrame(wxString title, wxIcon* icon, wxIcon* icon32);
56
 
 
57
 
    ~CAdvancedFrame(void);
58
 
 
59
 
    void OnSwitchView( wxCommandEvent& event );
60
 
    void OnSwitchGUI( wxCommandEvent& event );
61
 
 
62
 
    void OnActivitySelection( wxCommandEvent& event );
63
 
    void OnNetworkSelection( wxCommandEvent& event );
64
 
 
65
 
    void OnProjectsAttachToProject( wxCommandEvent& event );
66
 
    void OnProjectsAttachToAccountManager( wxCommandEvent& event );
67
 
    void OnAccountManagerUpdate( wxCommandEvent& event );
68
 
    void OnAccountManagerDetach( wxCommandEvent& event );
69
 
 
70
 
    void OnOptionsOptions( wxCommandEvent& event );
71
 
        void OnDlgPreferences( wxCommandEvent& event );
72
 
    void OnSelectComputer( wxCommandEvent& event );
73
 
    void OnClientShutdown( wxCommandEvent& event );
74
 
    void OnRunBenchmarks( wxCommandEvent& event );
75
 
    void OnCommandsRetryCommunications( wxCommandEvent& event );
76
 
    void Onread_prefs( wxCommandEvent& event );
77
 
    void Onread_config( wxCommandEvent& event );
78
 
 
79
 
    void OnHelp( wxHelpEvent& event );
80
 
    void OnHelpBOINC( wxCommandEvent& event );
81
 
    void OnHelpAbout( wxCommandEvent& event );
82
 
 
83
 
    void OnShow( wxShowEvent& event );
84
 
 
85
 
    void OnRefreshState( wxTimerEvent& event );
86
 
    void OnFrameRender( wxTimerEvent& event );
87
 
    void OnListPanelRender( wxTimerEvent& event );
88
 
 
89
 
    void OnNotebookSelectionChanged( wxNotebookEvent& event );
90
 
 
91
 
    void OnRefreshView( CFrameEvent& event );
92
 
    void OnConnect( CFrameEvent& event );
93
 
    void OnUpdateStatus( CFrameEvent& event );
94
 
 
95
 
    void ResetReminderTimers();
96
 
 
97
 
    wxTimer*        m_pRefreshStateTimer;
98
 
    wxTimer*        m_pFrameRenderTimer;
99
 
    wxTimer*        m_pFrameListPanelRenderTimer;
100
 
 
101
 
private:
102
 
 
103
 
    wxMenuBar*      m_pMenubar;
104
 
    wxNotebook*     m_pNotebook;
105
 
    CStatusBar*     m_pStatusbar;
106
 
 
107
 
        wxInt32                 m_iDisplayViewType;
108
 
 
109
 
    wxString        m_strBaseTitle;
110
 
 
111
 
    bool            CreateMenu();
112
 
    bool            DeleteMenu();
113
 
 
114
 
    bool            CreateNotebook();
115
 
    bool            RepopulateNotebook();
116
 
    template < class T >
117
 
        bool        CreateNotebookPage( T pwndNewNotebookPage );
118
 
    bool            DeleteNotebook();
119
 
 
120
 
    bool            CreateStatusbar();
121
 
    bool            DeleteStatusbar();
122
 
 
123
 
    bool            SaveState();
124
 
    bool            SaveViewState();
125
 
    bool            RestoreState();
126
 
    bool            RestoreViewState();
127
 
 
128
 
    void            SaveWindowDimensions();
129
 
    void            RestoreWindowDimensions();
130
 
 
131
 
    void            UpdateActivityModeControls( CC_STATUS& status );
132
 
    void            UpdateNetworkModeControls( CC_STATUS& status );
133
 
    void            UpdateRefreshTimerInterval( wxInt32 iCurrentNotebookPage );
134
 
 
135
 
    void            StartTimers();
136
 
    void            StopTimers();
137
 
 
138
 
#ifdef __WXMAC__
139
 
protected:
140
 
 
141
 
    wxAcceleratorEntry  m_Shortcuts[1];     // For HELP keyboard shortcut
142
 
    wxAcceleratorTable* m_pAccelTable;
143
 
#endif
144
 
 
145
 
    DECLARE_EVENT_TABLE()
146
 
};
147
 
 
148
 
 
149
 
#endif
150
 
 
151
 
 
 
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 _ADVANCEDFRAME_H_
 
20
#define _ADVANCEDFRAME_H_
 
21
 
 
22
#if defined(__GNUG__) && !defined(__APPLE__)
 
23
#pragma interface "AdvancedFrame.cpp"
 
24
#endif
 
25
 
 
26
 
 
27
class CBOINCBaseView;
 
28
class CDlgEventLog;
 
29
 
 
30
class CStatusBar : public wxStatusBar
 
31
{
 
32
    DECLARE_DYNAMIC_CLASS(CStatusBar)
 
33
 
 
34
public:
 
35
    CStatusBar();
 
36
    CStatusBar(wxWindow *parent);
 
37
    ~CStatusBar();
 
38
 
 
39
    void OnSize(wxSizeEvent& event);
 
40
 
 
41
    wxStaticBitmap* m_pbmpConnected;
 
42
    wxStaticText*   m_ptxtConnected;
 
43
    wxStaticBitmap* m_pbmpDisconnect;
 
44
    wxStaticText*   m_ptxtDisconnect;
 
45
 
 
46
private:
 
47
    DECLARE_EVENT_TABLE()
 
48
};
 
49
 
 
50
 
 
51
class CAdvancedFrame : public CBOINCBaseFrame
 
52
{
 
53
    DECLARE_DYNAMIC_CLASS( CAdvancedFrame )
 
54
 
 
55
public:
 
56
    CAdvancedFrame();
 
57
    CAdvancedFrame( wxString title, wxIcon* icon, wxIcon* icon32, wxPoint position, wxSize size );
 
58
 
 
59
    ~CAdvancedFrame(void);
 
60
 
 
61
    void OnChangeView( wxCommandEvent& event );
 
62
    void OnChangeGUI( wxCommandEvent& event );
 
63
 
 
64
    void OnWizardAttach( wxCommandEvent& event );
 
65
    void OnWizardUpdate( wxCommandEvent& event );
 
66
    void OnWizardDetach( wxCommandEvent& event );
 
67
 
 
68
    void OnActivitySelection( wxCommandEvent& event );
 
69
    void OnGPUSelection( wxCommandEvent& event );
 
70
    void OnNetworkSelection( wxCommandEvent& event );
 
71
 
 
72
    void OnOptions( wxCommandEvent& event );
 
73
        void OnPreferences( wxCommandEvent& event );
 
74
    void OnSelectComputer( wxCommandEvent& event );
 
75
    void OnClientShutdown( wxCommandEvent& event );
 
76
    void OnRunBenchmarks( wxCommandEvent& event );
 
77
    void OnRetryCommunications( wxCommandEvent& event );
 
78
    void OnReadPreferences( wxCommandEvent& event );
 
79
    void OnReadConfig( wxCommandEvent& event );
 
80
    void OnEventLog( wxCommandEvent& event );
 
81
    void OnLaunchNewInstance( wxCommandEvent& event );
 
82
 
 
83
    void OnHelp( wxHelpEvent& event );
 
84
    void OnHelpBOINC( wxCommandEvent& event );
 
85
    void OnHelpAbout( wxCommandEvent& event );
 
86
 
 
87
    void OnRefreshState( wxTimerEvent& event );
 
88
    void OnFrameRender( wxTimerEvent& event );
 
89
 
 
90
    void OnNotebookSelectionChanged( wxNotebookEvent& event );
 
91
 
 
92
    void OnRefreshView( CFrameEvent& event );
 
93
    void OnConnect( CFrameEvent& event );
 
94
    void OnNotification( CFrameEvent& event );
 
95
 
 
96
    void OnUpdateStatus( CFrameEvent& event );
 
97
 
 
98
    void ResetReminderTimers();
 
99
 
 
100
    bool RestoreState();
 
101
    bool SaveState();
 
102
 
 
103
    wxTimer*        m_pRefreshStateTimer;
 
104
    wxTimer*        m_pFrameRenderTimer;
 
105
 
 
106
 
 
107
protected:
 
108
    virtual int     _GetCurrentViewPage();
 
109
 
 
110
    wxAcceleratorEntry  m_Shortcuts[1];     // For HELP keyboard shortcut
 
111
    wxAcceleratorTable* m_pAccelTable;
 
112
 
 
113
private:
 
114
 
 
115
    wxMenuBar*      m_pMenubar;
 
116
    wxNotebook*     m_pNotebook;
 
117
    CStatusBar*     m_pStatusbar;
 
118
 
 
119
    wxString        m_strBaseTitle;
 
120
 
 
121
    bool            CreateMenu();
 
122
    bool            DeleteMenu();
 
123
 
 
124
    bool            CreateNotebook();
 
125
    bool            RepopulateNotebook();
 
126
    bool            CreateNotebookPage( CBOINCBaseView* pwndNewNotebookPage );
 
127
    bool            DeleteNotebook();
 
128
    bool            CreateStatusbar();
 
129
    bool            DeleteStatusbar();
 
130
 
 
131
    void            SaveWindowDimensions();
 
132
 
 
133
    void            UpdateActivityModeControls( CC_STATUS& status );
 
134
    void            UpdateGPUModeControls( CC_STATUS& status );
 
135
    void            UpdateNetworkModeControls( CC_STATUS& status );
 
136
    void            UpdateRefreshTimerInterval( wxInt32 iCurrentNotebookPage );
 
137
    void            UpdateRefreshTimerInterval();
 
138
 
 
139
    void            StartTimers();
 
140
    void            StopTimers();
 
141
 
 
142
    DECLARE_EVENT_TABLE()
 
143
};
 
144
 
 
145
 
 
146
#endif
 
147
 
 
148