Resore push/pop-less PickerTool.

(Functionality was accidentallly lost when we removed the opt command
strings.)
This commit is contained in:
Jeff Young 2022-11-07 19:10:24 +00:00
parent e8762da4f4
commit ae741b93e6
4 changed files with 18 additions and 10 deletions

View File

@ -580,6 +580,9 @@ TOOL_ACTION ACTIONS::pickerTool( "common.InteractivePicker.pickerTool",
"", "",
BITMAPS::INVALID_BITMAP, AF_ACTIVATE );
TOOL_ACTION ACTIONS::pickerSubTool( "common.InteractivePicker.pickerSubTool",
AS_GLOBAL );
TOOL_ACTION ACTIONS::show3DViewer( "common.Control.show3DViewer",
AS_GLOBAL,
MD_ALT + '3', LEGACY_HK_NAME( "3D Viewer" ),

View File

@ -156,6 +156,7 @@ public:
static TOOL_ACTION selectionTool;
static TOOL_ACTION measureTool;
static TOOL_ACTION pickerTool;
static TOOL_ACTION pickerSubTool;
// Misc
static TOOL_ACTION show3DViewer;

View File

@ -2141,8 +2141,7 @@ bool EDIT_TOOL::pickReferencePoint( const wxString& aTooltip, const wxString& aS
m_statusPopup->Popup();
canvas()->SetStatusPopup( m_statusPopup->GetPanel() );
std::string tool = "";
m_toolMgr->RunAction( ACTIONS::pickerTool, true, &tool );
m_toolMgr->RunAction( ACTIONS::pickerSubTool, true );
while( !done )
{

View File

@ -43,7 +43,8 @@ int PCB_PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
PCB_GRID_HELPER grid( m_toolMgr, frame->GetMagneticItemsSettings() );
int finalize_state = WAIT_CANCEL;
frame->PushTool( aEvent );
if( aEvent.IsAction( &ACTIONS::pickerTool ) )
frame->PushTool( aEvent );
Activate();
setControls();
@ -170,18 +171,13 @@ int PCB_PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
controls->ForceCursorPosition( false );
controls->ShowCursor( false );
frame->PopTool( aEvent );
if( aEvent.IsAction( &ACTIONS::pickerTool ) )
frame->PopTool( aEvent );
return 0;
}
void PCB_PICKER_TOOL::setTransitions()
{
Go( &PCB_PICKER_TOOL::Main, ACTIONS::pickerTool.MakeEvent() );
}
void PCB_PICKER_TOOL::reset()
{
m_layerMask = LSET::AllLayersMask();
@ -196,3 +192,12 @@ void PCB_PICKER_TOOL::setControls()
controls->CaptureCursor( false );
controls->SetAutoPan( false );
}
void PCB_PICKER_TOOL::setTransitions()
{
Go( &PCB_PICKER_TOOL::Main, ACTIONS::pickerTool.MakeEvent() );
Go( &PCB_PICKER_TOOL::Main, ACTIONS::pickerSubTool.MakeEvent() );
}