KiCad PCB EDA Suite
wx_html_report_panel.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2015 CERN
5 * Copyright (C) 2015-2021 KiCad Developers, see change_log.txt for contributors.
6 * Author: Tomasz Wlostowski <[email protected]>
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation, either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#ifndef __WX_HTML_REPORT_PANEL_H__
23#define __WX_HTML_REPORT_PANEL_H__
24
25#include <reporter.h>
26#include <vector>
27
29
38{
39public:
40 WX_HTML_REPORT_PANEL( wxWindow* parent, wxWindowID id = wxID_ANY,
41 const wxPoint& pos = wxDefaultPosition,
42 const wxSize& size = wxSize( 500,300 ), long style = wxTAB_TRAVERSAL );
44
46 void MsgPanelSetMinSize( const wxSize& aMinSize );
47
50
57 void Report( const wxString& aText, SEVERITY aSeverity,
59
61 void Clear();
62
64 int Count( int severityMask );
65
67 void SetLabel( const wxString& aLabel ) override;
68
72 void SetLazyUpdate( bool aLazyUpdate );
73
76 void Flush( bool aSort = false );
77
80 void SetVisibleSeverities( int aSeverities );
81
84 int GetVisibleSeverities() const;
85
88 void SetShowSeverity( SEVERITY aSeverity, bool aValue );
89
91 void SetFileName( const wxString& aReportFileName );
92
94 wxString& GetFileName( void );
95
96
97private:
99 {
101 wxString message;
102 };
103
104 typedef std::vector<REPORT_LINE> REPORT_LINES;
105
106 wxString addHeader( const wxString& aBody );
107 wxString generateHtml( const REPORT_LINE& aLine );
108 wxString generatePlainText( const REPORT_LINE& aLine );
109 void updateBadges();
110
111 void scrollToBottom();
112 void syncCheckboxes();
113
114 void onRightClick( wxMouseEvent& event ) override;
115 void onMenuEvent( wxMenuEvent& event );
116 void onCheckBoxShowAll( wxCommandEvent& event ) override;
117 void onCheckBoxShowWarnings( wxCommandEvent& event ) override;
118 void onCheckBoxShowErrors( wxCommandEvent& event ) override;
119 void onCheckBoxShowInfos( wxCommandEvent& event ) override;
120 void onCheckBoxShowActions( wxCommandEvent& event ) override;
121
122 void onBtnSaveToFile( wxCommandEvent& event ) override;
123
124 void onThemeChanged( wxSysColourChangedEvent &aEvent );
125
126private:
128
132
135
137};
138
139#endif //__WX_HTML_REPORT_PANEL_H__
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:71
LOCATION
Location where the message is to be reported.
Definition: reporter.h:79
@ LOC_BODY
Definition: reporter.h:81
A wrapper for reporting to a wx HTML window.
Definition: reporter.h:189
Class WX_HTML_REPORT_PANEL_BASE.
A widget for browsing a rich text error/status report.
void Clear()
return the number of messages matching the given severity mask.
void onCheckBoxShowErrors(wxCommandEvent &event) override
wxString m_reportFileName
defaults to the not very useful /bin/report.txt
void onThemeChanged(wxSysColourChangedEvent &aEvent)
void onCheckBoxShowActions(wxCommandEvent &event) override
REPORT_LINES m_report
copy of the report, stored for filtering
void onRightClick(wxMouseEvent &event) override
int m_severities
message severities to display (mask)
int Count(int severityMask)
sets the frame label
void SetLazyUpdate(bool aLazyUpdate)
Forces updating the HTML page, after the report is built in lazy mode If aSort = true,...
WX_HTML_PANEL_REPORTER m_reporter
void SetLabel(const wxString &aLabel) override
Sets the lazy update.
std::vector< REPORT_LINE > REPORT_LINES
void MsgPanelSetMinSize(const wxSize &aMinSize)
returns the reporter object that reports to this panel
void SetFileName(const wxString &aReportFileName)
wxString generateHtml(const REPORT_LINE &aLine)
void Report(const wxString &aText, SEVERITY aSeverity, REPORTER::LOCATION aLocation=REPORTER::LOC_BODY)
Reports the string.
void onCheckBoxShowAll(wxCommandEvent &event) override
void SetShowSeverity(SEVERITY aSeverity, bool aValue)
Set the report full file name to the string.
void SetVisibleSeverities(int aSeverities)
void Flush(bool aSort=false)
Set the visible severity filter.
void onCheckBoxShowWarnings(wxCommandEvent &event) override
void onMenuEvent(wxMenuEvent &event)
wxString generatePlainText(const REPORT_LINE &aLine)
void onBtnSaveToFile(wxCommandEvent &event) override
REPORT_LINES m_reportHead
... and at the beginning, regardless of sorting
~WX_HTML_REPORT_PANEL()
Set the min size of the area which displays html messages:
void onCheckBoxShowInfos(wxCommandEvent &event) override
wxString addHeader(const wxString &aBody)
REPORT_LINES m_reportTail
Lines to print at the end, regardless of sorting.
WX_HTML_REPORT_PANEL(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(500, 300), long style=wxTAB_TRAVERSAL)
SEVERITY