Cancel interactive editing when switching sheets.
Fixes: lp:1819278 * https://bugs.launchpad.net/kicad/+bug/1819278
This commit is contained in:
parent
21ac28a1ec
commit
83ee51370c
|
@ -49,7 +49,8 @@
|
||||||
#include <lib_pin.h>
|
#include <lib_pin.h>
|
||||||
#include <sch_component.h>
|
#include <sch_component.h>
|
||||||
#include <connection_graph.h>
|
#include <connection_graph.h>
|
||||||
|
#include <tools/ee_actions.h>
|
||||||
|
#include <tool/tool_manager.h>
|
||||||
#include <dialog_erc.h>
|
#include <dialog_erc.h>
|
||||||
#include <erc.h>
|
#include <erc.h>
|
||||||
#include <id.h>
|
#include <id.h>
|
||||||
|
@ -283,6 +284,9 @@ void DIALOG_ERC::OnLeftClickMarkersList( wxHtmlLinkEvent& event )
|
||||||
|
|
||||||
if( sheetList[i] != m_parent->GetCurrentSheet() )
|
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->SetCurrentSheet( sheetList[i] );
|
||||||
m_parent->DisplayCurrentSheet();
|
m_parent->DisplayCurrentSheet();
|
||||||
sheetList[i].LastScreen()->SetZoom( m_parent->GetScreen()->GetZoom() );
|
sheetList[i].LastScreen()->SetZoom( m_parent->GetScreen()->GetZoom() );
|
||||||
|
|
|
@ -248,6 +248,9 @@ void HIERARCHY_NAVIG_DLG::buildHierarchyTree( SCH_SHEET_PATH* aList, wxTreeItemI
|
||||||
|
|
||||||
void HIERARCHY_NAVIG_DLG::onSelectSheetPath( wxTreeEvent& event )
|
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();
|
wxTreeItemId ItemSel = m_Tree->GetSelection();
|
||||||
m_SchFrameEditor->SetCurrentSheet(( (TreeItemData*) m_Tree->GetItemData( ItemSel ) )->m_SheetPath );
|
m_SchFrameEditor->SetCurrentSheet(( (TreeItemData*) m_Tree->GetItemData( ItemSel ) )->m_SheetPath );
|
||||||
m_SchFrameEditor->DisplayCurrentSheet();
|
m_SchFrameEditor->DisplayCurrentSheet();
|
||||||
|
|
|
@ -1141,7 +1141,12 @@ int SCH_EDITOR_CONTROL::EnterSheet( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
if( selection.GetSize() == 1 )
|
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();
|
m_frame->DisplayCurrentSheet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1153,6 +1158,9 @@ int SCH_EDITOR_CONTROL::LeaveSheet( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
if( g_CurrentSheet->Last() != g_RootSheet )
|
if( g_CurrentSheet->Last() != g_RootSheet )
|
||||||
{
|
{
|
||||||
|
m_toolMgr->RunAction( ACTIONS::cancelInteractive, true );
|
||||||
|
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
|
||||||
|
|
||||||
g_CurrentSheet->pop_back();
|
g_CurrentSheet->pop_back();
|
||||||
m_frame->DisplayCurrentSheet();
|
m_frame->DisplayCurrentSheet();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue