KiCad PCB EDA Suite
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: More...
 
void MsgPanelSetMinSize (const wxSize &aMinSize)
 returns the reporter object that reports to this panel More...
 
REPORTERReporter ()
 
void Report (const wxString &aText, SEVERITY aSeverity, REPORTER::LOCATION aLocation=REPORTER::LOC_BODY)
 Reports the string. More...
 
void Clear ()
 return the number of messages matching the given severity mask. More...
 
int Count (int severityMask)
 sets the frame label More...
 
void SetLabel (const wxString &aLabel) override
 Sets the lazy update. More...
 
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. More...
 
void Flush (bool aSort=false)
 Set the visible severity filter. More...
 
void SetVisibleSeverities (int aSeverities)
 
int GetVisibleSeverities () const
 
void SetShowSeverity (SEVERITY aSeverity, bool aValue)
 Set the report full file name to the string. More...
 
void SetFileName (const wxString &aReportFileName)
 
wxString & GetFileName (void)
 

Protected Attributes

wxStaticBoxSizer * m_box
 
wxFlexGridSizer * m_fgSizer
 
wxHtmlWindow * m_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 More...
 
REPORT_LINES m_reportTail
 Lines to print at the end, regardless of sorting. More...
 
REPORT_LINES m_reportHead
 ... and at the beginning, regardless of sorting More...
 
int m_severities
 message severities to display (mask) More...
 
bool m_lazyUpdate
 
wxString m_reportFileName
 defaults to the not very useful /bin/report.txt More...
 

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 37 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 104 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 
)

Definition at line 37 of file wx_html_report_panel.cpp.

38  :
39  WX_HTML_REPORT_PANEL_BASE( parent, id, pos, size, style ),
40  m_reporter( this ),
41  m_severities( -1 ),
42  m_lazyUpdate( false )
43 {
46  Flush();
47 
48  Connect( wxEVT_COMMAND_MENU_SELECTED,
49  wxMenuEventHandler( WX_HTML_REPORT_PANEL::onMenuEvent ), nullptr, this );
50 
51  m_htmlView->Bind( wxEVT_SYS_COLOUR_CHANGED,
52  wxSysColourChangedEventHandler( WX_HTML_REPORT_PANEL::onThemeChanged ),
53  this );
54 }
void Flush(bool aSort=false)
Set the visible severity filter.
wxFont GetInfoFont(wxWindow *aWindow)
Definition: ui_common.cpp:141
WX_HTML_PANEL_REPORTER m_reporter
void onThemeChanged(wxSysColourChangedEvent &aEvent)
void onMenuEvent(wxMenuEvent &event)
WX_HTML_REPORT_PANEL_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
int m_severities
message severities to display (mask)

References Flush(), KIUI::GetInfoFont(), WX_HTML_REPORT_PANEL_BASE::m_htmlView, onMenuEvent(), onThemeChanged(), and syncCheckboxes().

◆ ~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 57 of file wx_html_report_panel.cpp.

58 {
59 }

Member Function Documentation

◆ addHeader()

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

Definition at line 160 of file wx_html_report_panel.cpp.

161 {
162  // Handle light/dark mode colors...
163 
164  wxTextCtrl dummy( GetParent(), wxID_ANY );
165  wxColour foreground = dummy.GetForegroundColour();
166  wxColour background = dummy.GetBackgroundColour();
167 
168  return wxString::Format( wxT( "<html>"
169  " <body bgcolor='%s' text='%s'>"
170  " %s"
171  " </body>"
172  "</html>" ),
173  background.GetAsString( wxC2S_HTML_SYNTAX ),
174  foreground.GetAsString( wxC2S_HTML_SYNTAX ),
175  aBody );
176 }
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
Definition: sch_symbol.cpp:72
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200

References dummy(), and Format().

Referenced by Flush().

◆ Clear()

void WX_HTML_REPORT_PANEL::Clear ( )

return the number of messages matching the given severity mask.

Definition at line 388 of file wx_html_report_panel.cpp.

389 {
390  m_report.clear();
391  m_reportHead.clear();
392  m_reportTail.clear();
393 }
REPORT_LINES m_reportHead
... and at the beginning, regardless of sorting
REPORT_LINES m_reportTail
Lines to print at the end, regardless of sorting.
REPORT_LINES m_report
copy of the report, stored for filtering

References m_report, m_reportHead, and m_reportTail.

