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

« back to all changes in this revision

Viewing changes to clientgui/DlgEventLog.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
// 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 _DLGEVENTLOG_H_ 
 
20
#define _DLGEVENTLOG_H_ 
 
21
 
 
22
#if defined(__GNUG__) && !defined(__APPLE__)
 
23
#pragma interface "DlgEventLog.cpp"
 
24
#endif
 
25
 
 
26
#define EVENT_LOG_STRIPES 1
 
27
#define EVENT_LOG_RULES 1
 
28
 
 
29
#if EVENT_LOG_RULES
 
30
#define EVENT_LOG_DEFAULT_LIST_MULTI_SEL_FLAGS   wxLC_REPORT | wxLC_VIRTUAL | wxLC_HRULES
 
31
#else
 
32
#define EVENT_LOG_DEFAULT_LIST_MULTI_SEL_FLAGS   wxLC_REPORT | wxLC_VIRTUAL
 
33
#endif
 
34
 
 
35
 
 
36
/*!
 
37
 * Includes
 
38
 */
 
39
 
 
40
////@begin includes
 
41
////@end includes
 
42
 
 
43
/*!
 
44
 * Forward declarations
 
45
 */
 
46
 
 
47
////@begin forward declarations
 
48
class CDlgEventLogListCtrl;
 
49
////@end forward declarations
 
50
 
 
51
/*!
 
52
 * Control identifiers
 
53
 */
 
54
 
 
55
////@begin control identifiers
 
56
#define ID_DLGEVENTLOG 30000
 
57
#define SYMBOL_CDLGEVENTLOG_STYLE wxDEFAULT_DIALOG_STYLE|wxDIALOG_NO_PARENT|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxRESIZE_BORDER
 
58
#define SYMBOL_CDLGEVENTLOG_TITLE wxT("")
 
59
#define SYMBOL_CDLGEVENTLOG_IDNAME ID_DLGEVENTLOG
 
60
#define SYMBOL_CDLGEVENTLOG_SIZE wxDefaultSize
 
61
#define SYMBOL_CDLGEVENTLOG_POSITION wxDefaultPosition
 
62
#define ID_COPYSELECTED 10001
 
63
#define ID_COPYAll 10002
 
64
////@end control identifiers
 
65
 
 
66
/*!
 
67
 * Compatibility
 
68
 */
 
69
 
 
70
#ifndef wxCLOSE_BOX
 
71
#define wxCLOSE_BOX 0x1000
 
72
#endif
 
73
#ifndef wxFIXED_MINSIZE
 
74
#define wxFIXED_MINSIZE 0
 
75
#endif
 
76
 
 
77
class CDlgEventLog : public wxDialog
 
