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

« back to all changes in this revision

Viewing changes to clientgui/sg_ImageButton.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
 
#ifndef _IMAGEBUTTON_H_
21
 
#define _IMAGEBUTTON_H_ 
22
 
 
23
 
#if defined(__GNUG__) && !defined(__APPLE__)
24
 
#pragma interface "sg_ImageButton.cpp"
25
 
#endif
26
 
 
27
 
#define TAB_STATUS_RUNNING 1
28
 
#define TAB_STATUS_PREEMPTED 2 
29
 
#define TAB_STATUS_PAUSED_USER_ACTIVE 3
30
 
#define TAB_STATUS_PAUSED_USER_REQ 4
31
 
#define TAB_STATUS_PAUSED_POWER 5
32
 
#define TAB_STATUS_PAUSED_TIME_OF_DAY 6
33
 
#define TAB_STATUS_PAUSED_BENCHMARKS 7
34
 
#define TAB_STATUS_PAUSED 8
35
 
#define TAB_STATUS_INITIAL_DELAY 9
36
 
 
37
 
class CImageButton : public wxPanel 
38
 
39
 
public: 
40
 
            /// Constructors
41
 
            CImageButton(wxWindow* parent,wxBitmap bg,wxPoint coord, wxSize size, bool drawText, int initStatus); 
42
 
                ~CImageButton();
43
 
        void SetImage(wxBitmap bg);
44
 
                void OnPaint(wxPaintEvent& event); 
45
 
                void OnLeftUp(wxMouseEvent& event);
46
 
                void OnEraseBackground(wxEraseEvent& event);
47
 
                void SetEnableShowGraphics(bool show);
48
 
                void SetStatus(int status);
49
 
                int GetStatus();
50
 
private: 
51
 
        //static const int MaxWidth = 320; 
52
 
        //static const int MaxHeight = 240; 
53
 
        wxBitmap btnBG; 
54
 
                bool m_enableShowGraphics;
55
 
                int status;
56
 
                wxString GetStatusText();
57
 
                void SetToolTip();
58
 
        DECLARE_EVENT_TABLE() 
59
 
}; 
60
 
 
61
 
#endif 
 
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
#ifndef _IMAGEBUTTON_H_
 
19
#define _IMAGEBUTTON_H_ 
 
20
 
 
21
#if defined(__GNUG__) && !defined(__APPLE__)
 
22
#pragma interface "sg_ImageButton.cpp"
 
23
#endif
 
24
 
 
25
#define TAB_STATUS_RUNNING 1
 
26
#define TAB_STATUS_PREEMPTED 2 
 
27
#define TAB_STATUS_PAUSED_USER_ACTIVE 3
 
28
#define TAB_STATUS_PAUSED_USER_REQ 4
 
29
#define TAB_STATUS_PAUSED_POWER 5
 
30
#define TAB_STATUS_PAUSED_TIME_OF_DAY 6
 
31
#define TAB_STATUS_PAUSED_BENCHMARKS 7
 
32
#define TAB_STATUS_PAUSED 8
 
33
#define TAB_STATUS_INITIAL_DELAY 9
 
34
 
 
35
class CImageButton : public wxPanel 
 
36
 
37
public: 
 
38
            /// Constructors
 
39
            CImageButton(wxWindow* parent,wxBitmap bg,wxPoint coord, wxSize size, bool drawText, int initStatus); 
 
40
                ~CImageButton();
 
41
        void SetImage(wxBitmap bg);
 
42
                void OnPaint(wxPaintEvent& event); 
 
43
                void OnLeftUp(wxMouseEvent& event);
 
44
                void OnEraseBackground(wxEraseEvent& event);
 
45
                void SetEnableShowGraphics(bool show);
 
46
                void SetStatus(int status);
 
47
                int GetStatus();
 
48
private: 
 
49
        //static const int MaxWidth = 320; 
 
50
        //static const int MaxHeight = 240; 
 
51
        wxBitmap btnBG; 
 
52
                bool m_enableShowGraphics;
 
53
                int status;
 
54
                wxString GetStatusText();
 
55
                void SetToolTip();
 
56
        DECLARE_EVENT_TABLE() 
 
57
}; 
 
58
 
 
59
#endif