Referenced by DIALOG_NETLIST::loadNetlist(), DIALOG_ANNOTATE::OnApplyClick(), DIALOG_NETLIST::onFilenameChanged(), DIALOG_CHANGE_SYMBOLS::onOkButtonClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnOKClicked(), DIALOG_UPDATE_FROM_PCB::OnUpdateClick(), DIALOG_UPDATE_PCB::PerformUpdate(), and DIALOG_UPDATE_FROM_PCB::updateData().

◆ Count()

int WX_HTML_REPORT_PANEL::Count ( int  severityMask)

sets the frame label

Definition at line 179 of file wx_html_report_panel.cpp.

180 {
181  int count = 0;
182 
183  for( const auto& reportLineArray : { m_report, m_reportHead, m_reportTail } )
184  {
185  for( const REPORT_LINE& reportLine : reportLineArray )
186  {
187  if( severityMask & reportLine.severity )
188  count++;
189  }
190  }
191 
192  return count;
193 }
REPORT_LINES m_reportHead
... and at the beginning, regardless of sorting
REPORT_LINES m_reportTail
Lines to print at the end, regardless of sorting.
REPORT_LINES m_report
copy of the report, stored for filtering

References m_report, m_reportHead, and m_reportTail.

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

◆ Flush()

void WX_HTML_REPORT_PANEL::Flush ( bool  aSort = false)

Set the visible severity filter.

if aSeverities < 0 the m_showAll option is set

Definition at line 111 of file wx_html_report_panel.cpp.

112 {
113  wxString html;
114 
115  if( aSort )
116  {
117  std::sort( m_report.begin(), m_report.end(),
118  []( const REPORT_LINE& a, const REPORT_LINE& b)
119  {
120  return a.severity < b.severity;
121  });
122  }
123 
124  for( const auto& line : m_reportHead )
125  html += generateHtml( line );
126 
127  for( const auto& line : m_report )
128  html += generateHtml( line );
129 
130  for( const auto& line : m_reportTail )
131  html += generateHtml( line );
132 
133  m_htmlView->SetPage( addHeader( html ) );
134  scrollToBottom();
135 }
wxString addHeader(const wxString &aBody)
REPORT_LINES m_reportHead
... and at the beginning, regardless of sorting
REPORT_LINES m_reportTail
Lines to print at the end, regardless of sorting.
REPORT_LINES m_report
copy of the report, stored for filtering
wxString generateHtml(const REPORT_LINE &aLine)

References addHeader(), generateHtml(), WX_HTML_REPORT_PANEL_BASE::m_htmlView, m_report, m_reportHead, m_reportTail, scrollToBottom(), and WX_HTML_REPORT_PANEL::REPORT_LINE::severity.

Referenced by DIALOG_NETLIST::loadNetlist(), DIALOG_ANNOTATE::OnApplyClick(), DIALOG_BOARD_REANNOTATE::OnApplyClick(), onCheckBoxShowActions(), onCheckBoxShowAll(), onCheckBoxShowErrors(), onCheckBoxShowInfos(), onCheckBoxShowWarnings(), DIALOG_CHANGE_SYMBOLS::onOkButtonClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnOKClicked(), onThemeChanged(), DIALOG_UPDATE_FROM_PCB::OnUpdateClick(), DIALOG_UPDATE_PCB::PerformUpdate(), DIALOG_UPDATE_FROM_PCB::updateData(), and WX_HTML_REPORT_PANEL().

◆ generateHtml()

wxString WX_HTML_REPORT_PANEL::generateHtml ( const REPORT_LINE aLine)
private

Definition at line 196 of file wx_html_report_panel.cpp.

197 {
198  wxString retv;
199 
200  if( !( m_severities & aLine.severity ) )
201  return retv;
202 
203  switch( aLine.severity )
204  {
205  case RPT_SEVERITY_ERROR:
206  retv = "<font color=\"red\" size=3>" + _( "Error:" ) + " </font>"
207  "<font size=3>" + aLine.message + "</font><br>";
208  break;
210  retv = "<font size=3>" + _( "Warning:" ) + wxS( " " ) + aLine.message + "</font><br>";
211  break;
212  case RPT_SEVERITY_INFO:
213  retv = "<font color=\"dark gray\" size=3>" + aLine.message + "</font><br>";
214  break;
215  case RPT_SEVERITY_ACTION:
216  retv = "<font color=\"dark green\" size=3>" + aLine.message + "</font><br>";
217  break;
218  default:
219  retv = "<font size=3>" + aLine.message + "</font><br>";
220  }
221 
222  return retv;
223 }
#define _(s)
int m_severities
message severities to display (mask)

