KiCad PCB EDA Suite
Loading...
Searching...
No Matches
WX_HTML_REPORT_PANEL Class Reference

A widget for browsing a rich text error/status report. More...

#include <wx_html_report_panel.h>

Inheritance diagram for WX_HTML_REPORT_PANEL:
WX_HTML_REPORT_PANEL_BASE

Classes

struct  REPORT_LINE
 

Public Member Functions

 WX_HTML_REPORT_PANEL (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(500, 300), long style=wxTAB_TRAVERSAL)
 
 ~WX_HTML_REPORT_PANEL ()
 Set the min size of the area which displays html messages:
 
void MsgPanelSetMinSize (const wxSize &aMinSize)
 returns the reporter object that reports to this panel
 
REPORTERReporter ()
 
void Report (const wxString &aText, SEVERITY aSeverity, REPORTER::LOCATION aLocation=REPORTER::LOC_BODY)
 Reports the string.
 
void Clear ()
 return the number of messages matching the given severity mask.
 
int Count (int severityMask)
 sets the frame label
 
void SetLabel (const wxString &aLabel) override
 Sets the lazy update.
 
void SetLazyUpdate (bool aLazyUpdate)
 Forces updating the HTML page, after the report is built in lazy mode If aSort = true, the body messages will be ordered by severity.
 
void Flush (bool aSort=false)
 Set the visible severity filter.
 
void SetVisibleSeverities (int aSeverities)
 
int GetVisibleSeverities () const
 
void SetShowSeverity (SEVERITY aSeverity, bool aValue)
 Set the report full file name to the string.
 
void SetFileName (const wxString &aReportFileName)
 
wxString & GetFileName (void)
 

Protected Attributes

wxStaticBoxSizer * m_box
 
wxFlexGridSizer * m_fgSizer
 
HTML_WINDOWm_htmlView
 
wxStaticText * m_staticTextShow
 
wxCheckBox * m_checkBoxShowAll
 
wxCheckBox * m_checkBoxShowErrors
 
NUMBER_BADGEm_errorsBadge
 
wxCheckBox * m_checkBoxShowWarnings
 
NUMBER_BADGEm_warningsBadge
 
wxCheckBox * m_checkBoxShowActions
 
wxCheckBox * m_checkBoxShowInfos
 
wxButton * m_btnSaveReportToFile
 

Private Types

typedef std::vector< REPORT_LINEREPORT_LINES
 

Private Member Functions

wxString addHeader (const wxString &aBody)
 
wxString generateHtml (const REPORT_LINE &aLine)
 
wxString generatePlainText (const REPORT_LINE &aLine)
 
void updateBadges ()
 
void scrollToBottom ()
 
void syncCheckboxes ()
 
void onRightClick (wxMouseEvent &event) override
 
void onMenuEvent (wxMenuEvent &event)
 
void onCheckBoxShowAll (wxCommandEvent &event) override
 
void onCheckBoxShowWarnings (wxCommandEvent &event) override
 
void onCheckBoxShowErrors (wxCommandEvent &event) override
 
void onCheckBoxShowInfos (wxCommandEvent &event) override
 
void onCheckBoxShowActions (wxCommandEvent &event) override
 
void onBtnSaveToFile (wxCommandEvent &event) override
 
void onThemeChanged (wxSysColourChangedEvent &aEvent)
 

Private Attributes

WX_HTML_PANEL_REPORTER m_reporter
 
REPORT_LINES m_report
 copy of the report, stored for filtering
 
REPORT_LINES m_reportTail
 Lines to print at the end, regardless of sorting.
 
REPORT_LINES m_reportHead
 ... and at the beginning, regardless of sorting
 
int m_severities
 message severities to display (mask)
 
bool m_lazyUpdate
 
wxString m_reportFileName
 defaults to the not very useful /bin/report.txt
 

Detailed Description

A widget for browsing a rich text error/status report.

Used in numerous dialogs in eeschema and pcbnew. Provides error filtering functionality and saving report files.

The messages are reported through a REPORTER object

Definition at line 64 of file wx_html_report_panel.h.

Member Typedef Documentation

◆ REPORT_LINES

typedef std::vector<REPORT_LINE> WX_HTML_REPORT_PANEL::REPORT_LINES
private

Definition at line 131 of file wx_html_report_panel.h.

Constructor & Destructor Documentation

◆ WX_HTML_REPORT_PANEL()

WX_HTML_REPORT_PANEL::WX_HTML_REPORT_PANEL ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxSize( 500,300 ),
long  style = wxTAB_TRAVERSAL 
)

◆ ~WX_HTML_REPORT_PANEL()

WX_HTML_REPORT_PANEL::~WX_HTML_REPORT_PANEL ( )

Set the min size of the area which displays html messages:

