From f40408187e39381d90faff6dea283004b42e55d4 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 7 May 2019 11:30:30 +0100 Subject: [PATCH] A couple of temp hacks for LibEdit processing while in transition. Fixes: lp:1828004 * https://bugs.launchpad.net/kicad/+bug/1828004 --- eeschema/sch_draw_panel.cpp | 9 ++++++++- eeschema/tools/sch_selection_tool.cpp | 11 +++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/eeschema/sch_draw_panel.cpp b/eeschema/sch_draw_panel.cpp index 7f0e713322..5e676a953a 100644 --- a/eeschema/sch_draw_panel.cpp +++ b/eeschema/sch_draw_panel.cpp @@ -38,6 +38,8 @@ #include #include #include +#include // JEY TODO: temp LibEdit requirement +#include // JEY TODO: temp LibEdit requirement using namespace std::placeholders; @@ -614,7 +616,12 @@ void SCH_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event ) if( IsMouseCaptured() ) EndMouseCapture(); else - GetParent()->GetToolManager()->RunAction( ACTIONS::cancelInteractive, true ); + { + if( SCH_CONDITIONS::Idle( GetParent()->GetToolManager()->GetTool()->GetSelection() ) ) + GetParent()->GetToolManager()->RunAction( SCH_ACTIONS::selectionActivate, true ); + else + GetParent()->GetToolManager()->RunAction( ACTIONS::cancelInteractive, true ); + } keyWasHandled = true; // The key is captured: the key event will be not skipped break; diff --git a/eeschema/tools/sch_selection_tool.cpp b/eeschema/tools/sch_selection_tool.cpp index 685af1879d..9ea4574062 100644 --- a/eeschema/tools/sch_selection_tool.cpp +++ b/eeschema/tools/sch_selection_tool.cpp @@ -264,6 +264,17 @@ void SCH_SELECTION_TOOL::Reset( RESET_REASON aReason ) int SCH_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) { + // JEY TODO: temp hack for LibEdit legacy selection tool + if( m_isLibEdit ) + { + LIB_EDIT_FRAME* libEditFrame = (LIB_EDIT_FRAME*) m_frame; + wxCommandEvent selectArrow; + selectArrow.SetId( ID_NO_TOOL_SELECTED ); + libEditFrame->OnSelectTool( selectArrow ); + + return 0; + } + // Main loop: keep receiving events while( OPT_TOOL_EVENT evt = Wait() ) {