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.
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 3e4fa8143a
commit d27d2e0ad9
2 changed files with 12 additions and 0 deletions

View File

@ -440,6 +440,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();
}
@ -516,6 +519,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: