diff --git a/common/dialogs/wx_html_report_panel.cpp b/common/dialogs/wx_html_report_panel.cpp
index 9823a1e211..0c3549fcc1 100644
--- a/common/dialogs/wx_html_report_panel.cpp
+++ b/common/dialogs/wx_html_report_panel.cpp
@@ -22,6 +22,7 @@
#include "wx_html_report_panel.h"
#include
+#include
WX_HTML_REPORT_PANEL::WX_HTML_REPORT_PANEL( wxWindow* parent,
@@ -96,6 +97,95 @@ void WX_HTML_REPORT_PANEL::scrollToBottom()
m_htmlView->GetVirtualSize( &x, &y );
m_htmlView->GetScrollPixelsPerUnit( &xUnit, &yUnit );
m_htmlView->Scroll( 0, y / yUnit );
+
+ updateBadges();
+}
+
+
+const static wxSize BADGE_SIZE_DU( 9, 9 );
+const static int BADGE_FONT_SIZE = 9;
+
+static wxBitmap makeBadge( REPORTER::SEVERITY aStyle, int aCount, wxWindow *aWindow )
+{
+ wxSize size( aWindow->ConvertDialogToPixels( BADGE_SIZE_DU ) );
+ wxBitmap bitmap( size );
+ wxBrush brush;
+ wxMemoryDC badgeDC;
+ wxColour badgeColour;
+ wxColour textColour;
+ int fontSize = BADGE_FONT_SIZE;
+
+ if( aCount > 99 )
+ fontSize--;
+
+ badgeDC.SelectObject( bitmap );
+
+ brush.SetStyle( wxBRUSHSTYLE_SOLID );
+ // We're one level deep in staticBoxes; each level is darkened by 210
+ brush.SetColour( aWindow->GetParent()->GetBackgroundColour().MakeDisabled( 210 ) );
+ badgeDC.SetBackground( brush );
+ badgeDC.Clear();
+
+ switch( aStyle )
+ {
+ case REPORTER::RPT_ERROR:
+ badgeColour = *wxRED;
+ textColour = *wxWHITE;
+ break;
+ case REPORTER::RPT_WARNING:
+ badgeColour = *wxYELLOW;
+ textColour = *wxBLACK;
+ break;
+ case REPORTER::RPT_ACTION:
+ badgeColour = *wxGREEN;
+ textColour = *wxWHITE;
+ break;
+ case REPORTER::RPT_INFO:
+ default:
+ badgeColour = *wxLIGHT_GREY;
+ textColour = *wxBLACK;
+ break;
+ }
+
+ brush.SetStyle( wxBRUSHSTYLE_SOLID );
+ brush.SetColour( badgeColour );
+ badgeDC.SetBrush( brush );
+ badgeDC.SetPen( wxPen( badgeColour, 0 ) );
+ badgeDC.DrawCircle( size.x / 2 - 1, size.y / 2, ( std::max( size.x, size.y ) / 2 ) - 1 );
+
+ wxFont font( BADGE_FONT_SIZE, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD );
+ wxString text = wxString::Format( wxT( "%d" ), aCount );
+ wxSize textExtent = badgeDC.GetTextExtent( text );
+
+ badgeDC.SetFont( font );
+ badgeDC.SetTextForeground( textColour );
+ badgeDC.DrawText( text, size.x / 2 - textExtent.x / 2, size.y / 2 - textExtent.y / 2 + 2 );
+
+ return bitmap;
+}
+
+
+void WX_HTML_REPORT_PANEL::updateBadges()
+{
+ int count = Count( REPORTER::RPT_ERROR );
+
+ if( count > 0 )
+ {
+ m_errorsBadge->SetBitmap( makeBadge( REPORTER::RPT_ERROR, count, m_errorsBadge ) );
+ m_errorsBadge->Show( true );
+ }
+ else
+ m_errorsBadge->Show( false );
+
+ count = Count( REPORTER::RPT_WARNING );
+
+ if( count > 0 )
+ {
+ m_warningsBadge->SetBitmap( makeBadge( REPORTER::RPT_WARNING, count, m_errorsBadge ) );
+ m_errorsBadge->Show( true );
+ }
+ else
+ m_warningsBadge->Show( false );
}
@@ -201,13 +291,9 @@ void WX_HTML_REPORT_PANEL::onCheckBoxShowAll( wxCommandEvent& event )
void WX_HTML_REPORT_PANEL::syncCheckboxes()
{
m_checkBoxShowAll->SetValue( m_showAll );
- m_checkBoxShowWarnings->Enable( !m_showAll );
m_checkBoxShowWarnings->SetValue( m_severities & REPORTER::RPT_WARNING );
- m_checkBoxShowErrors->Enable( !m_showAll );
m_checkBoxShowErrors->SetValue( m_severities & REPORTER::RPT_ERROR );
- m_checkBoxShowInfos->Enable( !m_showAll );
m_checkBoxShowInfos->SetValue( m_severities & REPORTER::RPT_INFO );
- m_checkBoxShowActions->Enable( !m_showAll );
m_checkBoxShowActions->SetValue( m_severities & REPORTER::RPT_ACTION );
}
diff --git a/common/dialogs/wx_html_report_panel.h b/common/dialogs/wx_html_report_panel.h
index 7a00b5fc43..fa1dfb8709 100644
--- a/common/dialogs/wx_html_report_panel.h
+++ b/common/dialogs/wx_html_report_panel.h
@@ -92,6 +92,7 @@ private:
wxString addHeader( const wxString& aBody );
wxString generateHtml( const REPORT_LINE& aLine );
wxString generatePlainText( const REPORT_LINE& aLine );
+ void updateBadges();
void refreshView();
void scrollToBottom();
diff --git a/common/dialogs/wx_html_report_panel_base.cpp b/common/dialogs/wx_html_report_panel_base.cpp
index acf9eb9be5..ebbf7e3844 100644
--- a/common/dialogs/wx_html_report_panel_base.cpp
+++ b/common/dialogs/wx_html_report_panel_base.cpp
@@ -26,8 +26,8 @@ WX_HTML_REPORT_PANEL_BASE::WX_HTML_REPORT_PANEL_BASE( wxWindow* parent, wxWindow
m_fgSizer->Add( m_htmlView, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 2 );
wxFlexGridSizer* fgSizer3;
- fgSizer3 = new wxFlexGridSizer( 1, 7, 0, 0 );
- fgSizer3->AddGrowableCol( 6 );
+ fgSizer3 = new wxFlexGridSizer( 1, 9, 0, 0 );
+ fgSizer3->AddGrowableCol( 8 );
fgSizer3->SetFlexibleDirection( wxBOTH );
fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
@@ -39,24 +39,22 @@ WX_HTML_REPORT_PANEL_BASE::WX_HTML_REPORT_PANEL_BASE( wxWindow* parent, wxWindow
m_checkBoxShowAll->SetValue(true);
fgSizer3->Add( m_checkBoxShowAll, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
- m_checkBoxShowWarnings = new wxCheckBox( m_box->GetStaticBox(), wxID_ANY, _("Warnings"), wxDefaultPosition, wxDefaultSize, 0 );
- m_checkBoxShowWarnings->Enable( false );
-
- fgSizer3->Add( m_checkBoxShowWarnings, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
-
m_checkBoxShowErrors = new wxCheckBox( m_box->GetStaticBox(), wxID_ANY, _("Errors"), wxDefaultPosition, wxDefaultSize, 0 );
- m_checkBoxShowErrors->Enable( false );
+ fgSizer3->Add( m_checkBoxShowErrors, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 );
- fgSizer3->Add( m_checkBoxShowErrors, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
+ m_errorsBadge = new wxStaticBitmap( m_box->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
+ fgSizer3->Add( m_errorsBadge, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
+
+ m_checkBoxShowWarnings = new wxCheckBox( m_box->GetStaticBox(), wxID_ANY, _("Warnings"), wxDefaultPosition, wxDefaultSize, 0 );
+ fgSizer3->Add( m_checkBoxShowWarnings, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 );
+
+ m_warningsBadge = new wxStaticBitmap( m_box->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
+ fgSizer3->Add( m_warningsBadge, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_checkBoxShowInfos = new wxCheckBox( m_box->GetStaticBox(), wxID_ANY, _("Infos"), wxDefaultPosition, wxDefaultSize, 0 );
- m_checkBoxShowInfos->Enable( false );
-
fgSizer3->Add( m_checkBoxShowInfos, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
m_checkBoxShowActions = new wxCheckBox( m_box->GetStaticBox(), wxID_ANY, _("Actions"), wxDefaultPosition, wxDefaultSize, 0 );
- m_checkBoxShowActions->Enable( false );
-
fgSizer3->Add( m_checkBoxShowActions, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_btnSaveReportToFile = new wxButton( m_box->GetStaticBox(), wxID_ANY, _("Save Report File"), wxDefaultPosition, wxDefaultSize, 0 );
@@ -75,8 +73,8 @@ WX_HTML_REPORT_PANEL_BASE::WX_HTML_REPORT_PANEL_BASE( wxWindow* parent, wxWindow
// Connect Events
m_checkBoxShowAll->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( WX_HTML_REPORT_PANEL_BASE::onCheckBoxShowAll ), NULL, this );
- m_checkBoxShowWarnings->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( WX_HTML_REPORT_PANEL_BASE::onCheckBoxShowWarnings ), NULL, this );
m_checkBoxShowErrors->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( WX_HTML_REPORT_PANEL_BASE::onCheckBoxShowErrors ), NULL, this );
+ m_checkBoxShowWarnings->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( WX_HTML_REPORT_PANEL_BASE::onCheckBoxShowWarnings ), NULL, this );
m_checkBoxShowInfos->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( WX_HTML_REPORT_PANEL_BASE::onCheckBoxShowInfos ), NULL, this );
m_checkBoxShowActions->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( WX_HTML_REPORT_PANEL_BASE::onCheckBoxShowActions ), NULL, this );
m_btnSaveReportToFile->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WX_HTML_REPORT_PANEL_BASE::onBtnSaveToFile ), NULL, this );
@@ -86,8 +84,8 @@ WX_HTML_REPORT_PANEL_BASE::~WX_HTML_REPORT_PANEL_BASE()
{
// Disconnect Events
m_checkBoxShowAll->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( WX_HTML_REPORT_PANEL_BASE::onCheckBoxShowAll ), NULL, this );
- m_checkBoxShowWarnings->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( WX_HTML_REPORT_PANEL_BASE::onCheckBoxShowWarnings ), NULL, this );
m_checkBoxShowErrors->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( WX_HTML_REPORT_PANEL_BASE::onCheckBoxShowErrors ), NULL, this );
+ m_checkBoxShowWarnings->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( WX_HTML_REPORT_PANEL_BASE::onCheckBoxShowWarnings ), NULL, this );
m_checkBoxShowInfos->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( WX_HTML_REPORT_PANEL_BASE::onCheckBoxShowInfos ), NULL, this );
m_checkBoxShowActions->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( WX_HTML_REPORT_PANEL_BASE::onCheckBoxShowActions ), NULL, this );
m_btnSaveReportToFile->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WX_HTML_REPORT_PANEL_BASE::onBtnSaveToFile ), NULL, this );
diff --git a/common/dialogs/wx_html_report_panel_base.fbp b/common/dialogs/wx_html_report_panel_base.fbp
index abdf17dc12..59414acee0 100644
--- a/common/dialogs/wx_html_report_panel_base.fbp
+++ b/common/dialogs/wx_html_report_panel_base.fbp
@@ -192,9 +192,9 @@
wxEXPAND
1
-
- 5
- wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT
- 0
-
- 1
- 1
- 1
- 1
-
-
-
-
-
-
-
- 1
- 0
- 0
- 1
-
- 1
- 0
- Dock
- 0
- Left
- 0
+ 1
1
@@ -550,6 +462,256 @@
+
+ 5
+ wxALIGN_CENTER_VERTICAL|wxRIGHT
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+
+ 0
+
+
+ 0
+
+ 1
+ m_errorsBadge
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+ ; forward_declare
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+ wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+ Warnings
+
+ 0
+
+
+ 0
+
+ 1
+ m_checkBoxShowWarnings
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+
+ 0
+
+
+ wxFILTER_NONE
+ wxDefaultValidator
+
+
+
+
+
+ onCheckBoxShowWarnings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+ wxALIGN_CENTER_VERTICAL|wxRIGHT
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+
+ 0
+
+
+ 0
+
+ 1
+ m_warningsBadge
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+ ; forward_declare
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
5
wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT
@@ -576,7 +738,7 @@
Dock
0
Left
- 0
+ 1
1
@@ -664,7 +826,7 @@
Dock
0
Left
- 0
+ 1
1
diff --git a/common/dialogs/wx_html_report_panel_base.h b/common/dialogs/wx_html_report_panel_base.h
index f2a434c187..42d5b82bda 100644
--- a/common/dialogs/wx_html_report_panel_base.h
+++ b/common/dialogs/wx_html_report_panel_base.h
@@ -19,6 +19,10 @@
#include
#include
#include
+#include
+#include
+#include
+#include
#include
#include
#include
@@ -40,16 +44,18 @@ class WX_HTML_REPORT_PANEL_BASE : public wxPanel
wxHtmlWindow* m_htmlView;
wxStaticText* m_staticText3;
wxCheckBox* m_checkBoxShowAll;
- wxCheckBox* m_checkBoxShowWarnings;
wxCheckBox* m_checkBoxShowErrors;
+ wxStaticBitmap* m_errorsBadge;
+ wxCheckBox* m_checkBoxShowWarnings;
+ wxStaticBitmap* m_warningsBadge;
wxCheckBox* m_checkBoxShowInfos;
wxCheckBox* m_checkBoxShowActions;
wxButton* m_btnSaveReportToFile;
// Virtual event handlers, overide them in your derived class
virtual void onCheckBoxShowAll( wxCommandEvent& event ) { event.Skip(); }
- virtual void onCheckBoxShowWarnings( wxCommandEvent& event ) { event.Skip(); }
virtual void onCheckBoxShowErrors( wxCommandEvent& event ) { event.Skip(); }
+ virtual void onCheckBoxShowWarnings( wxCommandEvent& event ) { event.Skip(); }
virtual void onCheckBoxShowInfos( wxCommandEvent& event ) { event.Skip(); }
virtual void onCheckBoxShowActions( wxCommandEvent& event ) { event.Skip(); }
virtual void onBtnSaveToFile( wxCommandEvent& event ) { event.Skip(); }