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 ()
 
void MsgPanelSetMinSize (const wxSize &aMinSize)
 Set the min size of the area which displays html messages.
 
REPORTERReporter ()
 Return the reporter object that reports to this panel.
 
void Report (const wxString &aText, SEVERITY aSeverity, REPORTER::LOCATION aLocation=REPORTER::LOC_BODY)
 Report the string.
 
void Clear ()
 Clears the report panel.
 
int Count (int severityMask)
 Return the number of messages matching the given severity mask.
 
void SetLabel (const wxString &aLabel) override
 Set the frame label.
 
void SetLazyUpdate (bool aLazyUpdate)
 Set the lazy update.
 
void Flush (bool aSort=false)
 Force updating the HTML page, after the report is built in lazy mode If aSort = true, the body messages will be ordered by severity.
 
void SetVisibleSeverities (int aSeverities)
 Set the visible severity filter.
 
int GetVisibleSeverities () const
 
void SetShowSeverity (SEVERITY aSeverity, bool aValue)
 
void SetFileName (const wxString &aReportFileName)
 Set the report full file name to the string.
 
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 63 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 ( )

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)

Return the number of messages matching the given severity mask.

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  )
Returns
reference to the current report fill file name string.

Definition at line 449 of file wx_html_report_panel.cpp.

References m_reportFileName.

Referenced by DIALOG_BOARD_REANNOTATE::~DIALOG_BOARD_REANNOTATE().

◆ 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 437 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)

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

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 342 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 318 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 330 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 306 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 260 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 252 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()

◆ SetLazyUpdate()

void WX_HTML_REPORT_PANEL::SetLazyUpdate ( bool  aLazyUpdate)

◆ SetShowSeverity()

void WX_HTML_REPORT_PANEL::SetShowSeverity ( SEVERITY  aSeverity,
bool  aValue 
)

◆ SetVisibleSeverities()

void WX_HTML_REPORT_PANEL::SetVisibleSeverities ( int  aSeverities)

Set the visible severity filter.

if aSeverities < 0 the m_showAll option is set

Definition at line 426 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: