mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-20 18:31:43 +00:00
A more robust fix for 36f1d023f0
.
This one also handles when the events get out-of-order due to them starting out in the Simulation window and not getting dispatched until the mouse goes over the Schematic window. Fixes: lp:1835907 * https://bugs.launchpad.net/kicad/+bug/1835907 Fixes: lp:1836544 * https://bugs.launchpad.net/kicad/+bug/1836544
This commit is contained in:
parent
dad8c9821b
commit
58ca5b71a9
common
cvpcb/tools
eeschema/tools
ee_picker_tool.cpplib_drawing_tools.cpplib_edit_tool.cpplib_move_tool.cppsch_drawing_tools.cppsch_edit_tool.cppsch_editor_control.cppsch_line_wire_bus_tool.cppsch_line_wire_bus_tool.hsch_move_tool.cpp
gerbview/tools
include
pagelayout_editor/tools
pcbnew
@ -430,7 +430,7 @@ void EDA_DRAW_FRAME::PushTool( const std::string& actionName )
|
||||
|
||||
// Human cognitive stacking is very shallow; deeper tool stacks just get annoying
|
||||
if( m_toolStack.size() > 3 )
|
||||
m_toolStack.pop_front();
|
||||
m_toolStack.erase( m_toolStack.begin() );
|
||||
|
||||
TOOL_ACTION* action = m_toolManager->GetActionManager()->FindAction( actionName );
|
||||
|
||||
@ -441,27 +441,41 @@ void EDA_DRAW_FRAME::PushTool( const std::string& actionName )
|
||||
}
|
||||
|
||||
|
||||
void EDA_DRAW_FRAME::PopTool()
|
||||
void EDA_DRAW_FRAME::PopTool( const std::string& actionName )
|
||||
{
|
||||
if( m_toolStack.size() > 0 )
|
||||
m_toolStack.pop_back();
|
||||
// Push/pop events can get out of order (such as when they're generated by the Simulator
|
||||
// frame but not processed until the mouse is back in the Schematic frame), so make sure
|
||||
// we're popping the right stack frame.
|
||||
|
||||
if( m_toolStack.size() > 0 )
|
||||
for( size_t i = m_toolStack.size() - 1; i >= 0; --i )
|
||||
{
|
||||
TOOL_ACTION* action = m_toolManager->GetActionManager()->FindAction( m_toolStack.back() );
|
||||
|
||||
if( action )
|
||||
if( m_toolStack[ i ] == actionName )
|
||||
{
|
||||
// Pop the action as running it will push it back onto the stack
|
||||
m_toolStack.pop_back();
|
||||
m_toolStack.erase( m_toolStack.begin() + i );
|
||||
|
||||
TOOL_EVENT evt = action->MakeEvent();
|
||||
evt.SetHasPosition( false );
|
||||
GetToolManager()->PostEvent( evt );
|
||||
// If there's something underneath us, and it's now the top of the stack, then
|
||||
// re-activate it
|
||||
if( ( --i ) >= 0 && i == m_toolStack.size() - 1 )
|
||||
{
|
||||
std::string back = m_toolStack[ i ];
|
||||
TOOL_ACTION* action = m_toolManager->GetActionManager()->FindAction( back );
|
||||
|
||||
if( action )
|
||||
{
|
||||
// Pop the action as running it will push it back onto the stack
|
||||
m_toolStack.pop_back();
|
||||
|
||||
TOOL_EVENT evt = action->MakeEvent();
|
||||
evt.SetHasPosition( false );
|
||||
GetToolManager()->PostEvent( evt );
|
||||
}
|
||||
}
|
||||
else
|
||||
DisplayToolMsg( ACTIONS::selectionTool.GetLabel() );
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
DisplayToolMsg( ACTIONS::selectionTool.GetLabel() );
|
||||
}
|
||||
|
||||
|
||||
|
@ -49,11 +49,6 @@ int COMMON_TOOLS::SelectionTool( const TOOL_EVENT& aEvent )
|
||||
// just a cancel of whatever other tools might be running.
|
||||
|
||||
m_toolMgr->ProcessEvent( TOOL_EVENT( TC_COMMAND, TA_CANCEL_TOOL ) );
|
||||
|
||||
// Shouldn't be necessary, but as the Irish would say: "just to be sure to be sure"
|
||||
while( !m_frame->ToolStackIsEmpty() )
|
||||
m_frame->PopTool();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,8 @@ void ZOOM_TOOL::Reset( RESET_REASON aReason )
|
||||
|
||||
int ZOOM_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
|
||||
while( TOOL_EVENT* evt = Wait() )
|
||||
{
|
||||
@ -66,7 +67,7 @@ int ZOOM_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
|
||||
// Exit zoom tool
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,8 @@ int CVPCB_SELECTION_TOOL::MeasureTool( const TOOL_EVENT& aEvent )
|
||||
auto& controls = *getViewControls();
|
||||
auto previous_settings = controls.GetSettings();
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER twoPtMgr;
|
||||
@ -141,7 +142,7 @@ int CVPCB_SELECTION_TOOL::MeasureTool( const TOOL_EVENT& aEvent )
|
||||
clearRuler();
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -158,7 +159,7 @@ int CVPCB_SELECTION_TOOL::MeasureTool( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -135,7 +135,6 @@ int EE_PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
|
||||
resetPicker();
|
||||
controls->ForceCursorPosition( false );
|
||||
m_frame->PopTool();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,8 @@ int LIB_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
|
||||
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
|
||||
getViewControls()->ShowCursor( true );
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
// Prime the pump
|
||||
@ -102,7 +103,7 @@ int LIB_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
|
||||
cleanup();
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -118,7 +119,7 @@ int LIB_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -239,7 +240,8 @@ int LIB_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
|
||||
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
|
||||
getViewControls()->ShowCursor( true );
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
LIB_PART* part = m_frame->GetCurPart();
|
||||
@ -270,7 +272,7 @@ int LIB_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
|
||||
cleanup();
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -291,7 +293,7 @@ int LIB_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -383,7 +385,8 @@ int LIB_DRAWING_TOOLS::PlaceAnchor( const TOOL_EVENT& aEvent )
|
||||
getViewControls()->ShowCursor( true );
|
||||
getViewControls()->SetSnapping( true );
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
// Main loop: keep receiving events
|
||||
@ -393,12 +396,12 @@ int LIB_DRAWING_TOOLS::PlaceAnchor( const TOOL_EVENT& aEvent )
|
||||
|
||||
if( evt->IsCancelInteractive() )
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
else if( evt->IsActivate() )
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
else if( evt->IsClick( BUT_LEFT ) )
|
||||
|
@ -282,7 +282,8 @@ int LIB_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
|
||||
@ -333,7 +334,8 @@ int LIB_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent )
|
||||
|
||||
picker->Activate();
|
||||
Wait();
|
||||
// Picker calls PopTool() so that it gets done before activating tool's PushTool()
|
||||
|
||||
m_frame->PopTool( tool );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,8 @@ int LIB_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
if( selection.Empty() )
|
||||
return 0;
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
controls->ShowCursor( true );
|
||||
@ -282,7 +283,7 @@ int LIB_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
m_frame->OnModify();
|
||||
|
||||
m_moveInProgress = false;
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,8 @@ int SCH_DRAWING_TOOLS::PlaceComponent( const TOOL_EVENT& aEvent )
|
||||
m_selectionTool->AddItemToSel( component );
|
||||
}
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
// Prime the pump
|
||||
@ -131,7 +132,7 @@ int SCH_DRAWING_TOOLS::PlaceComponent( const TOOL_EVENT& aEvent )
|
||||
cleanup();
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -147,7 +148,7 @@ int SCH_DRAWING_TOOLS::PlaceComponent( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -247,7 +248,8 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent )
|
||||
m_view->AddToPreview( image->Clone() );
|
||||
}
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
// Prime the pump
|
||||
@ -275,13 +277,13 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent )
|
||||
cleanup();
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
|
||||
if( immediateMode )
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -297,7 +299,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -350,7 +352,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent )
|
||||
|
||||
if( immediateMode )
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -426,7 +428,8 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent )
|
||||
m_view->ClearPreview();
|
||||
m_view->AddToPreview( previewItem->Clone() );
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
// Prime the pump
|
||||
@ -441,7 +444,7 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent )
|
||||
|
||||
if( evt->IsCancelInteractive() )
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
else if( evt->IsActivate() )
|
||||
@ -453,7 +456,7 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -505,7 +508,8 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
|
||||
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
|
||||
getViewControls()->ShowCursor( true );
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
// Prime the pump
|
||||
@ -531,7 +535,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
|
||||
cleanup();
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -551,7 +555,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -692,7 +696,8 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent )
|
||||
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
|
||||
getViewControls()->ShowCursor( true );
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
// Prime the pump
|
||||
@ -720,7 +725,7 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent )
|
||||
cleanup();
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -740,7 +745,7 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -944,7 +944,8 @@ int SCH_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
|
||||
@ -1006,7 +1007,8 @@ int SCH_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent )
|
||||
|
||||
picker->Activate();
|
||||
Wait();
|
||||
// Picker calls PopTool() so that it gets done before activating tool's PushTool()
|
||||
|
||||
m_frame->PopTool( tool );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -478,14 +478,16 @@ int SCH_EDITOR_CONTROL::SimProbe( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
m_frame->GetCanvas()->SetCursor( SIMULATION_CURSORS::GetCursor( SIMULATION_CURSORS::CURSOR::PROBE ) );
|
||||
|
||||
picker->SetClickHandler( std::bind( probeSimulation, m_frame, std::placeholders::_1 ) );
|
||||
picker->Activate();
|
||||
Wait();
|
||||
// Picker calls PopTool() so that it gets done before activating tool's PushTool()
|
||||
|
||||
m_frame->PopTool( tool );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -520,14 +522,16 @@ int SCH_EDITOR_CONTROL::SimTune( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
m_frame->GetCanvas()->SetCursor( SIMULATION_CURSORS::GetCursor( SIMULATION_CURSORS::CURSOR::TUNE ) );
|
||||
|
||||
picker->SetClickHandler( std::bind( tuneSimulation, m_frame, std::placeholders::_1 ) );
|
||||
picker->Activate();
|
||||
Wait();
|
||||
// Picker calls PopTool() so that it gets done before activating tool's PushTool()
|
||||
|
||||
m_frame->PopTool( tool );
|
||||
return 0;
|
||||
}
|
||||
#endif /* KICAD_SPICE */
|
||||
@ -686,13 +690,15 @@ int SCH_EDITOR_CONTROL::HighlightNetCursor( const TOOL_EVENT& aEvent )
|
||||
|
||||
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
picker->SetClickHandler( std::bind( highlightNet, m_toolMgr, std::placeholders::_1 ) );
|
||||
picker->Activate();
|
||||
Wait();
|
||||
// Picker calls PopTool() so that it gets done before activating tool's PushTool()
|
||||
|
||||
m_frame->PopTool( tool );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -257,7 +257,8 @@ int SCH_LINE_WIRE_BUS_TOOL::DrawSegments( const TOOL_EVENT& aEvent )
|
||||
if( aEvent.HasPosition() )
|
||||
getViewControls()->WarpCursor( getViewControls()->GetCursorPosition(), true );
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
|
||||
if( aEvent.HasPosition() )
|
||||
{
|
||||
@ -265,7 +266,7 @@ int SCH_LINE_WIRE_BUS_TOOL::DrawSegments( const TOOL_EVENT& aEvent )
|
||||
segment = startSegments( layer, cursorPos );
|
||||
}
|
||||
|
||||
return doDrawSegments( layer, segment );
|
||||
return doDrawSegments( tool, layer, segment );
|
||||
}
|
||||
|
||||
|
||||
@ -277,7 +278,8 @@ int SCH_LINE_WIRE_BUS_TOOL::UnfoldBus( const TOOL_EVENT& aEvent )
|
||||
|
||||
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
if( netPtr )
|
||||
@ -313,10 +315,10 @@ int SCH_LINE_WIRE_BUS_TOOL::UnfoldBus( const TOOL_EVENT& aEvent )
|
||||
|
||||
// If we have an unfolded wire to draw, then draw it
|
||||
if( segment )
|
||||
return doDrawSegments( LAYER_WIRE, segment );
|
||||
return doDrawSegments( tool, LAYER_WIRE, segment );
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -437,7 +439,7 @@ static void computeBreakPoint( SCH_SCREEN* aScreen, SCH_LINE* aSegment, wxPoint&
|
||||
}
|
||||
|
||||
|
||||
int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( int aType, SCH_LINE* aSegment )
|
||||
int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType, SCH_LINE* aSegment )
|
||||
{
|
||||
bool forceHV = m_frame->GetForceHVLines();
|
||||
SCH_SCREEN* screen = m_frame->GetScreen();
|
||||
@ -486,7 +488,7 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( int aType, SCH_LINE* aSegment )
|
||||
cleanup();
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( aTool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -502,7 +504,7 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( int aType, SCH_LINE* aSegment )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( aTool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ public:
|
||||
int AddJunctionsIfNeeded( const TOOL_EVENT& aEvent );
|
||||
|
||||
private:
|
||||
int doDrawSegments( int aType, SCH_LINE* aSegment );
|
||||
int doDrawSegments( const std::string& aTool, int aType, SCH_LINE* aSegment );
|
||||
SCH_LINE* startSegments( int aType, const VECTOR2D& aPos );
|
||||
SCH_LINE* doUnfoldBus( const wxString& aNet );
|
||||
void finishSegments();
|
||||
|
@ -119,7 +119,8 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
else
|
||||
return 0;
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
|
||||
if( m_moveInProgress )
|
||||
{
|
||||
@ -448,7 +449,7 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
|
||||
m_dragAdditions.clear();
|
||||
m_moveInProgress = false;
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -574,7 +574,8 @@ int GERBVIEW_SELECTION_TOOL::MeasureTool( const TOOL_EVENT& aEvent )
|
||||
auto& controls = *getViewControls();
|
||||
auto previous_settings = controls.GetSettings();
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER twoPtMgr;
|
||||
@ -607,7 +608,7 @@ int GERBVIEW_SELECTION_TOOL::MeasureTool( const TOOL_EVENT& aEvent )
|
||||
clearRuler();
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -624,7 +625,7 @@ int GERBVIEW_SELECTION_TOOL::MeasureTool( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ protected:
|
||||
/// Tool ID of previously active draw tool bar button.
|
||||
int m_lastDrawToolId; // JEY TODO: remove this; it doesn't work in modern toolset anyway
|
||||
|
||||
std::deque<std::string> m_toolStack; // stack of user-level "tools". Used to temporarily
|
||||
std::vector<std::string> m_toolStack; // stack of user-level "tools". Used to temporarily
|
||||
// invoke an immediate-mode action. Note that these
|
||||
// are "tools" in the UI sense, which are actually
|
||||
// TOOL_ACTIONs internally
|
||||
@ -308,7 +308,7 @@ public:
|
||||
* and circle, or wire and bus. So each user-level tool is actually a TOOL_ACTION.
|
||||
*/
|
||||
virtual void PushTool( const std::string& actionName );
|
||||
virtual void PopTool();
|
||||
virtual void PopTool( const std::string& actionName );
|
||||
|
||||
bool ToolStackIsEmpty() { return m_toolStack.empty(); }
|
||||
|
||||
|
@ -80,7 +80,8 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent )
|
||||
m_toolMgr->RunAction( PL_ACTIONS::clearSelection, true );
|
||||
getViewControls()->ShowCursor( true );
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
// Prime the pump
|
||||
@ -108,7 +109,7 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent )
|
||||
cleanup();
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -124,7 +125,7 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -196,7 +197,8 @@ int PL_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
|
||||
m_toolMgr->RunAction( PL_ACTIONS::clearSelection, true );
|
||||
getViewControls()->ShowCursor( true );
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
// Prime the pump
|
||||
@ -277,7 +279,7 @@ int PL_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
|
||||
getViewControls()->CaptureCursor( item != nullptr );
|
||||
}
|
||||
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,8 @@ int PL_EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
if( selection.Empty() )
|
||||
return 0;
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
controls->ShowCursor( true );
|
||||
@ -247,7 +248,7 @@ int PL_EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
m_frame->OnModify();
|
||||
|
||||
m_moveInProgress = false;
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -340,7 +341,8 @@ int PL_EDIT_TOOL::DoDelete( const TOOL_EVENT& aEvent )
|
||||
|
||||
int PL_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
PL_PICKER_TOOL* picker = m_toolMgr->GetTool<PL_PICKER_TOOL>();
|
||||
@ -399,7 +401,8 @@ int PL_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent )
|
||||
|
||||
picker->Activate();
|
||||
Wait();
|
||||
// Picker calls PopTool() so that it gets done before activating tool's PushTool()
|
||||
|
||||
m_frame->PopTool( tool );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -159,7 +159,6 @@ int PL_PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
|
||||
resetPicker();
|
||||
controls->ForceCursorPosition( false );
|
||||
m_frame->PopTool();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -263,7 +263,8 @@ int LENGTH_TUNER_TOOL::MainLoop( const TOOL_EVENT& aEvent )
|
||||
// Deselect all items
|
||||
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
|
||||
|
||||
frame()->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
frame()->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
m_router->SetMode( aEvent.Parameter<PNS::ROUTER_MODE>() );
|
||||
@ -306,7 +307,7 @@ int LENGTH_TUNER_TOOL::MainLoop( const TOOL_EVENT& aEvent )
|
||||
m_savedSettings = m_router->Settings();
|
||||
m_savedSizes = m_router->Sizes();
|
||||
|
||||
frame()->PopTool();
|
||||
frame()->PopTool( tool );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -869,7 +869,8 @@ int ROUTER_TOOL::MainLoop( const TOOL_EVENT& aEvent )
|
||||
// Deselect all items
|
||||
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
|
||||
|
||||
frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
m_router->SetMode( mode );
|
||||
@ -894,7 +895,7 @@ int ROUTER_TOOL::MainLoop( const TOOL_EVENT& aEvent )
|
||||
|
||||
if( evt->IsCancelInteractive() )
|
||||
{
|
||||
frame->PopTool();
|
||||
frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
else if( evt->IsActivate() )
|
||||
@ -906,7 +907,7 @@ int ROUTER_TOOL::MainLoop( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
else
|
||||
{
|
||||
frame->PopTool();
|
||||
frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -964,7 +965,7 @@ int ROUTER_TOOL::MainLoop( const TOOL_EVENT& aEvent )
|
||||
|
||||
if( m_cancelled )
|
||||
{
|
||||
frame->PopTool();
|
||||
frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -145,10 +145,11 @@ int DRAWING_TOOL::DrawLine( const TOOL_EVENT& aEvent )
|
||||
if( aEvent.HasPosition() )
|
||||
startingPoint = getViewControls()->GetCursorPosition( !aEvent.Modifier( MD_ALT ) );
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
while( drawSegment( S_SEGMENT, line, startingPoint ) )
|
||||
while( drawSegment( tool, S_SEGMENT, line, startingPoint ) )
|
||||
{
|
||||
if( line )
|
||||
{
|
||||
@ -188,10 +189,11 @@ int DRAWING_TOOL::DrawCircle( const TOOL_EVENT& aEvent )
|
||||
if( aEvent.HasPosition() )
|
||||
startingPoint = getViewControls()->GetCursorPosition( !aEvent.Modifier( MD_ALT ) );
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
while( drawSegment( S_CIRCLE, circle, startingPoint ) )
|
||||
while( drawSegment( tool, S_CIRCLE, circle, startingPoint ) )
|
||||
{
|
||||
if( circle )
|
||||
{
|
||||
@ -226,10 +228,11 @@ int DRAWING_TOOL::DrawArc( const TOOL_EVENT& aEvent )
|
||||
|
||||
arc->SetFlags( IS_NEW );
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
while( drawArc( arc, immediateMode ) )
|
||||
while( drawArc( tool, arc, immediateMode ) )
|
||||
{
|
||||
if( arc )
|
||||
{
|
||||
@ -266,7 +269,8 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
|
||||
|
||||
SCOPED_DRAW_MODE scopedDrawMode( m_mode, MODE::TEXT );
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
bool reselect = false;
|
||||
@ -299,7 +303,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
|
||||
cleanup();
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -315,7 +319,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -472,7 +476,8 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
|
||||
|
||||
SCOPED_DRAW_MODE scopedDrawMode( m_mode, MODE::DIMENSION );
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
enum DIMENSION_STEPS
|
||||
@ -517,7 +522,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
|
||||
cleanup();
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -537,7 +542,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -749,7 +754,8 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent )
|
||||
|
||||
m_view->Update( &preview );
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
// Main loop: keep receiving events
|
||||
@ -762,7 +768,7 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
preview.FreeItems();
|
||||
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
else if( evt->IsMotion() )
|
||||
@ -827,7 +833,8 @@ int DRAWING_TOOL::SetAnchor( const TOOL_EVENT& aEvent )
|
||||
|
||||
SCOPED_DRAW_MODE scopedDrawMode( m_mode, MODE::ANCHOR );
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
m_controls->ShowCursor( true );
|
||||
@ -854,7 +861,7 @@ int DRAWING_TOOL::SetAnchor( const TOOL_EVENT& aEvent )
|
||||
|
||||
// Usually, we do not need to change twice the anchor position,
|
||||
// so deselect the active tool
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
else if( evt->IsClick( BUT_RIGHT ) )
|
||||
@ -863,7 +870,7 @@ int DRAWING_TOOL::SetAnchor( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
else if( evt->IsCancelInteractive() || evt->IsActivate() )
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -872,7 +879,8 @@ int DRAWING_TOOL::SetAnchor( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
|
||||
|
||||
bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic, OPT<VECTOR2D> aStartingPoint )
|
||||
bool DRAWING_TOOL::drawSegment( const std::string& aTool, int aShape, DRAWSEGMENT*& aGraphic,
|
||||
OPT<VECTOR2D> aStartingPoint )
|
||||
{
|
||||
// Only two shapes are currently supported
|
||||
assert( aShape == S_SEGMENT || aShape == S_CIRCLE );
|
||||
@ -956,7 +964,7 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic, OPT<VECTOR2D
|
||||
cleanup();
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( aTool );
|
||||
cancelled = true;
|
||||
}
|
||||
|
||||
@ -982,7 +990,7 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic, OPT<VECTOR2D
|
||||
if( started )
|
||||
cleanup();
|
||||
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( aTool );
|
||||
cancelled = true;
|
||||
break;
|
||||
}
|
||||
@ -1135,7 +1143,7 @@ static void updateArcFromConstructionMgr( const KIGFX::PREVIEW::ARC_GEOM_MANAGER
|
||||
}
|
||||
|
||||
|
||||
bool DRAWING_TOOL::drawArc( DRAWSEGMENT*& aGraphic, bool aImmediateMode )
|
||||
bool DRAWING_TOOL::drawArc( const std::string& aTool, DRAWSEGMENT*& aGraphic, bool aImmediateMode )
|
||||
{
|
||||
m_lineWidth = getSegmentWidth( getDrawingLayer() );
|
||||
|
||||
@ -1188,7 +1196,7 @@ bool DRAWING_TOOL::drawArc( DRAWSEGMENT*& aGraphic, bool aImmediateMode )
|
||||
cleanup();
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( aTool );
|
||||
cancelled = true;
|
||||
}
|
||||
|
||||
@ -1214,7 +1222,7 @@ bool DRAWING_TOOL::drawArc( DRAWSEGMENT*& aGraphic, bool aImmediateMode )
|
||||
if( firstPoint )
|
||||
cleanup();
|
||||
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( aTool );
|
||||
cancelled = true;
|
||||
break;
|
||||
}
|
||||
@ -1387,7 +1395,8 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent )
|
||||
// hands the calculated points over to the zone creator tool
|
||||
POLYGON_GEOM_MANAGER polyGeomMgr( zoneTool );
|
||||
|
||||
m_frame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
m_frame->PushTool( tool );
|
||||
Activate(); // register for events
|
||||
|
||||
m_controls->ShowCursor( true );
|
||||
@ -1427,7 +1436,7 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent )
|
||||
cleanup();
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1447,7 +1456,7 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_frame->PopTool();
|
||||
m_frame->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1814,9 +1823,9 @@ int DRAWING_TOOL::DrawVia( const TOOL_EVENT& aEvent )
|
||||
VIA_PLACER placer( frame() );
|
||||
|
||||
SCOPED_DRAW_MODE scopedDrawMode( m_mode, MODE::VIA );
|
||||
frame()->PushTool( aEvent.GetCommandStr().get() );
|
||||
|
||||
doInteractiveItemPlacement( &placer, _( "Place via" ), IPO_REPEAT | IPO_SINGLE_CLICK );
|
||||
doInteractiveItemPlacement( aEvent.GetCommandStr().get(), &placer, _( "Place via" ),
|
||||
IPO_REPEAT | IPO_SINGLE_CLICK );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -164,14 +164,15 @@ private:
|
||||
///> and its settings (width, layer) set to the current default values.
|
||||
///> @return False if the tool was cancelled before the origin was set or origin and end are
|
||||
///> the same point.
|
||||
bool drawSegment( int aShape, DRAWSEGMENT*& aGraphic, OPT<VECTOR2D> aStartingPoint );
|
||||
bool drawSegment( const std::string& aTool, int aShape, DRAWSEGMENT*& aGraphic,
|
||||
OPT<VECTOR2D> aStartingPoint );
|
||||
|
||||
///> Starts drawing an arc.
|
||||
///> @param aGraphic is an object that is going to be used by the tool for drawing. It has to
|
||||
///> be already created. The tool deletes the object if it is not added to a BOARD.
|
||||
///> @return False if the tool was cancelled before the origin was set or origin and end are
|
||||
///> the same point.
|
||||
bool drawArc( DRAWSEGMENT*& aGraphic, bool aImmediateMode );
|
||||
bool drawArc( const std::string& aTool, DRAWSEGMENT*& aGraphic, bool aImmediateMode );
|
||||
|
||||
/**
|
||||
* Draws a polygon, that is added as a zone or a keepout area.
|
||||
|
@ -269,7 +269,8 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
if( selection.Empty() )
|
||||
return 0;
|
||||
|
||||
editFrame->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
editFrame->PushTool( tool );
|
||||
Activate();
|
||||
controls->ShowCursor( true );
|
||||
controls->SetAutoPan( true );
|
||||
@ -506,7 +507,7 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
m_commit->Push( _( "Drag" ) );
|
||||
}
|
||||
|
||||
editFrame->PopTool();
|
||||
editFrame->PopTool( tool );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1117,7 +1118,8 @@ int EDIT_TOOL::MeasureTool( const TOOL_EVENT& aEvent )
|
||||
auto& view = *getView();
|
||||
auto& controls = *getViewControls();
|
||||
|
||||
frame()->PushTool( aEvent.GetCommandStr().get() );
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
frame()->PushTool( tool );
|
||||
Activate();
|
||||
|
||||
EDA_UNITS_T units = frame()->GetUserUnits();
|
||||
@ -1157,7 +1159,7 @@ int EDIT_TOOL::MeasureTool( const TOOL_EVENT& aEvent )
|
||||
clearRuler();
|
||||
else
|
||||
{
|
||||
frame()->PopTool();
|
||||
frame()->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1174,7 +1176,7 @@ int EDIT_TOOL::MeasureTool( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
else
|
||||
{
|
||||
frame()->PopTool();
|
||||
frame()->PopTool( tool );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -313,9 +313,7 @@ int MODULE_EDITOR_TOOLS::PlacePad( const TOOL_EVENT& aEvent )
|
||||
|
||||
PAD_PLACER placer;
|
||||
|
||||
frame()->PushTool( aEvent.GetCommandStr().get() );
|
||||
|
||||
doInteractiveItemPlacement( &placer, _( "Place pad" ),
|
||||
doInteractiveItemPlacement( aEvent.GetCommandStr().get(), &placer, _( "Place pad" ),
|
||||
IPO_REPEAT | IPO_SINGLE_CLICK | IPO_ROTATE | IPO_FLIP );
|
||||
|
||||
return 0;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user