diff --git a/common/dialogs/dialog_display_html_text_base.fbp b/common/dialogs/dialog_display_html_text_base.fbp index ad2d208353..c6247e09e5 100644 --- a/common/dialogs/dialog_display_html_text_base.fbp +++ b/common/dialogs/dialog_display_html_text_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,7 +14,6 @@ dialog_display_html_text_base 1000 none - 1 dialog_display_html_text_base @@ -26,7 +25,6 @@ 1 1 UI - 0 0 0 @@ -52,7 +50,6 @@ DIALOG_SHIM; dialog_shim.h - 0 @@ -62,7 +59,7 @@ wxVERTICAL none - 5 + 10 wxALL|wxEXPAND 1 diff --git a/eeschema/tools/ee_inspection_tool.cpp b/eeschema/tools/ee_inspection_tool.cpp index d30f3c3bf1..92d557f18c 100644 --- a/eeschema/tools/ee_inspection_tool.cpp +++ b/eeschema/tools/ee_inspection_tool.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2019 CERN - * Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -39,26 +39,11 @@ #include #include #include -#include +#include #include #include // for KiROUND -class DIALOG_DISPLAY_HTML_TEXT : public DIALOG_DISPLAY_HTML_TEXT_BASE -{ -public: - DIALOG_DISPLAY_HTML_TEXT( wxWindow* aParent, wxWindowID aId, const wxString& aTitle, - const wxPoint& aPos, const wxSize& aSize, long aStyle = 0 ) : - DIALOG_DISPLAY_HTML_TEXT_BASE( aParent, aId, aTitle, aPos, aSize, aStyle ) - { } - - ~DIALOG_DISPLAY_HTML_TEXT() - { } - - void SetPage( const wxString& message ) { m_htmlWindow->SetPage( message ); } -}; - - EE_INSPECTION_TOOL::EE_INSPECTION_TOOL() : EE_TOOL_BASE( "eeschema.InspectionTool" ), m_ercDialog( nullptr ) @@ -259,7 +244,7 @@ int EE_INSPECTION_TOOL::CheckSymbol( const TOOL_EVENT& aEvent ) if( symbol->HasConversion() && next->GetConvert() ) { - if( symbol->GetUnitCount() <= 1 ) + if( pin->GetUnit() == 0 || next->GetUnit() == 0 ) { msg.Printf( _( "Duplicate pin %s %s at location (%.3f, %.3f)" " conflicts with pin %s%s at location (%.3f, %.3f)" @@ -286,13 +271,13 @@ int EE_INSPECTION_TOOL::CheckSymbol( const TOOL_EVENT& aEvent ) pinName, MessageTextFromValue( units, pin->GetPosition().x ), MessageTextFromValue( units, -pin->GetPosition().y ), - 'A' + next->GetUnit() - 1, - 'A' + pin->GetUnit() - 1 ); + symbol->GetUnitReference( next->GetUnit() ), + symbol->GetUnitReference( pin->GetUnit() ) ); } } else { - if( symbol->GetUnitCount() <= 1 ) + if( pin->GetUnit() == 0 || next->GetUnit() == 0 ) { msg.Printf( _( "Duplicate pin %s %s at location (%s, %s)" " conflicts with pin %s%s at location (%s, %s)." ), @@ -318,8 +303,8 @@ int EE_INSPECTION_TOOL::CheckSymbol( const TOOL_EVENT& aEvent ) pinName, MessageTextFromValue( units, pin->GetPosition().x ), MessageTextFromValue( units, -pin->GetPosition().y ), - 'A' + next->GetUnit() - 1, - 'A' + pin->GetUnit() - 1 ); + symbol->GetUnitReference( next->GetUnit() ), + symbol->GetUnitReference( pin->GetUnit() ) ); } } @@ -450,16 +435,12 @@ int EE_INSPECTION_TOOL::CheckSymbol( const TOOL_EVENT& aEvent ) } else { - wxString outmsg; + HTML_MESSAGE_BOX dlg( m_frame, _( "Symbol Warnings" ) ); for( const wxString& single_msg : messages ) - outmsg += single_msg; + dlg.AddHTML_Text( single_msg ); - DIALOG_DISPLAY_HTML_TEXT error_display( m_frame, wxID_ANY, _( "Symbol Warnings" ), - wxDefaultPosition, wxSize( 700, 350 ) ); - - error_display.SetPage( outmsg ); - error_display.ShowModal(); + dlg.ShowModal(); } return 0;