diff --git a/eeschema/dialogs/dialog_erc.cpp b/eeschema/dialogs/dialog_erc.cpp index a769a0ab28..1033c1d188 100644 --- a/eeschema/dialogs/dialog_erc.cpp +++ b/eeschema/dialogs/dialog_erc.cpp @@ -49,7 +49,8 @@ #include #include #include - +#include +#include #include #include #include @@ -283,6 +284,9 @@ void DIALOG_ERC::OnLeftClickMarkersList( wxHtmlLinkEvent& event ) if( sheetList[i] != m_parent->GetCurrentSheet() ) { + m_parent->GetToolManager()->RunAction( ACTIONS::cancelInteractive, true ); + m_parent->GetToolManager()->RunAction( EE_ACTIONS::clearSelection, true ); + m_parent->SetCurrentSheet( sheetList[i] ); m_parent->DisplayCurrentSheet(); sheetList[i].LastScreen()->SetZoom( m_parent->GetScreen()->GetZoom() ); diff --git a/eeschema/hierarch.cpp b/eeschema/hierarch.cpp index 09800b0adf..f3d25a8252 100644 --- a/eeschema/hierarch.cpp +++ b/eeschema/hierarch.cpp @@ -248,6 +248,9 @@ void HIERARCHY_NAVIG_DLG::buildHierarchyTree( SCH_SHEET_PATH* aList, wxTreeItemI void HIERARCHY_NAVIG_DLG::onSelectSheetPath( wxTreeEvent& event ) { + m_SchFrameEditor->GetToolManager()->RunAction( ACTIONS::cancelInteractive, true ); + m_SchFrameEditor->GetToolManager()->RunAction( EE_ACTIONS::clearSelection, true ); + wxTreeItemId ItemSel = m_Tree->GetSelection(); m_SchFrameEditor->SetCurrentSheet(( (TreeItemData*) m_Tree->GetItemData( ItemSel ) )->m_SheetPath ); m_SchFrameEditor->DisplayCurrentSheet(); diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index fbeae20cff..b254e80d35 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -1141,7 +1141,12 @@ int SCH_EDITOR_CONTROL::EnterSheet( const TOOL_EVENT& aEvent ) if( selection.GetSize() == 1 ) { - g_CurrentSheet->push_back( (SCH_SHEET*) selection.Front() ); + SCH_SHEET* sheet = (SCH_SHEET*) selection.Front(); + + m_toolMgr->RunAction( ACTIONS::cancelInteractive, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + + g_CurrentSheet->push_back( sheet ); m_frame->DisplayCurrentSheet(); } @@ -1153,6 +1158,9 @@ int SCH_EDITOR_CONTROL::LeaveSheet( const TOOL_EVENT& aEvent ) { if( g_CurrentSheet->Last() != g_RootSheet ) { + m_toolMgr->RunAction( ACTIONS::cancelInteractive, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + g_CurrentSheet->pop_back(); m_frame->DisplayCurrentSheet(); }