From c1eda6b88c1cced3bfe315285acd6cb7d990b3e5 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 9 Jul 2014 16:50:31 +0200 Subject: [PATCH] Some of the Tool Actions need to be run in immediate mode - fixed. --- pcbnew/router/router_tool.cpp | 2 +- pcbnew/tools/drawing_tool.cpp | 18 +++++++++--------- pcbnew/tools/edit_tool.cpp | 16 ++++++++-------- pcbnew/tools/module_tools.cpp | 4 ++-- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 884af6a172..03298fd9a1 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -626,7 +626,7 @@ int ROUTER_TOOL::Main( TOOL_EVENT& aEvent ) BOARD_DESIGN_SETTINGS& bds = board->GetDesignSettings(); // Deselect all items - m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); + m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true ); getEditFrame()->SetToolID( ID_TRACK_BUTT, wxCURSOR_PENCIL, _( "Interactive Router" ) ); diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 83ae2129b8..e1e15322fa 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -251,7 +251,7 @@ int DRAWING_TOOL::DrawDimension( TOOL_EVENT& aEvent ) KIGFX::VIEW_GROUP preview( m_view ); m_view->Add( &preview ); - m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); + m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true ); m_controls->ShowCursor( true ); m_controls->SetSnapping( true ); @@ -450,7 +450,7 @@ int DRAWING_TOOL::PlaceTarget( TOOL_EVENT& aEvent ) m_view->Add( &preview ); preview.ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); - m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); + m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true ); m_controls->SetSnapping( true ); m_controls->SetAutoPan( true ); @@ -525,7 +525,7 @@ int DRAWING_TOOL::PlaceModule( TOOL_EVENT& aEvent ) KIGFX::VIEW_GROUP preview( m_view ); m_view->Add( &preview ); - m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); + m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true ); m_controls->ShowCursor( true ); m_controls->SetSnapping( true ); m_controls->SetAutoPan( true ); @@ -703,7 +703,7 @@ int DRAWING_TOOL::PlaceDXF( TOOL_EVENT& aEvent ) BOARD_ITEM* firstItem = static_cast( *preview.Begin() ); m_view->Add( &preview ); - m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); + m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true ); m_controls->ShowCursor( true ); m_controls->SetSnapping( true ); @@ -877,7 +877,7 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic, KIGFX::VIEW_GROUP preview( m_view ); m_view->Add( &preview ); - m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); + m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true ); m_controls->ShowCursor( true ); m_controls->SetSnapping( true ); @@ -1042,7 +1042,7 @@ bool DRAWING_TOOL::drawArc( DRAWSEGMENT*& aGraphic ) KIGFX::VIEW_GROUP preview( m_view ); m_view->Add( &preview ); - m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); + m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true ); m_controls->ShowCursor( true ); m_controls->SetSnapping( true ); @@ -1212,7 +1212,7 @@ int DRAWING_TOOL::drawZone( bool aKeepout ) KIGFX::VIEW_GROUP preview( m_view ); m_view->Add( &preview ); - m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); + m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true ); m_controls->ShowCursor( true ); m_controls->SetSnapping( true ); @@ -1421,7 +1421,7 @@ int DRAWING_TOOL::placeTextModule() KIGFX::VIEW_GROUP preview( m_view ); m_view->Add( &preview ); - m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); + m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true ); m_controls->ShowCursor( true ); m_controls->SetSnapping( true ); m_controls->SetAutoPan( true ); @@ -1539,7 +1539,7 @@ int DRAWING_TOOL::placeTextPcb() KIGFX::VIEW_GROUP preview( m_view ); m_view->Add( &preview ); - m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); + m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true ); m_controls->ShowCursor( true ); m_controls->SetSnapping( true ); m_controls->SetAutoPan( true ); diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 9d6e646c96..da350c4aa8 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -181,7 +181,7 @@ int EDIT_TOOL::Main( TOOL_EVENT& aEvent ) } selection.group->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); - m_toolMgr->RunAction( COMMON_ACTIONS::pointEditorUpdate ); + m_toolMgr->RunAction( COMMON_ACTIONS::pointEditorUpdate, true ); } else if( evt->IsMouseUp( BUT_LEFT ) || evt->IsClick( BUT_LEFT ) ) @@ -205,7 +205,7 @@ int EDIT_TOOL::Main( TOOL_EVENT& aEvent ) } if( unselect ) - m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); + m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true ); RN_DATA* ratsnest = getModel()->GetRatsnest(); ratsnest->ClearSimple(); @@ -278,7 +278,7 @@ int EDIT_TOOL::Properties( TOOL_EVENT& aEvent ) getModel()->GetRatsnest()->Recalculate(); item->ViewUpdate(); - m_toolMgr->RunAction( COMMON_ACTIONS::pointEditorUpdate ); + m_toolMgr->RunAction( COMMON_ACTIONS::pointEditorUpdate, true ); } item->SetFlags( flags ); @@ -335,9 +335,9 @@ int EDIT_TOOL::Rotate( TOOL_EVENT& aEvent ) getModel()->GetRatsnest()->Recalculate(); if( unselect ) - m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); + m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true ); - m_toolMgr->RunAction( COMMON_ACTIONS::pointEditorUpdate ); + m_toolMgr->RunAction( COMMON_ACTIONS::pointEditorUpdate, true ); setTransitions(); return 0; @@ -389,9 +389,9 @@ int EDIT_TOOL::Flip( TOOL_EVENT& aEvent ) getModel()->GetRatsnest()->Recalculate(); if( unselect ) - m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); + m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true ); - m_toolMgr->RunAction( COMMON_ACTIONS::pointEditorUpdate ); + m_toolMgr->RunAction( COMMON_ACTIONS::pointEditorUpdate, true ); setTransitions(); return 0; @@ -414,7 +414,7 @@ int EDIT_TOOL::Remove( TOOL_EVENT& aEvent ) PCB_BASE_FRAME* editFrame = getEditFrame(); // As we are about to remove items, they have to be removed from the selection first - m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); + m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true ); // Save them for( unsigned int i = 0; i < selectedItems.GetCount(); ++i ) diff --git a/pcbnew/tools/module_tools.cpp b/pcbnew/tools/module_tools.cpp index effaf732dc..a03ea3adcf 100644 --- a/pcbnew/tools/module_tools.cpp +++ b/pcbnew/tools/module_tools.cpp @@ -258,7 +258,7 @@ int MODULE_TOOLS::EnumeratePads( TOOL_EVENT& aEvent ) Activate(); - m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); + m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true ); m_controls->ShowCursor( true ); while( OPT_TOOL_EVENT evt = Wait() ) @@ -433,7 +433,7 @@ int MODULE_TOOLS::PasteItems( TOOL_EVENT& aEvent ) preview.Add( pastedModule ); m_view->Add( &preview ); - m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); + m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true ); m_controls->ShowCursor( true ); m_controls->SetSnapping( true ); m_controls->SetAutoPan( true );