From c1d1c12b41149e0d714d5488fcf59b38872cb9ae Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 18 Nov 2020 15:36:47 +0000 Subject: [PATCH] Simplify message panel code. We've had the colours turned off for two releases now without any screaming or gnashing of teeth, so it's time to clean up the code. --- common/eda_draw_frame.cpp | 6 ++-- common/page_layout/ws_draw_item.cpp | 26 ++++++++-------- common/widgets/msgpanel.cpp | 18 +++-------- eeschema/lib_circle.cpp | 6 ++-- eeschema/lib_field.cpp | 10 +++---- eeschema/lib_item.cpp | 6 ++-- eeschema/lib_pin.cpp | 18 +++++------ eeschema/lib_polyline.cpp | 4 +-- eeschema/lib_rectangle.cpp | 2 +- eeschema/lib_text.cpp | 2 +- eeschema/lib_view_frame.cpp | 8 ++--- eeschema/sch_bitmap.cpp | 10 +++---- eeschema/sch_bus_entry.cpp | 2 +- eeschema/sch_component.cpp | 31 ++++++++++--------- eeschema/sch_connection.cpp | 14 ++++----- eeschema/sch_line.cpp | 6 ++-- eeschema/sch_marker.cpp | 2 +- eeschema/sch_pin.cpp | 27 ++++++++--------- eeschema/sch_text.cpp | 10 +++---- eeschema/symbol_editor/symbol_editor.cpp | 16 +++++----- include/eda_draw_frame.h | 10 +++---- include/widgets/msgpanel.h | 38 ++++++++---------------- pcbnew/tools/pcbnew_control.cpp | 12 ++++---- pcbnew/track.cpp | 6 ++-- pcbnew/zone.cpp | 8 +++-- 25 files changed, 137 insertions(+), 161 deletions(-) diff --git a/common/eda_draw_frame.cpp b/common/eda_draw_frame.cpp index c7f9d69008..2ca4bef4d7 100644 --- a/common/eda_draw_frame.cpp +++ b/common/eda_draw_frame.cpp @@ -601,11 +601,11 @@ void EDA_DRAW_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg ) } -void EDA_DRAW_FRAME::AppendMsgPanel( const wxString& textUpper, const wxString& textLower, - COLOR4D color, int pad ) +void EDA_DRAW_FRAME::AppendMsgPanel( const wxString& aTextUpper, const wxString& aTextLower, + int aPadding ) { if( m_messagePanel ) - m_messagePanel->AppendMessage( textUpper, textLower, color, pad ); + m_messagePanel->AppendMessage( aTextUpper, aTextLower, aPadding ); } diff --git a/common/page_layout/ws_draw_item.cpp b/common/page_layout/ws_draw_item.cpp index ec12053002..2a3182b8df 100644 --- a/common/page_layout/ws_draw_item.cpp +++ b/common/page_layout/ws_draw_item.cpp @@ -101,7 +101,7 @@ bool WS_DRAW_ITEM_BASE::HitTest( const EDA_RECT& aRect, bool aContained, int aAc void WS_DRAW_ITEM_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) { - wxString msg; + wxString msg; WS_DATA_ITEM* dataItem = GetPeer(); if( dataItem == nullptr ) // Is only a pure graphic item used in page layout editor @@ -111,49 +111,49 @@ void WS_DRAW_ITEM_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS switch( dataItem->GetType() ) { case WS_DATA_ITEM::WS_SEGMENT: - aList.push_back( MSG_PANEL_ITEM( _( "Line" ), msg, DARKCYAN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Line" ), msg ) ); break; case WS_DATA_ITEM::WS_RECT: - aList.push_back( MSG_PANEL_ITEM( _( "Rectangle" ), msg, DARKCYAN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Rectangle" ), msg ) ); break; case WS_DATA_ITEM::WS_TEXT: msg = static_cast( this )->GetShownText(); - aList.push_back( MSG_PANEL_ITEM( _( "Text" ), msg, DARKCYAN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Text" ), msg ) ); break; case WS_DATA_ITEM::WS_POLYPOLYGON: - aList.push_back( MSG_PANEL_ITEM( _( "Imported Shape" ), msg, DARKCYAN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Imported Shape" ), msg ) ); break; case WS_DATA_ITEM::WS_BITMAP: - aList.push_back( MSG_PANEL_ITEM( _( "Image" ), msg, DARKCYAN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Image" ), msg ) ); break; } switch( dataItem->GetPage1Option() ) { - case FIRST_PAGE_ONLY: msg = _( "First Page Only" ); break; + case FIRST_PAGE_ONLY: msg = _( "First Page Only" ); break; case SUBSEQUENT_PAGES: msg = _( "Subsequent Pages" ); break; - default: msg = _( "All Pages" ); break; + default: msg = _( "All Pages" ); break; } - aList.push_back( MSG_PANEL_ITEM( _( "First Page Option" ), msg, BROWN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "First Page Option" ), msg ) ); msg = MessageTextFromValue( EDA_UNITS::UNSCALED, dataItem->m_RepeatCount ); - aList.push_back( MSG_PANEL_ITEM( _( "Repeat Count" ), msg, BLUE ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Repeat Count" ), msg ) ); msg = MessageTextFromValue( EDA_UNITS::UNSCALED, dataItem->m_IncrementLabel ); - aList.push_back( MSG_PANEL_ITEM( _( "Repeat Label Increment" ), msg, DARKGRAY ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Repeat Label Increment" ), msg ) ); msg.Printf( wxT( "(%s, %s)" ), MessageTextFromValue( aFrame->GetUserUnits(), dataItem->m_IncrementVector.x ), MessageTextFromValue( aFrame->GetUserUnits(), dataItem->m_IncrementVector.y ) ); - aList.push_back( MSG_PANEL_ITEM( _( "Repeat Position Increment" ), msg, RED ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Repeat Position Increment" ), msg ) ); - aList.push_back( MSG_PANEL_ITEM( _( "Comment" ), dataItem->m_Info, MAGENTA ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Comment" ), dataItem->m_Info ) ); } diff --git a/common/widgets/msgpanel.cpp b/common/widgets/msgpanel.cpp index c4324d8790..456045039e 100644 --- a/common/widgets/msgpanel.cpp +++ b/common/widgets/msgpanel.cpp @@ -111,15 +111,14 @@ void EDA_MSG_PANEL::OnPaint( wxPaintEvent& aEvent ) } -void EDA_MSG_PANEL::AppendMessage( const wxString& aUpperText, - const wxString& aLowerText, - COLOR4D aColor, int aPad ) +void EDA_MSG_PANEL::AppendMessage( const wxString& aUpperText, const wxString& aLowerText, + int aPadding ) { wxString text; wxSize drawSize = GetClientSize(); text = ( aUpperText.Len() > aLowerText.Len() ) ? aUpperText : aLowerText; - text.Append( ' ', aPad ); + text.Append( ' ', aPadding ); MSG_PANEL_ITEM item; @@ -135,7 +134,6 @@ void EDA_MSG_PANEL::AppendMessage( const wxString& aUpperText, item.m_UpperText = aUpperText; item.m_LowerText = aLowerText; - item.m_Color = aColor; m_Items.push_back( item ); m_last_x += computeTextSize( text ).x; @@ -147,7 +145,7 @@ void EDA_MSG_PANEL::AppendMessage( const wxString& aUpperText, void EDA_MSG_PANEL::SetMessage( int aXPosition, const wxString& aUpperText, - const wxString& aLowerText, COLOR4D aColor ) + const wxString& aLowerText ) { wxPoint pos; wxSize drawSize = GetClientSize(); @@ -166,7 +164,6 @@ void EDA_MSG_PANEL::SetMessage( int aXPosition, const wxString& aUpperText, item.m_UpperText = aUpperText; item.m_LowerText = aLowerText; - item.m_Color = aColor; int ndx; @@ -190,9 +187,7 @@ void EDA_MSG_PANEL::SetMessage( int aXPosition, const wxString& aUpperText, } if( ndx == limit ) // mutually exclusive with two above if tests - { m_Items.push_back( item ); - } Refresh(); } @@ -200,20 +195,15 @@ void EDA_MSG_PANEL::SetMessage( int aXPosition, const wxString& aUpperText, void EDA_MSG_PANEL::showItem( wxDC& aDC, const MSG_PANEL_ITEM& aItem ) { - // COLOR4D color = aItem.m_Color; COLOR4D color = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT ); aDC.SetTextForeground( color.ToColour() ); if( !aItem.m_UpperText.IsEmpty() ) - { aDC.DrawText( aItem.m_UpperText, aItem.m_X, aItem.m_UpperY ); - } if( !aItem.m_LowerText.IsEmpty() ) - { aDC.DrawText( aItem.m_LowerText, aItem.m_X, aItem.m_LowerY ); - } } diff --git a/eeschema/lib_circle.cpp b/eeschema/lib_circle.cpp index 444d59eed8..1c60027c26 100644 --- a/eeschema/lib_circle.cpp +++ b/eeschema/lib_circle.cpp @@ -247,10 +247,10 @@ void LIB_CIRCLE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList msg = MessageTextFromValue( aFrame->GetUserUnits(), m_Width ); - aList.push_back( MSG_PANEL_ITEM( _( "Line Width" ), msg, BLUE ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Line Width" ), msg ) ); msg = MessageTextFromValue( aFrame->GetUserUnits(), GetRadius() ); - aList.push_back( MSG_PANEL_ITEM( _( "Radius" ), msg, RED ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Radius" ), msg ) ); msg.Printf( wxT( "(%d, %d, %d, %d)" ), bBox.GetOrigin().x, @@ -258,7 +258,7 @@ void LIB_CIRCLE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList bBox.GetEnd().x, bBox.GetEnd().y ); - aList.push_back( MSG_PANEL_ITEM( _( "Bounding Box" ), msg, BROWN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Bounding Box" ), msg ) ); } diff --git a/eeschema/lib_field.cpp b/eeschema/lib_field.cpp index 568fea431c..82d48d379f 100644 --- a/eeschema/lib_field.cpp +++ b/eeschema/lib_field.cpp @@ -430,19 +430,19 @@ void LIB_FIELD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList // Display style: msg = GetTextStyleName(); - aList.push_back( MSG_PANEL_ITEM( _( "Style" ), msg, MAGENTA ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Style" ), msg ) ); msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextWidth() ); - aList.push_back( MSG_PANEL_ITEM( _( "Width" ), msg, BLUE ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Width" ), msg ) ); msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextHeight() ); - aList.push_back( MSG_PANEL_ITEM( _( "Height" ), msg, BLUE ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Height" ), msg ) ); // Display field name (ref, value ...) - aList.push_back( MSG_PANEL_ITEM( _( "Field" ), GetName(), BROWN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Field" ), GetName() ) ); // Display field text: - aList.push_back( MSG_PANEL_ITEM( _( "Value" ), GetShownText(), BROWN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Value" ), GetShownText() ) ); } diff --git a/eeschema/lib_item.cpp b/eeschema/lib_item.cpp index dc9a31c44b..9e5e07706d 100644 --- a/eeschema/lib_item.cpp +++ b/eeschema/lib_item.cpp @@ -51,14 +51,14 @@ void LIB_ITEM::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) { wxString msg; - aList.push_back( MSG_PANEL_ITEM( _( "Type" ), GetTypeName(), CYAN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Type" ), GetTypeName() ) ); if( m_Unit == 0 ) msg = _( "All" ); else msg.Printf( wxT( "%d" ), m_Unit ); - aList.push_back( MSG_PANEL_ITEM( _( "Unit" ), msg, BROWN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Unit" ), msg ) ); if( m_Convert == LIB_ITEM::LIB_CONVERT::BASE ) msg = _( "no" ); @@ -67,7 +67,7 @@ void LIB_ITEM::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) else msg = wxT( "?" ); - aList.push_back( MSG_PANEL_ITEM( _( "Converted" ), msg, BROWN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Converted" ), msg ) ); } diff --git a/eeschema/lib_pin.cpp b/eeschema/lib_pin.cpp index 8eec18e9a9..a615dfbf5a 100644 --- a/eeschema/lib_pin.cpp +++ b/eeschema/lib_pin.cpp @@ -978,32 +978,32 @@ void LIB_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) LIB_ITEM::GetMsgPanelInfo( aFrame, aList ); - aList.push_back( MSG_PANEL_ITEM( _( "Name" ), m_name, DARKCYAN ) ); - aList.push_back( MSG_PANEL_ITEM( _( "Number" ), text, DARKCYAN ) ); - aList.push_back( MSG_PANEL_ITEM( _( "Type" ), ElectricalPinTypeGetText( m_type ), RED ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Name" ), m_name ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Number" ), text ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Type" ), ElectricalPinTypeGetText( m_type ) ) ); text = PinShapeGetText( m_shape ); - aList.push_back( MSG_PANEL_ITEM( _( "Style" ), text, BLUE ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Style" ), text ) ); text = IsVisible() ? _( "Yes" ) : _( "No" ); - aList.push_back( MSG_PANEL_ITEM( _( "Visible" ), text, DARKGREEN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Visible" ), text ) ); // Display pin length text = StringFromValue( aFrame->GetUserUnits(), m_length ); - aList.push_back( MSG_PANEL_ITEM( _( "Length" ), text, MAGENTA ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Length" ), text ) ); text = PinOrientationName( (unsigned) PinOrientationIndex( m_orientation ) ); - aList.push_back( MSG_PANEL_ITEM( _( "Orientation" ), text, DARKMAGENTA ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Orientation" ), text ) ); wxPoint pinpos = GetPosition(); pinpos.y = -pinpos.y; // Display coord are top to bottom // lib items coord are bottom to top text = MessageTextFromValue( aFrame->GetUserUnits(), pinpos.x ); - aList.push_back( MSG_PANEL_ITEM( _( "Pos X" ), text, DARKMAGENTA ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Pos X" ), text ) ); text = MessageTextFromValue( aFrame->GetUserUnits(), pinpos.y ); - aList.push_back( MSG_PANEL_ITEM( _( "Pos Y" ), text, DARKMAGENTA ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Pos Y" ), text ) ); } diff --git a/eeschema/lib_polyline.cpp b/eeschema/lib_polyline.cpp index c04a6f5da0..718063183a 100644 --- a/eeschema/lib_polyline.cpp +++ b/eeschema/lib_polyline.cpp @@ -337,12 +337,12 @@ void LIB_POLYLINE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aLi msg = MessageTextFromValue( aFrame->GetUserUnits(), m_Width ); - aList.push_back( MSG_PANEL_ITEM( _( "Line Width" ), msg, BLUE ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Line Width" ), msg ) ); msg.Printf( wxT( "(%d, %d, %d, %d)" ), bBox.GetOrigin().x, bBox.GetOrigin().y, bBox.GetEnd().x, bBox.GetEnd().y ); - aList.push_back( MSG_PANEL_ITEM( _( "Bounding Box" ), msg, BROWN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Bounding Box" ), msg ) ); } diff --git a/eeschema/lib_rectangle.cpp b/eeschema/lib_rectangle.cpp index 3c43539209..c7a5982b3f 100644 --- a/eeschema/lib_rectangle.cpp +++ b/eeschema/lib_rectangle.cpp @@ -193,7 +193,7 @@ void LIB_RECTANGLE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aL wxString msg = MessageTextFromValue( aFrame->GetUserUnits(), m_Width ); - aList.push_back( MSG_PANEL_ITEM( _( "Line Width" ), msg, BLUE ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Line Width" ), msg ) ); } diff --git a/eeschema/lib_text.cpp b/eeschema/lib_text.cpp index 787374bb9e..49d0999ecd 100644 --- a/eeschema/lib_text.cpp +++ b/eeschema/lib_text.cpp @@ -349,7 +349,7 @@ void LIB_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) LIB_ITEM::GetMsgPanelInfo( aFrame, aList ); wxString msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextThickness() ); - aList.push_back( MSG_PANEL_ITEM( _( "Line Width" ), msg, BLUE ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Line Width" ), msg ) ); } diff --git a/eeschema/lib_view_frame.cpp b/eeschema/lib_view_frame.cpp index b7ba87b865..044e9b4292 100644 --- a/eeschema/lib_view_frame.cpp +++ b/eeschema/lib_view_frame.cpp @@ -356,10 +356,10 @@ void LIB_VIEW_FRAME::updatePreviewSymbol() if( parent ) parentName = parent->GetName(); - AppendMsgPanel( _( "Name" ), m_previewItem->GetName(), BLUE, 6 ); - AppendMsgPanel( _( "Parent" ), parentName, RED, 6 ); - AppendMsgPanel( _( "Description" ), m_previewItem->GetDescription(), CYAN, 6 ); - AppendMsgPanel( _( "Keywords" ), m_previewItem->GetKeyWords(), DARKDARKGRAY ); + AppendMsgPanel( _( "Name" ), m_previewItem->GetName() ); + AppendMsgPanel( _( "Parent" ), parentName ); + AppendMsgPanel( _( "Description" ), m_previewItem->GetDescription() ); + AppendMsgPanel( _( "Keywords" ), m_previewItem->GetKeyWords() ); } GetCanvas()->ForceRefresh(); diff --git a/eeschema/sch_bitmap.cpp b/eeschema/sch_bitmap.cpp index 68da3be63f..cc1160e1a1 100644 --- a/eeschema/sch_bitmap.cpp +++ b/eeschema/sch_bitmap.cpp @@ -198,12 +198,12 @@ BITMAP_DEF SCH_BITMAP::GetMenuImage() const void SCH_BITMAP::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) { - aList.push_back( MSG_PANEL_ITEM( _( "Bitmap" ), wxEmptyString, RED ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Bitmap" ), wxEmptyString ) ); - aList.push_back( MSG_PANEL_ITEM( _( "Width" ), - MessageTextFromValue( aFrame->GetUserUnits(), GetSize().x ), RED ) ); - aList.push_back( MSG_PANEL_ITEM( _( "Height" ), - MessageTextFromValue( aFrame->GetUserUnits(), GetSize().y ), RED ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Width" ), MessageTextFromValue( aFrame->GetUserUnits(), + GetSize().x ) ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Height" ), MessageTextFromValue( aFrame->GetUserUnits(), + GetSize().y ) ) ); } diff --git a/eeschema/sch_bus_entry.cpp b/eeschema/sch_bus_entry.cpp index e41535ed29..8758a3a5bf 100644 --- a/eeschema/sch_bus_entry.cpp +++ b/eeschema/sch_bus_entry.cpp @@ -418,7 +418,7 @@ void SCH_BUS_ENTRY_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEM case LAYER_BUS: msg = _( "Bus" ); break; } - aList.push_back( MSG_PANEL_ITEM( _( "Bus Entry Type" ), msg, DARKCYAN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Bus Entry Type" ), msg ) ); SCH_EDIT_FRAME* frame = dynamic_cast( aFrame ); diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index ab96596b71..33905c04c4 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -1352,19 +1352,19 @@ void SCH_COMPONENT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aL { if( m_part.get() != dummy() ) { - aList.push_back( MSG_PANEL_ITEM( _( "Reference" ), GetRef( currentSheet ), DARKCYAN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Reference" ), GetRef( currentSheet ) ) ); msg = m_part->IsPower() ? _( "Power symbol" ) : _( "Value" ); - aList.push_back( MSG_PANEL_ITEM( msg, GetValue( currentSheet, true ), DARKCYAN ) ); + aList.push_back( MSG_PANEL_ITEM( msg, GetValue( currentSheet, true ) ) ); #if 0 // Display component flags, for debug only - aList.push_back( MSG_PANEL_ITEM( _( "flags" ), - wxString::Format("%X", GetEditFlags()), BROWN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "flags" ), wxString::Format( "%X", + GetEditFlags() ) ) ); #endif // Display component reference in library and library - aList.push_back( MSG_PANEL_ITEM( _( "Name" ), GetLibId().GetLibItemName(), BROWN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Name" ), GetLibId().GetLibItemName() ) ); if( !m_part->IsRoot() ) { @@ -1375,16 +1375,15 @@ void SCH_COMPONENT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aL if( parent ) msg = parent->GetName(); - aList.push_back( MSG_PANEL_ITEM( _( "Alias of" ), msg, BROWN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Alias of" ), msg ) ); } else if( !m_lib_id.GetLibNickname().empty() ) { - aList.push_back( MSG_PANEL_ITEM( _( "Library" ), m_lib_id.GetLibNickname(), - BROWN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Library" ), m_lib_id.GetLibNickname() ) ); } else { - aList.push_back( MSG_PANEL_ITEM( _( "Library" ), _( "Undefined!!!" ), RED ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Library" ), _( "Undefined!!!" ) ) ); } // Display the current associated footprint, if exists. @@ -1393,31 +1392,31 @@ void SCH_COMPONENT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aL if( msg.IsEmpty() ) msg = _( "" ); - aList.push_back( MSG_PANEL_ITEM( _( "Footprint" ), msg, DARKRED ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Footprint" ), msg ) ); // Display description of the component, and keywords found in lib aList.push_back( MSG_PANEL_ITEM( _( "Description" ), m_part->GetDescription(), DARKCYAN ) ); - aList.push_back( MSG_PANEL_ITEM( _( "Keywords" ), m_part->GetKeyWords(), DARKCYAN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Keywords" ), m_part->GetKeyWords() ) ); } } else { - aList.push_back( MSG_PANEL_ITEM( _( "Reference" ), GetRef( currentSheet ), DARKCYAN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Reference" ), GetRef( currentSheet ) ) ); - aList.push_back( MSG_PANEL_ITEM( _( "Value" ), GetValue( currentSheet, true ), DARKCYAN ) ); - aList.push_back( MSG_PANEL_ITEM( _( "Name" ), GetLibId().GetLibItemName(), BROWN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Value" ), GetValue( currentSheet, true ) ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Name" ), GetLibId().GetLibItemName() ) ); wxString libNickname = GetLibId().GetLibNickname(); if( libNickname.empty() ) { - aList.push_back( MSG_PANEL_ITEM( _( "Library" ), _( "No library defined!" ), RED ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Library" ), _( "No library defined!" ) ) ); } else { msg.Printf( _( "Symbol not found in %s!" ), libNickname ); - aList.push_back( MSG_PANEL_ITEM( _( "Library" ), msg , RED ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Library" ), msg ) ); } } } diff --git a/eeschema/sch_connection.cpp b/eeschema/sch_connection.cpp index a7b3e93057..daa781ea31 100644 --- a/eeschema/sch_connection.cpp +++ b/eeschema/sch_connection.cpp @@ -350,7 +350,7 @@ void SCH_CONNECTION::AppendInfoToMsgPanel( MSG_PANEL_ITEMS& aList ) const wxString msg, group_name; std::vector group_members; - aList.push_back( MSG_PANEL_ITEM( _( "Connection Name" ), UnescapeString( Name() ), BROWN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Connection Name" ), UnescapeString( Name() ) ) ); // NOTE(JE) Disabling this for now, because net codes are generated in the netlist exporter // in order to avoid sort costs. It may make sense to just tear out net codes from the @@ -359,7 +359,7 @@ void SCH_CONNECTION::AppendInfoToMsgPanel( MSG_PANEL_ITEMS& aList ) const if( !IsBus() ) { msg.Printf( "%d", m_net_code ); - aList.push_back( MSG_PANEL_ITEM( _( "Net Code" ), msg, BROWN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Net Code" ), msg ) ); } #endif @@ -372,7 +372,7 @@ void SCH_CONNECTION::AppendInfoToMsgPanel( MSG_PANEL_ITEMS& aList ) const for( const auto& member : alias->Members() ) members << member << " "; - aList.push_back( MSG_PANEL_ITEM( msg, members, RED ) ); + aList.push_back( MSG_PANEL_ITEM( msg, members ) ); } else if( NET_SETTINGS::ParseBusGroup( m_name, &group_name, &group_members ) ) { @@ -387,7 +387,7 @@ void SCH_CONNECTION::AppendInfoToMsgPanel( MSG_PANEL_ITEMS& aList ) const for( const auto& member : group_alias->Members() ) members << member << " "; - aList.push_back( MSG_PANEL_ITEM( msg, members, RED ) ); + aList.push_back( MSG_PANEL_ITEM( msg, members ) ); } } } @@ -401,16 +401,16 @@ void SCH_CONNECTION::AppendInfoToMsgPanel( MSG_PANEL_ITEMS& aList ) const if( IsBus() ) { msg.Printf( "%d", m_bus_code ); - aList.push_back( MSG_PANEL_ITEM( "Bus Code", msg, BROWN ) ); + aList.push_back( MSG_PANEL_ITEM( "Bus Code", msg ) ); } msg.Printf( "%d", m_subgraph_code ); - aList.push_back( MSG_PANEL_ITEM( "Subgraph Code", msg, BROWN ) ); + aList.push_back( MSG_PANEL_ITEM( "Subgraph Code", msg ) ); if( auto driver = Driver() ) { msg.Printf( "%s at %p", driver->GetSelectMenuText( EDA_UNITS::MILLIMETRES ), driver ); - aList.push_back( MSG_PANEL_ITEM( "Connection Source", msg, RED ) ); + aList.push_back( MSG_PANEL_ITEM( "Connection Source", msg ) ); } #endif } diff --git a/eeschema/sch_line.cpp b/eeschema/sch_line.cpp index c7c063a11c..2bf3a6aa59 100644 --- a/eeschema/sch_line.cpp +++ b/eeschema/sch_line.cpp @@ -817,14 +817,14 @@ void SCH_LINE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) default: msg = _( "Graphical" ); break; } - aList.push_back( MSG_PANEL_ITEM( _( "Line Type" ), msg, DARKCYAN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Line Type" ), msg ) ); if( GetLineStyle() != GetEffectiveLineStyle() ) msg = _( "from netclass" ); else msg = GetLineStyleName( GetLineStyle() ); - aList.push_back( MSG_PANEL_ITEM( _( "Line Style" ), msg, DARKCYAN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Line Style" ), msg ) ); SCH_EDIT_FRAME* frame = dynamic_cast( aFrame ); @@ -841,7 +841,7 @@ void SCH_LINE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) if( netSettings.m_NetClassAssignments.count( netname ) ) netclassName = netSettings.m_NetClassAssignments[ netname ]; - aList.push_back( MSG_PANEL_ITEM( _( "Assigned Netclass" ), netclassName, DARKRED ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Assigned Netclass" ), netclassName ) ); } } } diff --git a/eeschema/sch_marker.cpp b/eeschema/sch_marker.cpp index bf9f06bc68..8173e19d38 100644 --- a/eeschema/sch_marker.cpp +++ b/eeschema/sch_marker.cpp @@ -135,7 +135,7 @@ const EDA_RECT SCH_MARKER::GetBoundingBox() const void SCH_MARKER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) { aList.push_back( MSG_PANEL_ITEM( _( "Electronics Rule Check Error" ), - m_rcItem->GetErrorMessage(), DARKRED ) ); + m_rcItem->GetErrorMessage() ) ); } diff --git a/eeschema/sch_pin.cpp b/eeschema/sch_pin.cpp index d24fc05db2..b8da3e13e8 100644 --- a/eeschema/sch_pin.cpp +++ b/eeschema/sch_pin.cpp @@ -156,14 +156,14 @@ void SCH_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) { wxString msg; - aList.push_back( MSG_PANEL_ITEM( _( "Type" ), _( "Pin" ), CYAN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Type" ), _( "Pin" ) ) ); if( m_libPin->GetUnit() == 0 ) msg = _( "All" ); else msg.Printf( wxT( "%d" ), m_libPin->GetUnit() ); - aList.push_back( MSG_PANEL_ITEM( _( "Unit" ), msg, BROWN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Unit" ), msg ) ); if( m_libPin->GetConvert() == LIB_ITEM::LIB_CONVERT::BASE ) msg = _( "no" ); @@ -172,37 +172,36 @@ void SCH_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) else msg = wxT( "?" ); - aList.push_back( MSG_PANEL_ITEM( _( "Converted" ), msg, BROWN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Converted" ), msg ) ); - aList.push_back( MSG_PANEL_ITEM( _( "Name" ), GetName(), DARKCYAN ) ); - aList.push_back( MSG_PANEL_ITEM( _( "Number" ), msg, DARKCYAN ) ); - aList.push_back( MSG_PANEL_ITEM( _( "Type" ), ElectricalPinTypeGetText( GetType() ), RED ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Name" ), GetName() ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Number" ), msg ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Type" ), ElectricalPinTypeGetText( GetType() ) ) ); msg = PinShapeGetText( GetShape() ); - aList.push_back( MSG_PANEL_ITEM( _( "Style" ), msg, BLUE ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Style" ), msg ) ); msg = IsVisible() ? _( "Yes" ) : _( "No" ); - aList.push_back( MSG_PANEL_ITEM( _( "Visible" ), msg, DARKGREEN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Visible" ), msg ) ); // Display pin length msg = StringFromValue( aFrame->GetUserUnits(), GetLength() ); - aList.push_back( MSG_PANEL_ITEM( _( "Length" ), msg, MAGENTA ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Length" ), msg ) ); msg = PinOrientationName( (unsigned) PinOrientationIndex( GetOrientation() ) ); - aList.push_back( MSG_PANEL_ITEM( _( "Orientation" ), msg, DARKMAGENTA ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Orientation" ), msg ) ); msg = MessageTextFromValue( aFrame->GetUserUnits(), m_position.x ); - aList.emplace_back( _( "Pos X" ), msg, DARKMAGENTA ); + aList.emplace_back( _( "Pos X" ), msg ); msg = MessageTextFromValue( aFrame->GetUserUnits(), m_position.y ); - aList.emplace_back( _( "Pos Y" ), msg, DARKMAGENTA ); + aList.emplace_back( _( "Pos Y" ), msg ); SCH_EDIT_FRAME* schframe = dynamic_cast( aFrame ); SCH_SHEET_PATH* currentSheet = schframe ? &schframe->GetCurrentSheet() : nullptr; SCH_COMPONENT* symbol = GetParentSymbol(); - aList.emplace_back( symbol->GetRef( currentSheet ), symbol->GetValue( currentSheet, true ), - DARKCYAN ); + aList.emplace_back( symbol->GetRef( currentSheet ), symbol->GetValue( currentSheet, true ) ); #if defined(DEBUG) diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index 635e857d98..4d23eba409 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -640,7 +640,7 @@ void SCH_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) default: return; } - aList.push_back( MSG_PANEL_ITEM( msg, GetShownText(), DARKCYAN ) ); + aList.push_back( MSG_PANEL_ITEM( msg, GetShownText() ) ); switch( GetLabelSpinStyle() ) { @@ -662,18 +662,18 @@ void SCH_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) if( IsBold() ) style += 2; - aList.push_back( MSG_PANEL_ITEM( _( "Style" ), textStyle[style], BROWN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Style" ), textStyle[style] ) ); // Display electrical type if it is relevant if( Type() == SCH_GLOBAL_LABEL_T || Type() == SCH_HIER_LABEL_T || Type() == SCH_SHEET_PIN_T ) { msg = getElectricalTypeLabel( GetShape() ); - aList.push_back( MSG_PANEL_ITEM( _( "Type" ), msg, BLUE ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Type" ), msg ) ); } // Display text size (X or Y value, with are the same value in Eeschema) msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextWidth() ); - aList.push_back( MSG_PANEL_ITEM( _( "Size" ), msg, RED ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Size" ), msg ) ); SCH_EDIT_FRAME* frame = dynamic_cast( aFrame ); @@ -689,7 +689,7 @@ void SCH_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) if( netSettings.m_NetClassAssignments.count( netname ) ) { const wxString& netclassName = netSettings.m_NetClassAssignments[ netname ]; - aList.push_back( MSG_PANEL_ITEM( _( "Assigned Netclass" ), netclassName, DARKRED ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Assigned Netclass" ), netclassName ) ); } } } diff --git a/eeschema/symbol_editor/symbol_editor.cpp b/eeschema/symbol_editor/symbol_editor.cpp index 370528d6af..be8677555f 100644 --- a/eeschema/symbol_editor/symbol_editor.cpp +++ b/eeschema/symbol_editor/symbol_editor.cpp @@ -1145,37 +1145,37 @@ void SYMBOL_EDIT_FRAME::DisplaySymbolDatasheet() wxString msg = m_my_part->GetName(); - AppendMsgPanel( _( "Name" ), msg, BLUE, 8 ); + AppendMsgPanel( _( "Name" ), msg, 8 ); if( m_my_part->IsAlias() ) { PART_SPTR parent = m_my_part->GetParent().lock(); msg = parent ? parent->GetName() : _( "Undefined!" ); - AppendMsgPanel( _( "Parent" ), msg, BROWN, 8 ); + AppendMsgPanel( _( "Parent" ), msg, 8 ); } static wxChar UnitLetter[] = wxT( "?ABCDEFGHIJKLMNOPQRSTUVWXYZ" ); msg = UnitLetter[m_unit]; - AppendMsgPanel( _( "Unit" ), msg, BROWN, 8 ); + AppendMsgPanel( _( "Unit" ), msg, 8 ); if( m_convert > 1 ) msg = _( "Convert" ); else msg = _( "Normal" ); - AppendMsgPanel( _( "Body" ), msg, GREEN, 8 ); + AppendMsgPanel( _( "Body" ), msg, 8 ); if( m_my_part->IsPower() ) msg = _( "Power Symbol" ); else msg = _( "Symbol" ); - AppendMsgPanel( _( "Type" ), msg, MAGENTA, 8 ); - AppendMsgPanel( _( "Description" ), m_my_part->GetDescription(), CYAN, 8 ); - AppendMsgPanel( _( "Keywords" ), m_my_part->GetKeyWords(), DARKDARKGRAY ); - AppendMsgPanel( _( "Datasheet" ), m_my_part->GetDatasheetField().GetText(), DARKDARKGRAY ); + AppendMsgPanel( _( "Type" ), msg, 8 ); + AppendMsgPanel( _( "Description" ), m_my_part->GetDescription(), 8 ); + AppendMsgPanel( _( "Keywords" ), m_my_part->GetKeyWords() ); + AppendMsgPanel( _( "Datasheet" ), m_my_part->GetDatasheetField().GetText() ); } diff --git a/include/eda_draw_frame.h b/include/eda_draw_frame.h index c47ca494a2..d544c0043f 100644 --- a/include/eda_draw_frame.h +++ b/include/eda_draw_frame.h @@ -412,13 +412,11 @@ public: * the frame and appends a message to it using the message panel * AppendMessage() method. * - * @param textUpper - The message upper text. - * @param textLower - The message lower text. - * @param color - A color ID from the KiCad color list (see colors.h). - * @param pad - Number of spaces to pad between messages (default = 4). + * @param aTextUpper - The message upper text. + * @param aTextLower - The message lower text. + * @param aPadding - Number of spaces to pad between messages. */ - void AppendMsgPanel( const wxString& textUpper, const wxString& textLower, - COLOR4D color, int pad = 6 ); + void AppendMsgPanel( const wxString& aTextUpper, const wxString& aTextLower, int aPadding = 6 ); /** * Clear all messages from the message panel. diff --git a/include/widgets/msgpanel.h b/include/widgets/msgpanel.h index 58a2f9a408..f4ebee95b2 100644 --- a/include/widgets/msgpanel.h +++ b/include/widgets/msgpanel.h @@ -58,18 +58,16 @@ class MSG_PANEL_ITEM int m_LowerY; wxString m_UpperText; wxString m_LowerText; - COLOR4D m_Color; - int m_Pad; + int m_Padding; friend class EDA_MSG_PANEL; public: - MSG_PANEL_ITEM( const wxString& aUpperText, const wxString& aLowerText, COLOR4D aColor, - int aPad = MSG_PANEL_DEFAULT_PAD ) : - m_UpperText( aUpperText ), - m_LowerText( aLowerText ), - m_Color( aColor ), - m_Pad( aPad ) + MSG_PANEL_ITEM( const wxString& aUpperText, const wxString& aLowerText, + int aPadding = MSG_PANEL_DEFAULT_PAD ) : + m_UpperText( aUpperText ), + m_LowerText( aLowerText ), + m_Padding( aPadding ) { m_X = 0; m_UpperY = 0; @@ -77,13 +75,12 @@ public: } MSG_PANEL_ITEM() : - m_Pad( MSG_PANEL_DEFAULT_PAD ) + m_Padding( MSG_PANEL_DEFAULT_PAD ) { m_X = 0; m_UpperY = 0; m_LowerY = 0; - m_Color = COLOR4D::UNSPECIFIED; } void SetUpperText( const wxString& aUpperText ) { m_UpperText = aUpperText; } @@ -92,17 +89,12 @@ public: void SetLowerText( const wxString& aLowerText ) { m_LowerText = aLowerText; } const wxString& GetLowerText() const { return m_LowerText; } - void SetColor( COLOR4D aColor ) { m_Color = aColor; } - COLOR4D GetColor() const { return m_Color; } - - void SetPadding( int aPad ) { m_Pad = aPad; } - int GetPadding() const { return m_Pad; } + void SetPadding( int aPadding ) { m_Padding = aPadding; } + int GetPadding() const { return m_Padding; } }; typedef std::vector MSG_PANEL_ITEMS; -typedef MSG_PANEL_ITEMS::iterator MSG_PANEL_ITEMS_ITER; -typedef MSG_PANEL_ITEMS::const_iterator MSG_PANEL_ITEMS_CITER; /** @@ -155,10 +147,8 @@ public: * to set the message using the last message position. * @param aUpperText The text to be displayed in top line. * @param aLowerText The text to be displayed in bottom line. - * @param aColor Color of the text to display. */ - void SetMessage( int aXPosition, const wxString& aUpperText, - const wxString& aLowerText, COLOR4D aColor ); + void SetMessage( int aXPosition, const wxString& aUpperText, const wxString& aLowerText ); /** * Function AppendMessage @@ -171,11 +161,9 @@ public: * * @param aUpperText The message upper text. * @param aLowerText The message lower text. - * @param aColor A color to use for the message text - * @param aPad Number of spaces to pad between messages (default = 4). + * @param aPadding Number of spaces to pad between messages (default = 4). */ - void AppendMessage( const wxString& aUpperText, const wxString& aLowerText, - COLOR4D aColor, int aPad = 6 ); + void AppendMessage( const wxString& aUpperText, const wxString& aLowerText, int aPadding = 6 ); /** * Function AppendMessage @@ -187,7 +175,7 @@ public: void AppendMessage( const MSG_PANEL_ITEM& aMessageItem ) { AppendMessage( aMessageItem.GetUpperText(), aMessageItem.GetLowerText(), - aMessageItem.GetColor(), aMessageItem.GetPadding() ); + aMessageItem.GetPadding() ); } DECLARE_EVENT_TABLE() diff --git a/pcbnew/tools/pcbnew_control.cpp b/pcbnew/tools/pcbnew_control.cpp index 6f94fd2987..bff082a359 100644 --- a/pcbnew/tools/pcbnew_control.cpp +++ b/pcbnew/tools/pcbnew_control.cpp @@ -1068,7 +1068,7 @@ int PCBNEW_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent ) MSG_PANEL_ITEMS msgItems; wxString msg = wxString::Format( wxT( "%d" ), selection.GetSize() ); - msgItems.emplace_back( MSG_PANEL_ITEM( _( "Selected Items" ), msg, DARKCYAN ) ); + msgItems.emplace_back( MSG_PANEL_ITEM( _( "Selected Items" ), msg ) ); m_frame->SetMsgPanel( msgItems ); } else if( auto editFrame = dynamic_cast( m_frame ) ) @@ -1082,10 +1082,10 @@ int PCBNEW_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent ) wxString msg; msg = footprint->GetFPID().GetLibNickname().wx_str(); - msgItems.emplace_back( MSG_PANEL_ITEM( _( "Library" ), msg, DARKCYAN ) ); + msgItems.emplace_back( MSG_PANEL_ITEM( _( "Library" ), msg ) ); msg = footprint->GetFPID().GetLibItemName().wx_str(); - msgItems.emplace_back( MSG_PANEL_ITEM( _( "Footprint Name" ), msg, DARKCYAN ) ); + msgItems.emplace_back( MSG_PANEL_ITEM( _( "Footprint Name" ), msg ) ); wxDateTime date( static_cast( footprint->GetLastEditTime() ) ); @@ -1095,15 +1095,15 @@ int PCBNEW_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent ) else msg = _( "Unknown" ); - msgItems.emplace_back( MSG_PANEL_ITEM( _( "Last Change" ), msg, BROWN ) ); + msgItems.emplace_back( MSG_PANEL_ITEM( _( "Last Change" ), msg ) ); msg.Printf( wxT( "%zu" ), (size_t) footprint->GetPadCount( DO_NOT_INCLUDE_NPTH ) ); - msgItems.emplace_back( MSG_PANEL_ITEM( _( "Pads" ), msg, BLUE ) ); + msgItems.emplace_back( MSG_PANEL_ITEM( _( "Pads" ), msg ) ); wxString doc, keyword; doc.Printf( _( "Doc: %s" ), footprint->GetDescription() ); keyword.Printf( _( "Keywords: %s" ), footprint->GetKeywords() ); - msgItems.emplace_back( MSG_PANEL_ITEM( doc, keyword, BLACK ) ); + msgItems.emplace_back( MSG_PANEL_ITEM( doc, keyword ) ); m_frame->SetMsgPanel( msgItems ); } diff --git a/pcbnew/track.cpp b/pcbnew/track.cpp index 36ac1b22bb..bd39249400 100644 --- a/pcbnew/track.cpp +++ b/pcbnew/track.cpp @@ -743,9 +743,9 @@ void TRACK::GetMsgPanelInfoBase_Common( EDA_DRAW_FRAME* aFrame, std::vector& AccumulateDescription( msg, _( "No footprints" ) ); if( !msg.IsEmpty() ) - aList.emplace_back( MSG_PANEL_ITEM( _( "Restrictions" ), msg, RED ) ); + aList.emplace_back( MSG_PANEL_ITEM( _( "Restrictions" ), msg ) ); } else if( IsOnCopperLayer() ) { @@ -633,7 +633,7 @@ void ZONE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& // Useful for statistics, especially when zones are complex the number of hatches // and filled polygons can explain the display and DRC calculation time: msg.Printf( wxT( "%d" ), (int) m_borderHatchLines.size() ); - aList.emplace_back( MSG_PANEL_ITEM( _( "HatchBorder Lines" ), msg, BLUE ) ); + aList.emplace_back( MSG_PANEL_ITEM( _( "HatchBorder Lines" ), msg ) ); PCB_LAYER_ID layer = m_layer; @@ -641,8 +641,10 @@ void ZONE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& // TODO: Figure out a way for items to know the active layer without the whole edit frame? #if 0 if( PCB_EDIT_FRAME* pcbframe = dynamic_cast( aFrame ) ) + { if( m_FilledPolysList.count( pcbframe->GetActiveLayer() ) ) layer = pcbframe->GetActiveLayer(); + } #endif if( !GetIsRuleArea() ) @@ -655,7 +657,7 @@ void ZONE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& if( layer_it != m_FilledPolysList.end() ) { msg.Printf( wxT( "%d" ), layer_it->second.TotalVertices() ); - aList.emplace_back( MSG_PANEL_ITEM( _( "Corner Count" ), msg, BLUE ) ); + aList.emplace_back( MSG_PANEL_ITEM( _( "Corner Count" ), msg ) ); } } }