78
{
 
79
    DECLARE_DYNAMIC_CLASS( CDlgEventLog )
 
80
    DECLARE_EVENT_TABLE()
 
81
 
 
82
public:
 
83
    /// Constructors
 
84
    CDlgEventLog( wxWindow* parent = NULL, wxWindowID id = SYMBOL_CDLGEVENTLOG_IDNAME, const wxString& caption = SYMBOL_CDLGEVENTLOG_TITLE, const wxPoint& pos = SYMBOL_CDLGEVENTLOG_POSITION, const wxSize& size = SYMBOL_CDLGEVENTLOG_SIZE, long style = SYMBOL_CDLGEVENTLOG_STYLE );
 
85
    ~CDlgEventLog();
 
86
    
 
87
    /// Creation
 
88
    bool Create( wxWindow* parent = NULL, wxWindowID id = SYMBOL_CDLGEVENTLOG_IDNAME, const wxString& caption = SYMBOL_CDLGEVENTLOG_TITLE, const wxPoint& pos = SYMBOL_CDLGEVENTLOG_POSITION, const wxSize& size = SYMBOL_CDLGEVENTLOG_SIZE, long style = SYMBOL_CDLGEVENTLOG_STYLE );
 
89
 
 
90
    /// Creates the controls and sizers
 
91
    void CreateControls();
 
92
 
 
93
    /// Sets text for m_pFilterButton
 
94
    void SetFilterButtonText();
 
95
    
 
96
    /// Text color selection
 
97
    void SetTextColor();
 
98
    
 
99
////@begin CDlgEventLog event handler declarations
 
100
    /// wxEVT_HELP event handler for ID_DLGEVENTLOG
 
101
    void OnHelp( wxHelpEvent& event );
 
102
 
 
103
    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
 
104
    void OnOK( wxCommandEvent& event );
 
105
    
 
106
    /// wxEVT_CLOSE event handler for CDlgEventLog (window close control clicked)
 
107
    void OnClose(wxCloseEvent& event);
 
108
 
 
109
    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_COPYAll
 
110
    void OnMessagesCopyAll( wxCommandEvent& event );
 
111
 
 
112
    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_COPYSELECTED
 
113
    void OnMessagesCopySelected( wxCommandEvent& event );
 
114
 
 
115
    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_TASK_MESSAGES_FILTERBYPROJECT
 
116
    void OnMessagesFilter( wxCommandEvent& event );
 
117
 
 
118
    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_SIMPLE_HELP
 
119
    void OnButtonHelp( wxCommandEvent& event );
 
120
 
 
121
    /// called from CMainDocument::HandleCompletedRPC() after wxEVT_RPC_FINISHED event
 
122
    void OnRefresh();
 
123
////@end CDlgEventLog event handler declarations
 
124
 
 
125
////@begin CDlgEventLog member function declarations
 
126
////@end CDlgEventLog member function declarations
 
127
 
 
128
    virtual wxInt32         GetFilteredMessageIndex( wxInt32 iRow) const;
 
129
    virtual wxInt32         GetDocCount();
 
130
 
 
131
    virtual wxString        OnListGetItemText( long item, long column ) const;
 
132
    virtual wxListItemAttr* OnListGetItemAttr( long item ) const;
 
133
 
 
134
    bool                    OnSaveState(wxConfigBase* pConfig);
 
135
    bool                    OnRestoreState(wxConfigBase* pConfig);
 
136
 
 
137
    void                    UpdateButtons();
 
138
 
 
139
private:
 
140
////@begin CDlgEventLog member variables
 
141
////@end CDlgEventLog member variables
 
142
    wxTimer*                m_pRefreshTimer;
 
143
 
 
144
    wxInt32                 m_iPreviousDocCount;
 
145
 
 
146
    CDlgEventLogListCtrl*   m_pList;
 
147
    wxArrayInt              m_iFilteredIndexes;
 
148
    wxInt32                 m_iTotalDocCount;
 
149
    wxInt32                 m_iFilteredDocCount;
 
150
    wxInt32                 m_iPreviousTotalDocCount;
 
151
    wxInt32                 m_iPreviousRowCount;
 
152
    wxButton*               m_pFilterButton;
 
153
    wxButton*               m_pCopySelectedButton;
 
154
 
 
155
    wxListItemAttr*         m_pMessageInfoAttr;
 
156
    wxListItemAttr*         m_pMessageErrorAttr;
 
157
    wxListItemAttr*         m_pMessageInfoGrayAttr;
 
158
    wxListItemAttr*         m_pMessageErrorGrayAttr;
 
159
 
 
160
    bool                    m_bProcessingRefreshEvent;
 
161
    
 
162
    bool                    m_bEventLogIsOpen;
 
163
 
 
164
    bool                    SaveState();
 
165
    bool                    RestoreState();
 
166
 
 
167
    void                    GetWindowDimensions( wxPoint& position, wxSize& size );
 
168
    void                    SetWindowDimensions();
 
169
 
 
170
    void                    OnMouseUp(wxMouseEvent& event);
 
171
 
 
172
    void                    ResetMessageFiltering();    
 
173
    
 
174
    bool                    EnsureLastItemVisible();
 
175
    wxInt32                 FormatProjectName( wxInt32 item, wxString& strBuffer ) const;
 
176
    wxInt32                 FormatTime( wxInt32 item, wxString& strBuffer ) const;
 
177
    wxInt32                 FormatMessage( wxInt32 item, wxString& strBuffer ) const;
 
178
 
 
179
#ifdef wxUSE_CLIPBOARD
 
180
    bool                    m_bClipboardOpen;
 
181
    wxString                m_strClipboardData;
 
182
    bool                    OpenClipboard( wxInt32 size );
 
183
    wxInt32                 CopyToClipboard( wxInt32 item );
 
184
    bool                    CloseClipboard();
 
185
#endif
 
186
};
 
187
 
 
188
 
 
189
#endif  // end CDlgMessages