Cancel interactive editing when switching sheets.

Fixes: lp:1819278
* https://bugs.launchpad.net/kicad/+bug/1819278
This commit is contained in:
Jeff Young 2019-06-13 22:04:31 +01:00
parent 21ac28a1ec
commit 83ee51370c
3 changed files with 17 additions and 2 deletions

View File

@ -49,7 +49,8 @@
#include <lib_pin.h>
#include <sch_component.h>
#include <connection_graph.h>
#include <tools/ee_actions.h>
#include <tool/tool_manager.h>
#include <dialog_erc.h>
#include <erc.h>
#include <id.h>
@ -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() );

View File

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

View File

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