References _, m_severities, WX_HTML_REPORT_PANEL::REPORT_LINE::message, RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, RPT_SEVERITY_WARNING, and WX_HTML_REPORT_PANEL::REPORT_LINE::severity.

Referenced by Flush(), and Report().

◆ generatePlainText()

wxString WX_HTML_REPORT_PANEL::generatePlainText ( const REPORT_LINE aLine)
private

Definition at line 226 of file wx_html_report_panel.cpp.

227 {
228  switch( aLine.severity )
229  {
230  case RPT_SEVERITY_ERROR: return _( "Error:" ) + wxS( " " ) + aLine.message + wxT( "\n" );
231  case RPT_SEVERITY_WARNING: return _( "Warning:" ) + wxS( " " ) + aLine.message + wxT( "\n" );
232  case RPT_SEVERITY_INFO: return _( "Info:" ) + wxS( " " ) + aLine.message + wxT( "\n" );
233  default: return aLine.message + wxT( "\n" );
234  }
235 }
#define _(s)

References _, WX_HTML_REPORT_PANEL::REPORT_LINE::message, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, RPT_SEVERITY_WARNING, and WX_HTML_REPORT_PANEL::REPORT_LINE::severity.

Referenced by onBtnSaveToFile().

◆ GetFileName()

wxString & WX_HTML_REPORT_PANEL::GetFileName ( void  )

Definition at line 425 of file wx_html_report_panel.cpp.

426 {
427  return ( m_reportFileName );
428 }
wxString m_reportFileName
defaults to the not very useful /bin/report.txt

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 413 of file wx_html_report_panel.cpp.

414 {
415  return m_severities;
416 }
int m_severities
message severities to display (mask)

References m_severities.

Referenced by DIALOG_ANNOTATE::~DIALOG_ANNOTATE(), DIALOG_NETLIST::~DIALOG_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 70 of file wx_html_report_panel.cpp.

71 {
72  m_fgSizer->SetMinSize( aMinSize );
73  GetSizer()->SetSizeHints( this );
74 }

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

Reimplemented from WX_HTML_REPORT_PANEL_BASE.

Definition at line 340 of file wx_html_report_panel.cpp.

341 {
342  wxFileName fn;
343 
344  if( m_reportFileName.empty() )
345  fn = wxT( "./report.txt" );
346  else
347  fn = m_reportFileName;
348 
349  wxFileDialog dlg( this, _( "Save Report to File" ), fn.GetPath(), fn.GetFullName(),
350  TextFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
351 
352  if( dlg.ShowModal() != wxID_OK )
353  return;
354 
355  fn = dlg.GetPath();
356 
357  if( fn.GetExt().IsEmpty() )
358  fn.SetExt( "txt" );
359 
360  wxFFile f( fn.GetFullPath(), "wb" );
361 
362  if( !f.IsOpened() )
363  {
364  wxString msg;
365 
366  msg.Printf( _( "Cannot write report to file '%s'." ),
367  fn.GetFullPath().GetData() );
368  wxMessageBox( msg, _( "File save error" ), wxOK | wxICON_ERROR, this );
369  return;
370  }
371 
372  for( REPORT_LINES section : { m_reportHead, m_report, m_reportTail } )
373  {
374  for( const REPORT_LINE& l : section )
375  {
376  wxString s = generatePlainText( l );
377 
379  f.Write( s );
380  }
381  }
382 
383  m_reportFileName = fn.GetFullPath();
384  f.Close();
385 }
wxString generatePlainText(const REPORT_LINE &aLine)
REPORT_LINES m_reportHead
... and at the beginning, regardless of sorting
REPORT_LINES m_reportTail
Lines to print at the end, regardless of sorting.
#define _(s)
bool ConvertSmartQuotesAndDashes(wxString *aString)
Convert curly quotes and em/en dashes to straight quotes and dashes.
wxString m_reportFileName
defaults to the not very useful /bin/report.txt
REPORT_LINES m_report
copy of the report, stored for filtering
std::vector< REPORT_LINE > REPORT_LINES
wxString TextFileWildcard()

References _, ConvertSmartQuotesAndDashes(), generatePlainText(), m_report, m_reportFileName, m_reportHead, m_reportTail, and TextFileWildcard().

◆ onCheckBoxShowActions()

void WX_HTML_REPORT_PANEL::onCheckBoxShowActions ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from WX_HTML_REPORT_PANEL_BASE.

Definition at line 328 of file wx_html_report_panel.cpp.

329 {
330  if( event.IsChecked() )
332  else
334 
335  syncCheckboxes();
336  Flush( true );
337 }
void Flush(bool aSort=false)
Set the visible severity filter.
int m_severities
message severities to display (mask)

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

◆ onCheckBoxShowAll()

void WX_HTML_REPORT_PANEL::onCheckBoxShowAll ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from WX_HTML_REPORT_PANEL_BASE.

Definition at line 270 of file wx_html_report_panel.cpp.

271 {
272  if( event.IsChecked() )
274  else
276 
277  syncCheckboxes();
278  Flush( true );
279 }
void Flush(bool aSort=false)
Set the visible severity filter.
int m_severities
message severities to display (mask)
static int RPT_SEVERITY_ALL

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

◆ onCheckBoxShowErrors()

void WX_HTML_REPORT_PANEL::onCheckBoxShowErrors ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from WX_HTML_REPORT_PANEL_BASE.

Definition at line 304 of file wx_html_report_panel.cpp.

305 {
306  if( event.IsChecked() )
308  else
310 
311  syncCheckboxes();
312  Flush( true );
313 }
void Flush(bool aSort=false)
Set the visible severity filter.
int m_severities
message severities to display (mask)

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 316 of file wx_html_report_panel.cpp.

317 {
318  if( event.IsChecked() )
320  else
322 
323  syncCheckboxes();
324  Flush( true );
325 }
void Flush(bool aSort=false)
Set the visible severity filter.
int m_severities
message severities to display (mask)

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 292 of file wx_html_report_panel.cpp.

293 {
294  if( event.IsChecked() )
296  else
298 
299  syncCheckboxes();
300  Flush( true );
301 }
void Flush(bool aSort=false)
Set the visible severity filter.
int m_severities
message severities to display (mask)

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

◆ onMenuEvent()

void WX_HTML_REPORT_PANEL::onMenuEvent ( wxMenuEvent &  event)
private

Definition at line 246 of file wx_html_report_panel.cpp.

247 {
248  if( event.GetId() == wxID_COPY )
249  {
250  wxLogNull doNotLog; // disable logging of failed clipboard actions
251 
252  if( wxTheClipboard->Open() )
253  {
254  bool primarySelection = wxTheClipboard->IsUsingPrimarySelection();
255  wxTheClipboard->UsePrimarySelection( false ); // required to use the main clipboard
256  wxTheClipboard->SetData( new wxTextDataObject( m_htmlView->SelectionToText() ) );
257  wxTheClipboard->Flush(); // Allow data to be available after closing KiCad
258  wxTheClipboard->Close();
259  wxTheClipboard->UsePrimarySelection( primarySelection );
260  }
261  }
262 }

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 238 of file wx_html_report_panel.cpp.

239 {
240  wxMenu popup;
241  popup.Append( wxID_COPY, "Copy" );
242  PopupMenu( &popup );
243 }

◆ onThemeChanged()

void WX_HTML_REPORT_PANEL::onThemeChanged ( wxSysColourChangedEvent &  aEvent)
private

Definition at line 62 of file wx_html_report_panel.cpp.

63 {
64  Flush();
65 
66  aEvent.Skip();
67 }
void Flush(bool aSort=false)
Set the visible severity filter.

References Flush().

Referenced by WX_HTML_REPORT_PANEL().

◆ Report()

void WX_HTML_REPORT_PANEL::Report ( const wxString &  aText,
SEVERITY  aSeverity,
REPORTER::LOCATION  aLocation = REPORTER::LOC_BODY 
)

Reports the string.

Parameters
aTextstring message to report
aSeveritystring classification level bitfield
aLocationREPORTER::LOCATION enum for placement of messageclears the report panel

Definition at line 83 of file wx_html_report_panel.cpp.

85 {
86  REPORT_LINE line;
87  line.message = aText;
88  line.severity = aSeverity;
89 
90  if( aLocation == REPORTER::LOC_HEAD )
91  m_reportHead.push_back( line );
92  else if( aLocation == REPORTER::LOC_TAIL )
93  m_reportTail.push_back( line );
94  else
95  m_report.push_back( line );
96 
97  if( !m_lazyUpdate )
98  {
99  m_htmlView->AppendToPage( generateHtml( line ) );
100  scrollToBottom();
101  }
102 }
REPORT_LINES m_reportHead
... and at the beginning, regardless of sorting
REPORT_LINES m_reportTail
Lines to print at the end, regardless of sorting.
REPORT_LINES m_report
copy of the report, stored for filtering
wxString generateHtml(const REPORT_LINE &aLine)

References generateHtml(), REPORTER::LOC_HEAD, REPORTER::LOC_TAIL, WX_HTML_REPORT_PANEL_BASE::m_htmlView, m_lazyUpdate, m_report, m_reportHead, m_reportTail, WX_HTML_REPORT_PANEL::REPORT_LINE::message, scrollToBottom(), and WX_HTML_REPORT_PANEL::REPORT_LINE::severity.

Referenced by DIALOG_EXCHANGE_FOOTPRINTS::processFootprint(), DIALOG_CHANGE_SYMBOLS::processSymbol(), WX_HTML_PANEL_REPORTER::Report(), WX_HTML_PANEL_REPORTER::ReportHead(), WX_HTML_PANEL_REPORTER::ReportTail(), and DIALOG_BOARD_REANNOTATE::ShowReport().

◆ Reporter()

◆ scrollToBottom()

void WX_HTML_REPORT_PANEL::scrollToBottom ( )
private

Definition at line 138 of file wx_html_report_panel.cpp.

139 {
140  int x, y, xUnit, yUnit;
141 
142  m_htmlView->GetVirtualSize( &x, &y );
143  m_htmlView->GetScrollPixelsPerUnit( &xUnit, &yUnit );
144  m_htmlView->Scroll( 0, y / yUnit );
145 
146  updateBadges();
147 }

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 396 of file wx_html_report_panel.cpp.

397 {
398  m_box->GetStaticBox()->SetLabel( aLabel );
399 }

References WX_HTML_REPORT_PANEL_BASE::m_box.

Referenced by DIALOG_ANNOTATE::DIALOG_ANNOTATE(), DIALOG_NETLIST::DIALOG_NETLIST(), DIALOG_UPDATE_FROM_PCB::DIALOG_UPDATE_FROM_PCB(), DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB(), DIALOG_UPDATE_PCB::OnUpdateClick(), and DIALOG_NETLIST::OnUpdatePCB().

◆ 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)
Returns
the visible severity filter. If the m_showAll option is set, the mask is < 0

