diff --git a/common/eda_base_frame.cpp b/common/eda_base_frame.cpp index eeba0744f6..17ae5ba395 100644 --- a/common/eda_base_frame.cpp +++ b/common/eda_base_frame.cpp @@ -1243,7 +1243,7 @@ void EDA_BASE_FRAME::DoWithAcceptedFiles() for( const wxFileName& file : m_AcceptedFiles ) { wxString fn = file.GetFullPath(); - m_toolManager->RunAction( *m_acceptedExts.at( file.GetExt() ), true, &fn ); + m_toolManager->RunAction<wxString*>( *m_acceptedExts.at( file.GetExt() ), true, &fn ); } } diff --git a/common/tool/action_menu.cpp b/common/tool/action_menu.cpp index 6b77d32079..5245a53b5a 100644 --- a/common/tool/action_menu.cpp +++ b/common/tool/action_menu.cpp @@ -405,7 +405,7 @@ void ACTION_MENU::OnMenuEvent( wxMenuEvent& aEvent ) if( type == wxEVT_MENU_OPEN ) { if( m_dirty && m_tool ) - getToolManager()->RunAction( ACTIONS::updateMenu, true, this ); + getToolManager()->RunAction<ACTION_MENU*>( ACTIONS::updateMenu, true, this ); wxMenu* parent = dynamic_cast<wxMenu*>( GetParent() ); diff --git a/eeschema/picksymbol.cpp b/eeschema/picksymbol.cpp index f55ad66965..209127b96f 100644 --- a/eeschema/picksymbol.cpp +++ b/eeschema/picksymbol.cpp @@ -313,7 +313,7 @@ void SCH_EDIT_FRAME::ConvertPart( SCH_SYMBOL* aSymbol ) // If selected make sure all the now-included pins are selected if( aSymbol->IsSelected() ) - m_toolManager->RunAction( EE_ACTIONS::addItemToSel, true, aSymbol ); + m_toolManager->RunAction<EDA_ITEM*>( EE_ACTIONS::addItemToSel, true, aSymbol ); UpdateItem( aSymbol, false, true ); OnModify(); diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index 4de18dca27..0873410789 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -585,7 +585,7 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) && *evt->GetCommandId() <= ID_POPUP_SCH_UNFOLD_BUS_END ) { wxString* net = new wxString( *evt->Parameter<wxString*>() ); - m_toolMgr->RunAction( EE_ACTIONS::unfoldBus, true, net ); + m_toolMgr->RunAction<wxString*>( EE_ACTIONS::unfoldBus, true, net ); } } else if( evt->IsCancelInteractive() ) @@ -907,7 +907,7 @@ bool EE_SELECTION_TOOL::selectPoint( EE_COLLECTOR& aCollector, const VECTOR2I& a // Try to call selectionMenu via RunAction() to avoid event-loop contention // But it we cannot handle the event, then we don't have an active tool loop, so // handle it directly. - if( !m_toolMgr->RunAction( EE_ACTIONS::selectionMenu, true, &aCollector ) ) + if( !m_toolMgr->RunAction<COLLECTOR*>( EE_ACTIONS::selectionMenu, true, &aCollector ) ) { if( !doSelectionMenu( &aCollector ) ) aCollector.m_MenuCancelled = true; diff --git a/eeschema/tools/sch_edit_tool.cpp b/eeschema/tools/sch_edit_tool.cpp index b5ca96325b..7c4a507828 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -1269,7 +1269,7 @@ int SCH_EDIT_TOOL::RepeatDrawItem( const TOOL_EVENT& aEvent ) schIUScale.MilsToIU( cfg->m_Drawing.default_repeat_offset_y ) ) ); } - m_toolMgr->RunAction( EE_ACTIONS::addItemToSel, true, newItem ); + m_toolMgr->RunAction<EDA_ITEM*>( EE_ACTIONS::addItemToSel, true, newItem ); newItem->SetFlags( IS_NEW ); m_frame->AddToScreen( newItem, m_frame->GetScreen() ); commit.Added( newItem, m_frame->GetScreen() ); @@ -1500,7 +1500,7 @@ int SCH_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent ) m_toolMgr->RunAction( EE_ACTIONS::selectionActivate, false ); } ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, (void*) &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); return 0; } @@ -2315,7 +2315,7 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent ) } if( selected ) - m_toolMgr->RunAction( EE_ACTIONS::removeItemFromSel, true, item ); + m_toolMgr->RunAction<EDA_ITEM*>( EE_ACTIONS::removeItemFromSel, true, item ); SCH_COMMIT commit( m_toolMgr ); @@ -2331,7 +2331,7 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent ) commit.Push( _( "Change Item Type" ) ); if( selected ) - m_toolMgr->RunAction( EE_ACTIONS::addItemToSel, true, newtext ); + m_toolMgr->RunAction<EDA_ITEM*>( EE_ACTIONS::addItemToSel, true, newtext ); // Otherwise, pointer is owned by the undo stack if( item->IsNew() ) diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 93575ff3c2..7f619369ab 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -659,7 +659,7 @@ int SCH_EDITOR_CONTROL::SimProbe( const TOOL_EVENT& aEvent ) m_toolMgr->RunAction( EE_ACTIONS::selectionActivate, false ); } ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, (void*) &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); return 0; } @@ -749,7 +749,7 @@ int SCH_EDITOR_CONTROL::SimTune( const TOOL_EVENT& aEvent ) m_toolMgr->RunAction( EE_ACTIONS::selectionActivate, false ); } ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, (void*) &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); return 0; } @@ -1196,7 +1196,7 @@ int SCH_EDITOR_CONTROL::HighlightNetCursor( const TOOL_EVENT& aEvent ) return highlightNet( m_toolMgr, aPos ); } ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, (void*) &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); return 0; } @@ -1855,7 +1855,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent ) // Now clear the previous selection, select the pasted items, and fire up the "move" tool. m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); - m_toolMgr->RunAction( EE_ACTIONS::addItemsToSel, true, &loadedItems ); + m_toolMgr->RunAction<EDA_ITEMS*>( EE_ACTIONS::addItemsToSel, true, &loadedItems ); EE_SELECTION& selection = selTool->GetSelection(); diff --git a/eeschema/tools/symbol_editor_drawing_tools.cpp b/eeschema/tools/symbol_editor_drawing_tools.cpp index 46e0159150..3431f01f82 100644 --- a/eeschema/tools/symbol_editor_drawing_tools.cpp +++ b/eeschema/tools/symbol_editor_drawing_tools.cpp @@ -657,7 +657,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::RepeatDrawItem( const TOOL_EVENT& aEvent ) m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); if( pin ) - m_toolMgr->RunAction( EE_ACTIONS::addItemToSel, true, pin ); + m_toolMgr->RunAction<EDA_ITEM*>( EE_ACTIONS::addItemToSel, true, pin ); } return 0; diff --git a/eeschema/tools/symbol_editor_edit_tool.cpp b/eeschema/tools/symbol_editor_edit_tool.cpp index 1dba750b3e..cd49161ca6 100644 --- a/eeschema/tools/symbol_editor_edit_tool.cpp +++ b/eeschema/tools/symbol_editor_edit_tool.cpp @@ -402,7 +402,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent ) m_toolMgr->RunAction( EE_ACTIONS::selectionActivate, false ); } ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, (void*) &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); return 0; } @@ -871,7 +871,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent ) } m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); - m_toolMgr->RunAction( EE_ACTIONS::addItemsToSel, true, &newItems ); + m_toolMgr->RunAction<EDA_ITEMS*>( EE_ACTIONS::addItemsToSel, true, &newItems ); selection.SetReferencePoint( mapCoords( getViewControls()->GetCursorPosition( true ) ) ); m_toolMgr->RunAction( EE_ACTIONS::move, true, &commit ); diff --git a/eeschema/widgets/hierarchy_pane.cpp b/eeschema/widgets/hierarchy_pane.cpp index cf70e045dd..17852a3b4d 100644 --- a/eeschema/widgets/hierarchy_pane.cpp +++ b/eeschema/widgets/hierarchy_pane.cpp @@ -253,7 +253,8 @@ void HIERARCHY_PANE::onSelectSheetPath( wxTreeEvent& aEvent ) TREE_ITEM_DATA* itemData = static_cast<TREE_ITEM_DATA*>( m_tree->GetItemData( itemSel ) ); SetCursor( wxCURSOR_ARROWWAIT ); - m_frame->GetToolManager()->RunAction( EE_ACTIONS::changeSheet, true, &itemData->m_SheetPath ); + m_frame->GetToolManager()->RunAction<SCH_SHEET_PATH*>( EE_ACTIONS::changeSheet, true, + &itemData->m_SheetPath ); SetCursor( wxCURSOR_ARROW ); } diff --git a/eeschema/widgets/search_handlers.cpp b/eeschema/widgets/search_handlers.cpp index a92c1625d7..0e254355bf 100644 --- a/eeschema/widgets/search_handlers.cpp +++ b/eeschema/widgets/search_handlers.cpp @@ -105,7 +105,7 @@ void SCH_SEARCH_HANDLER::SelectItems( std::vector<long>& aItemRows ) } if( selectedItems.size() ) - m_frame->GetToolManager()->RunAction( EE_ACTIONS::addItemsToSel, true, &selectedItems ); + m_frame->GetToolManager()->RunAction<EDA_ITEMS*>( EE_ACTIONS::addItemsToSel, true, &selectedItems ); m_frame->GetCanvas()->Refresh( false ); } diff --git a/gerbview/files.cpp b/gerbview/files.cpp index c720bcc3ab..340935dcfb 100644 --- a/gerbview/files.cpp +++ b/gerbview/files.cpp @@ -687,7 +687,7 @@ void GERBVIEW_FRAME::DoWithAcceptedFiles() { wxString fn = file.GetFullPath(); // Open zip archive in editor - m_toolManager->RunAction( *m_acceptedExts.at( ArchiveFileExtension ), true, &fn ); + m_toolManager->RunAction<wxString*>( *m_acceptedExts.at( ArchiveFileExtension ), true, &fn ); } else { @@ -698,5 +698,5 @@ void GERBVIEW_FRAME::DoWithAcceptedFiles() // Open files in editor if( !gerbFn.IsEmpty() ) - m_toolManager->RunAction( *m_acceptedExts.at( GerberFileExtension ), true, &gerbFn ); -} \ No newline at end of file + m_toolManager->RunAction<wxString*>( *m_acceptedExts.at( GerberFileExtension ), true, &gerbFn ); +} diff --git a/kicad/kicad_manager_frame.cpp b/kicad/kicad_manager_frame.cpp index f36082add8..11dd20d000 100644 --- a/kicad/kicad_manager_frame.cpp +++ b/kicad/kicad_manager_frame.cpp @@ -440,7 +440,7 @@ void KICAD_MANAGER_FRAME::DoWithAcceptedFiles() if( ext == ProjectFileExtension || ext == LegacyProjectFileExtension ) { wxString fn = fileName.GetFullPath(); - m_toolManager->RunAction( *m_acceptedExts.at( fileName.GetExt() ), true, &fn ); + m_toolManager->RunAction<wxString*>( *m_acceptedExts.at( fileName.GetExt() ), true, &fn ); return; } @@ -464,7 +464,7 @@ void KICAD_MANAGER_FRAME::DoWithAcceptedFiles() else { wxString fn = fileName.GetFullPath(); - m_toolManager->RunAction( *m_acceptedExts.at( fileName.GetExt() ), true, &fn ); + m_toolManager->RunAction<wxString*>( *m_acceptedExts.at( fileName.GetExt() ), true, &fn ); } } @@ -476,7 +476,7 @@ void KICAD_MANAGER_FRAME::DoWithAcceptedFiles() if( wxFileExists( fullEditorName ) ) { wxString command = fullEditorName + " " + gerberFiles; - m_toolManager->RunAction( *m_acceptedExts.at( GerberFileExtension ), + m_toolManager->RunAction<wxString*>( *m_acceptedExts.at( GerberFileExtension ), true, &command ); } } @@ -713,7 +713,7 @@ void KICAD_MANAGER_FRAME::OnOpenFileInTextEditor( wxCommandEvent& event ) wxString filename = dlg.GetPath(); if( !dlg.GetPath().IsEmpty() && !Pgm().GetTextEditor().IsEmpty() ) - m_toolManager->RunAction( KICAD_MANAGER_ACTIONS::openTextEditor, true, &filename ); + m_toolManager->RunAction<wxString*>( KICAD_MANAGER_ACTIONS::openTextEditor, true, &filename ); } diff --git a/kicad/project_tree_item.cpp b/kicad/project_tree_item.cpp index f29b42d39b..c9db4ea734 100644 --- a/kicad/project_tree_item.cpp +++ b/kicad/project_tree_item.cpp @@ -202,7 +202,7 @@ void PROJECT_TREE_ITEM::Activate( PROJECT_TREE_PANE* aTreePrjFrame ) if( fullFileName == frame->SchFileName() || fullFileName == frame->SchLegacyFileName() ) toolMgr->RunAction( KICAD_MANAGER_ACTIONS::editSchematic, true ); else - toolMgr->RunAction( KICAD_MANAGER_ACTIONS::editOtherSch, true, &fullFileName ); + toolMgr->RunAction<wxString*>( KICAD_MANAGER_ACTIONS::editOtherSch, true, &fullFileName ); break; @@ -212,7 +212,7 @@ void PROJECT_TREE_ITEM::Activate( PROJECT_TREE_PANE* aTreePrjFrame ) if( fullFileName == frame->PcbFileName() || fullFileName == frame->PcbLegacyFileName() ) toolMgr->RunAction( KICAD_MANAGER_ACTIONS::editPCB, true ); else - toolMgr->RunAction( KICAD_MANAGER_ACTIONS::editOtherPCB, true, &fullFileName ); + toolMgr->RunAction<wxString*>( KICAD_MANAGER_ACTIONS::editOtherPCB, true, &fullFileName ); break; @@ -221,7 +221,7 @@ void PROJECT_TREE_ITEM::Activate( PROJECT_TREE_PANE* aTreePrjFrame ) case TREE_FILE_TYPE::DRILL: case TREE_FILE_TYPE::DRILL_NC: case TREE_FILE_TYPE::DRILL_XNC: - toolMgr->RunAction( KICAD_MANAGER_ACTIONS::viewGerbers, true, &fullFileName ); + toolMgr->RunAction<wxString*>( KICAD_MANAGER_ACTIONS::viewGerbers, true, &fullFileName ); break; case TREE_FILE_TYPE::HTML: @@ -236,11 +236,11 @@ void PROJECT_TREE_ITEM::Activate( PROJECT_TREE_PANE* aTreePrjFrame ) case TREE_FILE_TYPE::TXT: case TREE_FILE_TYPE::MD: case TREE_FILE_TYPE::REPORT: - toolMgr->RunAction( KICAD_MANAGER_ACTIONS::openTextEditor, true, &fullFileName ); + toolMgr->RunAction<wxString*>( KICAD_MANAGER_ACTIONS::openTextEditor, true, &fullFileName ); break; case TREE_FILE_TYPE::DRAWING_SHEET: - toolMgr->RunAction( KICAD_MANAGER_ACTIONS::editDrawingSheet, true, &fullFileName ); + toolMgr->RunAction<wxString*>( KICAD_MANAGER_ACTIONS::editDrawingSheet, true, &fullFileName ); break; case TREE_FILE_TYPE::FOOTPRINT_FILE: diff --git a/pagelayout_editor/tools/pl_edit_tool.cpp b/pagelayout_editor/tools/pl_edit_tool.cpp index 8b1f975315..9b918df1f6 100644 --- a/pagelayout_editor/tools/pl_edit_tool.cpp +++ b/pagelayout_editor/tools/pl_edit_tool.cpp @@ -476,7 +476,7 @@ int PL_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent ) m_toolMgr->RunAction( PL_ACTIONS::selectionActivate, false ); } ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, (void*) &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); return 0; } diff --git a/pcbnew/array_creator.cpp b/pcbnew/array_creator.cpp index 5eb51021c0..1f421c0f41 100644 --- a/pcbnew/array_creator.cpp +++ b/pcbnew/array_creator.cpp @@ -73,7 +73,7 @@ void ARRAY_CREATOR::Invoke() ARRAY_PAD_NUMBER_PROVIDER pad_number_provider( fp, *array_opts ); - std::vector<EDA_ITEM*> all_added_items; + EDA_ITEMS all_added_items; // The first item in list is the original item. We do not modify it for( int ptN = 0; ptN < array_opts->GetArraySize(); ptN++ ) @@ -206,7 +206,7 @@ void ARRAY_CREATOR::Invoke() } m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); - m_toolMgr->RunAction( PCB_ACTIONS::selectItems, true, &all_added_items ); + m_toolMgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, true, &all_added_items ); commit.Push( _( "Create an array" ) ); } diff --git a/pcbnew/cross-probing.cpp b/pcbnew/cross-probing.cpp index f587ec2342..d9479097b9 100644 --- a/pcbnew/cross-probing.cpp +++ b/pcbnew/cross-probing.cpp @@ -192,9 +192,9 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline ) bbox = footprint->GetBoundingBox( true, false ); // No invisible text in bbox calc if( pad ) - m_toolManager->RunAction( PCB_ACTIONS::highlightItem, true, pad ); + m_toolManager->RunAction<BOARD_ITEM*>( PCB_ACTIONS::highlightItem, true, pad ); else - m_toolManager->RunAction( PCB_ACTIONS::highlightItem, true, footprint ); + m_toolManager->RunAction<BOARD_ITEM*>( PCB_ACTIONS::highlightItem, true, footprint ); } else if( netcode > 0 || multiHighlight ) { diff --git a/pcbnew/dialogs/dialog_find.cpp b/pcbnew/dialogs/dialog_find.cpp index 5af309c440..02cae523c6 100644 --- a/pcbnew/dialogs/dialog_find.cpp +++ b/pcbnew/dialogs/dialog_find.cpp @@ -393,7 +393,7 @@ void DIALOG_FIND::search( bool aDirection ) } else { - m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectItem, true, *m_it ); + m_frame->GetToolManager()->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, *m_it ); msg.Printf( _( "'%s' found" ), searchString ); m_frame->SetStatusText( msg ); diff --git a/pcbnew/dialogs/dialog_group_properties.cpp b/pcbnew/dialogs/dialog_group_properties.cpp index 61265b2fa4..9300026e6b 100644 --- a/pcbnew/dialogs/dialog_group_properties.cpp +++ b/pcbnew/dialogs/dialog_group_properties.cpp @@ -115,7 +115,7 @@ bool DIALOG_GROUP_PROPERTIES::TransferDataFromWindow() m_group->AddItem( item ); } - m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, m_group ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, m_group ); commit.Push( _( "Modified group" ) ); return true; diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index c3668826be..429799ac9d 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -33,6 +33,7 @@ #include <footprint.h> #include <pad.h> #include <zone.h> +#include <pcb_group.h> #include <pcb_target.h> #include <pcb_dimension.h> #include <pcb_textbox.h> @@ -166,7 +167,8 @@ void PCB_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem ) break; case PCB_GROUP_T: - m_toolManager->RunAction( PCB_ACTIONS::groupProperties, true, aItem ); + m_toolManager->RunAction<PCB_GROUP*>( PCB_ACTIONS::groupProperties, true, + static_cast<PCB_GROUP*>( aItem ) ); break; case PCB_MARKER_T: diff --git a/pcbnew/footprint_editor_utils.cpp b/pcbnew/footprint_editor_utils.cpp index f9c607e279..ec82f9edf9 100644 --- a/pcbnew/footprint_editor_utils.cpp +++ b/pcbnew/footprint_editor_utils.cpp @@ -29,6 +29,7 @@ #include <fp_lib_table.h> #include <functional> #include <kiway_express.h> +#include <pcb_group.h> #include <pcb_marker.h> #include <pcb_textbox.h> #include <pcb_shape.h> @@ -250,7 +251,8 @@ void FOOTPRINT_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem ) } case PCB_GROUP_T: - m_toolManager->RunAction( PCB_ACTIONS::groupProperties, true, aItem ); + m_toolManager->RunAction<PCB_GROUP*>( PCB_ACTIONS::groupProperties, true, + static_cast<PCB_GROUP*>( aItem ) ); break; case PCB_MARKER_T: diff --git a/pcbnew/microwave/microwave_inductor.cpp b/pcbnew/microwave/microwave_inductor.cpp index 1d69b0adbc..57efb21f3e 100644 --- a/pcbnew/microwave/microwave_inductor.cpp +++ b/pcbnew/microwave/microwave_inductor.cpp @@ -309,7 +309,7 @@ void MICROWAVE_TOOL::createInductorBetween( const VECTOR2I& aStart, const VECTOR else { // at this point, we can save the footprint - m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, inductorFP.get() ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, inductorFP.get() ); BOARD_COMMIT commit( this ); commit.Add( inductorFP.release() ); diff --git a/pcbnew/netlist_reader/netlist.cpp b/pcbnew/netlist_reader/netlist.cpp index 72d183ba2e..9556e11680 100644 --- a/pcbnew/netlist_reader/netlist.cpp +++ b/pcbnew/netlist_reader/netlist.cpp @@ -128,7 +128,7 @@ void PCB_EDIT_FRAME::OnNetlistChanged( BOARD_NETLIST_UPDATER& aUpdater, bool* aR if( !newFootprints.empty() ) { for( FOOTPRINT* footprint : newFootprints ) - GetToolManager()->RunAction( PCB_ACTIONS::selectItem, true, footprint ); + GetToolManager()->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, footprint ); *aRunDragCommand = true; } diff --git a/pcbnew/tools/board_editor_control.cpp b/pcbnew/tools/board_editor_control.cpp index 184c27a3d4..c5aa4e248f 100644 --- a/pcbnew/tools/board_editor_control.cpp +++ b/pcbnew/tools/board_editor_control.cpp @@ -1024,7 +1024,7 @@ int BOARD_EDITOR_CONTROL::PlaceFootprint( const TOOL_EVENT& aEvent ) { m_placingFootprint = true; fp->SetPosition( cursorPos ); - m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, fp ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, fp ); m_toolMgr->RunAction( ACTIONS::refreshPreview ); } else if( aEvent.HasPosition() ) @@ -1044,7 +1044,7 @@ int BOARD_EDITOR_CONTROL::PlaceFootprint( const TOOL_EVENT& aEvent ) cursorPos = controls->GetCursorPosition( !evt->DisableGridSnapping() ); if( reselect && fp ) - m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, fp ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, fp ); if( evt->IsCancelInteractive() ) { @@ -1128,7 +1128,7 @@ int BOARD_EDITOR_CONTROL::PlaceFootprint( const TOOL_EVENT& aEvent ) fp->GetField( FOOTPRINT_FIELD )->SetText( UnescapeString( fp->GetFPIDAsString() ) ); commit.Add( fp ); - m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, fp ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, fp ); m_toolMgr->RunAction( ACTIONS::refreshPreview ); } @@ -1592,7 +1592,7 @@ int BOARD_EDITOR_CONTROL::DrillOrigin( const TOOL_EVENT& aEvent ) return false; // drill origin is a one-shot; don't continue with tool } ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, (void*) &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); return 0; } diff --git a/pcbnew/tools/board_inspection_tool.cpp b/pcbnew/tools/board_inspection_tool.cpp index 47bf0038d3..1971409012 100644 --- a/pcbnew/tools/board_inspection_tool.cpp +++ b/pcbnew/tools/board_inspection_tool.cpp @@ -1519,7 +1519,7 @@ int BOARD_INSPECTION_TOOL::HighlightItem( const TOOL_EVENT& aEvent ) m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); if( item ) - m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, item ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, item ); } m_frame->m_probingSchToPcb = false; @@ -1815,7 +1815,7 @@ int BOARD_INSPECTION_TOOL::LocalRatsnestTool( const TOOL_EVENT& aEvent ) } } ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, (void*) &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); return 0; } diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 68d44d02a2..5b28257aa4 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -410,7 +410,7 @@ int DRAWING_TOOL::DrawRectangle( const TOOL_EVENT& aEvent ) commit.Add( rect ); commit.Push( isTextBox ? _( "Draw a text box" ) : _( "Draw a rectangle" ) ); - m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, rect ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, rect ); } } @@ -458,7 +458,7 @@ int DRAWING_TOOL::DrawCircle( const TOOL_EVENT& aEvent ) commit.Add( circle ); commit.Push( _( "Draw a circle" ) ); - m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, circle ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, circle ); } circle = new PCB_SHAPE( parent ); @@ -505,7 +505,7 @@ int DRAWING_TOOL::DrawArc( const TOOL_EVENT& aEvent ) commit.Add( arc ); commit.Push( _( "Draw an arc" ) ); - m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, arc ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, arc ); } arc = new PCB_SHAPE( parent ); @@ -705,7 +705,7 @@ int DRAWING_TOOL::PlaceImage( const TOOL_EVENT& aEvent ) commit.Add( image ); commit.Push( _( "Place an image" ) ); - m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, image ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, image ); image = nullptr; m_toolMgr->RunAction( ACTIONS::activatePointEditor ); @@ -934,7 +934,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent ) m_frame->GetCanvas()->Refresh(); } - m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, text ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, text ); m_view->Update( &selection() ); // update the cursor so it looks correct before another event @@ -950,7 +950,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent ) commit.Add( text ); commit.Push( _( "Place a text" ) ); - m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, text ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, text ); text = nullptr; } @@ -1291,7 +1291,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent ) m_toolMgr->RunAction( PCB_ACTIONS::properties, true, dimension ); } - m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, dimension ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, dimension ); break; } @@ -2020,7 +2020,7 @@ bool DRAWING_TOOL::drawShape( const TOOL_EVENT& aTool, PCB_SHAPE** aGraphic, { commit.Add( graphic ); commit.Push( _( "Draw a line segment" ) ); - m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, graphic ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, graphic ); } else { diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index a0e5e735e1..a42b2d38fa 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -283,7 +283,7 @@ int EDIT_TOOL::GetAndPlace( const TOOL_EVENT& aEvent ) if( fp ) { m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); - m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, fp ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, fp ); selectionTool->GetSelection().SetReferencePoint( fp->GetPosition() ); m_toolMgr->RunAction( PCB_ACTIONS::move, false ); @@ -1857,7 +1857,7 @@ void EDIT_TOOL::DeleteItems( const PCB_SELECTION& aItems, bool aIsCut ) canvas()->Refresh(); // Restore the selection on the original zone - m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, zone ); + m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, zone ); break; } diff --git a/pcbnew/tools/group_tool.cpp b/pcbnew/tools/group_tool.cpp index ca13f7438d..aa7a1e03e4 100644 --- a/pcbnew/tools/group_tool.cpp +++ b/pcbnew/tools/group_tool.cpp @@ -200,7 +200,7 @@ int GROUP_TOOL::PickNewMember( const TOOL_EVENT& aEvent ) statusPopup.Popup(); canvas()->SetStatusPopup( statusPopup.GetPanel() ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, (void*) &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); while( !done ) { diff --git a/pcbnew/tools/pcb_control.cpp b/pcbnew/tools/pcb_control.cpp index 331da40a52..895ecd8792 100644 --- a/pcbnew/tools/pcb_control.cpp +++ b/pcbnew/tools/pcb_control.cpp @@ -570,7 +570,7 @@ int PCB_CONTROL::GridSetOrigin( const TOOL_EVENT& aEvent ) return false; // drill origin is a one-shot; don't continue with tool } ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, (void*) &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); } return 0; @@ -683,7 +683,7 @@ int PCB_CONTROL::DeleteItemCursor( const TOOL_EVENT& aEvent ) m_frame->GetCanvas()->Refresh(); } ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, (void*) &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); return 0; } diff --git a/pcbnew/tools/position_relative_tool.cpp b/pcbnew/tools/position_relative_tool.cpp index 48ccb7990d..ba4ee899b6 100644 --- a/pcbnew/tools/position_relative_tool.cpp +++ b/pcbnew/tools/position_relative_tool.cpp @@ -219,7 +219,7 @@ int POSITION_RELATIVE_TOOL::SelectPositionRelativeItem( const TOOL_EVENT& aEvent statusPopup.Popup(); canvas()->SetStatusPopup( statusPopup.GetPanel() ); - m_toolMgr->RunAction( ACTIONS::pickerTool, true, (void*) &aEvent ); + m_toolMgr->RunAction( ACTIONS::pickerTool, true, &aEvent ); while( !done ) { diff --git a/pcbnew/tools/zone_create_helper.cpp b/pcbnew/tools/zone_create_helper.cpp index eeb77e3bd0..0da5a1eaaf 100644 --- a/pcbnew/tools/zone_create_helper.cpp +++ b/pcbnew/tools/zone_create_helper.cpp @@ -213,7 +213,7 @@ void ZONE_CREATE_HELPER::performZoneCutout( ZONE& aZone, const ZONE& aCutout ) else { m_params.m_sourceZone = newZones[0]; - toolMgr->RunAction( PCB_ACTIONS::selectItem, true, newZones[0] ); + toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, newZones[0] ); } } @@ -238,7 +238,8 @@ void ZONE_CREATE_HELPER::commitZone( std::unique_ptr<ZONE> aZone ) commit.Add( aZone.get() ); commit.Push( _( "Add a zone" ) ); - m_tool.GetManager()->RunAction( PCB_ACTIONS::selectItem, true, aZone.release() ); + m_tool.GetManager()->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, + aZone.release() ); break; } @@ -262,7 +263,7 @@ void ZONE_CREATE_HELPER::commitZone( std::unique_ptr<ZONE> aZone ) poly->SetPolyShape( *aZone->Outline() ); commit.Add( poly ); - m_tool.GetManager()->RunAction( PCB_ACTIONS::selectItem, true, poly ); + m_tool.GetManager()->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, true, poly ); commit.Push( _( "Add a graphical polygon" ) );