library viewers: fix a focus issue that prevent using arrow keys in lib or fp lists.

Once the gal canvas hsad the focus, it was not possible to use arrow keys in library
or symbols or fp lists even after clicking on an item.

This focus issue is now fixed.

From the fix in Master
This commit is contained in:
jean-pierre charras 2020-05-03 20:23:41 +02:00
parent a152aa125b
commit d871a92d1c
2 changed files with 24 additions and 0 deletions

View File

@ -621,6 +621,12 @@ void LIB_VIEW_FRAME::ClickOnLibList( wxCommandEvent& event )
m_selection_changed = true;
SetSelectedLibrary( m_libList->GetString( ii ) );
// The m_libList has now the focus, in order to be able to use arrow keys
// to navigate inside the list.
// the gal canvas must not steal the focus to allow navigation
GetGalCanvas()->SetStealsFocus( false );
m_libList->SetFocus();
}
@ -651,6 +657,12 @@ void LIB_VIEW_FRAME::ClickOnCmpList( wxCommandEvent& event )
m_selection_changed = true;
SetSelectedComponent( m_cmpList->GetString( ii ) );
// The m_cmpList has now the focus, in order to be able to use arrow keys
// to navigate inside the list.
// the gal canvas must not steal the focus to allow navigation
GetGalCanvas()->SetStealsFocus( false );
m_cmpList->SetFocus();
}

View File

@ -403,6 +403,12 @@ void FOOTPRINT_VIEWER_FRAME::ClickOnLibList( wxCommandEvent& event )
ReCreateFootprintList();
UpdateTitle();
// The m_libList has now the focus, in order to be able to use arrow keys
// to navigate inside the list.
// the gal canvas must not steal the focus to allow navigation
GetGalCanvas()->SetStealsFocus( false );
m_libList->SetFocus();
}
@ -453,6 +459,12 @@ void FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList( wxCommandEvent& event )
m_canvas->Refresh();
Update3D_Frame();
}
// The m_footprintList has now the focus, in order to be able to use arrow keys
// to navigate inside the list.
// the gal canvas must not steal the focus to allow navigation
GetGalCanvas()->SetStealsFocus( false );
m_footprintList->SetFocus();
}