Definition at line 402 of file wx_html_report_panel.cpp.

403 {
404  if( aSeverities < 0 )
406  else
407  m_severities = aSeverities;
408 
409  syncCheckboxes();
410 }
int m_severities
message severities to display (mask)
static int RPT_SEVERITY_ALL

References m_severities, RPT_SEVERITY_ALL, and syncCheckboxes().

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

◆ syncCheckboxes()

void WX_HTML_REPORT_PANEL::syncCheckboxes ( )
private

Definition at line 282 of file wx_html_report_panel.cpp.

References WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowActions, WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowAll, WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowErrors, WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowInfos, WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowWarnings, m_severities, RPT_SEVERITY_ACTION, RPT_SEVERITY_ALL, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, and RPT_SEVERITY_WARNING.

Referenced by onCheckBoxShowActions(), onCheckBoxShowAll(), onCheckBoxShowErrors(), onCheckBoxShowInfos(), onCheckBoxShowWarnings(), SetVisibleSeverities(), and WX_HTML_REPORT_PANEL().

◆ updateBadges()

void WX_HTML_REPORT_PANEL::updateBadges ( )
private

Definition at line 150 of file wx_html_report_panel.cpp.

151 {
152  int count = Count(RPT_SEVERITY_ERROR );
154 
155  count = Count(RPT_SEVERITY_WARNING );
157 }
void UpdateNumber(int aNumber, SEVERITY aSeverity)
Update the number displayed on the badge.
int Count(int severityMask)
sets the frame label

References Count(), WX_HTML_REPORT_PANEL_BASE::m_errorsBadge, WX_HTML_REPORT_PANEL_BASE::m_warningsBadge, RPT_SEVERITY_ERROR, RPT_SEVERITY_WARNING, and NUMBER_BADGE::UpdateNumber().

Referenced by scrollToBottom().

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 134 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 129 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 127 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 136 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 131 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 130 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: