KiCad PCB EDA Suite
Loading...
Searching...
No Matches
wx_html_report_box.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) 2020-2022 KiCad Developers, see change_log.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef WX_HTML_REPORT_BOX_H
21#define WX_HTML_REPORT_BOX_H
22
23#include <reporter.h>
24#include <vector>
25#include <widgets/html_window.h>
26#include <eda_units.h>
27
32{
33public:
34 WX_HTML_REPORT_BOX( wxWindow* parent, wxWindowID id = wxID_ANY,
35 const wxPoint& pos = wxDefaultPosition,
36 const wxSize& size = wxSize( 500,300 ), long style = wxTAB_TRAVERSAL );
37
39
40 REPORTER& Report( const wxString& aText, SEVERITY aSeverity = RPT_SEVERITY_UNDEFINED ) override;
41
42 bool HasMessage() const override { return !m_messages.empty(); }
43
44 void SetUnits( EDA_UNITS aUnits ) { m_units = aUnits; }
45 EDA_UNITS GetUnits() const override { return m_units; }
46
52
57 void Flush();
58
62 void Clear();
63
64private:
65 void onThemeChanged( wxSysColourChangedEvent &aEvent );
66 void onRightClick( wxMouseEvent& event );
67 void onMenuEvent( wxMenuEvent& event );
68
69 wxString generateHtml( const wxString& aLine );
70
71private:
73
77
79 std::vector<wxString> m_messages;
80};
81
82#endif //WX_HTML_REPORT_BOX_H
Add dark theme support to wxHtmlWindow.
Definition: html_window.h:35
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:72
A slimmed down version of WX_HTML_REPORT_PANEL.
void onMenuEvent(wxMenuEvent &event)
void onRightClick(wxMouseEvent &event)
std::vector< wxString > m_messages
void Clear()
Delete the stored messages.
EDA_UNITS m_units
Indicates messages should be flushed as they are added.
void SetImmediateMode()
In immediate mode, messages are flushed as they are added.
REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
bool m_immediateMode
copy of the report, stored for filtering
EDA_UNITS GetUnits() const override
void SetUnits(EDA_UNITS aUnits)
void Flush()
Build the HTML messages page.
bool HasMessage() const override
Returns true if the reporter client is non-empty.
wxString generateHtml(const wxString &aLine)
void onThemeChanged(wxSysColourChangedEvent &aEvent)
EDA_UNITS
Definition: eda_units.h:46
SEVERITY
@ RPT_SEVERITY_UNDEFINED