Show pin hidden state in menu text.

Fixes https://gitlab.com/kicad/code/kicad/issues/5625
This commit is contained in:
Jeff Young 2022-10-24 11:34:47 +01:00
parent 0399d08aaa
commit a072c22b74
1 changed files with 31 additions and 10 deletions

View File

@ -1324,20 +1324,41 @@ BITMAPS LIB_PIN::GetMenuImage() const
wxString LIB_PIN::GetSelectMenuText( UNITS_PROVIDER* aUnitsProvider ) const wxString LIB_PIN::GetSelectMenuText( UNITS_PROVIDER* aUnitsProvider ) const
{ {
if( !m_name.IsEmpty() ) if( IsVisible() )
{ {
return wxString::Format( _( "Pin %s [%s, %s, %s]" ), if( !m_name.IsEmpty() )
GetShownNumber(), {
UnescapeString( GetShownName() ), return wxString::Format( _( "Pin %s [%s, %s, %s]" ),
GetElectricalTypeName(), GetShownNumber(),
PinShapeGetText( m_shape ) ); UnescapeString( GetShownName() ),
GetElectricalTypeName(),
PinShapeGetText( m_shape ) );
}
else
{
return wxString::Format( _( "Pin %s [%s, %s]" ),
GetShownNumber(),
GetElectricalTypeName(),
PinShapeGetText( m_shape ) );
}
} }
else else
{ {
return wxString::Format( _( "Pin %s [%s, %s]" ), if( !m_name.IsEmpty() )
GetShownNumber(), {
GetElectricalTypeName(), return wxString::Format( _( "Hidden pin %s [%s, %s, %s]" ),
PinShapeGetText( m_shape ) ); GetShownNumber(),
UnescapeString( GetShownName() ),
GetElectricalTypeName(),
PinShapeGetText( m_shape ) );
}
else
{
return wxString::Format( _( "Hidden pin %s [%s, %s]" ),
GetShownNumber(),
GetElectricalTypeName(),
PinShapeGetText( m_shape ) );
}
} }
} }