Pcbnew: fix lost of focus after clicking on a wxChoice in toolbar.

After changing track width, via size, grid or zoom from the toolbar, the
canvas has no longer the focus on Windows. So we force the focus after clicking
on these widgets.
From Master branch
Fixes #11103
https://gitlab.com/kicad/code/kicad/issues/11103
This commit is contained in:
jean-pierre charras 2022-03-21 18:10:07 +01:00
parent ea1a1a43c0
commit 6971e409bf
2 changed files with 12 additions and 0 deletions

View File

@ -387,6 +387,9 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
UpdateStatusBar();
m_canvas->Refresh();
// Needed on Windows because clicking on m_gridSelectBox remove the focus from m_canvas
// (Windows specific
m_canvas->SetFocus();
}
@ -463,6 +466,9 @@ void EDA_DRAW_FRAME::OnSelectZoom( wxCommandEvent& event )
m_toolManager->RunAction( ACTIONS::zoomPreset, true, static_cast<intptr_t>( id ) );
UpdateStatusBar();
m_canvas->Refresh();
// Needed on Windows because clicking on m_zoomSelectBox remove the focus from m_canvas
// (Windows specific
m_canvas->SetFocus();
}

View File

@ -192,6 +192,9 @@ void PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event( wxCommandEvent& event )
GetDesignSettings().m_TempOverrideTrackWidth = true;
}
// Needed on Windows because the canvas loses focus after clicking on m_SelTrackWidthBox:
GetCanvas()->SetFocus();
break;
case ID_AUX_TOOLBAR_PCB_VIA_SIZE:
@ -212,6 +215,9 @@ void PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event( wxCommandEvent& event )
GetDesignSettings().SetViaSizeIndex( ii );
}
// Needed on Windows because the canvas loses focus after clicking on m_SelViaSizeBox:
GetCanvas()->SetFocus();
break;
default: