diff --git a/pcbnew/dialogs/dialog_create_array.cpp b/pcbnew/dialogs/dialog_create_array.cpp index 31e0f2d09d..1410b9c449 100644 --- a/pcbnew/dialogs/dialog_create_array.cpp +++ b/pcbnew/dialogs/dialog_create_array.cpp @@ -253,28 +253,27 @@ void DIALOG_CREATE_ARRAY::OnSelectCenterButton( wxCommandEvent& event ) { event.Skip(); - PCB_PICKER_TOOL* pickerTool = m_frame->GetToolManager()->GetTool(); + TOOL_MANAGER* toolMgr = m_frame->GetToolManager(); + PCB_PICKER_TOOL* pickerTool = toolMgr->GetTool(); wxCHECK( pickerTool, /* void */ ); + // Hide, but do not close, the dialog + Hide(); + if( event.GetEventObject() == m_btnSelectCenterItem ) { - m_frame->GetToolManager()->RunAction( - PCB_ACTIONS::selectItemInteractively, - PCB_PICKER_TOOL::INTERACTIVE_PARAMS{ this, _( "Select center item..." ) } ); + toolMgr->RunAction( PCB_ACTIONS::selectItemInteractively, + PCB_PICKER_TOOL::INTERACTIVE_PARAMS { this, _( "Select center item..." ) } ); } else if( event.GetEventObject() == m_btnSelectCenterPoint ) { - m_frame->GetToolManager()->RunAction( - PCB_ACTIONS::selectPointInteractively, - PCB_PICKER_TOOL::INTERACTIVE_PARAMS{ this, _( "Select center point..." ) } ); + toolMgr->RunAction( PCB_ACTIONS::selectPointInteractively, + PCB_PICKER_TOOL::INTERACTIVE_PARAMS { this, _( "Select center point..." ) } ); } else { wxFAIL_MSG( "Unknown event source" ); } - - // Hide, but do not close, the dialog - Hide(); } diff --git a/pcbnew/dialogs/dialog_position_relative.cpp b/pcbnew/dialogs/dialog_position_relative.cpp index 95cd9d6208..dab2022472 100644 --- a/pcbnew/dialogs/dialog_position_relative.cpp +++ b/pcbnew/dialogs/dialog_position_relative.cpp @@ -231,10 +231,11 @@ void DIALOG_POSITION_RELATIVE::OnSelectPointClick( wxCommandEvent& event ) PCB_PICKER_TOOL* pickerTool = m_toolMgr->GetTool(); wxCHECK( pickerTool, /* void */ ); - m_toolMgr->RunAction( PCB_ACTIONS::selectPointInteractively, - PCB_PICKER_TOOL::INTERACTIVE_PARAMS{ this, _( "Select reference point..." ) } ); - + // Hide, but do not close, the dialog Hide(); + + m_toolMgr->RunAction( PCB_ACTIONS::selectPointInteractively, + PCB_PICKER_TOOL::INTERACTIVE_PARAMS { this, _( "Select reference point..." ) } ); }