Loading pcbnew/tools/common_actions.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,9 @@ TOOL_ACTION COMMON_ACTIONS::selectionClear( "pcbnew.InteractiveSelection.Clear", AS_GLOBAL, 0, "", "" ); // No description, it is not supposed to be shown anywhere TOOL_ACTION COMMON_ACTIONS::findMove( "pcbnew.InteractiveSelection.FindMove", AS_GLOBAL, 'T'); // Edit tool actions TOOL_ACTION COMMON_ACTIONS::editActivate( "pcbnew.InteractiveEdit", Loading Loading @@ -486,6 +489,9 @@ boost::optional<TOOL_EVENT> COMMON_ACTIONS::TranslateLegacyId( int aId ) case ID_TB_OPTIONS_SELECT_CURSOR: return COMMON_ACTIONS::switchCursor.MakeEvent(); case ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST: return COMMON_ACTIONS::findMove.MakeEvent(); case ID_NO_TOOL_SELECTED: return COMMON_ACTIONS::selectionTool.MakeEvent(); Loading pcbnew/tools/common_actions.h +3 −0 Original line number Diff line number Diff line Loading @@ -217,6 +217,9 @@ public: static TOOL_ACTION showHelp; static TOOL_ACTION toBeDone; /// Find an item and start moving static TOOL_ACTION findMove; /** * Function TranslateLegacyId() * Translates legacy tool ids to the corresponding TOOL_ACTION name. Loading pcbnew/tools/selection_tool.cpp +23 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,11 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent ) selectSingle( getView()->ToWorld( getViewControls()->GetMousePosition() ) ); } else if( evt->IsAction( &COMMON_ACTIONS::findMove ) ) { findMove( *evt ); } else if( evt->IsCancel() || evt->Action() == TA_UNDO_REDO || evt->IsAction( &COMMON_ACTIONS::selectionClear ) ) { Loading Loading @@ -386,6 +391,7 @@ void SELECTION_TOOL::setTransitions() Go( &SELECTION_TOOL::Main, COMMON_ACTIONS::selectionActivate.MakeEvent() ); Go( &SELECTION_TOOL::SingleSelection, COMMON_ACTIONS::selectionSingle.MakeEvent() ); Go( &SELECTION_TOOL::ClearSelection, COMMON_ACTIONS::selectionClear.MakeEvent() ); Go( &SELECTION_TOOL::findMove, COMMON_ACTIONS::findMove.MakeEvent() ); } Loading Loading @@ -449,6 +455,23 @@ int SELECTION_TOOL::ClearSelection( TOOL_EVENT& aEvent ) } int SELECTION_TOOL::findMove( TOOL_EVENT& aEvent ) { MODULE* module = m_frame->GetModuleByName(); if( module ) { clearSelection(); toggleSelection( module ); m_toolMgr->InvokeTool( "pcbnew.InteractiveEdit" ); } setTransitions(); return 0; } void SELECTION_TOOL::clearSelection() { if( m_selection.Empty() ) Loading pcbnew/tools/selection_tool.h +3 −0 Original line number Diff line number Diff line Loading @@ -187,6 +187,9 @@ private: */ bool selectMultiple(); ///> Find an item and start moving. int findMove( TOOL_EVENT& aEvent ); ///> Sets up handlers for various events. void setTransitions(); Loading Loading
pcbnew/tools/common_actions.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,9 @@ TOOL_ACTION COMMON_ACTIONS::selectionClear( "pcbnew.InteractiveSelection.Clear", AS_GLOBAL, 0, "", "" ); // No description, it is not supposed to be shown anywhere TOOL_ACTION COMMON_ACTIONS::findMove( "pcbnew.InteractiveSelection.FindMove", AS_GLOBAL, 'T'); // Edit tool actions TOOL_ACTION COMMON_ACTIONS::editActivate( "pcbnew.InteractiveEdit", Loading Loading @@ -486,6 +489,9 @@ boost::optional<TOOL_EVENT> COMMON_ACTIONS::TranslateLegacyId( int aId ) case ID_TB_OPTIONS_SELECT_CURSOR: return COMMON_ACTIONS::switchCursor.MakeEvent(); case ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST: return COMMON_ACTIONS::findMove.MakeEvent(); case ID_NO_TOOL_SELECTED: return COMMON_ACTIONS::selectionTool.MakeEvent(); Loading
pcbnew/tools/common_actions.h +3 −0 Original line number Diff line number Diff line Loading @@ -217,6 +217,9 @@ public: static TOOL_ACTION showHelp; static TOOL_ACTION toBeDone; /// Find an item and start moving static TOOL_ACTION findMove; /** * Function TranslateLegacyId() * Translates legacy tool ids to the corresponding TOOL_ACTION name. Loading
pcbnew/tools/selection_tool.cpp +23 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,11 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent ) selectSingle( getView()->ToWorld( getViewControls()->GetMousePosition() ) ); } else if( evt->IsAction( &COMMON_ACTIONS::findMove ) ) { findMove( *evt ); } else if( evt->IsCancel() || evt->Action() == TA_UNDO_REDO || evt->IsAction( &COMMON_ACTIONS::selectionClear ) ) { Loading Loading @@ -386,6 +391,7 @@ void SELECTION_TOOL::setTransitions() Go( &SELECTION_TOOL::Main, COMMON_ACTIONS::selectionActivate.MakeEvent() ); Go( &SELECTION_TOOL::SingleSelection, COMMON_ACTIONS::selectionSingle.MakeEvent() ); Go( &SELECTION_TOOL::ClearSelection, COMMON_ACTIONS::selectionClear.MakeEvent() ); Go( &SELECTION_TOOL::findMove, COMMON_ACTIONS::findMove.MakeEvent() ); } Loading Loading @@ -449,6 +455,23 @@ int SELECTION_TOOL::ClearSelection( TOOL_EVENT& aEvent ) } int SELECTION_TOOL::findMove( TOOL_EVENT& aEvent ) { MODULE* module = m_frame->GetModuleByName(); if( module ) { clearSelection(); toggleSelection( module ); m_toolMgr->InvokeTool( "pcbnew.InteractiveEdit" ); } setTransitions(); return 0; } void SELECTION_TOOL::clearSelection() { if( m_selection.Empty() ) Loading
pcbnew/tools/selection_tool.h +3 −0 Original line number Diff line number Diff line Loading @@ -187,6 +187,9 @@ private: */ bool selectMultiple(); ///> Find an item and start moving. int findMove( TOOL_EVENT& aEvent ); ///> Sets up handlers for various events. void setTransitions(); Loading