From 19e4cb409b2a1a236d576deb09f31e5610d1fbf5 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 24 Feb 2014 20:07:24 +0100 Subject: [PATCH] Viewlib: ensure in wxListBoxes the lib and the component are always shown as selected when a lib and component are specified (when called by the get component dialog for instance) --- eeschema/operations_on_items_lists.cpp | 5 ----- eeschema/viewlib_frame.cpp | 8 ++++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/eeschema/operations_on_items_lists.cpp b/eeschema/operations_on_items_lists.cpp index 2b417e0020..e897d8d735 100644 --- a/eeschema/operations_on_items_lists.cpp +++ b/eeschema/operations_on_items_lists.cpp @@ -59,11 +59,6 @@ void RotateListOfItems( PICKED_ITEMS_LIST& aItemsList, wxPoint& rotationPoint ) } -void DeleteItemsInList( EDA_DRAW_PANEL* panel, PICKED_ITEMS_LIST& aItemsList ); -void DuplicateItemsInList( SCH_SCREEN* screen, PICKED_ITEMS_LIST& aItemsList, - const wxPoint aMoveVector ); - - void MirrorY( PICKED_ITEMS_LIST& aItemsList, wxPoint& aMirrorPoint ) { for( unsigned ii = 0; ii < aItemsList.GetCount(); ii++ ) diff --git a/eeschema/viewlib_frame.cpp b/eeschema/viewlib_frame.cpp index 39e55ac1ff..b6a3b296a6 100644 --- a/eeschema/viewlib_frame.cpp +++ b/eeschema/viewlib_frame.cpp @@ -416,6 +416,10 @@ void LIB_VIEW_FRAME::SetSelectedLibrary( const wxString& aLibraryName ) m_canvas->Refresh(); DisplayLibInfos(); ReCreateHToolbar(); + // Ensure the corresponding line in m_libList is selected + // (which is not necessary the case if SetSelectedLibrary is called + // by an other caller than ClickOnLibList. + m_libList->SetStringSelection( m_libraryName, true ); } @@ -435,6 +439,10 @@ void LIB_VIEW_FRAME::SetSelectedComponent( const wxString& aComponentName ) if( m_entryName.CmpNoCase( aComponentName ) != 0 ) { m_entryName = aComponentName; + // Ensure the corresponding line in m_cmpList is selected + // (which is not necessary the case if SetSelectedComponent is called + // by an other caller than ClickOnCmpList. + m_cmpList->SetStringSelection( aComponentName, true ); DisplayLibInfos(); m_unit = 1; m_convert = 1;