7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-19 14:01:41 +00:00

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
common
cvpcb
eeschema
gerbview
include/tool
pagelayout_editor
pcbnew
qa

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;

Some files were not shown because too many files have changed in this diff Show More