From b2588e0bbfe736a01256be58eebfd926eb19611b Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 14 Jun 2024 22:40:33 +0100 Subject: [PATCH] Footprint Editor doesn't have nets. (Copper shapes, on the other hand, can. Since we use GetItemDescription() to report DRC errors and the like, it's better to have it report the net even when it's .) --- pcbnew/dialogs/dialog_shape_properties.cpp | 20 +++++++++++++------ .../dialogs/dialog_shape_properties_base.cpp | 6 +++--- .../dialogs/dialog_shape_properties_base.fbp | 4 ++-- pcbnew/dialogs/dialog_shape_properties_base.h | 2 +- pcbnew/pcb_shape.cpp | 10 +++++++--- 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/pcbnew/dialogs/dialog_shape_properties.cpp b/pcbnew/dialogs/dialog_shape_properties.cpp index 1dbb972518..042ea1cbc8 100644 --- a/pcbnew/dialogs/dialog_shape_properties.cpp +++ b/pcbnew/dialogs/dialog_shape_properties.cpp @@ -151,16 +151,24 @@ DIALOG_SHAPE_PROPERTIES::DIALOG_SHAPE_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, m_netSelector->SetBoard( aParent->GetBoard() ); m_netSelector->SetNetInfo( &aParent->GetBoard()->GetNetInfo() ); - int net = aShape->GetNetCode(); - - if( net >= 0 ) + if( m_parent->GetFrameType() == FRAME_FOOTPRINT_EDITOR ) { - m_netSelector->SetSelectedNetcode( net ); + m_netLabel->Hide(); + m_netSelector->Hide(); } else { - m_netSelector->SetIndeterminateString( INDETERMINATE_STATE ); - m_netSelector->SetIndeterminate(); + int net = aShape->GetNetCode(); + + if( net >= 0 ) + { + m_netSelector->SetSelectedNetcode( net ); + } + else + { + m_netSelector->SetIndeterminateString( INDETERMINATE_STATE ); + m_netSelector->SetIndeterminate(); + } } if( m_item->GetShape() == SHAPE_T::POLY ) diff --git a/pcbnew/dialogs/dialog_shape_properties_base.cpp b/pcbnew/dialogs/dialog_shape_properties_base.cpp index fc67af2465..399627666a 100644 --- a/pcbnew/dialogs/dialog_shape_properties_base.cpp +++ b/pcbnew/dialogs/dialog_shape_properties_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf0) +// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -219,10 +219,10 @@ DIALOG_SHAPE_PROPERTIES_BASE::DIALOG_SHAPE_PROPERTIES_BASE( wxWindow* parent, wx gbSizer2->SetEmptyCellSize( wxSize( -1,4 ) ); m_locked = new wxCheckBox( this, wxID_ANY, _("Locked"), wxDefaultPosition, wxDefaultSize, 0 ); - gbSizer2->Add( m_locked, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), 0, 5 ); + gbSizer2->Add( m_locked, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxLEFT, 5 ); m_filledCtrl = new wxCheckBox( this, wxID_ANY, _("Filled shape"), wxDefaultPosition, wxDefaultSize, 0 ); - gbSizer2->Add( m_filledCtrl, wxGBPosition( 1, 0 ), wxGBSpan( 1, 2 ), 0, 5 ); + gbSizer2->Add( m_filledCtrl, wxGBPosition( 1, 0 ), wxGBSpan( 1, 2 ), wxLEFT, 5 ); m_thicknessLabel = new wxStaticText( this, wxID_ANY, _("Line width:"), wxDefaultPosition, wxDefaultSize, 0 ); m_thicknessLabel->Wrap( -1 ); diff --git a/pcbnew/dialogs/dialog_shape_properties_base.fbp b/pcbnew/dialogs/dialog_shape_properties_base.fbp index fb501e50bb..2f235bc13f 100644 --- a/pcbnew/dialogs/dialog_shape_properties_base.fbp +++ b/pcbnew/dialogs/dialog_shape_properties_base.fbp @@ -2942,7 +2942,7 @@ 5 1 0 - + wxLEFT 0 1 @@ -3010,7 +3010,7 @@ 5 2 0 - + wxLEFT 1 1 diff --git a/pcbnew/dialogs/dialog_shape_properties_base.h b/pcbnew/dialogs/dialog_shape_properties_base.h index 4baf1c7dce..0fa7f87aa5 100644 --- a/pcbnew/dialogs/dialog_shape_properties_base.h +++ b/pcbnew/dialogs/dialog_shape_properties_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf0) +// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! diff --git a/pcbnew/pcb_shape.cpp b/pcbnew/pcb_shape.cpp index d62b2b1995..ac925e7aa4 100644 --- a/pcbnew/pcb_shape.cpp +++ b/pcbnew/pcb_shape.cpp @@ -699,14 +699,18 @@ void PCB_SHAPE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector 0 ) + if( IsOnCopperLayer() ) { - return wxString::Format( _( "%s %s on %s" ), GetFriendlyName(), GetNetnameMsg(), + return wxString::Format( _( "%s %s on %s" ), + GetFriendlyName(), + GetNetnameMsg(), GetLayerName() ); } else { - return wxString::Format( _( "%s on %s" ), GetFriendlyName(), GetLayerName() ); + return wxString::Format( _( "%s on %s" ), + GetFriendlyName(), + GetLayerName() ); } }