Definition at line 60 of file wx_html_report_panel.cpp.

Member Function Documentation

◆ addHeader()

wxString WX_HTML_REPORT_PANEL::addHeader ( const wxString &  aBody)
private

◆ Clear()

◆ Count()

int WX_HTML_REPORT_PANEL::Count ( int  severityMask)

sets the frame label

Definition at line 163 of file wx_html_report_panel.cpp.

References m_report, m_reportHead, and m_reportTail.

Referenced by WX_HTML_PANEL_REPORTER::HasMessageOfSeverity(), and updateBadges().

◆ Flush()

◆ generateHtml()

◆ generatePlainText()

wxString WX_HTML_REPORT_PANEL::generatePlainText ( const REPORT_LINE aLine)
private

◆ GetFileName()

wxString & WX_HTML_REPORT_PANEL::GetFileName ( void  )

◆ GetVisibleSeverities()

int WX_HTML_REPORT_PANEL::GetVisibleSeverities ( ) const
Returns
the visible severity filter. If the m_showAll option is set, the mask is < 0

Definition at line 435 of file wx_html_report_panel.cpp.

References m_severities.

Referenced by DIALOG_ANNOTATE::~DIALOG_ANNOTATE(), DIALOG_IMPORT_NETLIST::~DIALOG_IMPORT_NETLIST(), and DIALOG_UPDATE_PCB::~DIALOG_UPDATE_PCB().

◆ MsgPanelSetMinSize()

void WX_HTML_REPORT_PANEL::MsgPanelSetMinSize ( const wxSize &  aMinSize)

returns the reporter object that reports to this panel

Definition at line 73 of file wx_html_report_panel.cpp.

References WX_HTML_REPORT_PANEL_BASE::m_fgSizer.

Referenced by DIALOG_GEN_FOOTPRINT_POSITION::initDialog(), and DIALOG_ANNOTATE::InitValues().

◆ onBtnSaveToFile()

void WX_HTML_REPORT_PANEL::onBtnSaveToFile ( wxCommandEvent &  event)
overrideprivatevirtual

◆ onCheckBoxShowActions()

void WX_HTML_REPORT_PANEL::onCheckBoxShowActions ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from WX_HTML_REPORT_PANEL_BASE.

Definition at line 340 of file wx_html_report_panel.cpp.

References Flush(), m_severities, RPT_SEVERITY_ACTION, and syncCheckboxes().

◆ onCheckBoxShowAll()

void WX_HTML_REPORT_PANEL::onCheckBoxShowAll ( wxCommandEvent &  event)
overrideprivatevirtual

◆ onCheckBoxShowErrors()

void WX_HTML_REPORT_PANEL::onCheckBoxShowErrors ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from WX_HTML_REPORT_PANEL_BASE.

Definition at line 316 of file wx_html_report_panel.cpp.

References Flush(), m_severities, RPT_SEVERITY_ERROR, and syncCheckboxes().

◆ onCheckBoxShowInfos()

void WX_HTML_REPORT_PANEL::onCheckBoxShowInfos ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from WX_HTML_REPORT_PANEL_BASE.

Definition at line 328 of file wx_html_report_panel.cpp.

References Flush(), m_severities, RPT_SEVERITY_INFO, and syncCheckboxes().

◆ onCheckBoxShowWarnings()

void WX_HTML_REPORT_PANEL::onCheckBoxShowWarnings ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from WX_HTML_REPORT_PANEL_BASE.

Definition at line 304 of file wx_html_report_panel.cpp.

References Flush(), m_severities, RPT_SEVERITY_WARNING, and syncCheckboxes().

◆ onMenuEvent()

void WX_HTML_REPORT_PANEL::onMenuEvent ( wxMenuEvent &  event)
private

Definition at line 258 of file wx_html_report_panel.cpp.

References WX_HTML_REPORT_PANEL_BASE::m_htmlView.

Referenced by WX_HTML_REPORT_PANEL().

◆ onRightClick()

void WX_HTML_REPORT_PANEL::onRightClick ( wxMouseEvent &  event)
overrideprivatevirtual

Reimplemented from WX_HTML_REPORT_PANEL_BASE.

Definition at line 250 of file wx_html_report_panel.cpp.

◆ onThemeChanged()

void WX_HTML_REPORT_PANEL::onThemeChanged ( wxSysColourChangedEvent &  aEvent)
private

Definition at line 65 of file wx_html_report_panel.cpp.

References Flush().

Referenced by WX_HTML_REPORT_PANEL().

◆ Report()

◆ Reporter()

◆ scrollToBottom()

void WX_HTML_REPORT_PANEL::scrollToBottom ( )
private

Definition at line 141 of file wx_html_report_panel.cpp.

References WX_HTML_REPORT_PANEL_BASE::m_htmlView, and updateBadges().

