Browse Source

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
6.0.7
jean-pierre charras 4 years ago
parent
commit
6971e409bf
  1. 6
      common/eda_draw_frame.cpp
  2. 6
      pcbnew/edit_track_width.cpp

6
common/eda_draw_frame.cpp

@ -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();
}

6
pcbnew/edit_track_width.cpp

@ -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:

Loading…
Cancel
Save