1
// This file is part of BOINC.
2
// http://boinc.berkeley.edu
3
// Copyright (C) 2008 University of California
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.
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.
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/>.
19
#ifndef _DLGEVENTLOG_H_
20
#define _DLGEVENTLOG_H_
22
#if defined(__GNUG__) && !defined(__APPLE__)
23
#pragma interface "DlgEventLog.cpp"
26
#define EVENT_LOG_STRIPES 1
27
#define EVENT_LOG_RULES 1
30
#define EVENT_LOG_DEFAULT_LIST_MULTI_SEL_FLAGS wxLC_REPORT | wxLC_VIRTUAL | wxLC_HRULES
32
#define EVENT_LOG_DEFAULT_LIST_MULTI_SEL_FLAGS wxLC_REPORT | wxLC_VIRTUAL
44
* Forward declarations
47
////@begin forward declarations
48
class CDlgEventLogListCtrl;
49
////@end forward declarations
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
71
#define wxCLOSE_BOX 0x1000
73
#ifndef wxFIXED_MINSIZE
74
#define wxFIXED_MINSIZE 0
77
class CDlgEventLog : public wxDialog
79
DECLARE_DYNAMIC_CLASS( CDlgEventLog )
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 );
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 );
90
/// Creates the controls and sizers
91
void CreateControls();
93
/// Sets text for m_pFilterButton
94
void SetFilterButtonText();
96
/// Text color selection
99
////@begin CDlgEventLog event handler declarations
100
/// wxEVT_HELP event handler for ID_DLGEVENTLOG
101
void OnHelp( wxHelpEvent& event );
103
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
104
void OnOK( wxCommandEvent& event );
106
/// wxEVT_CLOSE event handler for CDlgEventLog (window close control clicked)
107
void OnClose(wxCloseEvent& event);
109
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_COPYAll
110
void OnMessagesCopyAll( wxCommandEvent& event );
112
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_COPYSELECTED
113
void OnMessagesCopySelected( wxCommandEvent& event );
115
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_TASK_MESSAGES_FILTERBYPROJECT
116
void OnMessagesFilter( wxCommandEvent& event );
118
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_SIMPLE_HELP
119
void OnButtonHelp( wxCommandEvent& event );
121
/// called from CMainDocument::HandleCompletedRPC() after wxEVT_RPC_FINISHED event
123
////@end CDlgEventLog event handler declarations
125
////@begin CDlgEventLog member function declarations
126
////@end CDlgEventLog member function declarations
128
virtual wxInt32 GetFilteredMessageIndex( wxInt32 iRow) const;
129
virtual wxInt32 GetDocCount();
131
virtual wxString OnListGetItemText( long item, long column ) const;
132
virtual wxListItemAttr* OnListGetItemAttr( long item ) const;
134
bool OnSaveState(wxConfigBase* pConfig);
135
bool OnRestoreState(wxConfigBase* pConfig);
137
void UpdateButtons();
140
////@begin CDlgEventLog member variables
141
////@end CDlgEventLog member variables
142
wxTimer* m_pRefreshTimer;
144
wxInt32 m_iPreviousDocCount;
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;
155
wxListItemAttr* m_pMessageInfoAttr;
156
wxListItemAttr* m_pMessageErrorAttr;
157
wxListItemAttr* m_pMessageInfoGrayAttr;
158
wxListItemAttr* m_pMessageErrorGrayAttr;
160
bool m_bProcessingRefreshEvent;
162
bool m_bEventLogIsOpen;
167
void GetWindowDimensions( wxPoint& position, wxSize& size );
168
void SetWindowDimensions();
170
void OnMouseUp(wxMouseEvent& event);
172
void ResetMessageFiltering();
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;
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();
189
#endif // end CDlgMessages