From 2a419156e0c7a6ef8823d2f8b4aa629d54548d7b Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 13 Apr 2018 21:41:36 +0100 Subject: [PATCH] Don't try to check uncheckable menu items. When updating toolbars make sure the events are coming from the toolbar in question (and not the menus which share the same ID). Fixes: lp:1763563 * https://bugs.launchpad.net/kicad/+bug/1763563 --- eeschema/lib_edit_frame.cpp | 3 ++- eeschema/schedit.cpp | 3 ++- gerbview/events_called_functions.cpp | 3 ++- pagelayout_editor/events_functions.cpp | 3 ++- pcbnew/footprint_edit_frame.cpp | 3 ++- pcbnew/toolbars_update_user_interface.cpp | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/eeschema/lib_edit_frame.cpp b/eeschema/lib_edit_frame.cpp index fe49764fb6..e87e1a1845 100644 --- a/eeschema/lib_edit_frame.cpp +++ b/eeschema/lib_edit_frame.cpp @@ -472,7 +472,8 @@ void LIB_EDIT_FRAME::ClearSearchTreeSelection() void LIB_EDIT_FRAME::OnUpdateSelectTool( wxUpdateUIEvent& aEvent ) { - aEvent.Check( GetToolId() == aEvent.GetId() ); + if( aEvent.GetEventObject() == m_drawToolBar ) + aEvent.Check( GetToolId() == aEvent.GetId() ); } diff --git a/eeschema/schedit.cpp b/eeschema/schedit.cpp index 10627498db..2d44c62476 100644 --- a/eeschema/schedit.cpp +++ b/eeschema/schedit.cpp @@ -640,7 +640,8 @@ void SCH_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent ) void SCH_EDIT_FRAME::OnUpdateSelectTool( wxUpdateUIEvent& aEvent ) { - aEvent.Check( GetToolId() == aEvent.GetId() ); + if( aEvent.GetEventObject() == m_drawToolBar ) + aEvent.Check( GetToolId() == aEvent.GetId() ); } diff --git a/gerbview/events_called_functions.cpp b/gerbview/events_called_functions.cpp index 668c5c3d24..b48f93f58a 100644 --- a/gerbview/events_called_functions.cpp +++ b/gerbview/events_called_functions.cpp @@ -532,7 +532,8 @@ void GERBVIEW_FRAME::OnToggleFlashItemDrawMode( wxCommandEvent& aEvent ) void GERBVIEW_FRAME::OnUpdateSelectTool( wxUpdateUIEvent& aEvent ) { - aEvent.Check( GetToolId() == aEvent.GetId() ); + if( aEvent.GetEventObject() == m_drawToolBar ) + aEvent.Check( GetToolId() == aEvent.GetId() ); } diff --git a/pagelayout_editor/events_functions.cpp b/pagelayout_editor/events_functions.cpp index 61237977c8..85ec0a0771 100644 --- a/pagelayout_editor/events_functions.cpp +++ b/pagelayout_editor/events_functions.cpp @@ -619,5 +619,6 @@ void PL_EDITOR_FRAME::OnUpdateTitleBlockDisplaySpecialMode( wxUpdateUIEvent& eve void PL_EDITOR_FRAME::OnUpdateSelectTool( wxUpdateUIEvent& aEvent ) { - aEvent.Check( GetToolId() == aEvent.GetId() ); + if( aEvent.GetEventObject() == m_drawToolBar ) + aEvent.Check( GetToolId() == aEvent.GetId() ); } diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 031d230bb2..cfd0f9df6f 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -572,7 +572,8 @@ void FOOTPRINT_EDIT_FRAME::CloseModuleEditor( wxCommandEvent& Event ) void FOOTPRINT_EDIT_FRAME::OnUpdateSelectTool( wxUpdateUIEvent& aEvent ) { - aEvent.Check( GetToolId() == aEvent.GetId() ); + if( aEvent.GetEventObject() == m_drawToolBar ) + aEvent.Check( GetToolId() == aEvent.GetId() ); } diff --git a/pcbnew/toolbars_update_user_interface.cpp b/pcbnew/toolbars_update_user_interface.cpp index e5447b4a66..c765dbe4b4 100644 --- a/pcbnew/toolbars_update_user_interface.cpp +++ b/pcbnew/toolbars_update_user_interface.cpp @@ -195,7 +195,8 @@ void PCB_EDIT_FRAME::OnUpdateSave( wxUpdateUIEvent& aEvent ) void PCB_EDIT_FRAME::OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent ) { - aEvent.Check( GetToolId() == aEvent.GetId() ); + if( aEvent.GetEventObject() == m_drawToolBar ) + aEvent.Check( GetToolId() == aEvent.GetId() ); } void PCB_EDIT_FRAME::OnUpdateMuWaveToolbar( wxUpdateUIEvent& aEvent )