Referenced by Flush(), and Report().

◆ SetFileName()

◆ SetLabel()

void WX_HTML_REPORT_PANEL::SetLabel ( const wxString &  aLabel)
override

Sets the lazy update.

If this mode is on, messages are stored but the display is not updated (Updating display can be very time consuming if there are many messages) A call to Flush() will be needed after build the report

Definition at line 418 of file wx_html_report_panel.cpp.

References WX_HTML_REPORT_PANEL_BASE::m_box.

Referenced by DIALOG_ANNOTATE::DIALOG_ANNOTATE(), DIALOG_IBIS_PARSER_REPORTER::DIALOG_IBIS_PARSER_REPORTER(), DIALOG_IMPORT_NETLIST::DIALOG_IMPORT_NETLIST(), DIALOG_UPDATE_FROM_PCB::DIALOG_UPDATE_FROM_PCB(), DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB(), DIALOG_UPDATE_PCB::OnUpdateClick(), and DIALOG_IMPORT_NETLIST::onUpdatePCB().

◆ SetLazyUpdate()

◆ SetShowSeverity()

◆ SetVisibleSeverities()

void WX_HTML_REPORT_PANEL::SetVisibleSeverities ( int  aSeverities)
Returns
the visible severity filter. If the m_showAll option is set, the mask is < 0

Definition at line 424 of file wx_html_report_panel.cpp.

References m_severities, RPT_SEVERITY_ALL, and syncCheckboxes().

Referenced by DIALOG_IMPORT_NETLIST::DIALOG_IMPORT_NETLIST(), DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB(), and DIALOG_ANNOTATE::InitValues().

◆ syncCheckboxes()

◆ updateBadges()

Member Data Documentation

◆ m_box

wxStaticBoxSizer* WX_HTML_REPORT_PANEL_BASE::m_box
protectedinherited

◆ m_btnSaveReportToFile

wxButton* WX_HTML_REPORT_PANEL_BASE::m_btnSaveReportToFile
protectedinherited

◆ m_checkBoxShowActions

wxCheckBox* WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowActions
protectedinherited

◆ m_checkBoxShowAll

wxCheckBox* WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowAll
protectedinherited

◆ m_checkBoxShowErrors

wxCheckBox* WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowErrors
protectedinherited

◆ m_checkBoxShowInfos

wxCheckBox* WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowInfos
protectedinherited

◆ m_checkBoxShowWarnings

wxCheckBox* WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowWarnings
protectedinherited

◆ m_errorsBadge

NUMBER_BADGE* WX_HTML_REPORT_PANEL_BASE::m_errorsBadge
protectedinherited

◆ m_fgSizer

wxFlexGridSizer* WX_HTML_REPORT_PANEL_BASE::m_fgSizer
protectedinherited

◆ m_htmlView

◆ m_lazyUpdate

bool WX_HTML_REPORT_PANEL::m_lazyUpdate
private

Definition at line 161 of file wx_html_report_panel.h.

Referenced by Report(), and SetLazyUpdate().

◆ m_report

REPORT_LINES WX_HTML_REPORT_PANEL::m_report
private

copy of the report, stored for filtering

Definition at line 156 of file wx_html_report_panel.h.

Referenced by Clear(), Count(), Flush(), onBtnSaveToFile(), and Report().

◆ m_reporter

WX_HTML_PANEL_REPORTER WX_HTML_REPORT_PANEL::m_reporter
private

Definition at line 154 of file wx_html_report_panel.h.

Referenced by Reporter().

◆ m_reportFileName

wxString WX_HTML_REPORT_PANEL::m_reportFileName
private

defaults to the not very useful /bin/report.txt

Definition at line 163 of file wx_html_report_panel.h.

Referenced by GetFileName(), onBtnSaveToFile(), and SetFileName().

◆ m_reportHead

REPORT_LINES WX_HTML_REPORT_PANEL::m_reportHead
private

... and at the beginning, regardless of sorting

Definition at line 158 of file wx_html_report_panel.h.

Referenced by Clear(), Count(), Flush(), onBtnSaveToFile(), and Report().

◆ m_reportTail

REPORT_LINES WX_HTML_REPORT_PANEL::m_reportTail
private

Lines to print at the end, regardless of sorting.

Definition at line 157 of file wx_html_report_panel.h.

Referenced by Clear(), Count(), Flush(), onBtnSaveToFile(), and Report().

◆ m_severities

int WX_HTML_REPORT_PANEL::m_severities
private

◆ m_staticTextShow

wxStaticText* WX_HTML_REPORT_PANEL_BASE::m_staticTextShow
protectedinherited

◆ m_warningsBadge

NUMBER_BADGE* WX_HTML_REPORT_PANEL_BASE::m_warningsBadge
protectedinherited

The documentation for this class was generated from the following files: