actions: move all basic selection operations to common actions

This commit is contained in:
Mike Williams 2025-04-02 11:01:22 -04:00
parent 8ff0aafbb8
commit 40058ebe80
88 changed files with 374 additions and 506 deletions

View File

@ -113,7 +113,7 @@ bool DIALOG_GROUP_PROPERTIES::TransferDataFromWindow()
static_cast<PCB_GROUP*>( m_group )->SetLocked( m_locked->GetValue() );
}
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_group->RemoveAll();
for( size_t ii = 0; ii < m_membersList->GetCount(); ++ii )
@ -122,7 +122,7 @@ bool DIALOG_GROUP_PROPERTIES::TransferDataFromWindow()
m_group->AddItem( item );
}
m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, m_group->AsEdaItem() );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, m_group->AsEdaItem() );
commit.Push( _( "Edit Group Properties" ) );
return true;

View File

@ -151,6 +151,48 @@ TOOL_ACTION ACTIONS::quit( TOOL_ACTION_ARGS()
.Tooltip( _( "Close the current editor" ) )
.Icon( BITMAPS::exit ) );
// Selection actions
TOOL_ACTION ACTIONS::selectionActivate( TOOL_ACTION_ARGS()
.Name( "common.InteractiveSelection" )
.Scope( AS_GLOBAL )
// No description, not shown anywhere
.Flags( AF_ACTIVATE ) );
TOOL_ACTION ACTIONS::selectionCursor( TOOL_ACTION_ARGS()
.Name( "common.InteractiveSelection.cursor" )
.Scope( AS_GLOBAL )
.Parameter<CLIENT_SELECTION_FILTER>( nullptr ) );
TOOL_ACTION ACTIONS::selectItem( TOOL_ACTION_ARGS()
.Name( "common.InteractiveSelection.selectItem" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION ACTIONS::selectItems( TOOL_ACTION_ARGS()
.Name( "common.InteractiveSelection.selectItems" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION ACTIONS::unselectItem( TOOL_ACTION_ARGS()
.Name( "common.InteractiveSelection.unselectItem" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION ACTIONS::unselectItems( TOOL_ACTION_ARGS()
.Name( "common.InteractiveSelection.unselectItems" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION ACTIONS::reselectItem( TOOL_ACTION_ARGS()
.Name( "common.InteractiveSelection.reselectItem" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION ACTIONS::selectionClear( TOOL_ACTION_ARGS()
.Name( "common.InteractiveSelection.clear" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION ACTIONS::selectionMenu( TOOL_ACTION_ARGS()
.Name( "common.InteractiveSelection.selectionMenu" )
.Scope( AS_GLOBAL ) );
// Group actions
TOOL_ACTION ACTIONS::group( TOOL_ACTION_ARGS()
.Name( "common.Interactive.group" )

View File

@ -121,7 +121,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aPa
RecreateToolbars();
// Run the control tool, it is supposed to be always active
m_toolManager->InvokeTool( "cvpcb.FootprintViewerInteractiveSelection" );
m_toolManager->InvokeTool( "common.InteractiveSelection" );
m_auimgr.SetManagedWindow( this );

View File

@ -34,13 +34,6 @@
#define _(s) s
// Selection tool action for the footprint viewer window
// No description, it is not supposed to be shown anywhere
TOOL_ACTION CVPCB_ACTIONS::selectionActivate( TOOL_ACTION_ARGS()
.Name( "cvpcb.FootprintViewerInteractiveSelection" )
.Scope( AS_GLOBAL )
.Flags( AF_ACTIVATE ) );
// No description, it is not supposed to be shown anywhere
TOOL_ACTION CVPCB_ACTIONS::controlActivate( TOOL_ACTION_ARGS()
.Name( "cvpcb.Control" )

View File

@ -38,7 +38,6 @@ class CVPCB_ACTIONS : public ACTIONS
{
public:
/// Activation actions
static TOOL_ACTION selectionActivate;
static TOOL_ACTION controlActivate;
/// Window control actions

View File

@ -27,7 +27,7 @@ using namespace std::placeholders;
CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL() :
TOOL_INTERACTIVE( "cvpcb.FootprintViewerInteractiveSelection" ),
TOOL_INTERACTIVE( "common.InteractiveSelection" ),
m_frame( nullptr )
{
}
@ -98,6 +98,5 @@ int CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::UpdateMenu( const TOOL_EVENT& aEvent
void CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::setTransitions()
{
Go( &CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::UpdateMenu, ACTIONS::updateMenu.MakeEvent() );
Go( &CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main,
CVPCB_ACTIONS::selectionActivate.MakeEvent() );
Go( &CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main, ACTIONS::selectionActivate.MakeEvent() );
}

View File

@ -292,7 +292,7 @@ void DIALOG_ERC::OnDeleteOneClick( wxCommandEvent& aEvent )
if( m_notebook->GetSelection() == 0 )
{
// Clear the selection. It may be the selected ERC marker.
m_parent->GetToolManager()->RunAction( SCH_ACTIONS::clearSelection );
m_parent->GetToolManager()->RunAction( ACTIONS::selectionClear );
m_markerTreeModel->DeleteCurrentItem( true );
@ -830,7 +830,7 @@ void DIALOG_ERC::OnERCItemRClick( wxDataViewEvent& aEvent )
// Clear the selection before deleting markers. It may be some selected ERC markers.
// Deleting a selected marker without deselecting it first generates a crash
m_parent->GetToolManager()->RunAction( SCH_ACTIONS::clearSelection );
m_parent->GetToolManager()->RunAction( ACTIONS::selectionClear );
SCH_SCREENS ScreenList( m_parent->Schematic().Root() );
ScreenList.DeleteMarkers( MARKER_BASE::MARKER_ERC, rcItem->GetErrorCode() );
@ -1010,7 +1010,7 @@ void DIALOG_ERC::deleteAllMarkers( bool aIncludeExclusions )
// Freeze to avoid repainting the dialog, which can cause a RePaint()
// of the screen as well
Freeze();
m_parent->GetToolManager()->RunAction( SCH_ACTIONS::clearSelection );
m_parent->GetToolManager()->RunAction( ACTIONS::selectionClear );
m_markerTreeModel->DeleteItems( false, aIncludeExclusions, false );

View File

@ -212,7 +212,7 @@ void SCH_EDIT_FRAME::FlipBodyStyle( SCH_SYMBOL* aSymbol )
// If selected make sure all the now-included pins are selected
if( aSymbol->IsSelected() )
m_toolManager->RunAction<EDA_ITEM*>( SCH_ACTIONS::addItemToSel, aSymbol );
m_toolManager->RunAction<EDA_ITEM*>( ACTIONS::selectItem, aSymbol );
commit.Push( _( "Change Body Style" ) );
}

View File

@ -553,7 +553,7 @@ void SCH_EDIT_FRAME::setupTools()
m_toolManager->InitTools();
// Run the selection tool, it is supposed to be always active
m_toolManager->PostAction( SCH_ACTIONS::selectionActivate );
m_toolManager->PostAction( ACTIONS::selectionActivate );
GetCanvas()->SetEventDispatcher( m_toolDispatcher );
}
@ -2233,7 +2233,7 @@ void SCH_EDIT_FRAME::UpdateNetHighlightStatus()
void SCH_EDIT_FRAME::SetScreen( BASE_SCREEN* aScreen )
{
if( m_toolManager )
m_toolManager->RunAction( SCH_ACTIONS::clearSelection );
m_toolManager->RunAction( ACTIONS::selectionClear );
SCH_BASE_FRAME::SetScreen( aScreen );
GetCanvas()->DisplaySheet( static_cast<SCH_SCREEN*>( aScreen ) );
@ -2420,12 +2420,12 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet()
wxCHECK( m_toolManager, /* void */ );
m_toolManager->RunAction( ACTIONS::cancelInteractive );
m_toolManager->RunAction( SCH_ACTIONS::clearSelection );
m_toolManager->RunAction( ACTIONS::selectionClear );
SCH_SCREEN* screen = GetCurrentSheet().LastScreen();
wxCHECK( screen, /* void */ );
m_toolManager->RunAction( SCH_ACTIONS::clearSelection );
m_toolManager->RunAction( ACTIONS::selectionClear );
SCH_BASE_FRAME::SetScreen( screen );

View File

@ -399,7 +399,7 @@ void SYMBOL_EDIT_FRAME::setupTools()
m_toolManager->InitTools();
// Run the selection tool, it is supposed to be always active
m_toolManager->InvokeTool( "eeschema.InteractiveSelection" );
m_toolManager->InvokeTool( "common.InteractiveSelection" );
GetCanvas()->SetEventDispatcher( m_toolDispatcher );
}
@ -857,7 +857,7 @@ void SYMBOL_EDIT_FRAME::SetCurSymbol( LIB_SYMBOL* aSymbol, bool aUpdateZoom )
{
wxCHECK( m_toolManager, /* void */ );
m_toolManager->RunAction( SCH_ACTIONS::clearSelection );
m_toolManager->RunAction( ACTIONS::selectionClear );
GetCanvas()->GetView()->Clear();
delete m_symbol;
@ -1052,7 +1052,7 @@ void SYMBOL_EDIT_FRAME::SetUnit( int aUnit )
return;
m_toolManager->RunAction( ACTIONS::cancelInteractive );
m_toolManager->RunAction( SCH_ACTIONS::clearSelection );
m_toolManager->RunAction( ACTIONS::selectionClear );
m_unit = aUnit;

View File

@ -339,7 +339,7 @@ void SYMBOL_VIEWER_FRAME::setupTools()
// Run the selection tool, it is supposed to be always active
// It also manages the mouse right click to show the context menu
m_toolManager->InvokeTool( "eeschema.InteractiveSelection" );
m_toolManager->InvokeTool( "common.InteractiveSelection" );
GetCanvas()->SetEventDispatcher( m_toolDispatcher );
}

View File

@ -68,7 +68,7 @@ void RULE_AREA_CREATE_HELPER::commitRuleArea( std::unique_ptr<SCH_RULE_AREA> aRu
commit.Add( ruleArea, m_frame->GetScreen() );
commit.Push( _( "Draw Rule Area" ) );
m_toolManager->RunAction<EDA_ITEM*>( SCH_ACTIONS::addItemToSel, ruleArea );
m_toolManager->RunAction<EDA_ITEM*>( ACTIONS::selectItem, ruleArea );
m_parentView.ClearPreview();
}
@ -80,7 +80,7 @@ bool RULE_AREA_CREATE_HELPER::OnFirstPoint( POLYGON_GEOM_MANAGER& aMgr )
if( m_rule_area )
{
m_toolManager->RunAction( SCH_ACTIONS::clearSelection );
m_toolManager->RunAction( ACTIONS::selectionClear );
SCH_RENDER_SETTINGS renderSettings;
COLOR_SETTINGS* colorSettings = m_frame->GetColorSettings();

View File

@ -94,11 +94,6 @@ TOOL_ACTION SCH_ACTIONS::pointEditorRemoveCorner( TOOL_ACTION_ARGS()
// SCH_SELECTION_TOOL
//
TOOL_ACTION SCH_ACTIONS::selectionActivate( TOOL_ACTION_ARGS()
.Name( "eeschema.InteractiveSelection" )
.Scope( AS_GLOBAL )
.Flags( AF_ACTIVATE ) );
TOOL_ACTION SCH_ACTIONS::selectNode( TOOL_ACTION_ARGS()
.Name( "eeschema.InteractiveSelection.SelectNode" )
.Scope( AS_GLOBAL )
@ -116,30 +111,6 @@ TOOL_ACTION SCH_ACTIONS::selectConnection( TOOL_ACTION_ARGS()
.Tooltip( _( "Select a complete connection" ) )
.Icon( BITMAPS::net_highlight_schematic ) );
TOOL_ACTION SCH_ACTIONS::selectionMenu( TOOL_ACTION_ARGS()
.Name( "eeschema.InteractiveSelection.SelectionMenu" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION SCH_ACTIONS::addItemToSel( TOOL_ACTION_ARGS()
.Name( "eeschema.InteractiveSelection.AddItemToSel" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION SCH_ACTIONS::addItemsToSel( TOOL_ACTION_ARGS()
.Name( "eeschema.InteractiveSelection.AddItemsToSel" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION SCH_ACTIONS::removeItemFromSel( TOOL_ACTION_ARGS()
.Name( "eeschema.InteractiveSelection.RemoveItemFromSel" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION SCH_ACTIONS::removeItemsFromSel( TOOL_ACTION_ARGS()
.Name( "eeschema.InteractiveSelection.RemoveItemsFromSel" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION SCH_ACTIONS::clearSelection( TOOL_ACTION_ARGS()
.Name( "eeschema.InteractiveSelection.ClearSelection" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION SCH_ACTIONS::syncSelection( TOOL_ACTION_ARGS()
.Name( "eeschema.InteractiveSelection.SyncSelection" )
.Scope( AS_GLOBAL ) );

View File

@ -43,9 +43,6 @@ public:
static TOOL_ACTION saveCurrSheetCopyAs;
// Selection Tool
/// Activation of the selection tool
static TOOL_ACTION selectionActivate;
/// Select the junction, wire or bus segment under the cursor.
static TOOL_ACTION selectNode;
@ -53,17 +50,6 @@ public:
/// Otherwise, select connection under cursor.
static TOOL_ACTION selectConnection;
/// Clears the current selection
static TOOL_ACTION clearSelection;
/// Selects an item (specified as the event parameter).
static TOOL_ACTION addItemToSel;
static TOOL_ACTION removeItemFromSel;
/// Selects a list of items (specified as the event parameter)
static TOOL_ACTION addItemsToSel;
static TOOL_ACTION removeItemsFromSel;
/// Runs a selection menu to select from a list of items
static TOOL_ACTION selectionMenu;

View File

@ -187,7 +187,7 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
auto addSymbol =
[this]( SCH_SYMBOL* aSymbol )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_selectionTool->AddItemToSel( aSymbol );
aSymbol->SetFlags( IS_NEW | IS_MOVING );
@ -210,7 +210,7 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
auto cleanup =
[&]()
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_view->ClearPreview();
delete symbol;
symbol = nullptr;
@ -337,7 +337,7 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
{
if( !symbol )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
SYMBOL_LIB_TABLE* libs = PROJECT_SCH::SchSymbolLibTable( &m_frame->Prj() );
SYMBOL_LIB* cache = PROJECT_SCH::SchLibs( &m_frame->Prj() )->GetCacheLibrary();
@ -840,7 +840,7 @@ int SCH_DRAWING_TOOLS::ImportSheet( const TOOL_EVENT& aEvent )
while( placeSheetContents() && cfg->m_DesignBlockChooserPanel.repeated_placement )
;
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_view->ClearPreview();
delete designBlock;
designBlock = nullptr;
@ -941,7 +941,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent )
KIGFX::VIEW_CONTROLS* controls = getViewControls();
VECTOR2I cursorPos;
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
// Add all the drawable symbols to preview
if( image )
@ -965,7 +965,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent )
auto cleanup =
[&] ()
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_view->ClearPreview();
m_view->RecacheAllItems();
delete image;
@ -1060,7 +1060,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent )
{
if( !image )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
wxFileDialog dlg( m_frame, _( "Choose Image" ), m_mruPath, wxEmptyString,
_( "Image Files" ) + wxS( " " ) + wxImage::GetImageExtWildcard(),
@ -1242,10 +1242,10 @@ int SCH_DRAWING_TOOLS::ImportGraphics( const TOOL_EVENT& aEvent )
m_view->Add( &preview );
// Clear the current selection then select the drawings so that edit tools work on them
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
EDA_ITEMS selItems( selectedItems.begin(), selectedItems.end() );
m_toolMgr->RunAction<EDA_ITEMS*>( SCH_ACTIONS::addItemsToSel, &selItems );
m_toolMgr->RunAction<EDA_ITEMS*>( ACTIONS::selectItems, &selItems );
m_frame->PushTool( aEvent );
@ -1289,7 +1289,7 @@ int SCH_DRAWING_TOOLS::ImportGraphics( const TOOL_EVENT& aEvent )
if( evt->IsCancelInteractive() || evt->IsActivate() )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
for( SCH_ITEM* item : newItems )
delete item;
@ -1396,7 +1396,7 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent )
return 0;
}
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
cursorPos = aEvent.HasPosition() ? aEvent.Position() : controls->GetMousePosition();
@ -1821,7 +1821,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
if( isSheetPin )
sheet = dynamic_cast<SCH_SHEET*>( m_selectionTool->GetSelection().Front() );
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_frame->PushTool( aEvent );
@ -1860,7 +1860,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
auto cleanup =
[&]()
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_view->ClearPreview();
delete item;
item = nullptr;
@ -1973,7 +1973,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
// First click creates...
if( !item )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
if( isText )
{
@ -2137,7 +2137,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
}
m_frame->PopTool( aEvent );
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_dialogSyncSheetPin->Show( true );
break;
}
@ -2278,7 +2278,7 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
// gets whacked.
m_toolMgr->DeactivateTool();
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_frame->PushTool( aEvent );
@ -2291,7 +2291,7 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
auto cleanup =
[&] ()
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_view->ClearPreview();
delete item;
item = nullptr;
@ -2363,7 +2363,7 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
}
else if( evt->IsClick( BUT_LEFT ) && !item )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
if( isTextBox )
{
@ -2532,7 +2532,7 @@ int SCH_DRAWING_TOOLS::DrawRuleArea( const TOOL_EVENT& aEvent )
// gets whacked.
m_toolMgr->DeactivateTool();
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_frame->PushTool( aEvent );
@ -2548,7 +2548,7 @@ int SCH_DRAWING_TOOLS::DrawRuleArea( const TOOL_EVENT& aEvent )
started = false;
getViewControls()->SetAutoPan( false );
getViewControls()->CaptureCursor( false );
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
};
Activate();
@ -2703,7 +2703,7 @@ int SCH_DRAWING_TOOLS::DrawTable( const TOOL_EVENT& aEvent )
// gets whacked.
m_toolMgr->DeactivateTool();
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_frame->PushTool( aEvent );
@ -2716,7 +2716,7 @@ int SCH_DRAWING_TOOLS::DrawTable( const TOOL_EVENT& aEvent )
auto cleanup =
[&] ()
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_view->ClearPreview();
delete table;
table = nullptr;
@ -2790,7 +2790,7 @@ int SCH_DRAWING_TOOLS::DrawTable( const TOOL_EVENT& aEvent )
}
else if( evt->IsClick( BUT_LEFT ) && !table )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
table = new SCH_TABLE( 0 );
table->SetColCount( 1 );
@ -2954,7 +2954,7 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent )
EE_GRID_HELPER grid( m_toolMgr );
VECTOR2I cursorPos;
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_frame->PushTool( aEvent );
@ -2967,7 +2967,7 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent )
auto cleanup =
[&] ()
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_view->ClearPreview();
delete sheet;
sheet = nullptr;
@ -3064,7 +3064,7 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent )
}
}
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
sheet = new SCH_SHEET( m_frame->GetCurrentSheet().Last(), cursorPos );
sheet->SetScreen( nullptr );
@ -3361,12 +3361,12 @@ int SCH_DRAWING_TOOLS::AutoPlaceAllSheetPins( const TOOL_EVENT& aEvent )
m_statusPopup->Move( KIPLATFORM::UI::GetMousePosition() + wxPoint( 20, 20 ) );
m_statusPopup->PopupFor( 2000 );
m_frame->PopTool( aEvent );
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_view->ClearPreview();
return 0;
}
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
SCH_COMMIT commit( m_toolMgr );
BOX2I boundingBox = sheet->GetBoundingBox();

View File

@ -75,7 +75,7 @@ int SCH_EDIT_TABLE_TOOL::EditTable( const TOOL_EVENT& aEvent )
}
if( clearSelection )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
return 0;
}

View File

@ -65,7 +65,7 @@ private:
BASE_SCREEN* getScreen() override { return m_frame->GetScreen(); }
const SELECTION& getTableCellSelection() override;
void clearSelection() override { m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); };
void clearSelection() override { m_toolMgr->RunAction( ACTIONS::selectionClear ); };
SCH_TABLECELL* copyCell( SCH_TABLECELL* aSource ) override;
};

View File

@ -1041,7 +1041,7 @@ int SCH_EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent )
SCH_SELECTION selectionCopy = selection;
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
SCH_LINE_WIRE_BUS_TOOL* lwbTool = m_toolMgr->GetTool<SCH_LINE_WIRE_BUS_TOOL>();
lwbTool->TrimOverLappingWires( commit, &selectionCopy );
@ -1236,7 +1236,7 @@ int SCH_EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent )
SCH_SELECTION selectionCopy = selection;
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
if( connections )
{
@ -1475,7 +1475,7 @@ int SCH_EDIT_TOOL::Swap( const TOOL_EVENT& aEvent )
else
{
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
if( connections )
m_frame->TestDanglingEnds();
@ -1494,7 +1494,7 @@ int SCH_EDIT_TOOL::RepeatDrawItem( const TOOL_EVENT& aEvent )
if( sourceItems.empty() )
return 0;
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
SCH_COMMIT commit( m_toolMgr );
SCH_SELECTION newItems;
@ -1554,7 +1554,7 @@ int SCH_EDIT_TOOL::RepeatDrawItem( const TOOL_EVENT& aEvent )
}
}
m_toolMgr->RunAction<EDA_ITEM*>( SCH_ACTIONS::addItemToSel, newItem );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, newItem );
newItem->SetFlags( IS_NEW );
m_frame->AddToScreen( newItem, m_frame->GetScreen() );
commit.Added( newItem, m_frame->GetScreen() );
@ -1576,7 +1576,7 @@ int SCH_EDIT_TOOL::RepeatDrawItem( const TOOL_EVENT& aEvent )
}
// Annotation clears the selection so re-add the item
m_toolMgr->RunAction<EDA_ITEM*>( SCH_ACTIONS::addItemToSel, newItem );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, newItem );
restore_state = !m_toolMgr->RunSynchronousAction( SCH_ACTIONS::move, &commit );
}
@ -1647,7 +1647,7 @@ int SCH_EDIT_TOOL::DoDelete( const TOOL_EVENT& aEvent )
return 0;
// Don't leave a freed pointer in the selection
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
for( EDA_ITEM* item : items )
item->ClearFlags( STRUCT_DELETED );
@ -1733,7 +1733,7 @@ int SCH_EDIT_TOOL::InteractiveDelete( const TOOL_EVENT& aEvent )
{
PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>();
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_pickerItem = nullptr;
// Deactivate other tools; particularly important if another PICKER is currently running
@ -1788,7 +1788,7 @@ int SCH_EDIT_TOOL::InteractiveDelete( const TOOL_EVENT& aEvent )
m_toolMgr->GetTool<SCH_SELECTION_TOOL>()->UnbrightenItem( m_pickerItem );
// Wake the selection tool after exiting to ensure the cursor gets updated
m_toolMgr->PostAction( SCH_ACTIONS::selectionActivate );
m_toolMgr->PostAction( ACTIONS::selectionActivate );
} );
m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent );
@ -1920,7 +1920,7 @@ int SCH_EDIT_TOOL::EditField( const TOOL_EVENT& aEvent )
}
if( clearSelection )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
return 0;
}
@ -1968,7 +1968,7 @@ int SCH_EDIT_TOOL::AutoplaceFields( const TOOL_EVENT& aEvent )
commit.Push( _( "Autoplace Fields" ) );
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
}
return 0;
@ -1997,7 +1997,7 @@ int SCH_EDIT_TOOL::ChangeSymbols( const TOOL_EVENT& aEvent )
dlg.ShowQuasiModal();
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
return 0;
}
@ -2038,7 +2038,7 @@ int SCH_EDIT_TOOL::ChangeBodyStyle( const TOOL_EVENT& aEvent )
commit.Push( _( "Change Body Style" ) );
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
return 0;
}
@ -2409,7 +2409,7 @@ int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
updateItem( curr_item, true );
if( clearSelection )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
return 0;
}
@ -2755,7 +2755,7 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent )
}
if( selected )
m_toolMgr->RunAction<EDA_ITEM*>( SCH_ACTIONS::removeItemFromSel, item );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::unselectItem, item );
if( !item->IsNew() )
{
@ -2767,7 +2767,7 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent )
}
if( selected )
m_toolMgr->RunAction<EDA_ITEM*>( SCH_ACTIONS::addItemToSel, newtext );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, newtext );
// Otherwise, pointer is owned by the undo stack
if( item->IsNew() )
@ -2779,7 +2779,7 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent )
commit.Push( _( "Change To" ) );
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
return 0;
}
@ -2864,7 +2864,7 @@ int SCH_EDIT_TOOL::JustifyText( const TOOL_EVENT& aEvent )
SCH_SELECTION selectionCopy = selection;
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
if( !localCommit.Empty() )
{
@ -2942,7 +2942,7 @@ int SCH_EDIT_TOOL::BreakWire( const TOOL_EVENT& aEvent )
}
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
return 0;
}
@ -2969,7 +2969,7 @@ int SCH_EDIT_TOOL::CleanupSheetPins( const TOOL_EVENT& aEvent )
commit.Push( _( "Cleanup Sheet Pins" ) );
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
return 0;
}
@ -3043,7 +3043,7 @@ int SCH_EDIT_TOOL::EditPageNumber( const TOOL_EVENT& aEvent )
commit.Push( wxS( "Change Sheet Page Number" ) );
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
return 0;
}
@ -3128,7 +3128,7 @@ int SCH_EDIT_TOOL::Increment( const TOOL_EVENT& aEvent )
commit->Push( _( "Increment" ) );
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
return 0;
}
@ -3218,7 +3218,7 @@ int SCH_EDIT_TOOL::SetAttribute( const TOOL_EVENT& aEvent )
commit.Push( _( "Toggle Attribute" ) );
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
return 0;
}

View File

@ -699,7 +699,7 @@ int SCH_EDITOR_CONTROL::SimProbe( const TOOL_EVENT& aEvent )
// ( avoid crash in some cases when the SimProbe tool is deselected )
SCH_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<SCH_SELECTION_TOOL>();
selectionTool->ClearSelection();
m_toolMgr->PostAction( SCH_ACTIONS::selectionActivate );
m_toolMgr->PostAction( ACTIONS::selectionActivate );
} );
m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent );
@ -792,7 +792,7 @@ int SCH_EDITOR_CONTROL::SimTune( const TOOL_EVENT& aEvent )
// ( avoid crash in some cases when the SimTune tool is deselected )
SCH_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<SCH_SELECTION_TOOL>();
selectionTool->ClearSelection();
m_toolMgr->PostAction( SCH_ACTIONS::selectionActivate );
m_toolMgr->PostAction( ACTIONS::selectionActivate );
} );
m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent );
@ -1369,7 +1369,7 @@ bool SCH_EDITOR_CONTROL::doCopy( bool aUseDuplicateClipboard )
KICAD_FORMAT::Prettify( prettyData, true );
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
if( aUseDuplicateClipboard )
{
@ -1447,7 +1447,7 @@ int SCH_EDITOR_CONTROL::CopyAsText( const TOOL_EVENT& aEvent )
wxString itemsAsText = GetSelectedItemsAsText( selection );
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
return SaveClipboard( itemsAsText.ToStdString() );
}
@ -2171,8 +2171,8 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
allScreens.PruneOrphanedSheetInstances( m_frame->Prj().GetProjectName(), sheets );
// Now clear the previous selection, select the pasted items, and fire up the "move" tool.
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction<EDA_ITEMS*>( SCH_ACTIONS::addItemsToSel, &loadedItems );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_toolMgr->RunAction<EDA_ITEMS*>( ACTIONS::selectItems, &loadedItems );
SCH_SELECTION& selection = selTool->GetSelection();
@ -2307,7 +2307,7 @@ int SCH_EDITOR_CONTROL::EditWithSymbolEditor( const TOOL_EVENT& aEvent )
symbol = (SCH_SYMBOL*) selection.Front();
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
if( !symbol )
{

View File

@ -292,7 +292,7 @@ int SCH_LINE_WIRE_BUS_TOOL::DrawSegments( const TOOL_EVENT& aEvent )
const DRAW_SEGMENT_EVENT_PARAMS* params = aEvent.Parameter<const DRAW_SEGMENT_EVENT_PARAMS*>();
m_frame->PushTool( aEvent );
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
if( aEvent.HasPosition() )
{
@ -411,7 +411,7 @@ SCH_LINE* SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus( const wxString& aN
// it might not be, but it won't be a broken connection (and the user asked for it!)
pos = bus->GetSeg().NearestPoint( pos );
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_busUnfold.entry = new SCH_BUS_WIRE_ENTRY( pos );
m_busUnfold.entry->SetParent( screen );
@ -626,7 +626,7 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const TOOL_EVENT& aTool, int aType,
auto cleanup =
[&] ()
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
for( SCH_LINE* wire : m_wires )
delete wire;
@ -1169,7 +1169,7 @@ void SCH_LINE_WIRE_BUS_TOOL::finishSegments()
// Clear selection when done so that a new wire can be started.
// NOTE: this must be done before simplifyWireList is called or we might end up with
// freed selected items.
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
SCH_SCREEN* screen = m_frame->GetScreen();
SCH_COMMIT commit( m_toolMgr );

View File

@ -1014,7 +1014,7 @@ bool SCH_MOVE_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, SCH_COMMIT* aComm
item->ClearEditFlags();
if( unselect )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
else
m_selectionTool->RebuildSelection(); // Schematic cleanup might have merged lines, etc.

View File

@ -125,7 +125,7 @@ int SCH_NAVIGATE_TOOL::Forward( const TOOL_EVENT& aEvent )
m_navIndex++;
m_frame->GetToolManager()->RunAction( ACTIONS::cancelInteractive );
m_frame->GetToolManager()->RunAction( SCH_ACTIONS::clearSelection );
m_frame->GetToolManager()->RunAction( ACTIONS::selectionClear );
m_frame->SetCurrentSheet( *m_navIndex );
m_frame->DisplayCurrentSheet();
@ -146,7 +146,7 @@ int SCH_NAVIGATE_TOOL::Back( const TOOL_EVENT& aEvent )
m_navIndex--;
m_frame->GetToolManager()->RunAction( ACTIONS::cancelInteractive );
m_frame->GetToolManager()->RunAction( SCH_ACTIONS::clearSelection );
m_frame->GetToolManager()->RunAction( ACTIONS::selectionClear );
m_frame->SetCurrentSheet( *m_navIndex );
m_frame->DisplayCurrentSheet();
@ -299,7 +299,7 @@ void SCH_NAVIGATE_TOOL::pushToHistory( SCH_SHEET_PATH aPath )
void SCH_NAVIGATE_TOOL::changeSheet( SCH_SHEET_PATH aPath )
{
m_frame->GetToolManager()->RunAction( ACTIONS::cancelInteractive );
m_frame->GetToolManager()->RunAction( SCH_ACTIONS::clearSelection );
m_frame->GetToolManager()->RunAction( ACTIONS::selectionClear );
// Store the current zoom level into the current screen before switching
m_frame->GetScreen()->m_LastZoomLevel = m_frame->GetCanvas()->GetView()->GetScale();

View File

@ -152,7 +152,7 @@ SELECTION_CONDITION SCH_CONDITIONS::AllPinsOrSheetPins = []( const SELECTION& aS
SCH_SELECTION_TOOL::SCH_SELECTION_TOOL() :
SELECTION_TOOL( "eeschema.InteractiveSelection" ),
SELECTION_TOOL( "common.InteractiveSelection" ),
m_frame( nullptr ),
m_nonModifiedCursor( KICURSOR::ARROW ),
m_isSymbolEditor( false ),
@ -1301,7 +1301,7 @@ bool SCH_SELECTION_TOOL::selectPoint( SCH_COLLECTOR& aCollector, const VECTOR2I&
// 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<COLLECTOR*>( SCH_ACTIONS::selectionMenu, &aCollector ) )
if( !m_toolMgr->RunAction<COLLECTOR*>( ACTIONS::selectionMenu, &aCollector ) )
{
if( !doSelectionMenu( &aCollector ) )
aCollector.m_MenuCancelled = true;
@ -2918,23 +2918,23 @@ void SCH_SELECTION_TOOL::setTransitions()
{
Go( &SCH_SELECTION_TOOL::UpdateMenu, ACTIONS::updateMenu.MakeEvent() );
Go( &SCH_SELECTION_TOOL::Main, SCH_ACTIONS::selectionActivate.MakeEvent() );
Go( &SCH_SELECTION_TOOL::Main, ACTIONS::selectionActivate.MakeEvent() );
Go( &SCH_SELECTION_TOOL::SelectNode, SCH_ACTIONS::selectNode.MakeEvent() );
Go( &SCH_SELECTION_TOOL::SelectConnection, SCH_ACTIONS::selectConnection.MakeEvent() );
Go( &SCH_SELECTION_TOOL::SelectColumns, ACTIONS::selectColumns.MakeEvent() );
Go( &SCH_SELECTION_TOOL::SelectRows, ACTIONS::selectRows.MakeEvent() );
Go( &SCH_SELECTION_TOOL::SelectTable, ACTIONS::selectTable.MakeEvent() );
Go( &SCH_SELECTION_TOOL::ClearSelection, SCH_ACTIONS::clearSelection.MakeEvent() );
Go( &SCH_SELECTION_TOOL::ClearSelection, ACTIONS::selectionClear.MakeEvent() );
Go( &SCH_SELECTION_TOOL::AddItemToSel, SCH_ACTIONS::addItemToSel.MakeEvent() );
Go( &SCH_SELECTION_TOOL::AddItemsToSel, SCH_ACTIONS::addItemsToSel.MakeEvent() );
Go( &SCH_SELECTION_TOOL::RemoveItemFromSel, SCH_ACTIONS::removeItemFromSel.MakeEvent() );
Go( &SCH_SELECTION_TOOL::RemoveItemsFromSel, SCH_ACTIONS::removeItemsFromSel.MakeEvent() );
Go( &SCH_SELECTION_TOOL::SelectionMenu, SCH_ACTIONS::selectionMenu.MakeEvent() );
Go( &SCH_SELECTION_TOOL::AddItemToSel, ACTIONS::selectItem.MakeEvent() );
Go( &SCH_SELECTION_TOOL::AddItemsToSel, ACTIONS::selectItems.MakeEvent() );
Go( &SCH_SELECTION_TOOL::RemoveItemFromSel, ACTIONS::unselectItem.MakeEvent() );
Go( &SCH_SELECTION_TOOL::RemoveItemsFromSel, ACTIONS::unselectItems.MakeEvent() );
Go( &SCH_SELECTION_TOOL::SelectionMenu, ACTIONS::selectionMenu.MakeEvent() );
Go( &SCH_SELECTION_TOOL::SelectAll, SCH_ACTIONS::selectAll.MakeEvent() );
Go( &SCH_SELECTION_TOOL::UnselectAll, SCH_ACTIONS::unselectAll.MakeEvent() );
Go( &SCH_SELECTION_TOOL::SelectAll, ACTIONS::selectAll.MakeEvent() );
Go( &SCH_SELECTION_TOOL::UnselectAll, ACTIONS::unselectAll.MakeEvent() );
Go( &SCH_SELECTION_TOOL::SelectNext, SCH_ACTIONS::nextNetItem.MakeEvent() );
Go( &SCH_SELECTION_TOOL::SelectPrevious, SCH_ACTIONS::previousNetItem.MakeEvent() );

View File

@ -573,7 +573,7 @@ int SYMBOL_EDITOR_CONTROL::OnDeMorgan( const TOOL_EVENT& aEvent )
if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) )
{
m_toolMgr->RunAction( ACTIONS::cancelInteractive );
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
SYMBOL_EDIT_FRAME* symbolEditor = static_cast<SYMBOL_EDIT_FRAME*>( m_frame );
symbolEditor->SetBodyStyle( bodyStyle );

View File

@ -101,7 +101,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
bool isText = aEvent.IsAction( &SCH_ACTIONS::placeSymbolText );
COMMON_SETTINGS* common_settings = Pgm().GetCommonSettings();
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_frame->PushTool( aEvent );
@ -119,7 +119,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
auto cleanup =
[&] ()
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_view->ClearPreview();
delete item;
item = nullptr;
@ -211,7 +211,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
// First click creates...
if( !item )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
switch( type )
{
@ -385,7 +385,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::doDrawShape( const TOOL_EVENT& aEvent, std::opt
// gets whacked.
m_toolMgr->DeactivateTool();
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_frame->PushTool( aEvent );
@ -398,7 +398,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::doDrawShape( const TOOL_EVENT& aEvent, std::opt
auto cleanup =
[&] ()
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_view->ClearPreview();
delete item;
item = nullptr;
@ -467,7 +467,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::doDrawShape( const TOOL_EVENT& aEvent, std::opt
if( !symbol )
continue;
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
int lineWidth = schIUScale.MilsToIU( cfg->m_Defaults.line_width );
@ -732,10 +732,10 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::ImportGraphics( const TOOL_EVENT& aEvent )
m_view->Add( &preview );
// Clear the current selection then select the drawings so that edit tools work on them
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
EDA_ITEMS selItems( selectedItems.begin(), selectedItems.end() );
m_toolMgr->RunAction<EDA_ITEMS*>( SCH_ACTIONS::addItemsToSel, &selItems );
m_toolMgr->RunAction<EDA_ITEMS*>( ACTIONS::selectItems, &selItems );
m_frame->PushTool( aEvent );
@ -779,7 +779,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::ImportGraphics( const TOOL_EVENT& aEvent )
if( evt->IsCancelInteractive() || evt->IsActivate() )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
for( SCH_ITEM* item : newItems )
delete item;
@ -860,10 +860,10 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::RepeatDrawItem( const TOOL_EVENT& aEvent )
if( pin )
g_lastPin = pin->m_Uuid;
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
if( pin )
m_toolMgr->RunAction<EDA_ITEM*>( SCH_ACTIONS::addItemToSel, pin );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, pin );
}
return 0;

View File

@ -204,7 +204,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent )
else
{
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
if( !localCommit.Empty() )
localCommit.Push( _( "Rotate" ) );
@ -282,7 +282,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent )
else
{
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_frame->OnModify();
}
@ -364,7 +364,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::Swap( const TOOL_EVENT& aEvent )
else
{
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_frame->OnModify();
}
@ -393,7 +393,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::DoDelete( const TOOL_EVENT& aEvent )
return 0;
// Don't leave a freed pointer in the selection
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
commit.Modify( symbol, m_frame->GetScreen() );
@ -490,7 +490,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::InteractiveDelete( const TOOL_EVENT& aEvent )
{
PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>();
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_pickerItem = nullptr;
// Deactivate other tools; particularly important if another PICKER is currently running
@ -552,7 +552,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::InteractiveDelete( const TOOL_EVENT& aEvent )
m_toolMgr->GetTool<SCH_SELECTION_TOOL>()->UnbrightenItem( m_pickerItem );
// Wake the selection tool after exiting to ensure the cursor gets updated
m_toolMgr->PostAction( SCH_ACTIONS::selectionActivate );
m_toolMgr->PostAction( ACTIONS::selectionActivate );
} );
m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent );
@ -622,7 +622,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
}
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
return 0;
}
@ -721,7 +721,7 @@ void SYMBOL_EDITOR_EDIT_TOOL::editSymbolProperties()
bool partLocked = symbol->UnitsLocked();
m_toolMgr->RunAction( ACTIONS::cancelInteractive );
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
DIALOG_LIB_SYMBOL_PROPERTIES dlg( m_frame, symbol );
@ -772,7 +772,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::PinTable( const TOOL_EVENT& aEvent )
commit.Modify( symbol );
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
DIALOG_LIB_EDIT_PIN_TABLE dlg( m_frame, symbol );
@ -943,7 +943,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::CopyAsText( const TOOL_EVENT& aEvent )
wxString itemsAsText = GetSelectedItemsAsText( selection );
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
return SaveClipboard( itemsAsText.ToStdString() );
}
@ -1094,8 +1094,8 @@ int SYMBOL_EDITOR_EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
getView()->Add( newItem );
}
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction<EDA_ITEMS*>( SCH_ACTIONS::addItemsToSel, &newItems );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_toolMgr->RunAction<EDA_ITEMS*>( ACTIONS::selectItems, &newItems );
selection.SetReferencePoint( getViewControls()->GetCursorPosition( true ) );

View File

@ -368,7 +368,7 @@ bool SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, SCH_COM
item->ClearEditFlags();
if( unselect )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_moveInProgress = false;
m_frame->PopTool( aEvent );

View File

@ -104,7 +104,7 @@ void SCH_SEARCH_HANDLER::SelectItems( std::vector<long>& aItemRows )
EDA_ITEMS selectedItems;
std::vector<SCH_SEARCH_HIT> selectedHits;
m_frame->GetToolManager()->RunAction( SCH_ACTIONS::clearSelection );
m_frame->GetToolManager()->RunAction( ACTIONS::selectionClear );
for( long row : aItemRows )
{
@ -134,7 +134,7 @@ void SCH_SEARCH_HANDLER::SelectItems( std::vector<long>& aItemRows )
m_frame->GetToolManager()->RunAction<SCH_SHEET_PATH*>( SCH_ACTIONS::changeSheet, sheet );
if( selectedItems.size() )
m_frame->GetToolManager()->RunAction<EDA_ITEMS*>( SCH_ACTIONS::addItemsToSel, &selectedItems );
m_frame->GetToolManager()->RunAction<EDA_ITEMS*>( ACTIONS::selectItems, &selectedItems );
switch( settings.selection_zoom )
{

View File

@ -307,7 +307,7 @@ void DIALOG_PRINT_GERBVIEW::saveSettings()
int GERBVIEW_CONTROL::Print( const TOOL_EVENT& aEvent )
{
// Selection affects the original item visibility
m_toolMgr->RunAction( GERBVIEW_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
BOARD_PRINTOUT_SETTINGS settings( m_frame->GetPageSettings() );
settings.m_colorSettings = m_frame->GetColorSettings();

View File

@ -1110,7 +1110,7 @@ void GERBVIEW_FRAME::setupTools()
m_toolManager->InitTools();
// Run the selection tool, it is supposed to be always active
m_toolManager->InvokeTool( "gerbview.InteractiveSelection" );
m_toolManager->InvokeTool( "common.InteractiveSelection" );
}

View File

@ -253,26 +253,6 @@ TOOL_ACTION GERBVIEW_ACTIONS::flipGerberView( TOOL_ACTION_ARGS()
.Icon( BITMAPS::flip_board ) );
// GERBVIEW_SELECTION_TOOL
//
TOOL_ACTION GERBVIEW_ACTIONS::selectionActivate( TOOL_ACTION_ARGS()
.Name( "gerbview.InteractiveSelection" )
.Scope( AS_GLOBAL )
.Flags( AF_ACTIVATE ) );
TOOL_ACTION GERBVIEW_ACTIONS::selectItem( TOOL_ACTION_ARGS()
.Name( "gerbview.InteractiveSelection.SelectItem" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION GERBVIEW_ACTIONS::unselectItem( TOOL_ACTION_ARGS()
.Name( "gerbview.InteractiveSelection.UnselectItem" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION GERBVIEW_ACTIONS::selectionClear( TOOL_ACTION_ARGS()
.Name( "gerbview.InteractiveSelection.Clear" )
.Scope( AS_GLOBAL ) );
// Drag and drop
//
TOOL_ACTION GERBVIEW_ACTIONS::loadZipFile( TOOL_ACTION_ARGS()

View File

@ -34,22 +34,6 @@ class TOOL_MANAGER;
class GERBVIEW_ACTIONS : public ACTIONS
{
public:
// Selection Tool
/// Activation of the selection tool
static TOOL_ACTION selectionActivate;
/// Select a single item under the cursor position
static TOOL_ACTION selectionCursor;
/// Clear the current selection
static TOOL_ACTION selectionClear;
/// Selects an item (specified as the event parameter).
static TOOL_ACTION selectItem;
/// Unselects an item (specified as the event parameter).
static TOOL_ACTION unselectItem;
/// Activation of the edit tool
static TOOL_ACTION properties;
static TOOL_ACTION showDCodes;

View File

@ -111,7 +111,7 @@ private:
GERBVIEW_SELECTION_TOOL::GERBVIEW_SELECTION_TOOL() :
SELECTION_TOOL( "gerbview.InteractiveSelection" ),
SELECTION_TOOL( "common.InteractiveSelection" ),
m_frame( nullptr )
{
}
@ -269,10 +269,10 @@ bool GERBVIEW_SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere )
void GERBVIEW_SELECTION_TOOL::setTransitions()
{
Go( &GERBVIEW_SELECTION_TOOL::UpdateMenu, ACTIONS::updateMenu.MakeEvent() );
Go( &GERBVIEW_SELECTION_TOOL::Main, GERBVIEW_ACTIONS::selectionActivate.MakeEvent() );
Go( &GERBVIEW_SELECTION_TOOL::ClearSelection, GERBVIEW_ACTIONS::selectionClear.MakeEvent() );
Go( &GERBVIEW_SELECTION_TOOL::SelectItem, GERBVIEW_ACTIONS::selectItem.MakeEvent() );
Go( &GERBVIEW_SELECTION_TOOL::UnselectItem, GERBVIEW_ACTIONS::unselectItem.MakeEvent() );
Go( &GERBVIEW_SELECTION_TOOL::Main, ACTIONS::selectionActivate.MakeEvent() );
Go( &GERBVIEW_SELECTION_TOOL::ClearSelection, ACTIONS::selectionClear.MakeEvent() );
Go( &GERBVIEW_SELECTION_TOOL::SelectItem, ACTIONS::selectItem.MakeEvent() );
Go( &GERBVIEW_SELECTION_TOOL::UnselectItem, ACTIONS::unselectItem.MakeEvent() );
}

View File

@ -31,6 +31,13 @@
#define LEGACY_HK_NAME( x ) x
class PCB_SELECTION_TOOL;
class GENERAL_COLLECTOR;
using CLIENT_SELECTION_FILTER =
std::function<void( const VECTOR2I&, GENERAL_COLLECTOR&, PCB_SELECTION_TOOL* )>;
/**
* Gather all the actions that are shared by tools.
*
@ -202,6 +209,28 @@ public:
static TOOL_ACTION togglePolarCoords;
static TOOL_ACTION resetLocalCoords;
// Selection
/// Activation of the selection tool
static TOOL_ACTION selectionActivate;
/// Select a single item under the cursor position
static TOOL_ACTION selectionCursor;
/// Clear the current selection
static TOOL_ACTION selectionClear;
/// Select an item (specified as the event parameter).
static TOOL_ACTION selectItem;
static TOOL_ACTION unselectItem;
static TOOL_ACTION reselectItem;
/// Select a list of items (specified as the event parameter)
static TOOL_ACTION selectItems;
static TOOL_ACTION unselectItems;
/// Run a selection menu to select from a list of items
static TOOL_ACTION selectionMenu;
// Grouping
static TOOL_ACTION group;
static TOOL_ACTION ungroup;

View File

@ -281,7 +281,7 @@ void PL_EDITOR_FRAME::setupTools()
m_toolManager->InitTools();
// Run the selection tool, it is supposed to be always active
m_toolManager->InvokeTool( "plEditor.InteractiveSelection" );
m_toolManager->InvokeTool( "common.InteractiveSelection" );
}

View File

@ -127,37 +127,3 @@ TOOL_ACTION PL_ACTIONS::layoutEditMode( TOOL_ACTION_ARGS()
.Tooltip( _( "Text placeholders are shown as ${keyword} tokens" ) )
.ToolbarState( TOOLBAR_STATE::TOGGLE )
.Icon( BITMAPS::pagelayout_special_view_mode ) );
// PL_SELECTION_TOOL
//
TOOL_ACTION PL_ACTIONS::selectionActivate( TOOL_ACTION_ARGS()
.Name( "plEditor.InteractiveSelection" )
.Scope( AS_GLOBAL )
.Flags( AF_ACTIVATE ) );
TOOL_ACTION PL_ACTIONS::selectionMenu( TOOL_ACTION_ARGS()
.Name( "plEditor.InteractiveSelection.SelectionMenu" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION PL_ACTIONS::addItemToSel( TOOL_ACTION_ARGS()
.Name( "plEditor.InteractiveSelection.AddItemToSel" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION PL_ACTIONS::addItemsToSel( TOOL_ACTION_ARGS()
.Name( "plEditor.InteractiveSelection.AddItemsToSel" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION PL_ACTIONS::removeItemFromSel( TOOL_ACTION_ARGS()
.Name( "plEditor.InteractiveSelection.RemoveItemFromSel" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION PL_ACTIONS::removeItemsFromSel( TOOL_ACTION_ARGS()
.Name( "plEditor.InteractiveSelection.RemoveItemsFromSel" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION PL_ACTIONS::clearSelection( TOOL_ACTION_ARGS()
.Name( "plEditor.InteractiveSelection.ClearSelection" )
.Scope( AS_GLOBAL ) );

View File

@ -35,24 +35,6 @@
class PL_ACTIONS : public ACTIONS
{
public:
// Selection Tool
/// Activation of the selection tool
static TOOL_ACTION selectionActivate;
/// Clear the current selection
static TOOL_ACTION clearSelection;
/// Select an item (specified as the event parameter).
static TOOL_ACTION addItemToSel;
static TOOL_ACTION removeItemFromSel;
/// Select a list of items (specified as the event parameter)
static TOOL_ACTION addItemsToSel;
static TOOL_ACTION removeItemsFromSel;
/// Run a selection menu to select from a list of items
static TOOL_ACTION selectionMenu;
// Tools
static TOOL_ACTION pickerTool;
static TOOL_ACTION placeText;

View File

@ -76,7 +76,7 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent )
DS_DRAW_ITEM_BASE* item = nullptr;
bool isText = aEvent.IsAction( &PL_ACTIONS::placeText );
m_toolMgr->RunAction( PL_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_frame->PushTool( aEvent );
@ -102,7 +102,7 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent )
auto cleanup =
[&] ()
{
m_toolMgr->RunAction( PL_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
item = nullptr;
// There's nothing to roll-back, but we still need to pop the undo stack
@ -165,7 +165,7 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent )
{
m_frame->SaveCopyInUndoList();
m_toolMgr->RunAction( PL_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
item = dataItem->GetDrawItems()[0];
item->SetFlags( IS_NEW | IS_MOVING );
@ -192,7 +192,7 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent )
// Now we re-select and inform other tools, so that the Properties panel
// is updated.
m_toolMgr->RunAction( PL_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_selectionTool->AddItemToSel( item, false );
item = nullptr;
@ -240,7 +240,7 @@ int PL_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
// gets whacked.
m_toolMgr->DeactivateTool();
m_toolMgr->RunAction( PL_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_frame->PushTool( aEvent );
@ -268,7 +268,7 @@ int PL_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
if( evt->IsCancelInteractive() || ( item && evt->IsAction( &ACTIONS::undo ) ) )
{
m_toolMgr->RunAction( PL_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
if( item )
{
@ -303,7 +303,7 @@ int PL_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
if( !item ) // start drawing
{
m_frame->SaveCopyInUndoList();
m_toolMgr->RunAction( PL_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
DS_DATA_ITEM* dataItem = m_frame->AddDrawingSheetItem( type );
dataItem->MoveToIU( cursorPos );
@ -319,7 +319,7 @@ int PL_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
{
// Now we re-select and inform other tools, so that the Properties panel
// is updated.
m_toolMgr->RunAction( PL_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_selectionTool->AddItemToSel( item, false );
item->ClearEditFlags();

View File

@ -314,7 +314,7 @@ int PL_EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
m_frame->OnModify();
if( unselect )
m_toolMgr->RunAction( PL_ACTIONS::clearSelection );
m_toolMgr->RunAction( ACTIONS::selectionClear );
else
m_toolMgr->PostEvent( EVENTS::SelectedEvent );
@ -477,7 +477,7 @@ int PL_EDIT_TOOL::InteractiveDelete( const TOOL_EVENT& aEvent )
m_toolMgr->GetTool<PL_SELECTION_TOOL>()->UnbrightenItem( m_pickerItem );
// Wake the selection tool after exiting to ensure the cursor gets updated
m_toolMgr->PostAction( PL_ACTIONS::selectionActivate );
m_toolMgr->PostAction( ACTIONS::selectionActivate );
} );
m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent );

View File

@ -45,7 +45,7 @@
PL_SELECTION_TOOL::PL_SELECTION_TOOL() :
SELECTION_TOOL( "plEditor.InteractiveSelection" ),
SELECTION_TOOL( "common.InteractiveSelection" ),
m_frame( nullptr )
{
}
@ -549,14 +549,14 @@ void PL_SELECTION_TOOL::setTransitions()
{
Go( &PL_SELECTION_TOOL::UpdateMenu, ACTIONS::updateMenu.MakeEvent() );
Go( &PL_SELECTION_TOOL::Main, PL_ACTIONS::selectionActivate.MakeEvent() );
Go( &PL_SELECTION_TOOL::ClearSelection, PL_ACTIONS::clearSelection.MakeEvent() );
Go( &PL_SELECTION_TOOL::Main, ACTIONS::selectionActivate.MakeEvent() );
Go( &PL_SELECTION_TOOL::ClearSelection, ACTIONS::selectionClear.MakeEvent() );
Go( &PL_SELECTION_TOOL::AddItemToSel, PL_ACTIONS::addItemToSel.MakeEvent() );
Go( &PL_SELECTION_TOOL::AddItemsToSel, PL_ACTIONS::addItemsToSel.MakeEvent() );
Go( &PL_SELECTION_TOOL::RemoveItemFromSel, PL_ACTIONS::removeItemFromSel.MakeEvent() );
Go( &PL_SELECTION_TOOL::RemoveItemsFromSel, PL_ACTIONS::removeItemsFromSel.MakeEvent() );
Go( &PL_SELECTION_TOOL::SelectionMenu, PL_ACTIONS::selectionMenu.MakeEvent() );
Go( &PL_SELECTION_TOOL::AddItemToSel, ACTIONS::selectItem.MakeEvent() );
Go( &PL_SELECTION_TOOL::AddItemsToSel, ACTIONS::selectItems.MakeEvent() );
Go( &PL_SELECTION_TOOL::RemoveItemFromSel, ACTIONS::unselectItem.MakeEvent() );
Go( &PL_SELECTION_TOOL::RemoveItemsFromSel, ACTIONS::unselectItems.MakeEvent() );
Go( &PL_SELECTION_TOOL::SelectionMenu, ACTIONS::selectionMenu.MakeEvent() );
Go( &PL_SELECTION_TOOL::disambiguateCursor, EVENTS::DisambiguatePoint );
}

View File

@ -733,7 +733,7 @@ HANDLER_RESULT<Empty> API_HANDLER_PCB::handleClearSelection(
}
TOOL_MANAGER* mgr = frame()->GetToolManager();
mgr->RunAction( PCB_ACTIONS::selectionClear );
mgr->RunAction( ACTIONS::selectionClear );
frame()->Refresh();
return Empty();
@ -1138,8 +1138,8 @@ HANDLER_RESULT<Empty> API_HANDLER_PCB::handleInteractiveMoveItems(
PCB_SELECTION_TOOL* selectionTool = mgr->GetTool<PCB_SELECTION_TOOL>();
selectionTool->GetSelection().SetReferencePoint( toSelect[0]->GetPosition() );
mgr->RunAction( PCB_ACTIONS::selectionClear );
mgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, &toSelect );
mgr->RunAction( ACTIONS::selectionClear );
mgr->RunAction<EDA_ITEMS*>( ACTIONS::selectItems, &toSelect );
COMMIT* commit = getCurrentCommit( aCtx.ClientName );
mgr->PostAPIAction( PCB_ACTIONS::move, commit );

View File

@ -108,7 +108,7 @@ void DIALOG_CLEANUP_GRAPHICS::doCleanup( bool aDryRun )
if( !aDryRun )
{
// Clear current selection list to avoid selection of deleted items
m_parentFrame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear );
m_parentFrame->GetToolManager()->RunAction( ACTIONS::selectionClear );
// ... and to keep the treeModel from trying to refresh a deleted item
m_changesTreeModel->Update( nullptr, RPT_SEVERITY_ACTION );

View File

@ -252,7 +252,7 @@ void DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup( bool aDryRun )
if( !aDryRun )
{
// Clear current selection list to avoid selection of deleted items
m_parentFrame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear );
m_parentFrame->GetToolManager()->RunAction( ACTIONS::selectionClear );
// ... and to keep the treeModel from trying to refresh a deleted item
m_changesTreeModel->Update( nullptr, RPT_SEVERITY_ACTION );

View File

@ -1209,7 +1209,7 @@ void DIALOG_DRC::deleteAllMarkers( bool aIncludeExclusions )
{
// Clear current selection list to avoid selection of deleted items
Freeze();
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear );
m_frame->GetToolManager()->RunAction( ACTIONS::selectionClear );
m_markersTreeModel->DeleteItems( false, aIncludeExclusions, false );
m_unconnectedTreeModel->DeleteItems( false, aIncludeExclusions, false );
@ -1225,7 +1225,7 @@ void DIALOG_DRC::OnDeleteOneClick( wxCommandEvent& aEvent )
if( m_Notebook->GetSelection() == 0 )
{
// Clear the selection. It may be the selected DRC marker.
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear );
m_frame->GetToolManager()->RunAction( ACTIONS::selectionClear );
m_markersTreeModel->DeleteCurrentItem( true );

View File

@ -266,7 +266,7 @@ void DIALOG_FIND::search( bool aDirection )
// Search parameters
m_frame->GetFindReplaceData().findString = searchString;
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear );
m_frame->GetToolManager()->RunAction( ACTIONS::selectionClear );
m_frame->GetCanvas()->GetViewStart( &screen->m_StartVisu.x, &screen->m_StartVisu.y );
BOARD* board = m_frame->GetBoard();
@ -420,7 +420,7 @@ void DIALOG_FIND::search( bool aDirection )
}
else
{
m_frame->GetToolManager()->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, *m_it );
m_frame->GetToolManager()->RunAction<EDA_ITEM*>( ACTIONS::selectItem, *m_it );
msg.Printf( _( "'%s' found" ), searchString );
m_frame->SetStatusText( msg );

View File

@ -392,7 +392,7 @@ void DIALOG_FOOTPRINT_CHECKER::refreshEditor()
void DIALOG_FOOTPRINT_CHECKER::OnDeleteOneClick( wxCommandEvent& aEvent )
{
// Clear the selection. It may be the selected DRC marker.
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear );
m_frame->GetToolManager()->RunAction( ACTIONS::selectionClear );
m_markersTreeModel->DeleteCurrentItem( true );
@ -416,7 +416,7 @@ void DIALOG_FOOTPRINT_CHECKER::OnDeleteAllClick( wxCommandEvent& event )
void DIALOG_FOOTPRINT_CHECKER::deleteAllMarkers()
{
// Clear current selection list to avoid selection of deleted items
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear );
m_frame->GetToolManager()->RunAction( ACTIONS::selectionClear );
m_markersTreeModel->DeleteItems( false, true, false );
m_frame->GetBoard()->DeleteMARKERs( true, true );

View File

@ -609,7 +609,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataFromWindow()
m_footprint->SetKeywords( m_KeywordCtrl->GetValue() );
// Update fields
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear );
m_frame->GetToolManager()->RunAction( ACTIONS::selectionClear );
while( !m_footprint->GetFields().empty() )
{

View File

@ -419,8 +419,8 @@ void DIALOG_GENERATORS::OnItemSelected( wxDataViewEvent& aEvent )
edaItems.push_back( brdItem );
}
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear );
m_frame->GetToolManager()->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, &edaItems );
m_frame->GetToolManager()->RunAction( ACTIONS::selectionClear );
m_frame->GetToolManager()->RunAction<EDA_ITEMS*>( ACTIONS::selectItems, &edaItems );
m_frame->FocusOnItems( boardItems );
}
@ -455,8 +455,8 @@ void DIALOG_GENERATORS::OnRebuildTypeClick( wxCommandEvent& event )
items.push_back( item );
}
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear );
m_frame->GetToolManager()->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, &items );
m_frame->GetToolManager()->RunAction( ACTIONS::selectionClear );
m_frame->GetToolManager()->RunAction<EDA_ITEMS*>( ACTIONS::selectItems, &items );
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::regenerateSelected );
RebuildModels();
}

View File

@ -118,7 +118,7 @@ void DIALOG_GLOBAL_DELETION::DoGlobalDeletions()
bool delete_all = m_delAll->GetValue();
// Clear selection before removing any items
m_Parent->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear );
m_Parent->GetToolManager()->RunAction( ACTIONS::selectionClear );
BOARD* board = m_Parent->GetBoard();
BOARD_COMMIT commit( m_Parent );

View File

@ -479,7 +479,7 @@ void DIALOG_PRINT_PCBNEW::saveSettings()
int PCB_CONTROL::Print( const TOOL_EVENT& aEvent )
{
// Selection affects the origin item visibility
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
PCBNEW_PRINTOUT_SETTINGS settings( m_frame->GetPageSettings() );
DIALOG_PRINT_PCBNEW dlg( (PCB_BASE_EDIT_FRAME*) m_frame, &settings );

View File

@ -111,7 +111,7 @@ void DIALOG_UPDATE_PCB::PerformUpdate( bool aDryRun )
if( !aDryRun )
{
m_frame->GetToolManager()->DeactivateTool();
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear );
m_frame->GetToolManager()->RunAction( ACTIONS::selectionClear );
}
BOARD_NETLIST_UPDATER updater( m_frame, m_frame->GetBoard() );

View File

@ -848,7 +848,7 @@ bool PANEL_SETUP_LAYERS::TransferDataFromWindow()
if( !removedLayers.empty() )
{
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear );
m_frame->GetToolManager()->RunAction( ACTIONS::selectionClear );
PCB_LAYER_COLLECTOR collector;

View File

@ -1212,7 +1212,7 @@ void FOOTPRINT_EDIT_FRAME::setupTools()
m_toolManager->GetTool<PCB_VIEWER_TOOLS>()->SetFootprintFrame( true );
m_toolManager->InitTools();
m_toolManager->InvokeTool( "pcbnew.InteractiveSelection" );
m_toolManager->InvokeTool( "common.InteractiveSelection" );
// Load or reload wizard plugins in case they changed since the last time the frame opened
// Because the board editor has also a plugin python menu,

View File

@ -908,7 +908,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard( bool aAddNew )
return false;
}
m_toolManager->RunAction( PCB_ACTIONS::selectionClear );
m_toolManager->RunAction( ACTIONS::selectionClear );
BOARD_COMMIT commit( pcbframe );
// Create a copy for the board, first using Clone() to keep existing Uuids, and then either

View File

@ -216,7 +216,7 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
m_toolManager->GetTool<PCB_VIEWER_TOOLS>()->SetFootprintFrame( true );
m_toolManager->InitTools();
m_toolManager->InvokeTool( "pcbnew.InteractiveSelection" );
m_toolManager->InvokeTool( "common.InteractiveSelection" );
setupUIConditions();
@ -749,7 +749,7 @@ void FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB()
if( blocking_dialog )
blocking_dialog->Close( true );
toolMgr->RunAction( PCB_ACTIONS::selectionClear );
toolMgr->RunAction( ACTIONS::selectionClear );
BOARD_COMMIT commit( pcbframe );
// Create the "new" footprint

View File

@ -149,7 +149,7 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* aParent
m_toolManager->InitTools();
// Run the control tool, it is supposed to be always active
m_toolManager->InvokeTool( "pcbnew.InteractiveSelection" );
m_toolManager->InvokeTool( "common.InteractiveSelection" );
// Create the toolbars
m_toolbarSettings = Pgm().GetSettingsManager().GetToolbarSettings<FOOTPRINT_WIZARD_TOOLBAR_SETTINGS>( "fpwizard-toolbars" );

View File

@ -2246,7 +2246,7 @@ int DRAWING_TOOL::PlaceTuningPattern( const TOOL_EVENT& aEvent )
REENTRANCY_GUARD guard( &m_inDrawingTool );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_frame->PushTool( aEvent );
Activate();

View File

@ -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<EDA_ITEM*>( PCB_ACTIONS::selectItem, inductorFP.get() );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, inductorFP.get() );
BOARD_COMMIT commit( this );
commit.Add( inductorFP.release() );

View File

@ -141,7 +141,7 @@ void PCB_EDIT_FRAME::OnNetlistChanged( BOARD_NETLIST_UPDATER& aUpdater, bool* aR
// Spread new footprints.
std::vector<FOOTPRINT*> newFootprints = aUpdater.GetAddedFootprints();
GetToolManager()->RunAction( PCB_ACTIONS::selectionClear );
GetToolManager()->RunAction( ACTIONS::selectionClear );
SpreadFootprints( &newFootprints, { 0, 0 }, true );
@ -150,7 +150,7 @@ void PCB_EDIT_FRAME::OnNetlistChanged( BOARD_NETLIST_UPDATER& aUpdater, bool* aR
{
EDA_ITEMS items;
std::copy( newFootprints.begin(), newFootprints.end(), std::back_inserter( items ) );
GetToolManager()->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, &items );
GetToolManager()->RunAction<EDA_ITEMS*>( ACTIONS::selectItems, &items );
*aRunDragCommand = true;
}

View File

@ -1270,7 +1270,7 @@ void PCB_BASE_FRAME::OnFpChangeDebounceTimer( wxTimerEvent& aEvent )
}
if( !sel.empty() )
m_toolManager->RunAction( PCB_ACTIONS::selectItems, &sel );
m_toolManager->RunAction( ACTIONS::selectItems, &sel );
}
}
catch( const IO_ERROR& ioe )

View File

@ -791,7 +791,7 @@ void PCB_EDIT_FRAME::setupTools()
}
// Run the selection tool, it is supposed to be always active
m_toolManager->InvokeTool( "pcbnew.InteractiveSelection" );
m_toolManager->InvokeTool( "common.InteractiveSelection" );
}

View File

@ -1578,7 +1578,7 @@ int ROUTER_TOOL::RouteSelected( const TOOL_EVENT& aEvent )
if( selection.Size() == 0 )
return 0;
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
frame->PushTool( aEvent );
@ -1712,7 +1712,7 @@ int ROUTER_TOOL::MainLoop( const TOOL_EVENT& aEvent )
}
// Deselect all items
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
frame->PushTool( aEvent );
@ -2072,7 +2072,7 @@ void ROUTER_TOOL::NeighboringSegmentFilter( const VECTOR2I& aPt, GENERAL_COLLECT
bool ROUTER_TOOL::CanInlineDrag( int aDragMode )
{
m_toolMgr->RunAction<CLIENT_SELECTION_FILTER>( PCB_ACTIONS::selectionCursor,
m_toolMgr->RunAction<CLIENT_SELECTION_FILTER>( ACTIONS::selectionCursor,
NeighboringSegmentFilter );
const PCB_SELECTION& selection = m_toolMgr->GetTool<PCB_SELECTION_TOOL>()->GetSelection();
@ -2098,7 +2098,7 @@ void ROUTER_TOOL::restoreSelection( const PCB_SELECTION& aOriginalSelection )
{
EDA_ITEMS selItems;
std::copy( aOriginalSelection.Items().begin(), aOriginalSelection.Items().end(), std::back_inserter( selItems ) );
m_toolMgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, &selItems );
m_toolMgr->RunAction<EDA_ITEMS*>( ACTIONS::selectItems, &selItems );
}
@ -2109,7 +2109,7 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent )
if( selection.Empty() )
{
m_toolMgr->RunAction<CLIENT_SELECTION_FILTER>( PCB_ACTIONS::selectionCursor,
m_toolMgr->RunAction<CLIENT_SELECTION_FILTER>( ACTIONS::selectionCursor,
NeighboringSegmentFilter );
}
@ -2159,7 +2159,7 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent )
item->SetLocked( false );
}
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
frame()->PushTool( aEvent );
Activate();
@ -2543,7 +2543,7 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent )
for( auto lseg : leaderSegments )
newItems.push_back( lseg->Parent() );
m_toolMgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, &newItems );
m_toolMgr->RunAction<EDA_ITEMS*>( ACTIONS::selectItems, &newItems );
}
m_gridHelper->SetAuxAxes( false );
@ -2572,7 +2572,7 @@ int ROUTER_TOOL::InlineBreakTrack( const TOOL_EVENT& aEvent )
if( item->Type() != PCB_TRACE_T && item->Type() != PCB_ARC_T )
return 0;
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
Activate();

View File

@ -366,8 +366,8 @@ void ARRAY_TOOL::onDialogClosed( wxCloseEvent& aEvent )
all_added_items.push_back( selection[i] );
}
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, &all_added_items );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_toolMgr->RunAction<EDA_ITEMS*>( ACTIONS::selectItems, &all_added_items );
commit.Push( _( "Create Array" ) );

View File

@ -1045,7 +1045,7 @@ int BOARD_EDITOR_CONTROL::PlaceFootprint( const TOOL_EVENT& aEvent )
BOARD* board = getModel<BOARD>();
COMMON_SETTINGS* common_settings = Pgm().GetCommonSettings();
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_frame->PushTool( aEvent );
@ -1058,7 +1058,7 @@ int BOARD_EDITOR_CONTROL::PlaceFootprint( const TOOL_EVENT& aEvent )
auto cleanup =
[&] ()
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
commit.Revert();
if( fromOtherCommand )
@ -1092,7 +1092,7 @@ int BOARD_EDITOR_CONTROL::PlaceFootprint( const TOOL_EVENT& aEvent )
{
m_placingFootprint = true;
fp->SetPosition( cursorPos );
m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, fp );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, fp );
m_toolMgr->PostAction( ACTIONS::refreshPreview );
}
else if( aEvent.HasPosition() )
@ -1112,7 +1112,7 @@ int BOARD_EDITOR_CONTROL::PlaceFootprint( const TOOL_EVENT& aEvent )
cursorPos = controls->GetCursorPosition( !evt->DisableGridSnapping() );
if( reselect && fp )
m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, fp );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, fp );
if( evt->IsCancelInteractive() || ( fp && evt->IsAction( &ACTIONS::undo ) ) )
{
@ -1193,13 +1193,13 @@ int BOARD_EDITOR_CONTROL::PlaceFootprint( const TOOL_EVENT& aEvent )
fp->SetPosition( cursorPos );
commit.Add( fp );
m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, fp );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, fp );
m_toolMgr->PostAction( ACTIONS::refreshPreview );
}
else
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
commit.Push( _( "Place Footprint" ) );
fp = nullptr; // to indicate that there is no footprint that we currently modify
m_placingFootprint = false;
@ -1269,7 +1269,7 @@ int BOARD_EDITOR_CONTROL::modifyLockSelected( MODIFY_MODE aMode )
BOARD_COMMIT commit( m_frame );
if( selection.Empty() )
m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor );
m_toolMgr->RunAction( ACTIONS::selectionCursor );
// Resolve TOGGLE mode
if( aMode == TOGGLE )
@ -1444,7 +1444,7 @@ int BOARD_EDITOR_CONTROL::ZoneMerge( const TOOL_EVENT& aEvent )
toMerge.push_back( curr_area );
}
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
if( !toMerge.empty() )
{
@ -1453,7 +1453,7 @@ int BOARD_EDITOR_CONTROL::ZoneMerge( const TOOL_EVENT& aEvent )
commit.Push( _( "Merge Zones" ) );
for( EDA_ITEM* item : merged )
m_toolMgr->RunAction( PCB_ACTIONS::selectItem, item );
m_toolMgr->RunAction( ACTIONS::selectItem, item );
}
}
@ -1650,7 +1650,7 @@ int BOARD_EDITOR_CONTROL::EditFpInFpEditor( const TOOL_EVENT& aEvent )
}
if( selection.IsHover() )
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
return 0;
}

View File

@ -1683,10 +1683,10 @@ int BOARD_INSPECTION_TOOL::HighlightItem( const TOOL_EVENT& aEvent )
m_frame->m_probingSchToPcb = true; // recursion guard
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
if( item )
m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, item );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, item );
}
m_frame->m_probingSchToPcb = false;
@ -1923,15 +1923,15 @@ int BOARD_INSPECTION_TOOL::LocalRatsnestTool( const TOOL_EVENT& aEvent )
{
PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction<CLIENT_SELECTION_FILTER>( PCB_ACTIONS::selectionCursor,
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_toolMgr->RunAction<CLIENT_SELECTION_FILTER>( ACTIONS::selectionCursor,
EDIT_TOOL::PadFilter );
PCB_SELECTION& selection = selectionTool->GetSelection();
if( selection.Empty() )
{
m_toolMgr->RunAction<CLIENT_SELECTION_FILTER>( PCB_ACTIONS::selectionCursor,
m_toolMgr->RunAction<CLIENT_SELECTION_FILTER>( ACTIONS::selectionCursor,
EDIT_TOOL::FootprintFilter );
selection = selectionTool->GetSelection();
}

View File

@ -551,7 +551,7 @@ int DRAWING_TOOL::InteractivePlaceWithPreview( const TOOL_EVENT& aEvent,
BOARD_COMMIT commit( m_frame );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
// do not capture or auto-pan until we start placing the table
SCOPED_DRAW_MODE scopedDrawMode( m_mode, MODE::TEXT );

View File

@ -444,7 +444,7 @@ int DRAWING_TOOL::DrawRectangle( const TOOL_EVENT& aEvent )
commit.Add( rect );
commit.Push( isTextBox ? _( "Draw Text Box" ) : _( "Draw Rectangle" ) );
m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, rect );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, rect );
}
}
@ -492,7 +492,7 @@ int DRAWING_TOOL::DrawCircle( const TOOL_EVENT& aEvent )
commit.Add( circle );
commit.Push( _( "Draw Circle" ) );
m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, circle );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, circle );
}
circle = new PCB_SHAPE( parent );
@ -539,7 +539,7 @@ int DRAWING_TOOL::DrawArc( const TOOL_EVENT& aEvent )
commit.Add( arc );
commit.Push( _( "Draw Arc" ) );
m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, arc );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, arc );
}
arc = new PCB_SHAPE( parent );
@ -629,7 +629,7 @@ int DRAWING_TOOL::PlaceReferenceImage( const TOOL_EVENT& aEvent )
PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
BOARD_COMMIT commit( m_frame );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
// Add all the drawable symbols to preview
if( image )
@ -653,7 +653,7 @@ int DRAWING_TOOL::PlaceReferenceImage( const TOOL_EVENT& aEvent )
auto cleanup =
[&] ()
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_view->ClearPreview();
m_view->RecacheAllItems();
delete image;
@ -745,7 +745,7 @@ int DRAWING_TOOL::PlaceReferenceImage( const TOOL_EVENT& aEvent )
{
if( !image )
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
wxFileDialog dlg( m_frame, _( "Choose Image" ), wxEmptyString, wxEmptyString,
_( "Image Files" ) + wxS( " " ) + wxImage::GetImageExtWildcard(),
@ -800,7 +800,7 @@ int DRAWING_TOOL::PlaceReferenceImage( const TOOL_EVENT& aEvent )
commit.Add( image );
commit.Push( _( "Place Image" ) );
m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, image );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, image );
image = nullptr;
m_toolMgr->PostAction( ACTIONS::activatePointEditor );
@ -887,7 +887,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
auto cleanup =
[&]()
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_controls->ForceCursorPosition( false );
m_controls->ShowCursor( true );
m_controls->SetAutoPan( false );
@ -896,7 +896,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
text = nullptr;
};
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_frame->PushTool( aEvent );
@ -976,7 +976,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
if( !text )
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_controls->ForceCursorPosition( true, m_controls->GetCursorPosition() );
@ -1032,7 +1032,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
m_frame->GetCanvas()->Refresh();
}
m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, text );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, text );
m_view->Update( &selection() );
// update the cursor so it looks correct before another event
@ -1043,12 +1043,12 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
if( placing )
{
text->ClearFlags();
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
commit.Add( text );
commit.Push( _( "Draw Text" ) );
m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, text );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, text );
text = nullptr;
}
@ -1139,7 +1139,7 @@ int DRAWING_TOOL::DrawTable( const TOOL_EVENT& aEvent )
auto cleanup =
[&] ()
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_controls->ForceCursorPosition( false );
m_controls->ShowCursor( true );
m_controls->SetAutoPan( false );
@ -1148,7 +1148,7 @@ int DRAWING_TOOL::DrawTable( const TOOL_EVENT& aEvent )
table = nullptr;
};
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_frame->PushTool( aEvent );
@ -1215,7 +1215,7 @@ int DRAWING_TOOL::DrawTable( const TOOL_EVENT& aEvent )
{
if( !table )
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
PCB_LAYER_ID layer = m_frame->GetActiveLayer();
@ -1234,7 +1234,7 @@ int DRAWING_TOOL::DrawTable( const TOOL_EVENT& aEvent )
m_frame->GetCanvas()->Refresh();
}
m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, table );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, table );
m_view->Update( &selection() );
// update the cursor so it looks correct before another event
@ -1242,7 +1242,7 @@ int DRAWING_TOOL::DrawTable( const TOOL_EVENT& aEvent )
}
else
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
table->Normalize();
@ -1254,7 +1254,7 @@ int DRAWING_TOOL::DrawTable( const TOOL_EVENT& aEvent )
commit.Add( table, m_frame->GetScreen() );
commit.Push( _( "Draw Table" ) );
m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, table );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, table );
m_toolMgr->PostAction( ACTIONS::activatePointEditor );
}
else
@ -1392,7 +1392,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::MEASURE );
};
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_frame->PushTool( aEvent );
@ -1500,7 +1500,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
{
case SET_ORIGIN:
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
PCB_LAYER_ID layer = m_frame->GetActiveLayer();
@ -1605,7 +1605,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
if( t == PCB_DIM_LEADER_T )
frame()->OnEditItemRequest( dimension );
m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, dimension );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, dimension );
break;
}
@ -1897,10 +1897,10 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent )
}
// Clear the current selection then select the drawings so that edit tools work on them
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
EDA_ITEMS selItems( selectedItems.begin(), selectedItems.end() );
m_toolMgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, &selItems );
m_toolMgr->RunAction<EDA_ITEMS*>( ACTIONS::selectItems, &selItems );
if( !dlg.IsPlacementInteractive() )
{
@ -1967,7 +1967,7 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent )
if( evt->IsCancelInteractive() || evt->IsActivate() )
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
if( group )
{
@ -2045,7 +2045,7 @@ int DRAWING_TOOL::SetAnchor( const TOOL_EVENT& aEvent )
SCOPED_DRAW_MODE scopedDrawMode( m_mode, MODE::ANCHOR );
PCB_GRID_HELPER grid( m_toolMgr, m_frame->GetMagneticItemsSettings() );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_frame->PushTool( aEvent );
@ -2337,7 +2337,7 @@ bool DRAWING_TOOL::drawShape( const TOOL_EVENT& aTool, PCB_SHAPE** aGraphic,
if( !started )
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
if( aStartingPoint )
{
@ -2391,7 +2391,7 @@ bool DRAWING_TOOL::drawShape( const TOOL_EVENT& aTool, PCB_SHAPE** aGraphic,
commit.Add( graphic );
commit.Push( _( "Draw Line" ) );
m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, graphic );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, graphic );
graphic = nullptr;
}
@ -2677,7 +2677,7 @@ bool DRAWING_TOOL::drawArc( const TOOL_EVENT& aTool, PCB_SHAPE** aGraphic,
{
if( !started )
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_controls->SetAutoPan( true );
m_controls->CaptureCursor( true );
@ -3010,7 +3010,7 @@ std::unique_ptr<PCB_SHAPE> DRAWING_TOOL::drawOneBezier( const TOOL_EVENT& aToo
{
if( !started() )
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_controls->SetAutoPan( true );
m_controls->CaptureCursor( true );
@ -3210,7 +3210,7 @@ bool DRAWING_TOOL::getSourceZoneForAction( ZONE_MODE aMode, ZONE** aZone )
if( selection.Empty() )
{
clearSelection = true;
m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor );
m_toolMgr->RunAction( ACTIONS::selectionCursor );
}
// we want a single zone
@ -3221,7 +3221,7 @@ bool DRAWING_TOOL::getSourceZoneForAction( ZONE_MODE aMode, ZONE** aZone )
if( !*aZone )
{
if( clearSelection )
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
return false;
}

View File

@ -83,7 +83,7 @@ void DRC_TOOL::ShowDRCDialog( wxWindow* aParent )
}
Activate();
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
if( !m_drcDialog )
{
@ -295,4 +295,4 @@ void DRC_TOOL::setTransitions()
Go( &DRC_TOOL::ExcludeMarker, ACTIONS::excludeMarker.MakeEvent() );
Go( &DRC_TOOL::CrossProbe, EVENTS::PointSelectedEvent );
Go( &DRC_TOOL::CrossProbe, EVENTS::SelectedEvent );
}
}

View File

@ -472,8 +472,8 @@ int EDIT_TOOL::GetAndPlace( const TOOL_EVENT& aEvent )
if( fp )
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, fp );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, fp );
selectionTool->GetSelection().SetReferencePoint( fp->GetPosition() );
m_toolMgr->PostAction( PCB_ACTIONS::move );
@ -1052,7 +1052,7 @@ int EDIT_TOOL::ChangeTrackWidth( const TOOL_EVENT& aEvent )
if( selection.IsHover() )
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
// Notify other tools of the changes -- This updates the visual ratsnest
m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified );
@ -1922,7 +1922,7 @@ int EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
if( selection.IsHover() )
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
}
else
{
@ -2069,7 +2069,7 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent )
localCommit.Push( _( "Rotate" ) );
if( is_hover && !m_dragging )
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified );
@ -2237,7 +2237,7 @@ int EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent )
localCommit.Push( _( "Mirror" ) );
if( selection.IsHover() && !m_dragging )
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified );
@ -2315,7 +2315,7 @@ int EDIT_TOOL::JustifyText( const TOOL_EVENT& aEvent )
}
if( selection.IsHover() && !m_dragging )
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified );
@ -2402,7 +2402,7 @@ int EDIT_TOOL::Flip( const TOOL_EVENT& aEvent )
localCommit.Push( _( "Change Side / Flip" ) );
if( selection.IsHover() && !m_dragging )
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified );
@ -2476,7 +2476,7 @@ void EDIT_TOOL::DeleteItems( const PCB_SELECTION& aItems, bool aIsCut )
BOARD_COMMIT commit( this );
// As we are about to remove items, they have to be removed from the selection first
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
// Only delete items that are the root of a selected set (e.g. only delete grouped / generated
// items from the parent item, not individually) - issue #17527
@ -2610,7 +2610,7 @@ void EDIT_TOOL::DeleteItems( const PCB_SELECTION& aItems, bool aIsCut )
canvas()->Refresh();
// Restore the selection on the original zone
m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, zone );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, zone );
break;
}
@ -2832,7 +2832,7 @@ int EDIT_TOOL::MoveExact( const TOOL_EVENT& aEvent )
commit.Push( _( "Move Exactly" ) );
if( selection.IsHover() )
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified );
@ -2993,11 +2993,11 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
}
// Clear the old selection first
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
// Select the new items
EDA_ITEMS nItems( new_items.begin(), new_items.end() );
m_toolMgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, &nItems );
m_toolMgr->RunAction<EDA_ITEMS*>( ACTIONS::selectItems, &nItems );
// record the new items as added
if( !selection.Empty() )
@ -3013,7 +3013,7 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
// Deselect the duplicated item if we originally started as a hover selection
if( is_hover )
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
}
return 0;

View File

@ -392,7 +392,7 @@ bool EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, BOARD_COMMIT* aCommit
pickedReferencePoint ) )
{
if( selection.IsHover() )
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
editFrame->PopTool( aEvent );
return false;
@ -805,7 +805,7 @@ bool EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, BOARD_COMMIT* aCommit
// Unselect all items to clear selection flags and then re-select the originally selected
// items.
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
if( restore_state )
{
@ -824,7 +824,7 @@ bool EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, BOARD_COMMIT* aCommit
}
EDA_ITEMS oItems( orig_items.begin(), orig_items.end() );
m_toolMgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, &oItems );
m_toolMgr->RunAction<EDA_ITEMS*>( ACTIONS::selectItems, &oItems );
}
// Remove the dynamic ratsnest from the screen

View File

@ -146,7 +146,7 @@ int GROUP_TOOL::PickNewMember( const TOOL_EVENT& aEvent )
picker->SetClickHandler(
[&]( const VECTOR2D& aPoint ) -> bool
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
const PCB_SELECTION& sel = m_selectionTool->RequestSelection(
[]( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector,
@ -294,10 +294,10 @@ int GROUP_TOOL::Ungroup( const TOOL_EVENT& aEvent )
EDA_ITEMS toSelect;
if( selection.Empty() )
m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor );
m_toolMgr->RunAction( ACTIONS::selectionCursor );
PCB_SELECTION selCopy = selection;
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
for( EDA_ITEM* item : selCopy )
{
@ -318,7 +318,7 @@ int GROUP_TOOL::Ungroup( const TOOL_EVENT& aEvent )
commit.Push( _( "Ungroup Items" ) );
m_toolMgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, &toSelect );
m_toolMgr->RunAction<EDA_ITEMS*>( ACTIONS::selectItems, &toSelect );
m_toolMgr->PostEvent( EVENTS::SelectedItemsModified );
m_frame->OnModify();
@ -334,7 +334,7 @@ int GROUP_TOOL::RemoveFromGroup( const TOOL_EVENT& aEvent )
BOARD_COMMIT commit( m_frame );
if( selection.Empty() )
m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor );
m_toolMgr->RunAction( ACTIONS::selectionCursor );
for( EDA_ITEM* item : selection )
{

View File

@ -328,7 +328,7 @@ int PAD_TOOL::EnumeratePads( const TOOL_EVENT& aEvent )
std::deque<int> storedPadNumbers;
std::map<wxString, std::pair<int, wxString>> oldNumbers;
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
frame()->PushTool( aEvent );
@ -424,7 +424,7 @@ int PAD_TOOL::EnumeratePads( const TOOL_EVENT& aEvent )
if( evt->IsCancelInteractive() )
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
commit.Revert();
frame()->PopTool( aEvent );
@ -757,7 +757,7 @@ int PAD_TOOL::EditPad( const TOOL_EVENT& aEvent )
explodePad( pad, &layer, commit );
commit.Push( _( "Edit Pad" ) );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
frame()->SetActiveLayer( layer );
settings->m_PadEditModePad = pad;
@ -920,7 +920,7 @@ std::vector<PCB_SHAPE*> PAD_TOOL::RecombinePad( PAD* aPad, bool aIsDryRun )
int maxError = board()->GetDesignSettings().m_MaxError;
// Don't leave an object in the point editor that might no longer exist after recombining.
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
return aPad->Recombine( aIsDryRun, maxError );
}

View File

@ -2150,47 +2150,6 @@ TOOL_ACTION PCB_ACTIONS::selectPointInteractively( TOOL_ACTION_ARGS()
.Parameter<PCB_PICKER_TOOL::INTERACTIVE_PARAMS>( {} ));
// PCB_SELECTION_TOOL
//
TOOL_ACTION PCB_ACTIONS::selectionActivate( TOOL_ACTION_ARGS()
.Name( "pcbnew.InteractiveSelection" )
.Scope( AS_GLOBAL )
// No description, not shown anywhere
.Flags( AF_ACTIVATE ) );
TOOL_ACTION PCB_ACTIONS::selectionCursor( TOOL_ACTION_ARGS()
.Name( "pcbnew.InteractiveSelection.Cursor" )
.Scope( AS_GLOBAL )
.Parameter<CLIENT_SELECTION_FILTER>( nullptr ) );
TOOL_ACTION PCB_ACTIONS::selectItem( TOOL_ACTION_ARGS()
.Name( "pcbnew.InteractiveSelection.SelectItem" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION PCB_ACTIONS::selectItems( TOOL_ACTION_ARGS()
.Name( "pcbnew.InteractiveSelection.SelectItems" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION PCB_ACTIONS::unselectItem( TOOL_ACTION_ARGS()
.Name( "pcbnew.InteractiveSelection.UnselectItem" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION PCB_ACTIONS::unselectItems( TOOL_ACTION_ARGS()
.Name( "pcbnew.InteractiveSelection.UnselectItems" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION PCB_ACTIONS::reselectItem( TOOL_ACTION_ARGS()
.Name( "pcbnew.InteractiveSelection.ReselectItem" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION PCB_ACTIONS::selectionClear( TOOL_ACTION_ARGS()
.Name( "pcbnew.InteractiveSelection.Clear" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION PCB_ACTIONS::selectionMenu( TOOL_ACTION_ARGS()
.Name( "pcbnew.InteractiveSelection.SelectionMenu" )
.Scope( AS_GLOBAL ) );
TOOL_ACTION PCB_ACTIONS::selectConnection( TOOL_ACTION_ARGS()
.Name( "pcbnew.InteractiveSelection.SelectConnection" )
.Scope( AS_GLOBAL )

View File

@ -59,24 +59,6 @@ public:
static TOOL_ACTION* LayerIDToAction( PCB_LAYER_ID aLayerID );
// Selection Tool
/// Activation of the selection tool
static TOOL_ACTION selectionActivate;
/// Select a single item under the cursor position
static TOOL_ACTION selectionCursor;
/// Clear the current selection
static TOOL_ACTION selectionClear;
/// Select an item (specified as the event parameter).
static TOOL_ACTION selectItem;
static TOOL_ACTION unselectItem;
static TOOL_ACTION reselectItem;
/// Select a list of items (specified as the event parameter)
static TOOL_ACTION selectItems;
static TOOL_ACTION unselectItems;
/// Sets selection to specified items, zooms to fit, if enabled
static TOOL_ACTION syncSelection;

View File

@ -799,7 +799,7 @@ int PCB_CONTROL::InteractiveDelete( const TOOL_EVENT& aEvent )
PCB_PICKER_TOOL* picker = m_toolMgr->GetTool<PCB_PICKER_TOOL>();
m_pickerItem = nullptr;
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
// Deactivate other tools; particularly important if another PICKER is currently running
Activate();
@ -1426,7 +1426,7 @@ bool PCB_CONTROL::placeBoardItems( BOARD_COMMIT* aCommit, BOARD* aBoard, bool aA
bool PCB_CONTROL::placeBoardItems( BOARD_COMMIT* aCommit, std::vector<BOARD_ITEM*>& aItems,
bool aIsNew, bool aAnchorAtOrigin, bool aReannotateDuplicates )
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
@ -1484,7 +1484,7 @@ bool PCB_CONTROL::placeBoardItems( BOARD_COMMIT* aCommit, std::vector<BOARD_ITEM
// Select the items that should be selected
EDA_ITEMS toSel( itemsToSel.begin(), itemsToSel.end() );
m_toolMgr->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, &toSel );
m_toolMgr->RunAction<EDA_ITEMS*>( ACTIONS::selectItems, &toSel );
// Reannotate duplicate footprints (make sense only in board editor )
if( aReannotateDuplicates && m_isBoardEditor )

View File

@ -76,7 +76,7 @@ const SELECTION& PCB_EDIT_TABLE_TOOL::getTableCellSelection()
void PCB_EDIT_TABLE_TOOL::clearSelection()
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
};
@ -112,7 +112,7 @@ int PCB_EDIT_TABLE_TOOL::EditTable( const TOOL_EVENT& aEvent )
}
if( clearSelection )
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
return 0;
}

View File

@ -319,7 +319,7 @@ int PCB_PICKER_TOOL::SelectItemInteractively( const TOOL_EVENT& aEvent )
SetClickHandler(
[&]( const VECTOR2D& aPoint ) -> bool
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
const PCB_SELECTION& sel = selectionTool->RequestSelection(
[]( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector,
PCB_SELECTION_TOOL* sTool )

View File

@ -2373,7 +2373,7 @@ int PCB_POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent )
inDrag = false;
frame()->UndoRedoBlock( false );
m_toolMgr->PostAction<EDA_ITEM*>( PCB_ACTIONS::reselectItem,
m_toolMgr->PostAction<EDA_ITEM*>( ACTIONS::reselectItem,
item ); // FIXME: Needed for generators
}
else if( evt->IsCancelInteractive() || evt->IsActivate() )
@ -2916,7 +2916,7 @@ int PCB_POINT_EDITOR::removeCorner( const TOOL_EVENT& aEvent )
}
else
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
commit.Remove( item );
}
}

View File

@ -127,7 +127,7 @@ public:
PCB_SELECTION_TOOL::PCB_SELECTION_TOOL() :
SELECTION_TOOL( "pcbnew.InteractiveSelection" ),
SELECTION_TOOL( "common.InteractiveSelection" ),
m_frame( nullptr ),
m_isFootprintEditor( false ),
m_nonModifiedCursor( KICURSOR::ARROW ),
@ -661,7 +661,7 @@ PCB_SELECTION& PCB_SELECTION_TOOL::RequestSelection( CLIENT_SELECTION_FILTER aCl
if( selectionEmpty )
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, aClientFilter );
m_toolMgr->RunAction( ACTIONS::selectionCursor, aClientFilter );
m_selection.ClearReferencePoint();
}
@ -4113,16 +4113,16 @@ void PCB_SELECTION_TOOL::setTransitions()
{
Go( &PCB_SELECTION_TOOL::UpdateMenu, ACTIONS::updateMenu.MakeEvent() );
Go( &PCB_SELECTION_TOOL::Main, PCB_ACTIONS::selectionActivate.MakeEvent() );
Go( &PCB_SELECTION_TOOL::CursorSelection, PCB_ACTIONS::selectionCursor.MakeEvent() );
Go( &PCB_SELECTION_TOOL::ClearSelection, PCB_ACTIONS::selectionClear.MakeEvent() );
Go( &PCB_SELECTION_TOOL::Main, ACTIONS::selectionActivate.MakeEvent() );
Go( &PCB_SELECTION_TOOL::CursorSelection, ACTIONS::selectionCursor.MakeEvent() );
Go( &PCB_SELECTION_TOOL::ClearSelection, ACTIONS::selectionClear.MakeEvent() );
Go( &PCB_SELECTION_TOOL::AddItemToSel, PCB_ACTIONS::selectItem.MakeEvent() );
Go( &PCB_SELECTION_TOOL::AddItemsToSel, PCB_ACTIONS::selectItems.MakeEvent() );
Go( &PCB_SELECTION_TOOL::RemoveItemFromSel, PCB_ACTIONS::unselectItem.MakeEvent() );
Go( &PCB_SELECTION_TOOL::RemoveItemsFromSel, PCB_ACTIONS::unselectItems.MakeEvent() );
Go( &PCB_SELECTION_TOOL::ReselectItem, PCB_ACTIONS::reselectItem.MakeEvent() );
Go( &PCB_SELECTION_TOOL::SelectionMenu, PCB_ACTIONS::selectionMenu.MakeEvent() );
Go( &PCB_SELECTION_TOOL::AddItemToSel, ACTIONS::selectItem.MakeEvent() );
Go( &PCB_SELECTION_TOOL::AddItemsToSel, ACTIONS::selectItems.MakeEvent() );
Go( &PCB_SELECTION_TOOL::RemoveItemFromSel, ACTIONS::unselectItem.MakeEvent() );
Go( &PCB_SELECTION_TOOL::RemoveItemsFromSel, ACTIONS::unselectItems.MakeEvent() );
Go( &PCB_SELECTION_TOOL::ReselectItem, ACTIONS::reselectItem.MakeEvent() );
Go( &PCB_SELECTION_TOOL::SelectionMenu, ACTIONS::selectionMenu.MakeEvent() );
Go( &PCB_SELECTION_TOOL::filterSelection, PCB_ACTIONS::filterSelection.MakeEvent() );
Go( &PCB_SELECTION_TOOL::expandConnection, PCB_ACTIONS::selectConnection.MakeEvent() );

View File

@ -31,6 +31,7 @@
#include <functional>
#include <memory>
#include <tool/actions.h>
#include <math/vector2d.h>
#include <project/board_project_settings.h>
#include <tool/action_menu.h>
@ -51,10 +52,6 @@ namespace KIGFX
}
using CLIENT_SELECTION_FILTER =
std::function<void( const VECTOR2I&, GENERAL_COLLECTOR&, PCB_SELECTION_TOOL* )>;
/**
* The selection tool: currently supports:
* - pick single objects (click LMB)

View File

@ -51,7 +51,7 @@ void PCB_TOOL_BASE::doInteractiveItemPlacement( const TOOL_EVENT& aTool,
BOARD_COMMIT commit( frame() );
GetManager()->RunAction( PCB_ACTIONS::selectionClear );
GetManager()->RunAction( ACTIONS::selectionClear );
Activate();
// Must be done after Activate() so that it gets set into the correct context

View File

@ -435,7 +435,7 @@ int POSITION_RELATIVE_TOOL::RelativeItemSelectionMove( const VECTOR2I& aPosAncho
m_commit->Push( _( "Position Relative" ) );
if( m_selection.IsHover() )
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified );

View File

@ -169,7 +169,7 @@ void ZONE_CREATE_HELPER::performZoneCutout( ZONE& aZone, const ZONE& aCutout )
// Clear the selection before removing the old zone
auto toolMgr = m_tool.GetManager();
toolMgr->RunAction( PCB_ACTIONS::selectionClear );
toolMgr->RunAction( ACTIONS::selectionClear );
SHAPE_POLY_SET originalOutline( *aZone.Outline() );
originalOutline.BooleanSubtract( *aCutout.Outline() );
@ -206,7 +206,7 @@ void ZONE_CREATE_HELPER::performZoneCutout( ZONE& aZone, const ZONE& aCutout )
else
{
m_params.m_sourceZone = newZones[0];
toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, newZones[0] );
toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, newZones[0] );
}
}
@ -230,7 +230,7 @@ void ZONE_CREATE_HELPER::commitZone( std::unique_ptr<ZONE> aZone )
commit.Add( aZone.get() );
commit.Push( _( "Draw Zone" ) );
m_tool.GetManager()->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, aZone.release() );
m_tool.GetManager()->RunAction<EDA_ITEM*>( ACTIONS::selectItem, aZone.release() );
break;
}
@ -252,7 +252,7 @@ void ZONE_CREATE_HELPER::commitZone( std::unique_ptr<ZONE> aZone )
commit.Add( poly );
commit.Push( _( "Draw Polygon" ) );
m_tool.GetManager()->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, poly );
m_tool.GetManager()->RunAction<EDA_ITEM*>( ACTIONS::selectItem, poly );
break;
}
}
@ -271,7 +271,7 @@ bool ZONE_CREATE_HELPER::OnFirstPoint( POLYGON_GEOM_MANAGER& aMgr )
if( m_zone )
{
m_tool.GetManager()->RunAction( PCB_ACTIONS::selectionClear );
m_tool.GetManager()->RunAction( ACTIONS::selectionClear );
// set up properties from zone
const auto& settings = *m_parentView.GetPainter()->GetSettings();

View File

@ -89,11 +89,11 @@ void PCB_SEARCH_HANDLER::SelectItems( std::vector<long>& aItemRows )
selectedItems.push_back( m_hitlist[row] );
}
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear );
m_frame->GetToolManager()->RunAction( ACTIONS::selectionClear );
if( selectedItems.size() )
{
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectItems, &selectedItems );
m_frame->GetToolManager()->RunAction( ACTIONS::selectItems, &selectedItems );
switch( settings.selection_zoom )
{

View File

@ -90,6 +90,6 @@
"pdf_viewer_name": "",
"text_editor": "/usr/bin/open -e",
"use_system_pdf_viewer": true,
"working_dir": "/home/wayne/src/kicad/qa/tests"
"working_dir": "/home/mike/Projects/src/kicad/qa/tests"
}
}

View File

@ -188,7 +188,7 @@ public:
PCB_SELECTION_TOOL::PCB_SELECTION_TOOL() :
SELECTION_TOOL( "pcbnew.InteractiveSelection" ),
SELECTION_TOOL( "common.InteractiveSelection" ),
m_frame( NULL ),
m_enteredGroup( NULL ),
m_nonModifiedCursor( KICURSOR::ARROW ),

View File

@ -118,7 +118,7 @@ void PCB_TEST_FRAME_BASE::SetBoard( std::shared_ptr<BOARD> b )
m_galPanel->SetEventDispatcher( m_toolDispatcher );
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
m_toolManager->InvokeTool( "pcbnew.InteractiveSelection" );
m_toolManager->InvokeTool( "common.InteractiveSelection" );
#endif
}
@ -208,7 +208,7 @@ void PCB_TEST_FRAME_BASE::LoadSettings()
void PCB_TEST_FRAME_BASE::SetSelectionHook( std::function<void(PCB_TEST_FRAME_BASE*, PCB_SELECTION*)> aHook )
{
auto tool = m_toolManager->FindTool("pcbnew.InteractiveSelection");
auto tool = m_toolManager->FindTool( "common.InteractiveSelection" );
if (!tool)
return;

View File

@ -5,8 +5,7 @@
#include <tool/actions.h>
#include <tool/tool_manager.h>
PCB_TEST_SELECTION_TOOL::PCB_TEST_SELECTION_TOOL()
: SELECTION_TOOL( "pcbnew.InteractiveSelection" )
PCB_TEST_SELECTION_TOOL::PCB_TEST_SELECTION_TOOL() : SELECTION_TOOL( "common.InteractiveSelection" )
{
}
@ -109,7 +108,7 @@ bool PCB_TEST_SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere )
void PCB_TEST_SELECTION_TOOL::setTransitions()
{
Go( &PCB_TEST_SELECTION_TOOL::Main, PCB_ACTIONS::selectionActivate.MakeEvent() );
Go( &PCB_TEST_SELECTION_TOOL::Main, ACTIONS::selectionActivate.MakeEvent() );
}