Select model when loading library.

This commit is contained in:
Jeff Young
2024-09-01 22:14:15 +01:00
parent edbe6e997d
commit baf7c592b9
+8 -1
View File
@@ -852,6 +852,13 @@ bool DIALOG_SIM_MODEL<T>::loadLibrary( const wxString& aLibraryPath, REPORTER& a
m_pinCombobox->SetSelection( -1 );
}
m_modelListBox->SetStringSelection( modelName );
if( m_modelListBox->GetSelection() < 0 && m_modelListBox->GetCount() > 0 )
m_modelListBox->SetSelection( 0 );
m_curModelType = curModel().GetType();
m_prevLibrary = aLibraryPath;
return true;
}
@@ -1078,7 +1085,7 @@ SIM_MODEL& DIALOG_SIM_MODEL<T>::curModel() const
{
if( m_rbLibraryModel->GetValue() )
{
if( library() )
if( library() && m_modelListBox->GetSelection() >= 0 )
return *library()->FindModel( m_modelListBox->GetStringSelection().ToStdString() );
}
else