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
<no net>.)
This commit is contained in:
Jeff Young 2024-06-14 22:40:33 +01:00
parent 0f8d543172
commit b2588e0bbf
5 changed files with 27 additions and 15 deletions

View File

@ -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 )

View File

@ -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 );

View File

@ -2942,7 +2942,7 @@
<property name="border">5</property>
<property name="colspan">1</property>
<property name="column">0</property>
<property name="flag"></property>
<property name="flag">wxLEFT</property>
<property name="row">0</property>
<property name="rowspan">1</property>
<object class="wxCheckBox" expanded="false">
@ -3010,7 +3010,7 @@
<property name="border">5</property>
<property name="colspan">2</property>
<property name="column">0</property>
<property name="flag"></property>
<property name="flag">wxLEFT</property>
<property name="row">1</property>
<property name="rowspan">1</property>
<object class="wxCheckBox" expanded="false">

View File

@ -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!

View File

@ -699,14 +699,18 @@ void PCB_SHAPE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_I
wxString PCB_SHAPE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
{
if( GetNetCode() > 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() );
}
}