Add wxGrids to list of things that get arrow keys.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17144

(cherry picked from commit f754410c7e)
This commit is contained in:
Jeff Young 2024-02-27 18:10:55 +00:00
parent 1fc79b9a46
commit 60dbd0ce0d
1 changed files with 4 additions and 3 deletions

View File

@ -355,7 +355,8 @@ void PAGED_DIALOG::onCharHook( wxKeyEvent& aEvent )
{
if( dynamic_cast<wxTextEntry*>( aEvent.GetEventObject() )
|| dynamic_cast<wxStyledTextCtrl*>( aEvent.GetEventObject() )
|| dynamic_cast<wxListView*>( aEvent.GetEventObject() ) )
|| dynamic_cast<wxListView*>( aEvent.GetEventObject() )
|| dynamic_cast<wxGrid*>( FindFocus() ) )
{
aEvent.Skip();
return;
@ -373,7 +374,7 @@ void PAGED_DIALOG::onCharHook( wxKeyEvent& aEvent )
m_treebook->SetSelection( page - 1 );
}
m_treebook->GetTreeCtrl()->SetFocus(); // Don't allow preview canvas to steal focus
m_treebook->GetTreeCtrl()->SetFocus(); // Don't allow preview canvas to steal gridFocus
}
else if( aEvent.GetKeyCode() == WXK_DOWN )
{
@ -381,7 +382,7 @@ void PAGED_DIALOG::onCharHook( wxKeyEvent& aEvent )
m_treebook->SetSelection( std::min<int>( page + 1, m_treebook->GetPageCount() - 1 ) );
m_treebook->GetTreeCtrl()->SetFocus(); // Don't allow preview canvas to steal focus
m_treebook->GetTreeCtrl()->SetFocus(); // Don't allow preview canvas to steal gridFocus
}
else
{