diff --git a/common/dialogs/wx_html_report_panel.cpp b/common/dialogs/wx_html_report_panel.cpp
index 42d884f58f..3c7b4d1976 100644
--- a/common/dialogs/wx_html_report_panel.cpp
+++ b/common/dialogs/wx_html_report_panel.cpp
@@ -32,7 +32,8 @@ WX_HTML_REPORT_PANEL::WX_HTML_REPORT_PANEL( wxWindow* parent,
WX_HTML_REPORT_PANEL_BASE( parent, id, pos, size, style ),
m_reporter( this ),
m_severities( -1 ),
- m_showAll( true )
+ m_showAll( true ),
+ m_lazyUpdate( false )
{
syncCheckboxes();
m_htmlView->SetPage( addHeader( "" ) );
@@ -57,7 +58,26 @@ void WX_HTML_REPORT_PANEL::Report( const wxString& aText, REPORTER::SEVERITY aSe
line.severity = aSeverity;
m_report.push_back( line );
- m_htmlView->AppendToPage( generateHtml( line ) );
+
+ m_html += generateHtml( line );
+
+ if( !m_lazyUpdate )
+ {
+ m_htmlView->AppendToPage( generateHtml( line ) );
+ scrollToBottom();
+ }
+}
+
+
+void WX_HTML_REPORT_PANEL::SetLazyUpdate( bool aLazyUpdate )
+{
+ m_lazyUpdate = aLazyUpdate;
+}
+
+
+void WX_HTML_REPORT_PANEL::Flush()
+{
+ m_htmlView->SetPage( m_html );
scrollToBottom();
}
@@ -65,6 +85,7 @@ void WX_HTML_REPORT_PANEL::Report( const wxString& aText, REPORTER::SEVERITY aSe
void WX_HTML_REPORT_PANEL::scrollToBottom()
{
int x, y, xUnit, yUnit;
+
m_htmlView->GetVirtualSize( &x, &y );
m_htmlView->GetScrollPixelsPerUnit( &xUnit, &yUnit );
m_htmlView->Scroll( 0, y / yUnit );
@@ -242,5 +263,12 @@ void WX_HTML_REPORT_PANEL::onBtnSaveToFile( wxCommandEvent& event )
void WX_HTML_REPORT_PANEL::Clear()
{
+ m_html.clear();
m_report.clear();
}
+
+
+void WX_HTML_REPORT_PANEL::SetLabel( const wxString& aLabel )
+{
+ m_box->GetStaticBox()->SetLabel( aLabel );
+}
diff --git a/common/dialogs/wx_html_report_panel.h b/common/dialogs/wx_html_report_panel.h
index 953a49be03..6442cf3c3f 100644
--- a/common/dialogs/wx_html_report_panel.h
+++ b/common/dialogs/wx_html_report_panel.h
@@ -55,6 +55,24 @@ public:
///> clears the report panel
void Clear();
+ ///> sets the frame label
+ void SetLabel( const wxString& aLabel );
+
+ ///> Sets the lasy update. If this mode is on, messages are stored but the display
+ ///> is not updated (Updating display can be very time consumming if there are many messages)
+ ///> A call to Flush() will be needed after build the report
+ void SetLazyUpdate( bool aLazyUpdate );
+
+ ///> Forces updating the HTML page, after the report is built in lazy mode
+ void Flush();
+
+ void SetVisibleSeverities( int aSeverities )
+ {
+ m_showAll = false;
+ m_severities = aSeverities;
+ syncCheckboxes();
+ }
+
private:
struct REPORT_LINE
{
@@ -91,6 +109,10 @@ private:
///> show all messages flag (overrides m_severities)
bool m_showAll;
+
+ wxString m_html;
+
+ bool m_lazyUpdate;
};
#endif //__WX_HTML_REPORT_PANEL_H__
diff --git a/common/dialogs/wx_html_report_panel_base.cpp b/common/dialogs/wx_html_report_panel_base.cpp
index fc47a8d0b4..80be22c349 100644
--- a/common/dialogs/wx_html_report_panel_base.cpp
+++ b/common/dialogs/wx_html_report_panel_base.cpp
@@ -11,8 +11,7 @@
WX_HTML_REPORT_PANEL_BASE::WX_HTML_REPORT_PANEL_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
- wxStaticBoxSizer* sbSizer3;
- sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Messages:") ), wxVERTICAL );
+ m_box = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Messages:") ), wxVERTICAL );
wxFlexGridSizer* fgSizer4;
fgSizer4 = new wxFlexGridSizer( 2, 1, 0, 0 );
@@ -67,10 +66,10 @@ WX_HTML_REPORT_PANEL_BASE::WX_HTML_REPORT_PANEL_BASE( wxWindow* parent, wxWindow
fgSizer4->Add( fgSizer3, 1, wxEXPAND, 5 );
- sbSizer3->Add( fgSizer4, 1, wxEXPAND|wxALL, 5 );
+ m_box->Add( fgSizer4, 1, wxEXPAND|wxALL, 5 );
- this->SetSizer( sbSizer3 );
+ this->SetSizer( m_box );
this->Layout();
// Connect Events
diff --git a/common/dialogs/wx_html_report_panel_base.fbp b/common/dialogs/wx_html_report_panel_base.fbp
index 0dc2fc1ac3..f707d9dddd 100644
--- a/common/dialogs/wx_html_report_panel_base.fbp
+++ b/common/dialogs/wx_html_report_panel_base.fbp
@@ -82,9 +82,9 @@
wxID_ANY
Messages:
- sbSizer3
+ m_box
wxVERTICAL
- none
+ protected