Select assigned footprint in right panel.
Fixes: lp:1793294 * https://bugs.launchpad.net/kicad/+bug/1793294
This commit is contained in:
parent
a1bcc4ba1e
commit
dd9b0c2dc6
|
@ -480,7 +480,10 @@ void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
|
|||
m_footprintListBox->SetFootprints( *m_FootprintsList, libraryName, component,
|
||||
m_currentSearchPattern, m_filteringOptions);
|
||||
|
||||
m_footprintListBox->SetSelection( m_footprintListBox->GetSelection(), false );
|
||||
if( component && component->GetFPID().IsValid() )
|
||||
m_footprintListBox->SetSelectedFootprint( component->GetFPID() );
|
||||
else
|
||||
m_footprintListBox->SetSelection( m_footprintListBox->GetSelection(), false );
|
||||
|
||||
refreshAfterComponentSearch (component);
|
||||
}
|
||||
|
|
|
@ -112,15 +112,28 @@ void FOOTPRINTS_LISTBOX::SetSelection( int index, bool State )
|
|||
|
||||
if( (index >= 0) && (GetCount() > 0) )
|
||||
{
|
||||
#ifndef __WXMAC__
|
||||
Select( index, State );
|
||||
#endif
|
||||
|
||||
EnsureVisible( index );
|
||||
|
||||
#ifdef __WXMAC__
|
||||
Refresh();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void FOOTPRINTS_LISTBOX::SetSelectedFootprint( const LIB_ID& aFPID )
|
||||
{
|
||||
wxString id = wxString::Format( "%s:%s",
|
||||
GetChars( aFPID.GetLibNickname() ),
|
||||
GetChars( aFPID.GetLibItemName() ) );
|
||||
|
||||
for( size_t i = 0; i < GetCount(); ++i )
|
||||
{
|
||||
wxString candidate = m_footprintList.Item( i ).substr( 4 );
|
||||
|
||||
if( candidate.CmpNoCase( id ) == 0 )
|
||||
{
|
||||
SetSelection( i, true );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -110,6 +110,7 @@ public:
|
|||
|
||||
int GetCount();
|
||||
void SetSelection( int index, bool State = true );
|
||||
void SetSelectedFootprint( const LIB_ID& aFPID );
|
||||
void SetString( unsigned linecount, const wxString& text );
|
||||
void AppendLine( const wxString& text );
|
||||
|
||||
|
|
Loading…
Reference in New Issue