mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Hide dialog before running picker tool.
(If the user were to close the dialog in between, we'd be in a world of hurt.)
This commit is contained in:
parent
0128fb2eaf
commit
606a5c7d21
@ -253,28 +253,27 @@ void DIALOG_CREATE_ARRAY::OnSelectCenterButton( wxCommandEvent& event )
|
||||
{
|
||||
event.Skip();
|
||||
|
||||
PCB_PICKER_TOOL* pickerTool = m_frame->GetToolManager()->GetTool<PCB_PICKER_TOOL>();
|
||||
TOOL_MANAGER* toolMgr = m_frame->GetToolManager();
|
||||
PCB_PICKER_TOOL* pickerTool = toolMgr->GetTool<PCB_PICKER_TOOL>();
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
|
@ -231,10 +231,11 @@ void DIALOG_POSITION_RELATIVE::OnSelectPointClick( wxCommandEvent& event )
|
||||
PCB_PICKER_TOOL* pickerTool = m_toolMgr->GetTool<PCB_PICKER_TOOL>();
|
||||
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..." ) } );
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user