From 5996cffabce986b69941334f3f3cea4626b9d110 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 12 Mar 2025 14:41:25 +0000 Subject: [PATCH] EE -> SCH (no functional changes) --- eeschema/CMakeLists.txt | 14 +- eeschema/annotate.cpp | 28 +- eeschema/autoplace_fields.cpp | 4 - eeschema/bus-wire-junction.cpp | 13 +- eeschema/cross-probing.cpp | 12 +- eeschema/design_block_utils.cpp | 4 +- eeschema/dialogs/dialog_erc.cpp | 18 +- eeschema/dialogs/dialog_field_properties.cpp | 2 +- .../dialog_global_edit_text_and_graphics.cpp | 6 +- .../dialogs/dialog_symbol_fields_table.cpp | 11 +- eeschema/dialogs/dialog_symbol_properties.cpp | 2 +- eeschema/dialogs/dialog_table_properties.cpp | 1 - .../dialogs/dialog_tablecell_properties.cpp | 1 - eeschema/dialogs/panel_setup_pinmap.cpp | 1 - eeschema/eeschema_config.cpp | 6 +- eeschema/files-io.cpp | 9 +- eeschema/menubar.cpp | 158 +++--- eeschema/net_navigator.cpp | 4 +- eeschema/picksymbol.cpp | 6 +- eeschema/printing/sch_printout.cpp | 10 +- eeschema/sch_base_frame.cpp | 11 +- .../{ee_collectors.cpp => sch_collectors.cpp} | 22 +- .../{ee_collectors.h => sch_collectors.h} | 10 +- eeschema/sch_commit.cpp | 20 +- eeschema/sch_commit.h | 4 +- eeschema/sch_edit_frame.cpp | 182 ++++--- .../sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp | 4 +- .../sch_io/kicad_sexpr/sch_io_kicad_sexpr.h | 4 +- eeschema/sch_symbol.cpp | 2 +- eeschema/sch_symbol.h | 2 - eeschema/schematic.cpp | 2 +- eeschema/schematic_undo_redo.cpp | 8 +- eeschema/sim/simulator_frame.cpp | 50 +- eeschema/sim/toolbars_simulator_frame.cpp | 60 +-- .../symbol_editor/menubar_symbol_editor.cpp | 60 +-- eeschema/symbol_editor/symbol_edit_frame.cpp | 108 ++-- eeschema/symbol_editor/symbol_edit_frame.h | 1 - eeschema/symbol_editor/symbol_editor.cpp | 1 - .../symbol_editor/symbol_editor_undo_redo.cpp | 3 +- .../symbol_editor/toolbars_symbol_editor.cpp | 56 +- eeschema/symbol_viewer_frame.cpp | 26 +- eeschema/toolbars_sch_editor.cpp | 96 ++-- eeschema/toolbars_symbol_viewer.cpp | 16 +- eeschema/tools/ee_grid_helper.cpp | 8 +- eeschema/tools/ee_grid_helper.h | 8 +- eeschema/tools/rule_area_create_helper.cpp | 6 +- .../tools/{ee_actions.cpp => sch_actions.cpp} | 424 +++++++-------- .../tools/{ee_actions.h => sch_actions.h} | 2 +- eeschema/tools/sch_design_block_control.cpp | 30 +- eeschema/tools/sch_design_block_control.h | 8 +- eeschema/tools/sch_drawing_tools.cpp | 251 ++++----- eeschema/tools/sch_drawing_tools.h | 6 +- eeschema/tools/sch_edit_table_tool.cpp | 14 +- eeschema/tools/sch_edit_table_tool.h | 6 +- eeschema/tools/sch_edit_tool.cpp | 486 +++++++++--------- eeschema/tools/sch_edit_tool.h | 8 +- eeschema/tools/sch_editor_control.cpp | 213 ++++---- eeschema/tools/sch_editor_control.h | 6 +- eeschema/tools/sch_find_replace_tool.cpp | 1 - eeschema/tools/sch_find_replace_tool.h | 6 +- ...ction_tool.cpp => sch_inspection_tool.cpp} | 118 ++--- ...nspection_tool.h => sch_inspection_tool.h} | 16 +- eeschema/tools/sch_line_wire_bus_tool.cpp | 94 ++-- eeschema/tools/sch_line_wire_bus_tool.h | 10 +- eeschema/tools/sch_move_tool.cpp | 58 +-- eeschema/tools/sch_move_tool.h | 6 +- eeschema/tools/sch_navigate_tool.cpp | 28 +- eeschema/tools/sch_navigate_tool.h | 6 +- ..._point_editor.cpp => sch_point_editor.cpp} | 94 ++-- .../{ee_point_editor.h => sch_point_editor.h} | 14 +- .../{ee_selection.cpp => sch_selection.cpp} | 12 +- .../tools/{ee_selection.h => sch_selection.h} | 10 +- ...ection_tool.cpp => sch_selection_tool.cpp} | 313 ++++++----- ..._selection_tool.h => sch_selection_tool.h} | 34 +- .../tools/{ee_tool_base.h => sch_tool_base.h} | 24 +- .../{ee_tool_utils.cpp => sch_tool_utils.cpp} | 2 +- .../{ee_tool_utils.h => sch_tool_utils.h} | 0 eeschema/tools/simulator_control.cpp | 44 +- eeschema/tools/symbol_editor_control.cpp | 118 ++--- eeschema/tools/symbol_editor_control.h | 6 +- .../tools/symbol_editor_drawing_tools.cpp | 58 +-- eeschema/tools/symbol_editor_drawing_tools.h | 4 +- eeschema/tools/symbol_editor_edit_tool.cpp | 162 +++--- eeschema/tools/symbol_editor_edit_tool.h | 4 +- eeschema/tools/symbol_editor_move_tool.cpp | 30 +- eeschema/tools/symbol_editor_move_tool.h | 6 +- eeschema/tools/symbol_editor_pin_tool.cpp | 42 +- eeschema/tools/symbol_editor_pin_tool.h | 4 +- eeschema/widgets/design_block_pane.cpp | 4 +- eeschema/widgets/hierarchy_pane.cpp | 4 +- .../widgets/panel_sch_selection_filter.cpp | 4 +- eeschema/widgets/panel_sch_selection_filter.h | 8 +- eeschema/widgets/sch_properties_panel.cpp | 33 +- eeschema/widgets/search_handlers.cpp | 8 +- eeschema/widgets/symbol_tree_pane.cpp | 4 +- 95 files changed, 1942 insertions(+), 1981 deletions(-) rename eeschema/{ee_collectors.cpp => sch_collectors.cpp} (86%) rename eeschema/{ee_collectors.h => sch_collectors.h} (95%) rename eeschema/tools/{ee_actions.cpp => sch_actions.cpp} (81%) rename eeschema/tools/{ee_actions.h => sch_actions.h} (99%) rename eeschema/tools/{ee_inspection_tool.cpp => sch_inspection_tool.cpp} (78%) rename eeschema/tools/{ee_inspection_tool.h => sch_inspection_tool.h} (89%) rename eeschema/tools/{ee_point_editor.cpp => sch_point_editor.cpp} (94%) rename eeschema/tools/{ee_point_editor.h => sch_point_editor.h} (94%) rename eeschema/tools/{ee_selection.cpp => sch_selection.cpp} (92%) rename eeschema/tools/{ee_selection.h => sch_selection.h} (91%) rename eeschema/tools/{ee_selection_tool.cpp => sch_selection_tool.cpp} (88%) rename eeschema/tools/{ee_selection_tool.h => sch_selection_tool.h} (92%) rename eeschema/tools/{ee_tool_base.h => sch_tool_base.h} (93%) rename eeschema/tools/{ee_tool_utils.cpp => sch_tool_utils.cpp} (99%) rename eeschema/tools/{ee_tool_utils.h => sch_tool_utils.h} (100%) diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index d59a61e47f..8b38c7e229 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -359,7 +359,6 @@ set( EESCHEMA_SRCS cross-probing.cpp design_block_tree_model_adapter.cpp design_block_utils.cpp - ee_collectors.cpp eeschema_config.cpp eeschema_helpers.cpp eeschema_jobs_handler.cpp @@ -383,6 +382,7 @@ set( EESCHEMA_SRCS sch_base_frame.cpp sch_bitmap.cpp sch_bus_entry.cpp + sch_collectors.cpp sch_commit.cpp sch_connection.cpp sch_draw_panel.cpp @@ -446,14 +446,9 @@ set( EESCHEMA_SRCS tools/assign_footprints.cpp tools/backannotate.cpp - tools/ee_actions.cpp tools/ee_grid_helper.cpp - tools/ee_inspection_tool.cpp - tools/ee_point_editor.cpp - tools/ee_selection.cpp - tools/ee_selection_tool.cpp - tools/ee_tool_utils.cpp tools/rule_area_create_helper.cpp + tools/sch_actions.cpp tools/sch_drawing_tools.cpp tools/sch_design_block_control.cpp tools/sch_edit_table_tool.cpp @@ -461,9 +456,14 @@ set( EESCHEMA_SRCS tools/sch_editor_control.cpp tools/sch_editor_conditions.cpp tools/sch_find_replace_tool.cpp + tools/sch_inspection_tool.cpp tools/sch_line_wire_bus_tool.cpp tools/sch_move_tool.cpp tools/sch_navigate_tool.cpp + tools/sch_point_editor.cpp + tools/sch_selection.cpp + tools/sch_selection_tool.cpp + tools/sch_tool_utils.cpp tools/symbol_editor_control.cpp tools/symbol_editor_drawing_tools.cpp tools/symbol_editor_edit_tool.cpp diff --git a/eeschema/annotate.cpp b/eeschema/annotate.cpp index 3401570ef6..f60b68793d 100644 --- a/eeschema/annotate.cpp +++ b/eeschema/annotate.cpp @@ -31,8 +31,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -138,9 +138,9 @@ void SCH_EDIT_FRAME::DeleteAnnotation( ANNOTATE_SCOPE_T aAnnotateScope, bool aRe case ANNOTATE_SELECTION: { - EE_SELECTION_TOOL* selTool = m_toolManager->GetTool(); - EE_SELECTION& selection = selTool->RequestSelection(); - SCH_SHEET_LIST selectedSheets; + SCH_SELECTION_TOOL* selTool = m_toolManager->GetTool(); + SCH_SELECTION& selection = selTool->RequestSelection(); + SCH_SHEET_LIST selectedSheets; for( EDA_ITEM* item : selection.Items() ) { @@ -178,7 +178,7 @@ void SCH_EDIT_FRAME::DeleteAnnotation( ANNOTATE_SCOPE_T aAnnotateScope, bool aRe } -std::unordered_set getInferredSymbols( const EE_SELECTION& aSelection ) +std::unordered_set getInferredSymbols( const SCH_SELECTION& aSelection ) { std::unordered_set symbols; @@ -214,13 +214,13 @@ void SCH_EDIT_FRAME::AnnotateSymbols( SCH_COMMIT* aCommit, ANNOTATE_SCOPE_T aAn bool aRecursive, int aStartNumber, bool aResetAnnotation, bool aRepairTimestamps, REPORTER& aReporter ) { - EE_SELECTION_TOOL* selTool = m_toolManager->GetTool(); - EE_SELECTION& selection = selTool->GetSelection(); + SCH_SELECTION_TOOL* selTool = m_toolManager->GetTool(); + SCH_SELECTION& selection = selTool->GetSelection(); - SCH_REFERENCE_LIST references; - SCH_SCREENS screens( Schematic().Root() ); - SCH_SHEET_LIST sheets = Schematic().Hierarchy(); - SCH_SHEET_PATH currentSheet = GetCurrentSheet(); + SCH_REFERENCE_LIST references; + SCH_SCREENS screens( Schematic().Root() ); + SCH_SHEET_LIST sheets = Schematic().Hierarchy(); + SCH_SHEET_PATH currentSheet = GetCurrentSheet(); // Store the selected sheets relative to the full hierarchy so we get the correct sheet numbers @@ -498,8 +498,8 @@ int SCH_EDIT_FRAME::CheckAnnotate( ANNOTATION_ERROR_HANDLER aErrorHandler, break; case ANNOTATE_SELECTION: - EE_SELECTION_TOOL* selTool = m_toolManager->GetTool(); - EE_SELECTION& selection = selTool->RequestSelection(); + SCH_SELECTION_TOOL* selTool = m_toolManager->GetTool(); + SCH_SELECTION& selection = selTool->RequestSelection(); for( SCH_SYMBOL* symbol : getInferredSymbols( selection ) ) GetCurrentSheet().AppendSymbol( referenceList, symbol, false, true ); diff --git a/eeschema/autoplace_fields.cpp b/eeschema/autoplace_fields.cpp index 570a8c8806..6b8ac1eabc 100644 --- a/eeschema/autoplace_fields.cpp +++ b/eeschema/autoplace_fields.cpp @@ -53,14 +53,10 @@ #include #include -#include #include -#include #include #include #include -#include -#include #include #define FIELD_PADDING schIUScale.MilsToIU( 15 ) // arbitrarily chosen for aesthetics diff --git a/eeschema/bus-wire-junction.cpp b/eeschema/bus-wire-junction.cpp index f0661732de..26ed3a9aa9 100644 --- a/eeschema/bus-wire-junction.cpp +++ b/eeschema/bus-wire-junction.cpp @@ -29,12 +29,9 @@ #include #include #include -#include -#include #include #include -#include -#include +#include #include @@ -117,7 +114,7 @@ bool SCH_EDIT_FRAME::TrimWire( SCH_COMMIT* aCommit, const VECTOR2I& aStart, cons void SCH_EDIT_FRAME::SchematicCleanUp( SCH_COMMIT* aCommit, SCH_SCREEN* aScreen ) { - EE_SELECTION_TOOL* selectionTool = m_toolManager->GetTool(); + SCH_SELECTION_TOOL* selectionTool = m_toolManager->GetTool(); std::vector lines; std::vector junctions; std::vector ncs; @@ -360,9 +357,9 @@ bool SCH_EDIT_FRAME::BreakSegmentsOnJunctions( SCH_COMMIT* aCommit, SCH_SCREEN* void SCH_EDIT_FRAME::DeleteJunction( SCH_COMMIT* aCommit, SCH_ITEM* aJunction ) { - SCH_SCREEN* screen = GetScreen(); - PICKED_ITEMS_LIST undoList; - EE_SELECTION_TOOL* selectionTool = m_toolManager->GetTool(); + SCH_SCREEN* screen = GetScreen(); + PICKED_ITEMS_LIST undoList; + SCH_SELECTION_TOOL* selectionTool = m_toolManager->GetTool(); aJunction->SetFlags( STRUCT_DELETED ); RemoveFromScreen( aJunction, screen ); diff --git a/eeschema/cross-probing.cpp b/eeschema/cross-probing.cpp index 1e46759f54..7426e85761 100644 --- a/eeschema/cross-probing.cpp +++ b/eeschema/cross-probing.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include @@ -133,7 +133,7 @@ SCH_ITEM* SCH_EDITOR_CONTROL::FindSymbolAndItem( const wxString* aPath, const wx { BOX2I bbox = symbol->GetBoundingBox(); - m_toolMgr->GetTool()->ZoomFitCrossProbeBBox( bbox ); + m_toolMgr->GetTool()->ZoomFitCrossProbeBBox( bbox ); } if( pin ) @@ -215,7 +215,7 @@ void SCH_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline ) } else if( strcmp( idcmd, "$ERC" ) == 0 ) { - GetToolManager()->RunAction( EE_ACTIONS::runERC ); + GetToolManager()->RunAction( SCH_ACTIONS::runERC ); return; } else if( strcmp( idcmd, "$NET:" ) == 0 ) @@ -230,7 +230,7 @@ void SCH_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline ) else m_highlightedConn = wxEmptyString; - GetToolManager()->RunAction( EE_ACTIONS::updateNetHighlighting ); + GetToolManager()->RunAction( SCH_ACTIONS::updateNetHighlighting ); RefreshNetNavigator(); SetStatusText( _( "Selected net:" ) + wxS( " " ) + UnescapeString( netName ) ); @@ -927,8 +927,8 @@ void SCH_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail ) m_syncingPcbToSchSelection = true; // recursion guard - GetToolManager()->GetTool()->SyncSelection( sheetPath, focusItem, - items ); + GetToolManager()->GetTool()->SyncSelection( sheetPath, focusItem, + items ); m_syncingPcbToSchSelection = false; } diff --git a/eeschema/design_block_utils.cpp b/eeschema/design_block_utils.cpp index d398247d62..29a263d13e 100644 --- a/eeschema/design_block_utils.cpp +++ b/eeschema/design_block_utils.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include @@ -370,7 +370,7 @@ void SCH_EDIT_FRAME::SaveSelectionAsDesignBlock( const wxString& aLibraryName ) } // Get all selected items - EE_SELECTION selection = m_toolManager->GetTool()->GetSelection(); + SCH_SELECTION selection = m_toolManager->GetTool()->GetSelection(); if( selection.Empty() ) { diff --git a/eeschema/dialogs/dialog_erc.cpp b/eeschema/dialogs/dialog_erc.cpp index 8f16b1f9b5..76301200b4 100644 --- a/eeschema/dialogs/dialog_erc.cpp +++ b/eeschema/dialogs/dialog_erc.cpp @@ -34,8 +34,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -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( EE_ACTIONS::clearSelection ); + m_parent->GetToolManager()->RunAction( SCH_ACTIONS::clearSelection ); m_markerTreeModel->DeleteCurrentItem( true ); @@ -570,7 +570,7 @@ void DIALOG_ERC::OnERCItemSelected( wxDataViewEvent& aEvent ) if( !sheet.empty() && sheet != m_parent->GetCurrentSheet() ) { m_parent->GetToolManager()->RunAction( ACTIONS::cancelInteractive ); - m_parent->GetToolManager()->RunAction( EE_ACTIONS::clearSelection ); + m_parent->GetToolManager()->RunAction( SCH_ACTIONS::clearSelection ); // Store the current zoom level into the current screen before switching m_parent->GetScreen()->m_LastZoomLevel = m_parent->GetCanvas()->GetView()->GetScale(); @@ -604,9 +604,9 @@ void DIALOG_ERC::OnERCItemDClick( wxDataViewEvent& aEvent ) void DIALOG_ERC::OnERCItemRClick( wxDataViewEvent& aEvent ) { - TOOL_MANAGER* toolMgr = m_parent->GetToolManager(); - EE_INSPECTION_TOOL* inspectionTool = toolMgr->GetTool(); - RC_TREE_NODE* node = RC_TREE_MODEL::ToNode( aEvent.GetItem() ); + TOOL_MANAGER* toolMgr = m_parent->GetToolManager(); + SCH_INSPECTION_TOOL* inspectionTool = toolMgr->GetTool(); + RC_TREE_NODE* node = RC_TREE_MODEL::ToNode( aEvent.GetItem() ); if( !node ) return; @@ -836,7 +836,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( EE_ACTIONS::clearSelection ); + m_parent->GetToolManager()->RunAction( SCH_ACTIONS::clearSelection ); SCH_SCREENS ScreenList( m_parent->Schematic().Root() ); ScreenList.DeleteMarkers( MARKER_BASE::MARKER_ERC, rcItem->GetErrorCode() ); @@ -1016,7 +1016,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( EE_ACTIONS::clearSelection ); + m_parent->GetToolManager()->RunAction( SCH_ACTIONS::clearSelection ); m_markerTreeModel->DeleteItems( false, aIncludeExclusions, false ); diff --git a/eeschema/dialogs/dialog_field_properties.cpp b/eeschema/dialogs/dialog_field_properties.cpp index 22d322c315..cf5d6830c2 100644 --- a/eeschema/dialogs/dialog_field_properties.cpp +++ b/eeschema/dialogs/dialog_field_properties.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp b/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp index a509877657..96ad652e00 100644 --- a/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp +++ b/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include @@ -69,7 +69,7 @@ static bool g_filterSelected; class DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS : public DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE { SCH_EDIT_FRAME* m_parent; - EE_SELECTION m_selection; + SCH_SELECTION m_selection; UNIT_BINDER m_textSize; UNIT_BINDER m_lineWidth; @@ -162,7 +162,7 @@ DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::~DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS() bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataToWindow() { - EE_SELECTION_TOOL* selectionTool = m_parent->GetToolManager()->GetTool(); + SCH_SELECTION_TOOL* selectionTool = m_parent->GetToolManager()->GetTool(); m_selection = selectionTool->GetSelection(); m_references->SetValue( g_modifyReferences ); diff --git a/eeschema/dialogs/dialog_symbol_fields_table.cpp b/eeschema/dialogs/dialog_symbol_fields_table.cpp index 66eac2857f..0c02f7d207 100644 --- a/eeschema/dialogs/dialog_symbol_fields_table.cpp +++ b/eeschema/dialogs/dialog_symbol_fields_table.cpp @@ -542,10 +542,10 @@ bool DIALOG_SYMBOL_FIELDS_TABLE::TransferDataToWindow() if( !wxDialog::TransferDataFromWindow() ) return false; - TOOL_MANAGER* toolMgr = m_parent->GetToolManager(); - EE_SELECTION_TOOL* selectionTool = toolMgr->GetTool(); - EE_SELECTION& selection = selectionTool->GetSelection(); - SCH_SYMBOL* symbol = nullptr; + TOOL_MANAGER* toolMgr = m_parent->GetToolManager(); + SCH_SELECTION_TOOL* selectionTool = toolMgr->GetTool(); + SCH_SELECTION& selection = selectionTool->GetSelection(); + SCH_SYMBOL* symbol = nullptr; UpdateScope(); @@ -1185,8 +1185,7 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnTableRangeSelected( wxGridRangeSelectEvent& a } else if( m_radioSelect->GetValue() ) { - EE_SELECTION_TOOL* selTool = m_parent->GetToolManager()->GetTool(); - + SCH_SELECTION_TOOL* selTool = m_parent->GetToolManager()->GetTool(); std::vector items( symbols.begin(), symbols.end() ); if( refs.size() > 0 ) diff --git a/eeschema/dialogs/dialog_symbol_properties.cpp b/eeschema/dialogs/dialog_symbol_properties.cpp index a29159010a..c299bcf538 100644 --- a/eeschema/dialogs/dialog_symbol_properties.cpp +++ b/eeschema/dialogs/dialog_symbol_properties.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/eeschema/dialogs/dialog_table_properties.cpp b/eeschema/dialogs/dialog_table_properties.cpp index e327242085..05d040565f 100644 --- a/eeschema/dialogs/dialog_table_properties.cpp +++ b/eeschema/dialogs/dialog_table_properties.cpp @@ -22,7 +22,6 @@ */ #include -#include #include #include #include diff --git a/eeschema/dialogs/dialog_tablecell_properties.cpp b/eeschema/dialogs/dialog_tablecell_properties.cpp index 1898b20d22..45955369a1 100644 --- a/eeschema/dialogs/dialog_tablecell_properties.cpp +++ b/eeschema/dialogs/dialog_tablecell_properties.cpp @@ -22,7 +22,6 @@ */ #include -#include #include #include #include diff --git a/eeschema/dialogs/panel_setup_pinmap.cpp b/eeschema/dialogs/panel_setup_pinmap.cpp index 3752f1e61f..eaa696d397 100644 --- a/eeschema/dialogs/panel_setup_pinmap.cpp +++ b/eeschema/dialogs/panel_setup_pinmap.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index 7bf5b03fb7..fb78c74d0e 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -46,7 +46,7 @@ #include #include #include -#include +#include /// Helper for all the old plotting/printing code while it still exists @@ -73,7 +73,7 @@ bool SCH_EDIT_FRAME::LoadProjectSettings() PROJECT_LOCAL_SETTINGS& localSettings = Prj().GetLocalSettings(); - EE_SELECTION_TOOL* selTool = GetToolManager()->GetTool(); + SCH_SELECTION_TOOL* selTool = GetToolManager()->GetTool(); selTool->GetFilter() = localSettings.m_SchSelectionFilter; m_selectionFilterPanel->SetCheckboxesFromFilter( localSettings.m_SchSelectionFilter ); @@ -243,7 +243,7 @@ void SCH_EDIT_FRAME::SaveProjectLocalSettings() m_schematic->RecordERCExclusions(); PROJECT_LOCAL_SETTINGS& localSettings = Prj().GetLocalSettings(); - EE_SELECTION_TOOL* selTool = GetToolManager()->GetTool(); + SCH_SELECTION_TOOL* selTool = GetToolManager()->GetTool(); localSettings.m_SchSelectionFilter = selTool->GetFilter(); } diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index 72e56d0cc9..64da930107 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -71,9 +71,8 @@ #include #include #include -#include -#include -#include +#include +#include #include #include // For ::ResolvePossibleSymlinks #include @@ -149,7 +148,7 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in ClearUndoRedoList(); ClearRepeatItemsList(); SetScreen( nullptr ); - m_toolManager->GetTool()->Reset( TOOL_BASE::SUPERMODEL_RELOAD ); + m_toolManager->GetTool()->Reset( TOOL_BASE::SUPERMODEL_RELOAD ); CreateScreens(); } @@ -673,7 +672,7 @@ void SCH_EDIT_FRAME::OnImportProject( wxCommandEvent& aEvent ) eeconfig()->m_System.show_import_issues = importOptions.GetShowIssues(); // Don't leave dangling pointers to previously-opened document. - m_toolManager->GetTool()->ClearSelection(); + m_toolManager->GetTool()->ClearSelection(); ClearUndoRedoList(); ClearRepeatItemsList(); diff --git a/eeschema/menubar.cpp b/eeschema/menubar.cpp index 313fe7762b..a0c39508e8 100644 --- a/eeschema/menubar.cpp +++ b/eeschema/menubar.cpp @@ -31,8 +31,8 @@ #include #include #include -#include -#include +#include +#include #include "eeschema_id.h" #include "sch_edit_frame.h" #include @@ -41,7 +41,7 @@ void SCH_EDIT_FRAME::doReCreateMenuBar() { - EE_SELECTION_TOOL* selTool = m_toolManager->GetTool(); + SCH_SELECTION_TOOL* selTool = m_toolManager->GetTool(); // wxWidgets handles the Mac Application menu behind the scenes, but that means // we always have to start from scratch with a new wxMenuBar. @@ -89,7 +89,7 @@ void SCH_EDIT_FRAME::doReCreateMenuBar() if( Kiface().IsSingle() ) fileMenu->Add( ACTIONS::saveAs ); else - fileMenu->Add( EE_ACTIONS::saveCurrSheetCopyAs ); + fileMenu->Add( SCH_ACTIONS::saveCurrSheetCopyAs ); fileMenu->Add( ACTIONS::revert ); @@ -105,9 +105,8 @@ void SCH_EDIT_FRAME::doReCreateMenuBar() ID_IMPORT_NON_KICAD_SCH, BITMAPS::import_document ); - submenuImport->Add( EE_ACTIONS::importFPAssignments, ACTION_MENU::NORMAL, - _( "Footprint Assignments..." ) ); - submenuImport->Add( EE_ACTIONS::importGraphics, ACTION_MENU::NORMAL, _( "Graphics..." ) ); + submenuImport->Add( SCH_ACTIONS::importFPAssignments, ACTION_MENU::NORMAL, _( "Footprint Assignments..." ) ); + submenuImport->Add( SCH_ACTIONS::importGraphics, ACTION_MENU::NORMAL, _( "Graphics..." ) ); fileMenu->Add( submenuImport ); @@ -116,17 +115,14 @@ void SCH_EDIT_FRAME::doReCreateMenuBar() ACTION_MENU* submenuExport = new ACTION_MENU( false, selTool ); submenuExport->SetTitle( _( "Export" ) ); submenuExport->SetIcon( BITMAPS::export_file ); - submenuExport->Add( EE_ACTIONS::drawSheetOnClipboard, ACTION_MENU::NORMAL, - _( "Drawing to Clipboard" ) ); - submenuExport->Add( EE_ACTIONS::exportNetlist, ACTION_MENU::NORMAL, _( "Netlist..." ) ); - submenuExport->Add( EE_ACTIONS::exportSymbolsToLibrary, ACTION_MENU::NORMAL, - _( "Symbols to Library..." ) ); - submenuExport->Add( EE_ACTIONS::exportSymbolsToNewLibrary, ACTION_MENU::NORMAL, - _( "Symbols to New Library..." ) ); + submenuExport->Add( SCH_ACTIONS::drawSheetOnClipboard, ACTION_MENU::NORMAL, _( "Drawing to Clipboard" ) ); + submenuExport->Add( SCH_ACTIONS::exportNetlist, ACTION_MENU::NORMAL, _( "Netlist..." ) ); + submenuExport->Add( SCH_ACTIONS::exportSymbolsToLibrary, ACTION_MENU::NORMAL, _( "Symbols to Library..." ) ); + submenuExport->Add( SCH_ACTIONS::exportSymbolsToNewLibrary, ACTION_MENU::NORMAL, _( "Symbols to New Library..." ) ); fileMenu->Add( submenuExport ); fileMenu->AppendSeparator(); - fileMenu->Add( EE_ACTIONS::schematicSetup ); + fileMenu->Add( SCH_ACTIONS::schematicSetup ); fileMenu->AppendSeparator(); fileMenu->Add( ACTIONS::pageSettings ); @@ -162,17 +158,17 @@ void SCH_EDIT_FRAME::doReCreateMenuBar() editMenu->AppendSeparator(); editMenu->Add( ACTIONS::deleteTool ); - editMenu->Add( EE_ACTIONS::editTextAndGraphics ); - editMenu->Add( EE_ACTIONS::changeSymbols ); - editMenu->Add( EE_ACTIONS::editPageNumber ); + editMenu->Add( SCH_ACTIONS::editTextAndGraphics ); + editMenu->Add( SCH_ACTIONS::changeSymbols ); + editMenu->Add( SCH_ACTIONS::editPageNumber ); ACTION_MENU* submenuAttributes = new ACTION_MENU( false, selTool ); submenuAttributes->SetTitle( _( "Attributes" ) ); - submenuAttributes->Add( EE_ACTIONS::setExcludeFromSimulation, ACTION_MENU::CHECK ); - submenuAttributes->Add( EE_ACTIONS::setExcludeFromBOM, ACTION_MENU::CHECK ); - submenuAttributes->Add( EE_ACTIONS::setExcludeFromBoard, ACTION_MENU::CHECK ); - submenuAttributes->Add( EE_ACTIONS::setDNP, ACTION_MENU::CHECK ); + submenuAttributes->Add( SCH_ACTIONS::setExcludeFromSimulation, ACTION_MENU::CHECK ); + submenuAttributes->Add( SCH_ACTIONS::setExcludeFromBOM, ACTION_MENU::CHECK ); + submenuAttributes->Add( SCH_ACTIONS::setExcludeFromBoard, ACTION_MENU::CHECK ); + submenuAttributes->Add( SCH_ACTIONS::setDNP, ACTION_MENU::CHECK ); editMenu->Add( submenuAttributes ); @@ -186,13 +182,13 @@ void SCH_EDIT_FRAME::doReCreateMenuBar() showHidePanels->Add( ACTIONS::showProperties, ACTION_MENU::CHECK ); showHidePanels->Add( ACTIONS::showSearch, ACTION_MENU::CHECK ); - showHidePanels->Add( EE_ACTIONS::showHierarchy, ACTION_MENU::CHECK ); + showHidePanels->Add( SCH_ACTIONS::showHierarchy, ACTION_MENU::CHECK ); if( ADVANCED_CFG::GetCfg().m_IncrementalConnectivity ) - showHidePanels->Add( EE_ACTIONS::showNetNavigator, ACTION_MENU::CHECK ); + showHidePanels->Add( SCH_ACTIONS::showNetNavigator, ACTION_MENU::CHECK ); if( ADVANCED_CFG::GetCfg().m_EnableDesignBlocks ) - showHidePanels->Add( EE_ACTIONS::showDesignBlockPanel, ACTION_MENU::CHECK, + showHidePanels->Add( SCH_ACTIONS::showDesignBlockPanel, ACTION_MENU::CHECK, _( "Design Blocks" ) ); viewMenu->Add( showHidePanels ); @@ -209,25 +205,25 @@ void SCH_EDIT_FRAME::doReCreateMenuBar() viewMenu->Add( ACTIONS::zoomRedraw ); viewMenu->AppendSeparator(); - viewMenu->Add( EE_ACTIONS::navigateBack ); - viewMenu->Add( EE_ACTIONS::navigateUp ); - viewMenu->Add( EE_ACTIONS::navigateForward ); - viewMenu->Add( EE_ACTIONS::navigatePrevious ); - viewMenu->Add( EE_ACTIONS::navigateNext ); + viewMenu->Add( SCH_ACTIONS::navigateBack ); + viewMenu->Add( SCH_ACTIONS::navigateUp ); + viewMenu->Add( SCH_ACTIONS::navigateForward ); + viewMenu->Add( SCH_ACTIONS::navigatePrevious ); + viewMenu->Add( SCH_ACTIONS::navigateNext ); viewMenu->AppendSeparator(); - viewMenu->Add( EE_ACTIONS::toggleHiddenPins, ACTION_MENU::CHECK ); - viewMenu->Add( EE_ACTIONS::toggleHiddenFields, ACTION_MENU::CHECK ); - viewMenu->Add( EE_ACTIONS::toggleDirectiveLabels, ACTION_MENU::CHECK ); - viewMenu->Add( EE_ACTIONS::toggleERCErrors, ACTION_MENU::CHECK ); - viewMenu->Add( EE_ACTIONS::toggleERCWarnings, ACTION_MENU::CHECK ); - viewMenu->Add( EE_ACTIONS::toggleERCExclusions, ACTION_MENU::CHECK ); - viewMenu->Add( EE_ACTIONS::markSimExclusions, ACTION_MENU::CHECK ); - viewMenu->Add( EE_ACTIONS::toggleOPVoltages, ACTION_MENU::CHECK ); - viewMenu->Add( EE_ACTIONS::toggleOPCurrents, ACTION_MENU::CHECK ); - viewMenu->Add( EE_ACTIONS::togglePinAltIcons, ACTION_MENU::CHECK ); + viewMenu->Add( SCH_ACTIONS::toggleHiddenPins, ACTION_MENU::CHECK ); + viewMenu->Add( SCH_ACTIONS::toggleHiddenFields, ACTION_MENU::CHECK ); + viewMenu->Add( SCH_ACTIONS::toggleDirectiveLabels, ACTION_MENU::CHECK ); + viewMenu->Add( SCH_ACTIONS::toggleERCErrors, ACTION_MENU::CHECK ); + viewMenu->Add( SCH_ACTIONS::toggleERCWarnings, ACTION_MENU::CHECK ); + viewMenu->Add( SCH_ACTIONS::toggleERCExclusions, ACTION_MENU::CHECK ); + viewMenu->Add( SCH_ACTIONS::markSimExclusions, ACTION_MENU::CHECK ); + viewMenu->Add( SCH_ACTIONS::toggleOPVoltages, ACTION_MENU::CHECK ); + viewMenu->Add( SCH_ACTIONS::toggleOPCurrents, ACTION_MENU::CHECK ); + viewMenu->Add( SCH_ACTIONS::togglePinAltIcons, ACTION_MENU::CHECK ); #ifdef __APPLE__ viewMenu->AppendSeparator(); @@ -237,54 +233,54 @@ void SCH_EDIT_FRAME::doReCreateMenuBar() // ACTION_MENU* placeMenu = new ACTION_MENU( false, selTool ); - placeMenu->Add( EE_ACTIONS::placeSymbol ); - placeMenu->Add( EE_ACTIONS::placePower ); - placeMenu->Add( EE_ACTIONS::drawWire ); - placeMenu->Add( EE_ACTIONS::drawBus ); - placeMenu->Add( EE_ACTIONS::placeBusWireEntry ); - placeMenu->Add( EE_ACTIONS::placeNoConnect ); - placeMenu->Add( EE_ACTIONS::placeJunction ); - placeMenu->Add( EE_ACTIONS::placeLabel ); - placeMenu->Add( EE_ACTIONS::placeGlobalLabel ); - placeMenu->Add( EE_ACTIONS::placeClassLabel ); - placeMenu->Add( EE_ACTIONS::drawRuleArea ); + placeMenu->Add( SCH_ACTIONS::placeSymbol ); + placeMenu->Add( SCH_ACTIONS::placePower ); + placeMenu->Add( SCH_ACTIONS::drawWire ); + placeMenu->Add( SCH_ACTIONS::drawBus ); + placeMenu->Add( SCH_ACTIONS::placeBusWireEntry ); + placeMenu->Add( SCH_ACTIONS::placeNoConnect ); + placeMenu->Add( SCH_ACTIONS::placeJunction ); + placeMenu->Add( SCH_ACTIONS::placeLabel ); + placeMenu->Add( SCH_ACTIONS::placeGlobalLabel ); + placeMenu->Add( SCH_ACTIONS::placeClassLabel ); + placeMenu->Add( SCH_ACTIONS::drawRuleArea ); placeMenu->AppendSeparator(); - placeMenu->Add( EE_ACTIONS::placeHierLabel ); - placeMenu->Add( EE_ACTIONS::drawSheet ); - placeMenu->Add( EE_ACTIONS::placeSheetPin ); - placeMenu->Add( EE_ACTIONS::syncAllSheetsPins ); - placeMenu->Add( EE_ACTIONS::importSheet ); + placeMenu->Add( SCH_ACTIONS::placeHierLabel ); + placeMenu->Add( SCH_ACTIONS::drawSheet ); + placeMenu->Add( SCH_ACTIONS::placeSheetPin ); + placeMenu->Add( SCH_ACTIONS::syncAllSheetsPins ); + placeMenu->Add( SCH_ACTIONS::importSheet ); placeMenu->AppendSeparator(); - placeMenu->Add( EE_ACTIONS::placeSchematicText ); - placeMenu->Add( EE_ACTIONS::drawTextBox ); - placeMenu->Add( EE_ACTIONS::drawTable ); - placeMenu->Add( EE_ACTIONS::drawRectangle ); - placeMenu->Add( EE_ACTIONS::drawCircle ); - placeMenu->Add( EE_ACTIONS::drawArc ); - placeMenu->Add( EE_ACTIONS::drawBezier ); - placeMenu->Add( EE_ACTIONS::drawLines ); - placeMenu->Add( EE_ACTIONS::placeImage ); + placeMenu->Add( SCH_ACTIONS::placeSchematicText ); + placeMenu->Add( SCH_ACTIONS::drawTextBox ); + placeMenu->Add( SCH_ACTIONS::drawTable ); + placeMenu->Add( SCH_ACTIONS::drawRectangle ); + placeMenu->Add( SCH_ACTIONS::drawCircle ); + placeMenu->Add( SCH_ACTIONS::drawArc ); + placeMenu->Add( SCH_ACTIONS::drawBezier ); + placeMenu->Add( SCH_ACTIONS::drawLines ); + placeMenu->Add( SCH_ACTIONS::placeImage ); //-- Inspect menu ----------------------------------------------- // ACTION_MENU* inspectMenu = new ACTION_MENU( false, selTool ); - inspectMenu->Add( EE_ACTIONS::showBusSyntaxHelp ); + inspectMenu->Add( SCH_ACTIONS::showBusSyntaxHelp ); inspectMenu->AppendSeparator(); - inspectMenu->Add( EE_ACTIONS::runERC ); + inspectMenu->Add( SCH_ACTIONS::runERC ); inspectMenu->Add( ACTIONS::prevMarker ); inspectMenu->Add( ACTIONS::nextMarker ); inspectMenu->Add( ACTIONS::excludeMarker ); inspectMenu->AppendSeparator(); - inspectMenu->Add( EE_ACTIONS::diffSymbol ); + inspectMenu->Add( SCH_ACTIONS::diffSymbol ); inspectMenu->AppendSeparator(); - inspectMenu->Add( EE_ACTIONS::showSimulator ); + inspectMenu->Add( SCH_ACTIONS::showSimulator ); //-- Tools menu ----------------------------------------------- @@ -294,34 +290,34 @@ void SCH_EDIT_FRAME::doReCreateMenuBar() wxMenuItem* update = toolsMenu->Add( ACTIONS::updatePcbFromSchematic ); update->Enable( !Kiface().IsSingle() ); - toolsMenu->Add( EE_ACTIONS::showPcbNew ); + toolsMenu->Add( SCH_ACTIONS::showPcbNew ); if( !Kiface().IsSingle() ) toolsMenu->Add( ACTIONS::showProjectManager ); toolsMenu->AppendSeparator(); toolsMenu->Add( ACTIONS::showSymbolEditor ); - toolsMenu->Add( EE_ACTIONS::updateSymbols ); + toolsMenu->Add( SCH_ACTIONS::updateSymbols ); toolsMenu->AppendSeparator(); - toolsMenu->Add( EE_ACTIONS::rescueSymbols ); - toolsMenu->Add( EE_ACTIONS::remapSymbols ); + toolsMenu->Add( SCH_ACTIONS::rescueSymbols ); + toolsMenu->Add( SCH_ACTIONS::remapSymbols ); if( ADVANCED_CFG::GetCfg().m_ShowRepairSchematic ) - toolsMenu->Add( EE_ACTIONS::repairSchematic ); + toolsMenu->Add( SCH_ACTIONS::repairSchematic ); toolsMenu->AppendSeparator(); - toolsMenu->Add( EE_ACTIONS::editSymbolFields ); - toolsMenu->Add( EE_ACTIONS::editSymbolLibraryLinks ); + toolsMenu->Add( SCH_ACTIONS::editSymbolFields ); + toolsMenu->Add( SCH_ACTIONS::editSymbolLibraryLinks ); toolsMenu->AppendSeparator(); - toolsMenu->Add( EE_ACTIONS::annotate ); - toolsMenu->Add( EE_ACTIONS::incrementAnnotations ); + toolsMenu->Add( SCH_ACTIONS::annotate ); + toolsMenu->Add( SCH_ACTIONS::incrementAnnotations ); toolsMenu->AppendSeparator(); - toolsMenu->Add( EE_ACTIONS::assignFootprints ); - toolsMenu->Add( EE_ACTIONS::generateBOM ); - toolsMenu->Add( EE_ACTIONS::generateBOMLegacy ); + toolsMenu->Add( SCH_ACTIONS::assignFootprints ); + toolsMenu->Add( SCH_ACTIONS::generateBOM ); + toolsMenu->Add( SCH_ACTIONS::generateBOMLegacy ); toolsMenu->AppendSeparator(); update = toolsMenu->Add( ACTIONS::updateSchematicFromPcb ); diff --git a/eeschema/net_navigator.cpp b/eeschema/net_navigator.cpp index f4f6a928f7..7b1c100d94 100644 --- a/eeschema/net_navigator.cpp +++ b/eeschema/net_navigator.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include static wxString GetNetNavigatorItemText( const SCH_ITEM* aItem, @@ -542,7 +542,7 @@ void SCH_EDIT_FRAME::onNetNavigatorSelection( wxTreeEvent& aEvent ) if( GetCurrentSheet() != itemData->GetSheetPath() ) { - GetToolManager()->RunAction( EE_ACTIONS::changeSheet, + GetToolManager()->RunAction( SCH_ACTIONS::changeSheet, &itemData->GetSheetPath() ); } diff --git a/eeschema/picksymbol.cpp b/eeschema/picksymbol.cpp index cbe224b6b9..20910dfcdd 100644 --- a/eeschema/picksymbol.cpp +++ b/eeschema/picksymbol.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include @@ -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( EE_ACTIONS::addItemToSel, aSymbol ); + m_toolManager->RunAction( SCH_ACTIONS::addItemToSel, aSymbol ); commit.Push( _( "Change Body Style" ) ); } diff --git a/eeschema/printing/sch_printout.cpp b/eeschema/printing/sch_printout.cpp index 2090254740..a9349164b0 100644 --- a/eeschema/printing/sch_printout.cpp +++ b/eeschema/printing/sch_printout.cpp @@ -20,7 +20,7 @@ #include "sch_printout.h" #include -#include +#include #include #include #include @@ -138,10 +138,10 @@ bool SCH_PRINTOUT::PrintPage( SCH_SCREEN* aScreen, wxDC* aDC, bool aForPrinting painter->SetSchematic( &m_parent->Schematic() ); - SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager(); - EESCHEMA_SETTINGS* cfg = m_parent->eeconfig(); - COLOR_SETTINGS* theme = mgr.GetColorSettings( cfg->m_Printing.color_theme ); - EE_SELECTION_TOOL* selTool = m_parent->GetToolManager()->GetTool(); + SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager(); + EESCHEMA_SETTINGS* cfg = m_parent->eeconfig(); + COLOR_SETTINGS* theme = mgr.GetColorSettings( cfg->m_Printing.color_theme ); + SCH_SELECTION_TOOL* selTool = m_parent->GetToolManager()->GetTool(); // Target paper size wxRect pageSizePix; diff --git a/eeschema/sch_base_frame.cpp b/eeschema/sch_base_frame.cpp index 1d55e45a7b..67c5747471 100644 --- a/eeschema/sch_base_frame.cpp +++ b/eeschema/sch_base_frame.cpp @@ -47,8 +47,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -111,7 +110,7 @@ SCH_BASE_FRAME::SCH_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aWindo // wxWidgets, we can't get modifier-key-up events. if( m_toolManager ) { - EE_SELECTION_TOOL* selTool = m_toolManager->GetTool(); + SCH_SELECTION_TOOL* selTool = m_toolManager->GetTool(); if( selTool ) selTool->OnIdle( aEvent ); @@ -434,9 +433,9 @@ void SCH_BASE_FRAME::RefreshZoomDependentItems() // items. if( m_toolManager ) { - EE_SELECTION_TOOL* selectionTool = m_toolManager->GetTool(); - SELECTION& selection = selectionTool->GetSelection(); - KIGFX::SCH_VIEW* view = GetCanvas()->GetView(); + SCH_SELECTION_TOOL* selectionTool = m_toolManager->GetTool(); + SELECTION& selection = selectionTool->GetSelection(); + KIGFX::SCH_VIEW* view = GetCanvas()->GetView(); for( EDA_ITEM* item : selection ) { diff --git a/eeschema/ee_collectors.cpp b/eeschema/sch_collectors.cpp similarity index 86% rename from eeschema/ee_collectors.cpp rename to eeschema/sch_collectors.cpp index 4be04137fc..b71d4bf16f 100644 --- a/eeschema/ee_collectors.cpp +++ b/eeschema/sch_collectors.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include @@ -35,7 +35,7 @@ #include "sch_reference_list.h" -const std::vector EE_COLLECTOR::EditableItems = { +const std::vector SCH_COLLECTOR::EditableItems = { SCH_SHAPE_T, SCH_TEXT_T, SCH_TEXTBOX_T, @@ -56,7 +56,7 @@ const std::vector EE_COLLECTOR::EditableItems = { }; -const std::vector EE_COLLECTOR::MovableItems = +const std::vector SCH_COLLECTOR::MovableItems = { SCH_MARKER_T, SCH_JUNCTION_T, @@ -82,21 +82,21 @@ const std::vector EE_COLLECTOR::MovableItems = }; -const std::vector EE_COLLECTOR::FieldOwners = { +const std::vector SCH_COLLECTOR::FieldOwners = { SCH_SYMBOL_T, SCH_SHEET_T, SCH_LABEL_LOCATE_ANY_T }; -INSPECT_RESULT EE_COLLECTOR::Inspect( EDA_ITEM* aItem, void* aTestData ) +INSPECT_RESULT SCH_COLLECTOR::Inspect( EDA_ITEM* aItem, void* aTestData ) { if( m_Unit || m_BodyStyle ) { SCH_ITEM* schItem = dynamic_cast( aItem ); // Special selection rules apply to pins of different units when edited in synchronized - // pins mode. Leave it to EE_SELECTION_TOOL::Selectable() to decide what to do with them. + // pins mode. Leave it to SCH_SELECTION_TOOL::Selectable() to decide what to do with them. if( schItem && schItem->Type() != SCH_PIN_T ) { @@ -120,8 +120,8 @@ INSPECT_RESULT EE_COLLECTOR::Inspect( EDA_ITEM* aItem, void* aTestData ) } -void EE_COLLECTOR::Collect( SCH_SCREEN* aScreen, const std::vector& aFilterList, - const VECTOR2I& aPos, int aUnit, int aConvert ) +void SCH_COLLECTOR::Collect( SCH_SCREEN* aScreen, const std::vector& aFilterList, + const VECTOR2I& aPos, int aUnit, int aConvert ) { Empty(); // empty the collection just in case @@ -140,8 +140,8 @@ void EE_COLLECTOR::Collect( SCH_SCREEN* aScreen, const std::vector& aFi } -void EE_COLLECTOR::Collect( LIB_ITEMS_CONTAINER& aItems, const std::vector& aFilterList, - const VECTOR2I& aPos, int aUnit, int aConvert ) +void SCH_COLLECTOR::Collect( LIB_ITEMS_CONTAINER& aItems, const std::vector& aFilterList, + const VECTOR2I& aPos, int aUnit, int aConvert ) { Empty(); // empty the collection just in case @@ -160,7 +160,7 @@ void EE_COLLECTOR::Collect( LIB_ITEMS_CONTAINER& aItems, const std::vector #include @@ -36,14 +36,14 @@ class SCH_SHEET_PATH; class SCH_SYMBOL; -class EE_COLLECTOR : public COLLECTOR +class SCH_COLLECTOR : public COLLECTOR { public: static const std::vector EditableItems; static const std::vector MovableItems; static const std::vector FieldOwners; - EE_COLLECTOR( const std::vector& aScanTypes = { SCH_LOCATE_ANY_T } ) : + SCH_COLLECTOR( const std::vector& aScanTypes = { SCH_LOCATE_ANY_T } ) : m_Unit( 0 ), m_BodyStyle( 0 ), m_ShowPinElectricalTypes( false ) @@ -111,4 +111,4 @@ public: void CollectOtherUnits( const wxString& thisRef, int thisUnit, const LIB_ID& aLibId, SCH_SHEET_PATH& aSheet, std::vector* otherUnits ); -#endif // EE_COLLECTORS_H +#endif // SCH_COLLECTORS_H diff --git a/eeschema/sch_commit.cpp b/eeschema/sch_commit.cpp index fc78be90a6..13da59b0a9 100644 --- a/eeschema/sch_commit.cpp +++ b/eeschema/sch_commit.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include @@ -47,7 +47,7 @@ SCH_COMMIT::SCH_COMMIT( TOOL_MANAGER* aToolMgr ) : } -SCH_COMMIT::SCH_COMMIT( EE_TOOL_BASE* aTool ) +SCH_COMMIT::SCH_COMMIT( SCH_TOOL_BASE* aTool ) { m_toolMgr = aTool->GetManager(); m_isLibEditor = aTool->IsSymbolEditor(); @@ -180,7 +180,7 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags ) KIGFX::VIEW* view = m_toolMgr->GetView(); SCH_EDIT_FRAME* frame = static_cast( m_toolMgr->GetToolHolder() ); - EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); bool itemsDeselected = false; bool selectedModified = false; bool dirtyConnectivity = false; @@ -488,9 +488,9 @@ void SCH_COMMIT::revertLibEdit() return; // Symbol editor just saves copies of the whole symbol, so grab the first and discard the rest - SYMBOL_EDIT_FRAME* frame = dynamic_cast( m_toolMgr->GetToolHolder() ); - LIB_SYMBOL* copy = dynamic_cast( m_changes.front().m_copy ); - EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + SYMBOL_EDIT_FRAME* frame = dynamic_cast( m_toolMgr->GetToolHolder() ); + LIB_SYMBOL* copy = dynamic_cast( m_changes.front().m_copy ); + SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); if( frame && copy ) { @@ -510,10 +510,10 @@ void SCH_COMMIT::revertLibEdit() void SCH_COMMIT::Revert() { - KIGFX::VIEW* view = m_toolMgr->GetView(); - SCH_EDIT_FRAME* frame = dynamic_cast( m_toolMgr->GetToolHolder() ); - EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - SCH_SHEET_LIST sheets; + KIGFX::VIEW* view = m_toolMgr->GetView(); + SCH_EDIT_FRAME* frame = dynamic_cast( m_toolMgr->GetToolHolder() ); + SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + SCH_SHEET_LIST sheets; if( m_changes.empty() ) return; diff --git a/eeschema/sch_commit.h b/eeschema/sch_commit.h index 9e84518e5b..edf66200b1 100644 --- a/eeschema/sch_commit.h +++ b/eeschema/sch_commit.h @@ -36,7 +36,7 @@ class EDA_DRAW_FRAME; class TOOL_BASE; template -class EE_TOOL_BASE; +class SCH_TOOL_BASE; #define SKIP_UNDO 0x0001 #define APPEND_UNDO 0x0002 @@ -47,7 +47,7 @@ class SCH_COMMIT : public COMMIT public: SCH_COMMIT( TOOL_MANAGER* aToolMgr ); SCH_COMMIT( EDA_DRAW_FRAME* aFrame ); - SCH_COMMIT( EE_TOOL_BASE* aFrame ); + SCH_COMMIT( SCH_TOOL_BASE* aFrame ); virtual ~SCH_COMMIT(); diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index f1d98c7bcb..65d865381b 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -74,10 +74,10 @@ #include #include #include -#include +#include #include -#include -#include +#include +#include #include #include #include @@ -423,7 +423,7 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : KIPLATFORM::APP::SetShutdownBlockReason( this, _( "New schematic file is unsaved" ) ); // Init for dropping files - m_acceptedExts.emplace( FILEEXT::KiCadSchematicFileExtension, &EE_ACTIONS::ddAppendFile ); + m_acceptedExts.emplace( FILEEXT::KiCadSchematicFileExtension, &SCH_ACTIONS::ddAppendFile ); DragAcceptFiles( true ); // Ensure the window is on top @@ -529,32 +529,32 @@ void SCH_EDIT_FRAME::setupTools() m_toolManager = new TOOL_MANAGER; m_toolManager->SetEnvironment( &Schematic(), GetCanvas()->GetView(), GetCanvas()->GetViewControls(), config(), this ); - m_actions = new EE_ACTIONS(); + m_actions = new SCH_ACTIONS(); m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager ); // Register tools m_toolManager->RegisterTool( new COMMON_CONTROL ); m_toolManager->RegisterTool( new COMMON_TOOLS ); m_toolManager->RegisterTool( new ZOOM_TOOL ); - m_toolManager->RegisterTool( new EE_SELECTION_TOOL ); + m_toolManager->RegisterTool( new SCH_SELECTION_TOOL ); m_toolManager->RegisterTool( new PICKER_TOOL ); m_toolManager->RegisterTool( new SCH_DRAWING_TOOLS ); m_toolManager->RegisterTool( new SCH_LINE_WIRE_BUS_TOOL ); m_toolManager->RegisterTool( new SCH_MOVE_TOOL ); m_toolManager->RegisterTool( new SCH_EDIT_TOOL ); m_toolManager->RegisterTool( new SCH_EDIT_TABLE_TOOL ); - m_toolManager->RegisterTool( new EE_INSPECTION_TOOL ); + m_toolManager->RegisterTool( new SCH_INSPECTION_TOOL ); m_toolManager->RegisterTool( new SCH_DESIGN_BLOCK_CONTROL ); m_toolManager->RegisterTool( new SCH_EDITOR_CONTROL ); m_toolManager->RegisterTool( new SCH_FIND_REPLACE_TOOL ); - m_toolManager->RegisterTool( new EE_POINT_EDITOR ); + m_toolManager->RegisterTool( new SCH_POINT_EDITOR ); m_toolManager->RegisterTool( new SCH_NAVIGATE_TOOL ); m_toolManager->RegisterTool( new PROPERTIES_TOOL ); m_toolManager->RegisterTool( new EMBED_TOOL ); m_toolManager->InitTools(); // Run the selection tool, it is supposed to be always active - m_toolManager->PostAction( EE_ACTIONS::selectionActivate ); + m_toolManager->PostAction( SCH_ACTIONS::selectionActivate ); GetCanvas()->SetEventDispatcher( m_toolDispatcher ); } @@ -622,46 +622,39 @@ void SCH_EDIT_FRAME::setupUIConditions() mgr->SetConditions( ACTIONS::undo, ENABLE( undoCond ) ); mgr->SetConditions( ACTIONS::redo, ENABLE( cond.RedoAvailable() ) ); - mgr->SetConditions( EE_ACTIONS::showSearch, CHECK( searchPaneCond ) ); - mgr->SetConditions( EE_ACTIONS::showHierarchy, CHECK( hierarchyNavigatorCond ) ); - mgr->SetConditions( EE_ACTIONS::showNetNavigator, CHECK( netNavigatorCond ) ); - mgr->SetConditions( ACTIONS::showProperties, CHECK( propertiesCond ) ); - mgr->SetConditions( EE_ACTIONS::showDesignBlockPanel, CHECK( designBlockCond ) ); - mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) ); - mgr->SetConditions( ACTIONS::toggleGridOverrides, CHECK( cond.GridOverrides() ) ); - mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); - mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MM ) ) ); - mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCH ) ) ); - mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) ); + mgr->SetConditions( SCH_ACTIONS::showSearch, CHECK( searchPaneCond ) ); + mgr->SetConditions( SCH_ACTIONS::showHierarchy, CHECK( hierarchyNavigatorCond ) ); + mgr->SetConditions( SCH_ACTIONS::showNetNavigator, CHECK( netNavigatorCond ) ); + mgr->SetConditions( ACTIONS::showProperties, CHECK( propertiesCond ) ); + mgr->SetConditions( SCH_ACTIONS::showDesignBlockPanel, CHECK( designBlockCond ) ); + mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) ); + mgr->SetConditions( ACTIONS::toggleGridOverrides, CHECK( cond.GridOverrides() ) ); + mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); + mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MM ) ) ); + mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCH ) ) ); + mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) ); - mgr->SetConditions( EE_ACTIONS::lineModeFree, - CHECK( cond.LineMode( LINE_MODE::LINE_MODE_FREE ) ) ); - mgr->SetConditions( EE_ACTIONS::lineMode90, - CHECK( cond.LineMode( LINE_MODE::LINE_MODE_90 ) ) ); - mgr->SetConditions( EE_ACTIONS::lineMode45, - CHECK( cond.LineMode( LINE_MODE::LINE_MODE_45 ) ) ); + mgr->SetConditions( SCH_ACTIONS::lineModeFree, CHECK( cond.LineMode( LINE_MODE::LINE_MODE_FREE ) ) ); + mgr->SetConditions( SCH_ACTIONS::lineMode90, CHECK( cond.LineMode( LINE_MODE::LINE_MODE_90 ) ) ); + mgr->SetConditions( SCH_ACTIONS::lineMode45, CHECK( cond.LineMode( LINE_MODE::LINE_MODE_45 ) ) ); mgr->SetConditions( ACTIONS::cut, ENABLE( hasElements ) ); mgr->SetConditions( ACTIONS::copy, ENABLE( hasElements ) ); mgr->SetConditions( ACTIONS::copyAsText, ENABLE( hasElements ) ); - mgr->SetConditions( ACTIONS::paste, - ENABLE( SELECTION_CONDITIONS::Idle && cond.NoActiveTool() ) ); - mgr->SetConditions( ACTIONS::pasteSpecial, - ENABLE( SELECTION_CONDITIONS::Idle && cond.NoActiveTool() ) ); + mgr->SetConditions( ACTIONS::paste, ENABLE( SELECTION_CONDITIONS::Idle && cond.NoActiveTool() ) ); + mgr->SetConditions( ACTIONS::pasteSpecial, ENABLE( SELECTION_CONDITIONS::Idle && cond.NoActiveTool() ) ); mgr->SetConditions( ACTIONS::doDelete, ENABLE( hasElements ) ); mgr->SetConditions( ACTIONS::duplicate, ENABLE( hasElements ) ); mgr->SetConditions( ACTIONS::selectAll, ENABLE( hasElements ) ); mgr->SetConditions( ACTIONS::unselectAll, ENABLE( hasElements ) ); - mgr->SetConditions( EE_ACTIONS::rotateCW, ENABLE( hasElements ) ); - mgr->SetConditions( EE_ACTIONS::rotateCCW, ENABLE( hasElements ) ); - mgr->SetConditions( EE_ACTIONS::mirrorH, ENABLE( hasElements ) ); - mgr->SetConditions( EE_ACTIONS::mirrorV, ENABLE( hasElements ) ); + mgr->SetConditions( SCH_ACTIONS::rotateCW, ENABLE( hasElements ) ); + mgr->SetConditions( SCH_ACTIONS::rotateCCW, ENABLE( hasElements ) ); + mgr->SetConditions( SCH_ACTIONS::mirrorH, ENABLE( hasElements ) ); + mgr->SetConditions( SCH_ACTIONS::mirrorV, ENABLE( hasElements ) ); - mgr->SetConditions( ACTIONS::zoomTool, - CHECK( cond.CurrentTool( ACTIONS::zoomTool ) ) ); - mgr->SetConditions( ACTIONS::selectionTool, - CHECK( cond.CurrentTool( ACTIONS::selectionTool ) ) ); + mgr->SetConditions( ACTIONS::zoomTool, CHECK( cond.CurrentTool( ACTIONS::zoomTool ) ) ); + mgr->SetConditions( ACTIONS::selectionTool, CHECK( cond.CurrentTool( ACTIONS::selectionTool ) ) ); auto showHiddenPinsCond = [this]( const SELECTION& ) @@ -755,65 +748,64 @@ void SCH_EDIT_FRAME::setupUIConditions() return navigateTool && navigateTool->CanGoUp(); }; - mgr->SetConditions( EE_ACTIONS::leaveSheet, ENABLE( belowRootSheetCondition ) ); + mgr->SetConditions( SCH_ACTIONS::leaveSheet, ENABLE( belowRootSheetCondition ) ); /* Some of these are bound by default to arrow keys which will get a different action if we * disable the buttons. So always leave them enabled so the action is consistent. * https://gitlab.com/kicad/code/kicad/-/issues/14783 - mgr->SetConditions( EE_ACTIONS::navigateUp, ENABLE( belowRootSheetCondition ) ); - mgr->SetConditions( EE_ACTIONS::navigateForward, ENABLE( navHistoryHasForward ) ); - mgr->SetConditions( EE_ACTIONS::navigateBack, ENABLE( navHistoryHsBackward ) ); + mgr->SetConditions( SCH_ACTIONS::navigateUp, ENABLE( belowRootSheetCondition ) ); + mgr->SetConditions( SCH_ACTIONS::navigateForward, ENABLE( navHistoryHasForward ) ); + mgr->SetConditions( SCH_ACTIONS::navigateBack, ENABLE( navHistoryHsBackward ) ); */ - mgr->SetConditions( EE_ACTIONS::remapSymbols, ENABLE( remapSymbolsCondition ) ); - mgr->SetConditions( EE_ACTIONS::toggleHiddenPins, CHECK( showHiddenPinsCond ) ); - mgr->SetConditions( EE_ACTIONS::toggleHiddenFields, CHECK( showHiddenFieldsCond ) ); - mgr->SetConditions( EE_ACTIONS::toggleDirectiveLabels, CHECK( showDirectiveLabelsCond ) ); - mgr->SetConditions( EE_ACTIONS::toggleERCErrors, CHECK( showERCErrorsCond ) ); - mgr->SetConditions( EE_ACTIONS::toggleERCWarnings, CHECK( showERCWarningsCond ) ); - mgr->SetConditions( EE_ACTIONS::toggleERCExclusions, CHECK( showERCExclusionsCond ) ); - mgr->SetConditions( EE_ACTIONS::markSimExclusions, CHECK( markSimExclusionsCond ) ); - mgr->SetConditions( EE_ACTIONS::toggleOPVoltages, CHECK( showOPVoltagesCond ) ); - mgr->SetConditions( EE_ACTIONS::toggleOPCurrents, CHECK( showOPCurrentsCond ) ); - mgr->SetConditions( EE_ACTIONS::togglePinAltIcons, CHECK( showPinAltModeIconsCond ) ); - mgr->SetConditions( EE_ACTIONS::toggleAnnotateAuto, CHECK( showAnnotateAutomaticallyCond ) ); - mgr->SetConditions( ACTIONS::toggleBoundingBoxes, CHECK( cond.BoundingBoxes() ) ); + mgr->SetConditions( SCH_ACTIONS::remapSymbols, ENABLE( remapSymbolsCondition ) ); + mgr->SetConditions( SCH_ACTIONS::toggleHiddenPins, CHECK( showHiddenPinsCond ) ); + mgr->SetConditions( SCH_ACTIONS::toggleHiddenFields, CHECK( showHiddenFieldsCond ) ); + mgr->SetConditions( SCH_ACTIONS::toggleDirectiveLabels, CHECK( showDirectiveLabelsCond ) ); + mgr->SetConditions( SCH_ACTIONS::toggleERCErrors, CHECK( showERCErrorsCond ) ); + mgr->SetConditions( SCH_ACTIONS::toggleERCWarnings, CHECK( showERCWarningsCond ) ); + mgr->SetConditions( SCH_ACTIONS::toggleERCExclusions, CHECK( showERCExclusionsCond ) ); + mgr->SetConditions( SCH_ACTIONS::markSimExclusions, CHECK( markSimExclusionsCond ) ); + mgr->SetConditions( SCH_ACTIONS::toggleOPVoltages, CHECK( showOPVoltagesCond ) ); + mgr->SetConditions( SCH_ACTIONS::toggleOPCurrents, CHECK( showOPCurrentsCond ) ); + mgr->SetConditions( SCH_ACTIONS::togglePinAltIcons, CHECK( showPinAltModeIconsCond ) ); + mgr->SetConditions( SCH_ACTIONS::toggleAnnotateAuto, CHECK( showAnnotateAutomaticallyCond ) ); + mgr->SetConditions( ACTIONS::toggleBoundingBoxes, CHECK( cond.BoundingBoxes() ) ); - mgr->SetConditions( EE_ACTIONS::saveSheetAsDesignBlock, ENABLE( hasElements ) ); - mgr->SetConditions( EE_ACTIONS::saveSelectionAsDesignBlock, - ENABLE( SELECTION_CONDITIONS::NotEmpty ) ); + mgr->SetConditions( SCH_ACTIONS::saveSheetAsDesignBlock, ENABLE( hasElements ) ); + mgr->SetConditions( SCH_ACTIONS::saveSelectionAsDesignBlock, ENABLE( SELECTION_CONDITIONS::NotEmpty ) ); #define CURRENT_TOOL( action ) mgr->SetConditions( action, CHECK( cond.CurrentTool( action ) ) ) CURRENT_TOOL( ACTIONS::deleteTool ); - CURRENT_TOOL( EE_ACTIONS::highlightNetTool ); - CURRENT_TOOL( EE_ACTIONS::placeSymbol ); - CURRENT_TOOL( EE_ACTIONS::placePower ); - CURRENT_TOOL( EE_ACTIONS::placeDesignBlock ); - CURRENT_TOOL( EE_ACTIONS::drawWire ); - CURRENT_TOOL( EE_ACTIONS::drawBus ); - CURRENT_TOOL( EE_ACTIONS::placeBusWireEntry ); - CURRENT_TOOL( EE_ACTIONS::placeNoConnect ); - CURRENT_TOOL( EE_ACTIONS::placeJunction ); - CURRENT_TOOL( EE_ACTIONS::placeLabel ); - CURRENT_TOOL( EE_ACTIONS::placeClassLabel ); - CURRENT_TOOL( EE_ACTIONS::placeGlobalLabel ); - CURRENT_TOOL( EE_ACTIONS::placeHierLabel ); - CURRENT_TOOL( EE_ACTIONS::drawRuleArea ); - CURRENT_TOOL( EE_ACTIONS::drawSheet ); - CURRENT_TOOL( EE_ACTIONS::placeSheetPin ); - CURRENT_TOOL( EE_ACTIONS::syncSheetPins ); - CURRENT_TOOL( EE_ACTIONS::drawSheetFromFile ); - CURRENT_TOOL( EE_ACTIONS::drawSheetFromDesignBlock ); - CURRENT_TOOL( EE_ACTIONS::drawRectangle ); - CURRENT_TOOL( EE_ACTIONS::drawCircle ); - CURRENT_TOOL( EE_ACTIONS::drawArc ); - CURRENT_TOOL( EE_ACTIONS::drawBezier ); - CURRENT_TOOL( EE_ACTIONS::drawLines ); - CURRENT_TOOL( EE_ACTIONS::placeSchematicText ); - CURRENT_TOOL( EE_ACTIONS::drawTextBox ); - CURRENT_TOOL( EE_ACTIONS::drawTable ); - CURRENT_TOOL( EE_ACTIONS::placeImage ); + CURRENT_TOOL( SCH_ACTIONS::highlightNetTool ); + CURRENT_TOOL( SCH_ACTIONS::placeSymbol ); + CURRENT_TOOL( SCH_ACTIONS::placePower ); + CURRENT_TOOL( SCH_ACTIONS::placeDesignBlock ); + CURRENT_TOOL( SCH_ACTIONS::drawWire ); + CURRENT_TOOL( SCH_ACTIONS::drawBus ); + CURRENT_TOOL( SCH_ACTIONS::placeBusWireEntry ); + CURRENT_TOOL( SCH_ACTIONS::placeNoConnect ); + CURRENT_TOOL( SCH_ACTIONS::placeJunction ); + CURRENT_TOOL( SCH_ACTIONS::placeLabel ); + CURRENT_TOOL( SCH_ACTIONS::placeClassLabel ); + CURRENT_TOOL( SCH_ACTIONS::placeGlobalLabel ); + CURRENT_TOOL( SCH_ACTIONS::placeHierLabel ); + CURRENT_TOOL( SCH_ACTIONS::drawRuleArea ); + CURRENT_TOOL( SCH_ACTIONS::drawSheet ); + CURRENT_TOOL( SCH_ACTIONS::placeSheetPin ); + CURRENT_TOOL( SCH_ACTIONS::syncSheetPins ); + CURRENT_TOOL( SCH_ACTIONS::drawSheetFromFile ); + CURRENT_TOOL( SCH_ACTIONS::drawSheetFromDesignBlock ); + CURRENT_TOOL( SCH_ACTIONS::drawRectangle ); + CURRENT_TOOL( SCH_ACTIONS::drawCircle ); + CURRENT_TOOL( SCH_ACTIONS::drawArc ); + CURRENT_TOOL( SCH_ACTIONS::drawBezier ); + CURRENT_TOOL( SCH_ACTIONS::drawLines ); + CURRENT_TOOL( SCH_ACTIONS::placeSchematicText ); + CURRENT_TOOL( SCH_ACTIONS::drawTextBox ); + CURRENT_TOOL( SCH_ACTIONS::drawTable ); + CURRENT_TOOL( SCH_ACTIONS::placeImage ); #undef CURRENT_TOOL #undef CHECK @@ -963,7 +955,7 @@ void SCH_EDIT_FRAME::HardRedraw() GetCanvas()->DisplaySheet( GetCurrentSheet().LastScreen() ); - if( EE_SELECTION_TOOL* selectionTool = m_toolManager->GetTool() ) + if( SCH_SELECTION_TOOL* selectionTool = m_toolManager->GetTool() ) selectionTool->Reset( TOOL_BASE::REDRAW ); GetCanvas()->ForceRefresh(); @@ -973,7 +965,7 @@ void SCH_EDIT_FRAME::HardRedraw() bool SCH_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent ) { // Exit interactive editing - // Note this this will commit *some* pending changes. For instance, the EE_POINT_EDITOR + // Note this this will commit *some* pending changes. For instance, the SCH_POINT_EDITOR // will cancel any drag currently in progress, but commit all changes from previous drags. if( m_toolManager ) m_toolManager->RunAction( ACTIONS::cancelInteractive ); @@ -1265,7 +1257,7 @@ void SCH_EDIT_FRAME::ShowFindReplaceDialog( bool aReplace ) { wxString findString; - EE_SELECTION& selection = m_toolManager->GetTool()->GetSelection(); + SCH_SELECTION& selection = m_toolManager->GetTool()->GetSelection(); if( selection.Size() == 1 ) { @@ -2092,7 +2084,7 @@ void SCH_EDIT_FRAME::RecalculateConnections( SCH_COMMIT* aCommit, SCH_CLEANUP_FL if( m_highlightedConnChanged || !Schematic().ConnectionGraph()->FindFirstSubgraphByName( highlightedConn ) ) { - GetToolManager()->RunAction( EE_ACTIONS::updateNetHighlighting ); + GetToolManager()->RunAction( SCH_ACTIONS::updateNetHighlighting ); RefreshNetNavigator(); m_highlightedConnChanged = false; } @@ -2239,7 +2231,7 @@ void SCH_EDIT_FRAME::UpdateNetHighlightStatus() void SCH_EDIT_FRAME::SetScreen( BASE_SCREEN* aScreen ) { if( m_toolManager ) - m_toolManager->RunAction( EE_ACTIONS::clearSelection ); + m_toolManager->RunAction( SCH_ACTIONS::clearSelection ); SCH_BASE_FRAME::SetScreen( aScreen ); GetCanvas()->DisplaySheet( static_cast( aScreen ) ); @@ -2329,7 +2321,7 @@ wxString SCH_EDIT_FRAME::GetCurrentFileName() const SELECTION& SCH_EDIT_FRAME::GetCurrentSelection() { - return m_toolManager->GetTool()->GetSelection(); + return m_toolManager->GetTool()->GetSelection(); } @@ -2422,12 +2414,12 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet() wxCHECK( m_toolManager, /* void */ ); m_toolManager->RunAction( ACTIONS::cancelInteractive ); - m_toolManager->RunAction( EE_ACTIONS::clearSelection ); + m_toolManager->RunAction( SCH_ACTIONS::clearSelection ); SCH_SCREEN* screen = GetCurrentSheet().LastScreen(); wxCHECK( screen, /* void */ ); - m_toolManager->RunAction( EE_ACTIONS::clearSelection ); + m_toolManager->RunAction( SCH_ACTIONS::clearSelection ); SCH_BASE_FRAME::SetScreen( screen ); @@ -2443,7 +2435,7 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet() GetCurrentSheet().LastScreen()->TestDanglingEnds(); RefreshOperatingPointDisplay(); - EE_SELECTION_TOOL* selectionTool = m_toolManager->GetTool(); + SCH_SELECTION_TOOL* selectionTool = m_toolManager->GetTool(); wxCHECK( selectionTool, /* void */ ); diff --git a/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp b/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp index 67c72d6acd..794a39a5cd 100644 --- a/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp +++ b/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include @@ -493,7 +493,7 @@ void SCH_IO_KICAD_SEXPR::Format( SCH_SHEET* aSheet ) } -void SCH_IO_KICAD_SEXPR::Format( EE_SELECTION* aSelection, SCH_SHEET_PATH* aSelectionPath, +void SCH_IO_KICAD_SEXPR::Format( SCH_SELECTION* aSelection, SCH_SHEET_PATH* aSelectionPath, SCHEMATIC& aSchematic, OUTPUTFORMATTER* aFormatter, bool aForClipboard ) { diff --git a/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.h b/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.h index 242ca3b64d..f4d238620c 100644 --- a/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.h +++ b/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.h @@ -51,7 +51,7 @@ class SCH_TABLE; class SCH_SYMBOL; class SCH_FIELD; struct SCH_SYMBOL_INSTANCE; -class EE_SELECTION; +class SCH_SELECTION; class SCH_IO_KICAD_SEXPR_LIB_CACHE; class LIB_SYMBOL; class SYMBOL_LIB; @@ -103,7 +103,7 @@ public: void Format( SCH_SHEET* aSheet ); - void Format( EE_SELECTION* aSelection, SCH_SHEET_PATH* aSelectionPath, + void Format( SCH_SELECTION* aSelection, SCH_SHEET_PATH* aSelectionPath, SCHEMATIC& aSchematic, OUTPUTFORMATTER* aFormatter, bool aForClipboard ); void EnumerateSymbolLib( wxArrayString& aSymbolNameList, diff --git a/eeschema/sch_symbol.cpp b/eeschema/sch_symbol.cpp index ad12b48bca..308dffd28b 100644 --- a/eeschema/sch_symbol.cpp +++ b/eeschema/sch_symbol.cpp @@ -22,7 +22,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include +#include #include #include #include diff --git a/eeschema/sch_symbol.h b/eeschema/sch_symbol.h index 8705b7f722..7eae9d90ac 100644 --- a/eeschema/sch_symbol.h +++ b/eeschema/sch_symbol.h @@ -53,10 +53,8 @@ class KIID_PATH; class SCH_SCREEN; class LIB_SYMBOL; class MSG_PANEL_ITEM; -class NETLIST_OBJECT_LIST; class SYMBOL_LIB; class SYMBOL_LIBS; -class EE_COLLECTOR; class SCH_SCREEN; class SCH_COMMIT; diff --git a/eeschema/schematic.cpp b/eeschema/schematic.cpp index b3cc96de43..3bb981eaf7 100644 --- a/eeschema/schematic.cpp +++ b/eeschema/schematic.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/eeschema/schematic_undo_redo.cpp b/eeschema/schematic_undo_redo.cpp index f9a445b377..242f888b7a 100644 --- a/eeschema/schematic_undo_redo.cpp +++ b/eeschema/schematic_undo_redo.cpp @@ -22,7 +22,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include +#include #include #include #include @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include @@ -361,7 +361,7 @@ void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList ) refreshHierarchy = true; if( static_cast( eda_item )->GetScreen() == GetScreen() ) - GetToolManager()->PostAction( EE_ACTIONS::leaveSheet ); + GetToolManager()->PostAction( SCH_ACTIONS::leaveSheet ); } RemoveFromScreen( eda_item, screen ); @@ -563,7 +563,7 @@ void SCH_EDIT_FRAME::RollbackSchematicFromUndo() delete undo; - m_toolManager->GetTool()->RebuildSelection(); + m_toolManager->GetTool()->RebuildSelection(); } GetCanvas()->Refresh(); diff --git a/eeschema/sim/simulator_frame.cpp b/eeschema/sim/simulator_frame.cpp index f410fa19d3..c5fe38496a 100644 --- a/eeschema/sim/simulator_frame.cpp +++ b/eeschema/sim/simulator_frame.cpp @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include #include "ngspice.h" @@ -778,34 +778,34 @@ void SIMULATOR_FRAME::setupUIConditions() #define ENABLE( x ) ACTION_CONDITIONS().Enable( x ) #define CHECK( x ) ACTION_CONDITIONS().Check( x ) + // clang-format off + mgr->SetConditions( SCH_ACTIONS::openWorkbook, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); + mgr->SetConditions( SCH_ACTIONS::saveWorkbook, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); + mgr->SetConditions( SCH_ACTIONS::saveWorkbookAs, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); - mgr->SetConditions( EE_ACTIONS::openWorkbook, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); - mgr->SetConditions( EE_ACTIONS::saveWorkbook, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); - mgr->SetConditions( EE_ACTIONS::saveWorkbookAs, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); + mgr->SetConditions( SCH_ACTIONS::exportPlotAsPNG, ENABLE( havePlot ) ); + mgr->SetConditions( SCH_ACTIONS::exportPlotAsCSV, ENABLE( havePlot ) ); + mgr->SetConditions( SCH_ACTIONS::exportPlotToClipboard, ENABLE( havePlot ) ); + mgr->SetConditions( SCH_ACTIONS::exportPlotToSchematic, ENABLE( havePlot ) ); - mgr->SetConditions( EE_ACTIONS::exportPlotAsPNG, ENABLE( havePlot ) ); - mgr->SetConditions( EE_ACTIONS::exportPlotAsCSV, ENABLE( havePlot ) ); - mgr->SetConditions( EE_ACTIONS::exportPlotToClipboard, ENABLE( havePlot ) ); - mgr->SetConditions( EE_ACTIONS::exportPlotToSchematic, ENABLE( havePlot ) ); + mgr->SetConditions( ACTIONS::toggleSimulationSidePanel, CHECK( isSidePanelShown ) ); + mgr->SetConditions( ACTIONS::toggleConsole, CHECK( isConsoleShown ) ); - mgr->SetConditions( ACTIONS::toggleSimulationSidePanel, CHECK( isSidePanelShown ) ); - mgr->SetConditions( ACTIONS::toggleConsole, CHECK( isConsoleShown ) ); - - mgr->SetConditions( ACTIONS::zoomUndo, ENABLE( haveZoomUndo ) ); - mgr->SetConditions( ACTIONS::zoomRedo, ENABLE( haveZoomRedo ) ); - mgr->SetConditions( EE_ACTIONS::toggleGrid, CHECK( showGridCondition ) ); - mgr->SetConditions( EE_ACTIONS::toggleLegend, CHECK( showLegendCondition ) ); - mgr->SetConditions( EE_ACTIONS::toggleDottedSecondary, CHECK( showDottedCondition ) ); - mgr->SetConditions( EE_ACTIONS::toggleDarkModePlots, CHECK( darkModePlotCondition ) ); - - mgr->SetConditions( EE_ACTIONS::newAnalysisTab, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); - mgr->SetConditions( EE_ACTIONS::simAnalysisProperties, ENABLE( haveSim ) ); - mgr->SetConditions( EE_ACTIONS::runSimulation, ENABLE( !simRunning ) ); - mgr->SetConditions( EE_ACTIONS::stopSimulation, ENABLE( simRunning ) ); - mgr->SetConditions( EE_ACTIONS::simProbe, ENABLE( simFinished ) ); - mgr->SetConditions( EE_ACTIONS::simTune, ENABLE( simFinished ) ); - mgr->SetConditions( EE_ACTIONS::showNetlist, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); + mgr->SetConditions( ACTIONS::zoomUndo, ENABLE( haveZoomUndo ) ); + mgr->SetConditions( ACTIONS::zoomRedo, ENABLE( haveZoomRedo ) ); + mgr->SetConditions( SCH_ACTIONS::toggleGrid, CHECK( showGridCondition ) ); + mgr->SetConditions( SCH_ACTIONS::toggleLegend, CHECK( showLegendCondition ) ); + mgr->SetConditions( SCH_ACTIONS::toggleDottedSecondary, CHECK( showDottedCondition ) ); + mgr->SetConditions( SCH_ACTIONS::toggleDarkModePlots, CHECK( darkModePlotCondition ) ); + mgr->SetConditions( SCH_ACTIONS::newAnalysisTab, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); + mgr->SetConditions( SCH_ACTIONS::simAnalysisProperties, ENABLE( haveSim ) ); + mgr->SetConditions( SCH_ACTIONS::runSimulation, ENABLE( !simRunning ) ); + mgr->SetConditions( SCH_ACTIONS::stopSimulation, ENABLE( simRunning ) ); + mgr->SetConditions( SCH_ACTIONS::simProbe, ENABLE( simFinished ) ); + mgr->SetConditions( SCH_ACTIONS::simTune, ENABLE( simFinished ) ); + mgr->SetConditions( SCH_ACTIONS::showNetlist, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); + // clang-format on #undef CHECK #undef ENABLE } diff --git a/eeschema/sim/toolbars_simulator_frame.cpp b/eeschema/sim/toolbars_simulator_frame.cpp index 642c56b354..9fdd2d2095 100644 --- a/eeschema/sim/toolbars_simulator_frame.cpp +++ b/eeschema/sim/toolbars_simulator_frame.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include @@ -42,16 +42,16 @@ std::optional SIMULATOR_TOOLBAR_SETTINGS::DefaultToolbarC return std::nullopt; case TOOLBAR_LOC::TOP_MAIN: - config.AppendAction( EE_ACTIONS::openWorkbook ) - .AppendAction( EE_ACTIONS::saveWorkbook ); + config.AppendAction( SCH_ACTIONS::openWorkbook ) + .AppendAction( SCH_ACTIONS::saveWorkbook ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::newAnalysisTab ) - .AppendAction( EE_ACTIONS::simAnalysisProperties ); + .AppendAction( SCH_ACTIONS::newAnalysisTab ) + .AppendAction( SCH_ACTIONS::simAnalysisProperties ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::runSimulation ) - .AppendAction( EE_ACTIONS::stopSimulation ); + .AppendAction( SCH_ACTIONS::runSimulation ) + .AppendAction( SCH_ACTIONS::stopSimulation ); config.AppendSeparator() .AppendAction( ACTIONS::zoomInCenter ) @@ -63,12 +63,12 @@ std::optional SIMULATOR_TOOLBAR_SETTINGS::DefaultToolbarC .AppendAction( ACTIONS::zoomFitScreen ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::simProbe ) - .AppendAction( EE_ACTIONS::simTune ); + .AppendAction( SCH_ACTIONS::simProbe ) + .AppendAction( SCH_ACTIONS::simTune ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::editUserDefinedSignals ) - .AppendAction( EE_ACTIONS::showNetlist ); + .AppendAction( SCH_ACTIONS::editUserDefinedSignals ) + .AppendAction( SCH_ACTIONS::showNetlist ); break; } @@ -94,19 +94,19 @@ void SIMULATOR_FRAME::doReCreateMenuBar() // ACTION_MENU* fileMenu = new ACTION_MENU( false, tool ); - fileMenu->Add( EE_ACTIONS::newAnalysisTab ); + fileMenu->Add( SCH_ACTIONS::newAnalysisTab ); fileMenu->AppendSeparator(); - fileMenu->Add( EE_ACTIONS::openWorkbook ); - fileMenu->Add( EE_ACTIONS::saveWorkbook ); - fileMenu->Add( EE_ACTIONS::saveWorkbookAs ); + fileMenu->Add( SCH_ACTIONS::openWorkbook ); + fileMenu->Add( SCH_ACTIONS::saveWorkbook ); + fileMenu->Add( SCH_ACTIONS::saveWorkbookAs ); fileMenu->AppendSeparator(); - fileMenu->Add( EE_ACTIONS::exportPlotAsPNG ); - fileMenu->Add( EE_ACTIONS::exportPlotAsCSV ); + fileMenu->Add( SCH_ACTIONS::exportPlotAsPNG ); + fileMenu->Add( SCH_ACTIONS::exportPlotAsCSV ); fileMenu->AppendSeparator(); - fileMenu->Add( EE_ACTIONS::exportPlotToClipboard ); - fileMenu->Add( EE_ACTIONS::exportPlotToSchematic ); + fileMenu->Add( SCH_ACTIONS::exportPlotToClipboard ); + fileMenu->Add( SCH_ACTIONS::exportPlotToSchematic ); fileMenu->AppendSeparator(); fileMenu->AddClose( _( "Simulator" ) ); @@ -134,26 +134,26 @@ void SIMULATOR_FRAME::doReCreateMenuBar() viewMenu->AppendSeparator(); viewMenu->Add( ACTIONS::toggleGrid, ACTION_MENU::CHECK ); - viewMenu->Add( EE_ACTIONS::toggleLegend, ACTION_MENU::CHECK ); - viewMenu->Add( EE_ACTIONS::toggleDottedSecondary, ACTION_MENU::CHECK ); - viewMenu->Add( EE_ACTIONS::toggleDarkModePlots, ACTION_MENU::CHECK ); + viewMenu->Add( SCH_ACTIONS::toggleLegend, ACTION_MENU::CHECK ); + viewMenu->Add( SCH_ACTIONS::toggleDottedSecondary, ACTION_MENU::CHECK ); + viewMenu->Add( SCH_ACTIONS::toggleDarkModePlots, ACTION_MENU::CHECK ); //-- Simulation menu ----------------------------------------------------------- // ACTION_MENU* simulationMenu = new ACTION_MENU( false, tool ); - simulationMenu->Add( EE_ACTIONS::newAnalysisTab ); - simulationMenu->Add( EE_ACTIONS::simAnalysisProperties ); - simulationMenu->Add( EE_ACTIONS::runSimulation ); + simulationMenu->Add( SCH_ACTIONS::newAnalysisTab ); + simulationMenu->Add( SCH_ACTIONS::simAnalysisProperties ); + simulationMenu->Add( SCH_ACTIONS::runSimulation ); simulationMenu->AppendSeparator(); - simulationMenu->Add( EE_ACTIONS::simProbe ); - simulationMenu->Add( EE_ACTIONS::simTune ); + simulationMenu->Add( SCH_ACTIONS::simProbe ); + simulationMenu->Add( SCH_ACTIONS::simTune ); simulationMenu->AppendSeparator(); - simulationMenu->Add( EE_ACTIONS::editUserDefinedSignals ); - simulationMenu->Add( EE_ACTIONS::showNetlist ); + simulationMenu->Add( SCH_ACTIONS::editUserDefinedSignals ); + simulationMenu->Add( SCH_ACTIONS::showNetlist ); //-- Preferences menu ----------------------------------------------- @@ -161,7 +161,7 @@ void SIMULATOR_FRAME::doReCreateMenuBar() ACTION_MENU* prefsMenu = new ACTION_MENU( false, tool ); //prefsMenu->Add( ACTIONS::configurePaths ); - //prefsMenu->Add( EE_ACTIONS::showSimLibTable ); + //prefsMenu->Add( SCH_ACTIONS::showSimLibTable ); prefsMenu->Add( ACTIONS::openPreferences ); prefsMenu->AppendSeparator(); diff --git a/eeschema/symbol_editor/menubar_symbol_editor.cpp b/eeschema/symbol_editor/menubar_symbol_editor.cpp index 87b941e1db..54251e1a10 100644 --- a/eeschema/symbol_editor/menubar_symbol_editor.cpp +++ b/eeschema/symbol_editor/menubar_symbol_editor.cpp @@ -26,8 +26,8 @@ #include #include #include -#include -#include +#include +#include #include #include "symbol_edit_frame.h" #include @@ -35,7 +35,7 @@ void SYMBOL_EDIT_FRAME::doReCreateMenuBar() { - EE_SELECTION_TOOL* selTool = m_toolManager->GetTool(); + SCH_SELECTION_TOOL* selTool = m_toolManager->GetTool(); // wxWidgets handles the Mac Application menu behind the scenes, but that means // we always have to start from scratch with a new wxMenuBar. wxMenuBar* oldMenuBar = GetMenuBar(); @@ -47,14 +47,14 @@ void SYMBOL_EDIT_FRAME::doReCreateMenuBar() fileMenu->Add( ACTIONS::newLibrary ); fileMenu->Add( ACTIONS::addLibrary ); - fileMenu->Add( EE_ACTIONS::saveLibraryAs ); - fileMenu->Add( EE_ACTIONS::newSymbol ); - fileMenu->Add( EE_ACTIONS::editLibSymbolWithLibEdit ); + fileMenu->Add( SCH_ACTIONS::saveLibraryAs ); + fileMenu->Add( SCH_ACTIONS::newSymbol ); + fileMenu->Add( SCH_ACTIONS::editLibSymbolWithLibEdit ); fileMenu->AppendSeparator(); fileMenu->Add( ACTIONS::save ); - fileMenu->Add( EE_ACTIONS::saveSymbolAs ); - fileMenu->Add( EE_ACTIONS::saveSymbolCopyAs ); + fileMenu->Add( SCH_ACTIONS::saveSymbolAs ); + fileMenu->Add( SCH_ACTIONS::saveSymbolCopyAs ); if( !IsSymbolFromSchematic() ) fileMenu->Add( ACTIONS::saveAll ); @@ -67,8 +67,8 @@ void SYMBOL_EDIT_FRAME::doReCreateMenuBar() submenuImport->SetTitle( _( "Import" ) ); submenuImport->SetIcon( BITMAPS::import ); - submenuImport->Add( EE_ACTIONS::importSymbol, ACTION_MENU::NORMAL, _( "Symbol..." ) ); - submenuImport->Add( EE_ACTIONS::importGraphics, ACTION_MENU::NORMAL, _( "Graphics..." ) ); + submenuImport->Add( SCH_ACTIONS::importSymbol, ACTION_MENU::NORMAL, _( "Symbol..." ) ); + submenuImport->Add( SCH_ACTIONS::importGraphics, ACTION_MENU::NORMAL, _( "Graphics..." ) ); fileMenu->Add( submenuImport ); @@ -76,13 +76,13 @@ void SYMBOL_EDIT_FRAME::doReCreateMenuBar() ACTION_MENU* submenuExport = new ACTION_MENU( false, selTool ); submenuExport->SetTitle( _( "Export" ) ); submenuExport->SetIcon( BITMAPS::export_file ); - submenuExport->Add( EE_ACTIONS::exportSymbol, ACTION_MENU::NORMAL, _( "Symbol..." ) ); - submenuExport->Add( EE_ACTIONS::exportSymbolView, ACTION_MENU::NORMAL, _( "View as PNG..." ) ); - submenuExport->Add( EE_ACTIONS::exportSymbolAsSVG, ACTION_MENU::NORMAL, _( "Symbol as SVG..." ) ); + submenuExport->Add( SCH_ACTIONS::exportSymbol, ACTION_MENU::NORMAL, _( "Symbol..." ) ); + submenuExport->Add( SCH_ACTIONS::exportSymbolView, ACTION_MENU::NORMAL, _( "View as PNG..." ) ); + submenuExport->Add( SCH_ACTIONS::exportSymbolAsSVG, ACTION_MENU::NORMAL, _( "Symbol as SVG..." ) ); fileMenu->Add( submenuExport ); fileMenu->AppendSeparator(); - fileMenu->Add( EE_ACTIONS::symbolProperties ); + fileMenu->Add( SCH_ACTIONS::symbolProperties ); fileMenu->AppendSeparator(); fileMenu->AddClose( _( "Library Editor" ) ); @@ -108,9 +108,9 @@ void SYMBOL_EDIT_FRAME::doReCreateMenuBar() editMenu->Add( ACTIONS::unselectAll ); editMenu->AppendSeparator(); - editMenu->Add( EE_ACTIONS::pinTable ); - editMenu->Add( EE_ACTIONS::setUnitDisplayName ); - editMenu->Add( EE_ACTIONS::updateSymbolFields ); + editMenu->Add( SCH_ACTIONS::pinTable ); + editMenu->Add( SCH_ACTIONS::setUnitDisplayName ); + editMenu->Add( SCH_ACTIONS::updateSymbolFields ); //-- View menu ----------------------------------------------- @@ -134,24 +134,24 @@ void SYMBOL_EDIT_FRAME::doReCreateMenuBar() viewMenu->Add( ACTIONS::zoomRedraw ); viewMenu->AppendSeparator(); - viewMenu->Add( EE_ACTIONS::showHiddenPins, ACTION_MENU::CHECK ); - viewMenu->Add( EE_ACTIONS::showHiddenFields, ACTION_MENU::CHECK ); - viewMenu->Add( EE_ACTIONS::togglePinAltIcons,ACTION_MENU::CHECK ); + viewMenu->Add( SCH_ACTIONS::showHiddenPins, ACTION_MENU::CHECK ); + viewMenu->Add( SCH_ACTIONS::showHiddenFields, ACTION_MENU::CHECK ); + viewMenu->Add( SCH_ACTIONS::togglePinAltIcons, ACTION_MENU::CHECK ); //-- Place menu ----------------------------------------------- // ACTION_MENU* placeMenu = new ACTION_MENU( false, selTool ); - placeMenu->Add( EE_ACTIONS::placeSymbolPin ); - placeMenu->Add( EE_ACTIONS::placeSymbolText ); - placeMenu->Add( EE_ACTIONS::drawSymbolTextBox ); - placeMenu->Add( EE_ACTIONS::drawRectangle ); - placeMenu->Add( EE_ACTIONS::drawCircle ); - placeMenu->Add( EE_ACTIONS::drawArc ); - placeMenu->Add( EE_ACTIONS::drawBezier ); - placeMenu->Add( EE_ACTIONS::drawSymbolLines ); - placeMenu->Add( EE_ACTIONS::drawSymbolPolygon ); + placeMenu->Add( SCH_ACTIONS::placeSymbolPin ); + placeMenu->Add( SCH_ACTIONS::placeSymbolText ); + placeMenu->Add( SCH_ACTIONS::drawSymbolTextBox ); + placeMenu->Add( SCH_ACTIONS::drawRectangle ); + placeMenu->Add( SCH_ACTIONS::drawCircle ); + placeMenu->Add( SCH_ACTIONS::drawArc ); + placeMenu->Add( SCH_ACTIONS::drawBezier ); + placeMenu->Add( SCH_ACTIONS::drawSymbolLines ); + placeMenu->Add( SCH_ACTIONS::drawSymbolPolygon ); //-- Inspect menu ----------------------------------------------- @@ -161,7 +161,7 @@ void SYMBOL_EDIT_FRAME::doReCreateMenuBar() inspectMenu->Add( ACTIONS::showDatasheet ); inspectMenu->AppendSeparator(); - inspectMenu->Add( EE_ACTIONS::checkSymbol ); + inspectMenu->Add( SCH_ACTIONS::checkSymbol ); //-- Preferences menu ----------------------------------------------- diff --git a/eeschema/symbol_editor/symbol_edit_frame.cpp b/eeschema/symbol_editor/symbol_edit_frame.cpp index 2027d0a73b..b548a0a805 100644 --- a/eeschema/symbol_editor/symbol_edit_frame.cpp +++ b/eeschema/symbol_editor/symbol_edit_frame.cpp @@ -61,11 +61,11 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include -#include +#include #include #include #include @@ -238,7 +238,7 @@ SYMBOL_EDIT_FRAME::SYMBOL_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : FinishAUIInitialization(); // Can't put this in LoadSettings, because it has to be called before setupTools :/ - EE_SELECTION_TOOL* selTool = GetToolManager()->GetTool(); + SCH_SELECTION_TOOL* selTool = GetToolManager()->GetTool(); selTool->GetFilter() = GetSettings()->m_SelectionFilter; if( m_settings->m_LibWidth > 0 ) @@ -348,7 +348,7 @@ void SYMBOL_EDIT_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg ) bool prop_shown = m_auimgr.GetPane( PropertiesPaneName() ).IsShown(); m_settings->m_AuiPanels.show_properties = prop_shown; - EE_SELECTION_TOOL* selTool = GetToolManager()->GetTool(); + SCH_SELECTION_TOOL* selTool = GetToolManager()->GetTool(); m_settings->m_SelectionFilter = selTool->GetFilter(); } @@ -376,19 +376,19 @@ void SYMBOL_EDIT_FRAME::setupTools() m_toolManager = new TOOL_MANAGER; m_toolManager->SetEnvironment( GetScreen(), GetCanvas()->GetView(), GetCanvas()->GetViewControls(), GetSettings(), this ); - m_actions = new EE_ACTIONS(); + m_actions = new SCH_ACTIONS(); m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager ); // Register tools m_toolManager->RegisterTool( new COMMON_CONTROL ); m_toolManager->RegisterTool( new COMMON_TOOLS ); m_toolManager->RegisterTool( new ZOOM_TOOL ); - m_toolManager->RegisterTool( new EE_SELECTION_TOOL ); + m_toolManager->RegisterTool( new SCH_SELECTION_TOOL ); m_toolManager->RegisterTool( new PICKER_TOOL ); - m_toolManager->RegisterTool( new EE_INSPECTION_TOOL ); + m_toolManager->RegisterTool( new SCH_INSPECTION_TOOL ); m_toolManager->RegisterTool( new SYMBOL_EDITOR_PIN_TOOL ); m_toolManager->RegisterTool( new SYMBOL_EDITOR_DRAWING_TOOLS ); - m_toolManager->RegisterTool( new EE_POINT_EDITOR ); + m_toolManager->RegisterTool( new SCH_POINT_EDITOR ); m_toolManager->RegisterTool( new SYMBOL_EDITOR_MOVE_TOOL ); m_toolManager->RegisterTool( new SYMBOL_EDITOR_EDIT_TOOL ); m_toolManager->RegisterTool( new LIBRARY_EDITOR_CONTROL ); @@ -473,12 +473,12 @@ void SYMBOL_EDIT_FRAME::setupUIConditions() // clang-format off mgr->SetConditions( ACTIONS::saveAll, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); mgr->SetConditions( ACTIONS::save, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); - mgr->SetConditions( EE_ACTIONS::saveLibraryAs, ENABLE( libSelectedCondition ) ); - mgr->SetConditions( EE_ACTIONS::saveSymbolAs, ENABLE( saveSymbolAsCondition ) ); - mgr->SetConditions( EE_ACTIONS::saveSymbolCopyAs, ENABLE( saveSymbolAsCondition ) ); - mgr->SetConditions( EE_ACTIONS::newSymbol, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); - mgr->SetConditions( EE_ACTIONS::importSymbol, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); - mgr->SetConditions( EE_ACTIONS::editLibSymbolWithLibEdit, ENABLE( isSymbolFromSchematicCond ) ); + mgr->SetConditions( SCH_ACTIONS::saveLibraryAs, ENABLE( libSelectedCondition ) ); + mgr->SetConditions( SCH_ACTIONS::saveSymbolAs, ENABLE( saveSymbolAsCondition ) ); + mgr->SetConditions( SCH_ACTIONS::saveSymbolCopyAs, ENABLE( saveSymbolAsCondition ) ); + mgr->SetConditions( SCH_ACTIONS::newSymbol, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); + mgr->SetConditions( SCH_ACTIONS::importSymbol, ENABLE( SELECTION_CONDITIONS::ShowAlways ) ); + mgr->SetConditions( SCH_ACTIONS::editLibSymbolWithLibEdit, ENABLE( isSymbolFromSchematicCond ) ); mgr->SetConditions( ACTIONS::undo, ENABLE( haveSymbolCond && cond.UndoAvailable() ) ); mgr->SetConditions( ACTIONS::redo, ENABLE( haveSymbolCond && cond.RedoAvailable() ) ); @@ -502,11 +502,11 @@ void SYMBOL_EDIT_FRAME::setupUIConditions() mgr->SetConditions( ACTIONS::unselectAll, ENABLE( haveSymbolCond ) ); // These actions in symbol editor when editing alias field rotations are allowed. - mgr->SetConditions( EE_ACTIONS::rotateCW, ENABLE( isEditableInAliasCond ) ); - mgr->SetConditions( EE_ACTIONS::rotateCCW, ENABLE( isEditableInAliasCond ) ); + mgr->SetConditions( SCH_ACTIONS::rotateCW, ENABLE( isEditableInAliasCond ) ); + mgr->SetConditions( SCH_ACTIONS::rotateCCW, ENABLE( isEditableInAliasCond ) ); - mgr->SetConditions( EE_ACTIONS::mirrorH, ENABLE( isEditableCond ) ); - mgr->SetConditions( EE_ACTIONS::mirrorV, ENABLE( isEditableCond ) ); + mgr->SetConditions( SCH_ACTIONS::mirrorH, ENABLE( isEditableCond ) ); + mgr->SetConditions( SCH_ACTIONS::mirrorV, ENABLE( isEditableCond ) ); mgr->SetConditions( ACTIONS::zoomTool, CHECK( cond.CurrentTool( ACTIONS::zoomTool ) ) ); mgr->SetConditions( ACTIONS::selectionTool, CHECK( cond.CurrentTool( ACTIONS::selectionTool ) ) ); @@ -548,13 +548,13 @@ void SYMBOL_EDIT_FRAME::setupUIConditions() return m_auimgr.GetPane( PropertiesPaneName() ).IsShown(); }; - mgr->SetConditions( EE_ACTIONS::showElectricalTypes, CHECK( pinTypeCond ) ); - mgr->SetConditions( ACTIONS::toggleBoundingBoxes, CHECK( cond.BoundingBoxes() ) ); - mgr->SetConditions( ACTIONS::showLibraryTree, CHECK( showLibraryTreeCond ) ); - mgr->SetConditions( ACTIONS::showProperties, CHECK( propertiesCond ) ); - mgr->SetConditions( EE_ACTIONS::showHiddenPins, CHECK( hiddenPinCond ) ); - mgr->SetConditions( EE_ACTIONS::showHiddenFields, CHECK( hiddenFieldCond ) ); - mgr->SetConditions( EE_ACTIONS::togglePinAltIcons, CHECK( showPinAltIconsCond ) ); + mgr->SetConditions( SCH_ACTIONS::showElectricalTypes, CHECK( pinTypeCond ) ); + mgr->SetConditions( ACTIONS::toggleBoundingBoxes, CHECK( cond.BoundingBoxes() ) ); + mgr->SetConditions( ACTIONS::showLibraryTree, CHECK( showLibraryTreeCond ) ); + mgr->SetConditions( ACTIONS::showProperties, CHECK( propertiesCond ) ); + mgr->SetConditions( SCH_ACTIONS::showHiddenPins, CHECK( hiddenPinCond ) ); + mgr->SetConditions( SCH_ACTIONS::showHiddenFields, CHECK( hiddenFieldCond ) ); + mgr->SetConditions( SCH_ACTIONS::togglePinAltIcons, CHECK( showPinAltIconsCond ) ); auto demorganCond = [this]( const SELECTION& ) @@ -598,35 +598,31 @@ void SYMBOL_EDIT_FRAME::setupUIConditions() return m_symbol && !m_symbol->GetDatasheetField().GetText().IsEmpty(); }; - mgr->SetConditions( ACTIONS::showDatasheet, ENABLE( haveDatasheetCond ) ); - mgr->SetConditions( EE_ACTIONS::symbolProperties, ENABLE( canEditProperties && haveSymbolCond ) ); - mgr->SetConditions( EE_ACTIONS::runERC, ENABLE( haveSymbolCond ) ); - mgr->SetConditions( EE_ACTIONS::pinTable, ENABLE( isEditableCond && haveSymbolCond ) ); + mgr->SetConditions( ACTIONS::showDatasheet, ENABLE( haveDatasheetCond ) ); + mgr->SetConditions( SCH_ACTIONS::symbolProperties, ENABLE( canEditProperties && haveSymbolCond ) ); + mgr->SetConditions( SCH_ACTIONS::runERC, ENABLE( haveSymbolCond ) ); + mgr->SetConditions( SCH_ACTIONS::pinTable, ENABLE( isEditableCond && haveSymbolCond ) ); - mgr->SetConditions( EE_ACTIONS::showDeMorganStandard, - ACTION_CONDITIONS().Enable( demorganCond ).Check( demorganStandardCond ) ); - mgr->SetConditions( EE_ACTIONS::showDeMorganAlternate, - ACTION_CONDITIONS().Enable( demorganCond ).Check( demorganAlternateCond ) ); - mgr->SetConditions( EE_ACTIONS::toggleSyncedPinsMode, - ACTION_CONDITIONS().Enable( multiUnitModeCond ).Check( syncedPinsModeCond ) ); - mgr->SetConditions( EE_ACTIONS::setUnitDisplayName, - ACTION_CONDITIONS().Enable( isEditableCond && hasMultipleUnitsCond ) ); + mgr->SetConditions( SCH_ACTIONS::showDeMorganStandard, ACTION_CONDITIONS().Enable( demorganCond ).Check( demorganStandardCond ) ); + mgr->SetConditions( SCH_ACTIONS::showDeMorganAlternate, ACTION_CONDITIONS().Enable( demorganCond ).Check( demorganAlternateCond ) ); + mgr->SetConditions( SCH_ACTIONS::toggleSyncedPinsMode, ACTION_CONDITIONS().Enable( multiUnitModeCond ).Check( syncedPinsModeCond ) ); + mgr->SetConditions( SCH_ACTIONS::setUnitDisplayName, ACTION_CONDITIONS().Enable( isEditableCond && hasMultipleUnitsCond ) ); // Only enable a tool if the symbol is edtable #define EDIT_TOOL( tool ) ACTION_CONDITIONS().Enable( isEditableCond ).Check( cond.CurrentTool( tool ) ) mgr->SetConditions( ACTIONS::deleteTool, EDIT_TOOL( ACTIONS::deleteTool ) ); - mgr->SetConditions( EE_ACTIONS::placeSymbolPin, EDIT_TOOL( EE_ACTIONS::placeSymbolPin ) ); - mgr->SetConditions( EE_ACTIONS::placeSymbolText, EDIT_TOOL( EE_ACTIONS::placeSymbolText ) ); - mgr->SetConditions( EE_ACTIONS::drawSymbolTextBox, EDIT_TOOL( EE_ACTIONS::drawSymbolTextBox ) ); - mgr->SetConditions( EE_ACTIONS::drawRectangle, EDIT_TOOL( EE_ACTIONS::drawRectangle ) ); - mgr->SetConditions( EE_ACTIONS::drawCircle, EDIT_TOOL( EE_ACTIONS::drawCircle ) ); - mgr->SetConditions( EE_ACTIONS::drawArc, EDIT_TOOL( EE_ACTIONS::drawArc ) ); - mgr->SetConditions( EE_ACTIONS::drawBezier, EDIT_TOOL( EE_ACTIONS::drawBezier ) ); - mgr->SetConditions( EE_ACTIONS::drawSymbolLines, EDIT_TOOL( EE_ACTIONS::drawSymbolLines ) ); - mgr->SetConditions( EE_ACTIONS::drawSymbolPolygon, EDIT_TOOL( EE_ACTIONS::drawSymbolPolygon ) ); - mgr->SetConditions( EE_ACTIONS::placeSymbolAnchor, EDIT_TOOL( EE_ACTIONS::placeSymbolAnchor ) ); - mgr->SetConditions( EE_ACTIONS::importGraphics, EDIT_TOOL( EE_ACTIONS::importGraphics ) ); + mgr->SetConditions( SCH_ACTIONS::placeSymbolPin, EDIT_TOOL( SCH_ACTIONS::placeSymbolPin ) ); + mgr->SetConditions( SCH_ACTIONS::placeSymbolText, EDIT_TOOL( SCH_ACTIONS::placeSymbolText ) ); + mgr->SetConditions( SCH_ACTIONS::drawSymbolTextBox, EDIT_TOOL( SCH_ACTIONS::drawSymbolTextBox ) ); + mgr->SetConditions( SCH_ACTIONS::drawRectangle, EDIT_TOOL( SCH_ACTIONS::drawRectangle ) ); + mgr->SetConditions( SCH_ACTIONS::drawCircle, EDIT_TOOL( SCH_ACTIONS::drawCircle ) ); + mgr->SetConditions( SCH_ACTIONS::drawArc, EDIT_TOOL( SCH_ACTIONS::drawArc ) ); + mgr->SetConditions( SCH_ACTIONS::drawBezier, EDIT_TOOL( SCH_ACTIONS::drawBezier ) ); + mgr->SetConditions( SCH_ACTIONS::drawSymbolLines, EDIT_TOOL( SCH_ACTIONS::drawSymbolLines ) ); + mgr->SetConditions( SCH_ACTIONS::drawSymbolPolygon, EDIT_TOOL( SCH_ACTIONS::drawSymbolPolygon ) ); + mgr->SetConditions( SCH_ACTIONS::placeSymbolAnchor, EDIT_TOOL( SCH_ACTIONS::placeSymbolAnchor ) ); + mgr->SetConditions( SCH_ACTIONS::importGraphics, EDIT_TOOL( SCH_ACTIONS::importGraphics ) ); #undef CHECK #undef ENABLE @@ -860,7 +856,7 @@ void SYMBOL_EDIT_FRAME::SetCurSymbol( LIB_SYMBOL* aSymbol, bool aUpdateZoom ) { wxCHECK( m_toolManager, /* void */ ); - m_toolManager->RunAction( EE_ACTIONS::clearSelection ); + m_toolManager->RunAction( SCH_ACTIONS::clearSelection ); GetCanvas()->GetView()->Clear(); delete m_symbol; @@ -920,7 +916,7 @@ void SYMBOL_EDIT_FRAME::SetCurSymbol( LIB_SYMBOL* aSymbol, bool aUpdateZoom ) button->Bind( wxEVT_COMMAND_HYPERLINK, std::function( [this, symbolName, libName]( wxHyperlinkEvent& aEvent ) { - GetToolManager()->RunAction( EE_ACTIONS::editLibSymbolWithLibEdit ); + GetToolManager()->RunAction( SCH_ACTIONS::editLibSymbolWithLibEdit ); } ) ); infobar.AddButton( button ); @@ -1053,7 +1049,7 @@ void SYMBOL_EDIT_FRAME::SetUnit( int aUnit ) return; m_toolManager->RunAction( ACTIONS::cancelInteractive ); - m_toolManager->RunAction( EE_ACTIONS::clearSelection ); + m_toolManager->RunAction( SCH_ACTIONS::clearSelection ); m_unit = aUnit; @@ -1462,8 +1458,8 @@ void SYMBOL_EDIT_FRAME::HardRedraw() if( m_symbol ) { - EE_SELECTION_TOOL* selectionTool = m_toolManager->GetTool(); - EE_SELECTION& selection = selectionTool->GetSelection(); + SCH_SELECTION_TOOL* selectionTool = m_toolManager->GetTool(); + SCH_SELECTION& selection = selectionTool->GetSelection(); for( SCH_ITEM& item : m_symbol->GetDrawItems() ) { @@ -1747,7 +1743,7 @@ void SYMBOL_EDIT_FRAME::ClearUndoORRedoList( UNDO_REDO_LIST whichList, int aItem SELECTION& SYMBOL_EDIT_FRAME::GetCurrentSelection() { - return m_toolManager->GetTool()->GetSelection(); + return m_toolManager->GetTool()->GetSelection(); } diff --git a/eeschema/symbol_editor/symbol_edit_frame.h b/eeschema/symbol_editor/symbol_edit_frame.h index 44f9727e13..337fe26f85 100644 --- a/eeschema/symbol_editor/symbol_edit_frame.h +++ b/eeschema/symbol_editor/symbol_edit_frame.h @@ -30,7 +30,6 @@ #include #include -#include #include #include diff --git a/eeschema/symbol_editor/symbol_editor.cpp b/eeschema/symbol_editor/symbol_editor.cpp index d210e63cac..a66ef69800 100644 --- a/eeschema/symbol_editor/symbol_editor.cpp +++ b/eeschema/symbol_editor/symbol_editor.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include diff --git a/eeschema/symbol_editor/symbol_editor_undo_redo.cpp b/eeschema/symbol_editor/symbol_editor_undo_redo.cpp index 8cac20378d..ffbba04494 100644 --- a/eeschema/symbol_editor/symbol_editor_undo_redo.cpp +++ b/eeschema/symbol_editor/symbol_editor_undo_redo.cpp @@ -27,8 +27,7 @@ #include #include #include -#include -#include +#include #include diff --git a/eeschema/symbol_editor/toolbars_symbol_editor.cpp b/eeschema/symbol_editor/toolbars_symbol_editor.cpp index a46f6a3b22..27e6e5fc68 100644 --- a/eeschema/symbol_editor/toolbars_symbol_editor.cpp +++ b/eeschema/symbol_editor/toolbars_symbol_editor.cpp @@ -32,8 +32,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -64,10 +64,10 @@ std::optional SYMBOL_EDIT_TOOLBAR_SETTINGS::DefaultToolba .AppendAction( ACTIONS::toggleCursorStyle ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::showElectricalTypes ) - .AppendAction( EE_ACTIONS::showHiddenPins ) - .AppendAction( EE_ACTIONS::showHiddenFields ); - // .AppendAction( EE_ACTIONS::togglePinAltIcons ); + .AppendAction( SCH_ACTIONS::showElectricalTypes ) + .AppendAction( SCH_ACTIONS::showHiddenPins ) + .AppendAction( SCH_ACTIONS::showHiddenFields ); + // .AppendAction( SCH_ACTIONS::togglePinAltIcons ); if( ADVANCED_CFG::GetCfg().m_DrawBoundingBoxes ) config.AppendAction( ACTIONS::toggleBoundingBoxes ); @@ -88,21 +88,21 @@ std::optional SYMBOL_EDIT_TOOLBAR_SETTINGS::DefaultToolba config.AppendAction( ACTIONS::selectionTool ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::placeSymbolPin ) - .AppendAction( EE_ACTIONS::placeSymbolText ) - .AppendAction( EE_ACTIONS::drawSymbolTextBox ) - .AppendAction( EE_ACTIONS::drawRectangle ) - .AppendAction( EE_ACTIONS::drawCircle ) - .AppendAction( EE_ACTIONS::drawArc ) - .AppendAction( EE_ACTIONS::drawBezier ) - .AppendAction( EE_ACTIONS::drawSymbolLines ) - .AppendAction( EE_ACTIONS::drawSymbolPolygon ) - .AppendAction( EE_ACTIONS::placeSymbolAnchor ) + .AppendAction( SCH_ACTIONS::placeSymbolPin ) + .AppendAction( SCH_ACTIONS::placeSymbolText ) + .AppendAction( SCH_ACTIONS::drawSymbolTextBox ) + .AppendAction( SCH_ACTIONS::drawRectangle ) + .AppendAction( SCH_ACTIONS::drawCircle ) + .AppendAction( SCH_ACTIONS::drawArc ) + .AppendAction( SCH_ACTIONS::drawBezier ) + .AppendAction( SCH_ACTIONS::drawSymbolLines ) + .AppendAction( SCH_ACTIONS::drawSymbolPolygon ) + .AppendAction( SCH_ACTIONS::placeSymbolAnchor ) .AppendAction( ACTIONS::deleteTool); break; case TOOLBAR_LOC::TOP_MAIN: - config.AppendAction( EE_ACTIONS::newSymbol ); + config.AppendAction( SCH_ACTIONS::newSymbol ); /* TODO (ISM): Handle visibility changes if( !IsSymbolFromSchematic() ) @@ -123,31 +123,31 @@ std::optional SYMBOL_EDIT_TOOLBAR_SETTINGS::DefaultToolba .AppendAction( ACTIONS::zoomTool ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::rotateCCW ) - .AppendAction( EE_ACTIONS::rotateCW ) - .AppendAction( EE_ACTIONS::mirrorV ) - .AppendAction( EE_ACTIONS::mirrorH ); + .AppendAction( SCH_ACTIONS::rotateCCW ) + .AppendAction( SCH_ACTIONS::rotateCW ) + .AppendAction( SCH_ACTIONS::mirrorV ) + .AppendAction( SCH_ACTIONS::mirrorH ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::symbolProperties ) - .AppendAction( EE_ACTIONS::pinTable ); + .AppendAction( SCH_ACTIONS::symbolProperties ) + .AppendAction( SCH_ACTIONS::pinTable ); config.AppendSeparator() .AppendAction( ACTIONS::showDatasheet ) - .AppendAction( EE_ACTIONS::checkSymbol ); + .AppendAction( SCH_ACTIONS::checkSymbol ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::showDeMorganStandard ) - .AppendAction( EE_ACTIONS::showDeMorganAlternate ); + .AppendAction( SCH_ACTIONS::showDeMorganStandard ) + .AppendAction( SCH_ACTIONS::showDeMorganAlternate ); config.AppendSeparator() .AppendControl( ACTION_TOOLBAR_CONTROLS::unitSelector ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::toggleSyncedPinsMode ); + .AppendAction( SCH_ACTIONS::toggleSyncedPinsMode ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::addSymbolToSchematic ); + .AppendAction( SCH_ACTIONS::addSymbolToSchematic ); break; } diff --git a/eeschema/symbol_viewer_frame.cpp b/eeschema/symbol_viewer_frame.cpp index 9f23ff9255..1bd3d0a50b 100644 --- a/eeschema/symbol_viewer_frame.cpp +++ b/eeschema/symbol_viewer_frame.cpp @@ -56,9 +56,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include @@ -324,15 +324,15 @@ void SYMBOL_VIEWER_FRAME::setupTools() m_toolManager = new TOOL_MANAGER; m_toolManager->SetEnvironment( GetScreen(), GetCanvas()->GetView(), GetCanvas()->GetViewControls(), config(), this ); - m_actions = new EE_ACTIONS(); + m_actions = new SCH_ACTIONS(); m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager ); // Register tools m_toolManager->RegisterTool( new COMMON_TOOLS ); m_toolManager->RegisterTool( new COMMON_CONTROL ); m_toolManager->RegisterTool( new ZOOM_TOOL ); - m_toolManager->RegisterTool( new EE_INSPECTION_TOOL ); // manage show datasheet - m_toolManager->RegisterTool( new EE_SELECTION_TOOL ); // manage context menu + m_toolManager->RegisterTool( new SCH_INSPECTION_TOOL ); // manage show datasheet + m_toolManager->RegisterTool( new SCH_SELECTION_TOOL ); // manage context menu m_toolManager->RegisterTool( new SYMBOL_EDITOR_CONTROL ); // manage render settings m_toolManager->InitTools(); @@ -397,14 +397,12 @@ void SYMBOL_VIEWER_FRAME::setupUIConditions() return symbol && !symbol->GetDatasheetField().GetText().IsEmpty(); }; - mgr->SetConditions( ACTIONS::showDatasheet, ENABLE( haveDatasheetCond ) ); - mgr->SetConditions( EE_ACTIONS::showElectricalTypes, CHECK( electricalTypesShownCondition ) ); - mgr->SetConditions( EE_ACTIONS::showPinNumbers, CHECK( pinNumbersShownCondition ) ); + mgr->SetConditions( ACTIONS::showDatasheet, ENABLE( haveDatasheetCond ) ); + mgr->SetConditions( SCH_ACTIONS::showElectricalTypes, CHECK( electricalTypesShownCondition ) ); + mgr->SetConditions( SCH_ACTIONS::showPinNumbers, CHECK( pinNumbersShownCondition ) ); - mgr->SetConditions( EE_ACTIONS::showDeMorganStandard, - ACTION_CONDITIONS().Enable( demorganCond ).Check( demorganStandardCond ) ); - mgr->SetConditions( EE_ACTIONS::showDeMorganAlternate, - ACTION_CONDITIONS().Enable( demorganCond ).Check( demorganAlternateCond ) ); + mgr->SetConditions( SCH_ACTIONS::showDeMorganStandard, ACTION_CONDITIONS().Enable( demorganCond ).Check( demorganStandardCond ) ); + mgr->SetConditions( SCH_ACTIONS::showDeMorganAlternate, ACTION_CONDITIONS().Enable( demorganCond ).Check( demorganAlternateCond ) ); #undef CHECK #undef ENABLE @@ -847,7 +845,7 @@ void SYMBOL_VIEWER_FRAME::SetSelectedSymbol( const wxString& aSymbolName ) void SYMBOL_VIEWER_FRAME::DClickOnSymbolList( wxCommandEvent& event ) { - m_toolManager->RunAction( EE_ACTIONS::addSymbolToSchematic ); + m_toolManager->RunAction( SCH_ACTIONS::addSymbolToSchematic ); } @@ -1121,7 +1119,7 @@ void SYMBOL_VIEWER_FRAME::DisplayLibInfos() SELECTION& SYMBOL_VIEWER_FRAME::GetCurrentSelection() { - return m_toolManager->GetTool()->GetSelection(); + return m_toolManager->GetTool()->GetSelection(); } diff --git a/eeschema/toolbars_sch_editor.cpp b/eeschema/toolbars_sch_editor.cpp index 9503ef6003..8db9a17cb4 100644 --- a/eeschema/toolbars_sch_editor.cpp +++ b/eeschema/toolbars_sch_editor.cpp @@ -35,8 +35,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -64,18 +64,18 @@ std::optional SCH_EDIT_TOOLBAR_SETTINGS::DefaultToolbarCo .AppendAction( ACTIONS::toggleCursorStyle ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::toggleHiddenPins ); + .AppendAction( SCH_ACTIONS::toggleHiddenPins ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::lineModeFree ) - .AppendAction( EE_ACTIONS::lineMode90 ) - .AppendAction( EE_ACTIONS::lineMode45 ); + .AppendAction( SCH_ACTIONS::lineModeFree ) + .AppendAction( SCH_ACTIONS::lineMode90 ) + .AppendAction( SCH_ACTIONS::lineMode45 ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::toggleAnnotateAuto ); + .AppendAction( SCH_ACTIONS::toggleAnnotateAuto ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::showHierarchy ) + .AppendAction( SCH_ACTIONS::showHierarchy ) .AppendAction( ACTIONS::showProperties ); if( ADVANCED_CFG::GetCfg().m_DrawBoundingBoxes ) @@ -91,35 +91,35 @@ std::optional SCH_EDIT_TOOLBAR_SETTINGS::DefaultToolbarCo case TOOLBAR_LOC::RIGHT: config.AppendAction( ACTIONS::selectionTool ) - .AppendAction( EE_ACTIONS::highlightNetTool ); + .AppendAction( SCH_ACTIONS::highlightNetTool ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::placeSymbol ) - .AppendAction( EE_ACTIONS::placePower ) - .AppendAction( EE_ACTIONS::drawWire ) - .AppendAction( EE_ACTIONS::drawBus ) - .AppendAction( EE_ACTIONS::placeBusWireEntry ) - .AppendAction( EE_ACTIONS::placeNoConnect ) - .AppendAction( EE_ACTIONS::placeJunction ) - .AppendAction( EE_ACTIONS::placeLabel ) - .AppendAction( EE_ACTIONS::placeClassLabel ) - .AppendAction( EE_ACTIONS::drawRuleArea ) - .AppendAction( EE_ACTIONS::placeGlobalLabel ) - .AppendAction( EE_ACTIONS::placeHierLabel ) - .AppendAction( EE_ACTIONS::drawSheet ) - .AppendAction( EE_ACTIONS::placeSheetPin ) - .AppendAction( EE_ACTIONS::syncAllSheetsPins ); + .AppendAction( SCH_ACTIONS::placeSymbol ) + .AppendAction( SCH_ACTIONS::placePower ) + .AppendAction( SCH_ACTIONS::drawWire ) + .AppendAction( SCH_ACTIONS::drawBus ) + .AppendAction( SCH_ACTIONS::placeBusWireEntry ) + .AppendAction( SCH_ACTIONS::placeNoConnect ) + .AppendAction( SCH_ACTIONS::placeJunction ) + .AppendAction( SCH_ACTIONS::placeLabel ) + .AppendAction( SCH_ACTIONS::placeClassLabel ) + .AppendAction( SCH_ACTIONS::drawRuleArea ) + .AppendAction( SCH_ACTIONS::placeGlobalLabel ) + .AppendAction( SCH_ACTIONS::placeHierLabel ) + .AppendAction( SCH_ACTIONS::drawSheet ) + .AppendAction( SCH_ACTIONS::placeSheetPin ) + .AppendAction( SCH_ACTIONS::syncAllSheetsPins ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::placeSchematicText ) - .AppendAction( EE_ACTIONS::drawTextBox ) - .AppendAction( EE_ACTIONS::drawTable ) - .AppendAction( EE_ACTIONS::drawRectangle ) - .AppendAction( EE_ACTIONS::drawCircle ) - .AppendAction( EE_ACTIONS::drawArc ) - .AppendAction( EE_ACTIONS::drawBezier ) - .AppendAction( EE_ACTIONS::drawLines ) - .AppendAction( EE_ACTIONS::placeImage ) + .AppendAction( SCH_ACTIONS::placeSchematicText ) + .AppendAction( SCH_ACTIONS::drawTextBox ) + .AppendAction( SCH_ACTIONS::drawTable ) + .AppendAction( SCH_ACTIONS::drawRectangle ) + .AppendAction( SCH_ACTIONS::drawCircle ) + .AppendAction( SCH_ACTIONS::drawArc ) + .AppendAction( SCH_ACTIONS::drawBezier ) + .AppendAction( SCH_ACTIONS::drawLines ) + .AppendAction( SCH_ACTIONS::placeImage ) .AppendAction( ACTIONS::deleteTool ); break; @@ -134,7 +134,7 @@ std::optional SCH_EDIT_TOOLBAR_SETTINGS::DefaultToolbarCo config.AppendAction( ACTIONS::save ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::schematicSetup ); + .AppendAction( SCH_ACTIONS::schematicSetup ); config.AppendSeparator() .AppendAction( ACTIONS::pageSettings ) @@ -161,15 +161,15 @@ std::optional SCH_EDIT_TOOLBAR_SETTINGS::DefaultToolbarCo .AppendAction( ACTIONS::zoomTool ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::navigateBack ) - .AppendAction( EE_ACTIONS::navigateUp ) - .AppendAction( EE_ACTIONS::navigateForward ); + .AppendAction( SCH_ACTIONS::navigateBack ) + .AppendAction( SCH_ACTIONS::navigateUp ) + .AppendAction( SCH_ACTIONS::navigateForward ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::rotateCCW ) - .AppendAction( EE_ACTIONS::rotateCW ) - .AppendAction( EE_ACTIONS::mirrorV ) - .AppendAction( EE_ACTIONS::mirrorH ); + .AppendAction( SCH_ACTIONS::rotateCCW ) + .AppendAction( SCH_ACTIONS::rotateCW ) + .AppendAction( SCH_ACTIONS::mirrorV ) + .AppendAction( SCH_ACTIONS::mirrorH ); config.AppendSeparator() .AppendAction( ACTIONS::showSymbolEditor ) @@ -177,15 +177,15 @@ std::optional SCH_EDIT_TOOLBAR_SETTINGS::DefaultToolbarCo .AppendAction( ACTIONS::showFootprintEditor ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::annotate ) - .AppendAction( EE_ACTIONS::runERC ) - .AppendAction( EE_ACTIONS::showSimulator ) - .AppendAction( EE_ACTIONS::assignFootprints ) - .AppendAction( EE_ACTIONS::editSymbolFields ) - .AppendAction( EE_ACTIONS::generateBOM ); + .AppendAction( SCH_ACTIONS::annotate ) + .AppendAction( SCH_ACTIONS::runERC ) + .AppendAction( SCH_ACTIONS::showSimulator ) + .AppendAction( SCH_ACTIONS::assignFootprints ) + .AppendAction( SCH_ACTIONS::editSymbolFields ) + .AppendAction( SCH_ACTIONS::generateBOM ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::showPcbNew ); + .AppendAction( SCH_ACTIONS::showPcbNew ); // Insert all the IPC plugins here on the toolbar // TODO (ISM): Move this to individual actions for each script diff --git a/eeschema/toolbars_symbol_viewer.cpp b/eeschema/toolbars_symbol_viewer.cpp index 50afa986aa..1e2d9a4bb8 100644 --- a/eeschema/toolbars_symbol_viewer.cpp +++ b/eeschema/toolbars_symbol_viewer.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include @@ -63,12 +63,12 @@ std::optional SYMBOL_VIEWER_TOOLBAR_SETTINGS::DefaultTool .AppendAction( ACTIONS::zoomFitScreen ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::showElectricalTypes ) - .AppendAction( EE_ACTIONS::showPinNumbers ); + .AppendAction( SCH_ACTIONS::showElectricalTypes ) + .AppendAction( SCH_ACTIONS::showPinNumbers ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::showDeMorganStandard ) - .AppendAction( EE_ACTIONS::showDeMorganAlternate ); + .AppendAction( SCH_ACTIONS::showDeMorganStandard ) + .AppendAction( SCH_ACTIONS::showDeMorganAlternate ); config.AppendSeparator() .AppendControl( ACTION_TOOLBAR_CONTROLS::unitSelector ); @@ -77,7 +77,7 @@ std::optional SYMBOL_VIEWER_TOOLBAR_SETTINGS::DefaultTool .AppendAction( ACTIONS::showDatasheet ); config.AppendSeparator() - .AppendAction( EE_ACTIONS::addSymbolToSchematic ); + .AppendAction( SCH_ACTIONS::addSymbolToSchematic ); break; } @@ -134,8 +134,8 @@ void SYMBOL_VIEWER_FRAME::doReCreateMenuBar() viewMenu->AppendSeparator(); viewMenu->AppendSeparator(); - viewMenu->Add( EE_ACTIONS::showElectricalTypes, ACTION_MENU::CHECK ); - viewMenu->Add( EE_ACTIONS::showPinNumbers, ACTION_MENU::CHECK ); + viewMenu->Add( SCH_ACTIONS::showElectricalTypes, ACTION_MENU::CHECK ); + viewMenu->Add( SCH_ACTIONS::showPinNumbers, ACTION_MENU::CHECK ); //-- Menubar ------------------------------------------------------------- diff --git a/eeschema/tools/ee_grid_helper.cpp b/eeschema/tools/ee_grid_helper.cpp index 01164804b7..8eb50e3868 100644 --- a/eeschema/tools/ee_grid_helper.cpp +++ b/eeschema/tools/ee_grid_helper.cpp @@ -68,7 +68,7 @@ EE_GRID_HELPER::~EE_GRID_HELPER() VECTOR2I EE_GRID_HELPER::BestDragOrigin( const VECTOR2I& aMousePos, GRID_HELPER_GRIDS aGrid, - const EE_SELECTION& aItems ) + const SCH_SELECTION& aItems ) { clearAnchors(); @@ -130,7 +130,7 @@ VECTOR2I EE_GRID_HELPER::BestDragOrigin( const VECTOR2I& aMousePos, GRID_HELPER_ VECTOR2I EE_GRID_HELPER::BestSnapAnchor( const VECTOR2I& aOrigin, GRID_HELPER_GRIDS aGrid, SCH_ITEM* aSkip ) { - EE_SELECTION skipItems; + SCH_SELECTION skipItems; skipItems.Add( aSkip ); return BestSnapAnchor( aOrigin, aGrid, skipItems ); @@ -138,7 +138,7 @@ VECTOR2I EE_GRID_HELPER::BestSnapAnchor( const VECTOR2I& aOrigin, GRID_HELPER_GR VECTOR2I EE_GRID_HELPER::BestSnapAnchor( const VECTOR2I& aOrigin, GRID_HELPER_GRIDS aGrid, - const EE_SELECTION& aSkip ) + const SCH_SELECTION& aSkip ) { constexpr int snapRange = SNAP_RANGE * schIUScale.IU_PER_MILS; @@ -321,7 +321,7 @@ SCH_ITEM* EE_GRID_HELPER::GetSnapped() const std::set EE_GRID_HELPER::queryVisible( const BOX2I& aArea, - const EE_SELECTION& aSkipList ) const + const SCH_SELECTION& aSkipList ) const { std::set items; std::vector selectedItems; diff --git a/eeschema/tools/ee_grid_helper.h b/eeschema/tools/ee_grid_helper.h index 8d7b877f20..06503a7289 100644 --- a/eeschema/tools/ee_grid_helper.h +++ b/eeschema/tools/ee_grid_helper.h @@ -29,7 +29,7 @@ #include #include #include -#include +#include class SCH_ITEM; @@ -57,14 +57,14 @@ public: GRID_HELPER_GRIDS GetItemGrid( const EDA_ITEM* aItem ) const override; VECTOR2I BestDragOrigin( const VECTOR2I& aMousePos, GRID_HELPER_GRIDS aGrid, - const EE_SELECTION& aItems ); + const SCH_SELECTION& aItems ); VECTOR2I BestSnapAnchor( const VECTOR2I& aOrigin, GRID_HELPER_GRIDS aGrid, SCH_ITEM* aSkip ); VECTOR2I BestSnapAnchor( const VECTOR2I& aOrigin, GRID_HELPER_GRIDS aGrid, - const EE_SELECTION& aSkip = {} ); + const SCH_SELECTION& aSkip = {} ); private: - std::set queryVisible( const BOX2I& aArea, const EE_SELECTION& aSkipList ) const; + std::set queryVisible( const BOX2I& aArea, const SCH_SELECTION& aSkipList ) const; ANCHOR* nearestAnchor( const VECTOR2I& aPos, int aFlags, GRID_HELPER_GRIDS aGrid ); diff --git a/eeschema/tools/rule_area_create_helper.cpp b/eeschema/tools/rule_area_create_helper.cpp index 89ee50fb6e..407349bf94 100644 --- a/eeschema/tools/rule_area_create_helper.cpp +++ b/eeschema/tools/rule_area_create_helper.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include @@ -68,7 +68,7 @@ void RULE_AREA_CREATE_HELPER::commitRuleArea( std::unique_ptr aRu commit.Add( ruleArea, m_frame->GetScreen() ); commit.Push( _( "Draw Rule Area" ) ); - m_toolManager->RunAction( EE_ACTIONS::addItemToSel, ruleArea ); + m_toolManager->RunAction( SCH_ACTIONS::addItemToSel, 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( EE_ACTIONS::clearSelection ); + m_toolManager->RunAction( SCH_ACTIONS::clearSelection ); SCH_RENDER_SETTINGS renderSettings; COLOR_SETTINGS* colorSettings = m_frame->GetColorSettings(); diff --git a/eeschema/tools/ee_actions.cpp b/eeschema/tools/sch_actions.cpp similarity index 81% rename from eeschema/tools/ee_actions.cpp rename to eeschema/tools/sch_actions.cpp index 7e836443a0..f2f5276218 100644 --- a/eeschema/tools/ee_actions.cpp +++ b/eeschema/tools/sch_actions.cpp @@ -22,7 +22,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "tools/ee_actions.h" +#include "tools/sch_actions.h" #include #include @@ -39,36 +39,36 @@ #define _(s) s -// EE_INSPECTION_TOOL +// SCH_INSPECTION_TOOL // -TOOL_ACTION EE_ACTIONS::runERC( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::runERC( TOOL_ACTION_ARGS() .Name( "eeschema.InspectionTool.runERC" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Electrical Rules Checker" ) ) .Tooltip( _( "Show the electrical rules checker window" ) ) .Icon( BITMAPS::erc ) ); -TOOL_ACTION EE_ACTIONS::checkSymbol( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::checkSymbol( TOOL_ACTION_ARGS() .Name( "eeschema.InspectionTool.checkSymbol" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Symbol Checker" ) ) .Tooltip( _( "Show the symbol checker window" ) ) .Icon( BITMAPS::erc ) ); -TOOL_ACTION EE_ACTIONS::diffSymbol( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::diffSymbol( TOOL_ACTION_ARGS() .Name( "eeschema.InspectionTool.diffSymbol" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Compare Symbol with Library" ) ) .Tooltip( _( "Show differences between schematic symbol and its library equivalent" ) ) .Icon( BITMAPS::library ) ); -TOOL_ACTION EE_ACTIONS::showBusSyntaxHelp( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::showBusSyntaxHelp( TOOL_ACTION_ARGS() .Name( "eeschema.InspectionTool.showBusSyntaxHelp" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Show Bus Syntax Help" ) ) .Icon( BITMAPS::bus_definition_tool ) ); -TOOL_ACTION EE_ACTIONS::showSimulator( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::showSimulator( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.showSimulator" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Simulator" ) ) @@ -76,28 +76,28 @@ TOOL_ACTION EE_ACTIONS::showSimulator( TOOL_ACTION_ARGS() .Icon( BITMAPS::simulator ) ); -// EE_POINT_EDITOR +// SCH_POINT_EDITOR // -TOOL_ACTION EE_ACTIONS::pointEditorAddCorner( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::pointEditorAddCorner( TOOL_ACTION_ARGS() .Name( "eeschema.PointEditor.addCorner" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Create Corner" ) ) .Icon( BITMAPS::add_corner ) ); -TOOL_ACTION EE_ACTIONS::pointEditorRemoveCorner( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::pointEditorRemoveCorner( TOOL_ACTION_ARGS() .Name( "eeschema.PointEditor.removeCorner" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Remove Corner" ) ) .Icon( BITMAPS::delete_cursor ) ); -// EE_SELECTION_TOOL +// SCH_SELECTION_TOOL // -TOOL_ACTION EE_ACTIONS::selectionActivate( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::selectionActivate( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveSelection" ) .Scope( AS_GLOBAL ) .Flags( AF_ACTIVATE ) ); -TOOL_ACTION EE_ACTIONS::selectNode( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::selectNode( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveSelection.SelectNode" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_ALT + '3' ) @@ -105,7 +105,7 @@ TOOL_ACTION EE_ACTIONS::selectNode( TOOL_ACTION_ARGS() .FriendlyName( _( "Select Node" ) ) .Tooltip( _( "Select a connection item under the cursor" ) ) ); -TOOL_ACTION EE_ACTIONS::selectConnection( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::selectConnection( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveSelection.SelectConnection" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_CTRL + '4' ) @@ -114,64 +114,64 @@ TOOL_ACTION EE_ACTIONS::selectConnection( TOOL_ACTION_ARGS() .Tooltip( _( "Select a complete connection" ) ) .Icon( BITMAPS::net_highlight_schematic ) ); -TOOL_ACTION EE_ACTIONS::selectionMenu( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::selectionMenu( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveSelection.SelectionMenu" ) .Scope( AS_GLOBAL ) ); -TOOL_ACTION EE_ACTIONS::addItemToSel( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::addItemToSel( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveSelection.AddItemToSel" ) .Scope( AS_GLOBAL ) ); -TOOL_ACTION EE_ACTIONS::addItemsToSel( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::addItemsToSel( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveSelection.AddItemsToSel" ) .Scope( AS_GLOBAL ) ); -TOOL_ACTION EE_ACTIONS::removeItemFromSel( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::removeItemFromSel( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveSelection.RemoveItemFromSel" ) .Scope( AS_GLOBAL ) ); -TOOL_ACTION EE_ACTIONS::removeItemsFromSel( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::removeItemsFromSel( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveSelection.RemoveItemsFromSel" ) .Scope( AS_GLOBAL ) ); -TOOL_ACTION EE_ACTIONS::clearSelection( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::clearSelection( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveSelection.ClearSelection" ) .Scope( AS_GLOBAL ) ); -TOOL_ACTION EE_ACTIONS::syncSelection( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::syncSelection( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveSelection.SyncSelection" ) .Scope( AS_GLOBAL ) ); // SCH_DESIGN_BLOCK_CONTROL -TOOL_ACTION EE_ACTIONS::showDesignBlockPanel( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::showDesignBlockPanel( TOOL_ACTION_ARGS() .Name( "eeschema.SchDesignBlockControl.showDesignBlockPanel" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Design Blocks" ) ) .Tooltip( _( "Show/hide design blocks library" ) ) .Icon( BITMAPS::search_tree ) ); -TOOL_ACTION EE_ACTIONS::saveSheetAsDesignBlock( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::saveSheetAsDesignBlock( TOOL_ACTION_ARGS() .Name( "eeschema.SchDesignBlockControl.saveSheetAsDesignBlock" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Save Current Sheet as Design Block..." ) ) .Tooltip( _( "Create a new design block from the current sheet" ) ) .Icon( BITMAPS::new_component ) ); -TOOL_ACTION EE_ACTIONS::saveSelectionAsDesignBlock( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::saveSelectionAsDesignBlock( TOOL_ACTION_ARGS() .Name( "eeschema.SchDesignBlockControl.saveSelectionAsDesignBlock" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Save Selection as Design Block..." ) ) .Tooltip( _( "Create a new design block from the current selection" ) ) .Icon( BITMAPS::new_component ) ); -TOOL_ACTION EE_ACTIONS::deleteDesignBlock( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::deleteDesignBlock( TOOL_ACTION_ARGS() .Name( "eeschema.SchDesignBlockControl.saveDeleteDesignBlock" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Delete Design Block" ) ) .Tooltip( _( "Remove the selected design block from its library" ) ) .Icon( BITMAPS::trash ) ); -TOOL_ACTION EE_ACTIONS::editDesignBlockProperties( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::editDesignBlockProperties( TOOL_ACTION_ARGS() .Name( "eeschema.SchDesignBlockControl.editDesignBlockProperties" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Properties..." ) ) @@ -180,7 +180,7 @@ TOOL_ACTION EE_ACTIONS::editDesignBlockProperties( TOOL_ACTION_ARGS() // SYMBOL_EDITOR_CONTROL // -TOOL_ACTION EE_ACTIONS::saveLibraryAs( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::saveLibraryAs( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.saveLibraryAs" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_CTRL + MD_SHIFT + 'S' ) @@ -188,7 +188,7 @@ TOOL_ACTION EE_ACTIONS::saveLibraryAs( TOOL_ACTION_ARGS() .FriendlyName( _( "Save Library As..." ) ) .Tooltip( _( "Save the current library to a new file" ) ) ); -TOOL_ACTION EE_ACTIONS::newSymbol( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::newSymbol( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.newSymbol" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_CTRL + 'N' ) @@ -196,106 +196,106 @@ TOOL_ACTION EE_ACTIONS::newSymbol( TOOL_ACTION_ARGS() .Tooltip( _( "Create a new symbol in an existing library" ) ) .Icon( BITMAPS::new_component ) ); -TOOL_ACTION EE_ACTIONS::deriveFromExistingSymbol( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::deriveFromExistingSymbol( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.deriveFromExistingSymbol" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Derive from Existing Symbol..." ) ) .Tooltip( _( "Create a new symbol, derived from an existing symbol" ) ) .Icon( BITMAPS::new_component ) ); -TOOL_ACTION EE_ACTIONS::editSymbol( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::editSymbol( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.editSymbol" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Edit Symbol" ) ) .Tooltip( _( "Show selected symbol on editor canvas" ) ) .Icon( BITMAPS::edit ) ); -TOOL_ACTION EE_ACTIONS::duplicateSymbol( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::duplicateSymbol( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.duplicateSymbol" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Duplicate Symbol" ) ) .Icon( BITMAPS::duplicate ) ); -TOOL_ACTION EE_ACTIONS::renameSymbol( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::renameSymbol( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.renameFootprint" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Rename Symbol..." ) ) .Icon( BITMAPS::edit ) ); -TOOL_ACTION EE_ACTIONS::saveSymbolAs( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::saveSymbolAs( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.saveSymbolAs" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Save As..." ) ) .Tooltip( _( "Save the current symbol to a different library or name" ) ) .Icon( BITMAPS::save_as ) ); -TOOL_ACTION EE_ACTIONS::saveSymbolCopyAs( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::saveSymbolCopyAs( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.saveSymbolCopyAs" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Save Copy As..." ) ) .Tooltip( _( "Save a copy of the current symbol to a different library or name" ) ) .Icon( BITMAPS::save_as ) ); -TOOL_ACTION EE_ACTIONS::deleteSymbol( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::deleteSymbol( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.deleteSymbol" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Delete Symbol" ) ) .Tooltip( _( "Remove the selected symbol from its library" ) ) .Icon( BITMAPS::trash ) ); -TOOL_ACTION EE_ACTIONS::cutSymbol( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::cutSymbol( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.cutSymbol" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Cut" ) ) .Icon( BITMAPS::cut ) ); -TOOL_ACTION EE_ACTIONS::copySymbol( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::copySymbol( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.copySymbol" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Copy" ) ) .Icon( BITMAPS::copy ) ); -TOOL_ACTION EE_ACTIONS::pasteSymbol( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::pasteSymbol( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.pasteSymbol" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Paste Symbol" ) ) .Icon( BITMAPS::paste ) ); -TOOL_ACTION EE_ACTIONS::importSymbol( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::importSymbol( TOOL_ACTION_ARGS() .Name("eeschema.SymbolLibraryControl.importSymbol" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Import Symbol..." ) ) .Tooltip( _( "Import a symbol to the current library" ) ) .Icon( BITMAPS::import_part ) ); -TOOL_ACTION EE_ACTIONS::exportSymbol( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::exportSymbol( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.exportSymbol" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Export..." ) ) .Tooltip( _( "Export a symbol to a new library file" ) ) .Icon( BITMAPS::export_part ) ); -TOOL_ACTION EE_ACTIONS::updateSymbolFields( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::updateSymbolFields( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.updateSymbolFields" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Update Symbol Fields..." ) ) .Tooltip( _( "Update symbol to match changes made in parent symbol" ) ) .Icon( BITMAPS::refresh ) ); -TOOL_ACTION EE_ACTIONS::setUnitDisplayName( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::setUnitDisplayName( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.setUnitDisplayName" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Set Unit Display Name..." ) ) .Tooltip( _( "Set the display name for a particular unit in a multi-unit symbol" ) ) ); -TOOL_ACTION EE_ACTIONS::addSymbolToSchematic( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::addSymbolToSchematic( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.addSymbolToSchematic" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Add Symbol to Schematic" ) ) .Tooltip( _( "Add the current symbol to the schematic" ) ) .Icon( BITMAPS::add_symbol_to_schematic ) ); -TOOL_ACTION EE_ACTIONS::showElectricalTypes( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::showElectricalTypes( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.showElectricalTypes" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Show Pin Electrical Types" ) ) @@ -303,7 +303,7 @@ TOOL_ACTION EE_ACTIONS::showElectricalTypes( TOOL_ACTION_ARGS() .ToolbarState( TOOLBAR_STATE::TOGGLE ) .Icon( BITMAPS::pin_show_etype ) ); -TOOL_ACTION EE_ACTIONS::showPinNumbers( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::showPinNumbers( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.showPinNumbers" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Show Pin Numbers" ) ) @@ -311,21 +311,21 @@ TOOL_ACTION EE_ACTIONS::showPinNumbers( TOOL_ACTION_ARGS() .ToolbarState( TOOLBAR_STATE::TOGGLE ) .Icon( BITMAPS::pin ) ); -TOOL_ACTION EE_ACTIONS::exportSymbolView( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::exportSymbolView( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.exportSymbolView" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Export View as PNG..." ) ) .Tooltip( _( "Create PNG file from the current view" ) ) .Icon( BITMAPS::export_png ) ); -TOOL_ACTION EE_ACTIONS::exportSymbolAsSVG( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::exportSymbolAsSVG( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.exportSymbolAsSVG" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Export Symbol as SVG..." ) ) .Tooltip( _( "Create SVG file from the current symbol" ) ) .Icon( BITMAPS::export_svg ) ); -TOOL_ACTION EE_ACTIONS::toggleSyncedPinsMode( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::toggleSyncedPinsMode( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.toggleSyncedPinsMode" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Synchronized Pins Mode" ) ) @@ -335,14 +335,14 @@ TOOL_ACTION EE_ACTIONS::toggleSyncedPinsMode( TOOL_ACTION_ARGS() .ToolbarState( TOOLBAR_STATE::TOGGLE ) .Icon( BITMAPS::pin2pin ) ); -TOOL_ACTION EE_ACTIONS::showHiddenPins( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::showHiddenPins( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.showHiddenPins" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Show Hidden Pins" ) ) .ToolbarState( TOOLBAR_STATE::TOGGLE ) .Icon( BITMAPS::hidden_pin ) ); -TOOL_ACTION EE_ACTIONS::showHiddenFields( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::showHiddenFields( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolLibraryControl.showHiddenFields" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Show Hidden Fields" ) ) @@ -352,7 +352,7 @@ TOOL_ACTION EE_ACTIONS::showHiddenFields( TOOL_ACTION_ARGS() // SYMBOL_EDITOR_DRAWING_TOOLS // -TOOL_ACTION EE_ACTIONS::placeSymbolPin( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::placeSymbolPin( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolDrawing.placeSymbolPin" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'P' ) @@ -363,7 +363,7 @@ TOOL_ACTION EE_ACTIONS::placeSymbolPin( TOOL_ACTION_ARGS() .Flags( AF_ACTIVATE ) .Parameter( SCH_PIN_T ) ); -TOOL_ACTION EE_ACTIONS::placeSymbolText( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::placeSymbolText( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolDrawing.placeSymbolText" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Draw Text" ) ) @@ -372,7 +372,7 @@ TOOL_ACTION EE_ACTIONS::placeSymbolText( TOOL_ACTION_ARGS() .Flags( AF_ACTIVATE ) .Parameter( SCH_TEXT_T ) ); -TOOL_ACTION EE_ACTIONS::drawSymbolTextBox( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::drawSymbolTextBox( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolDrawing.drawSymbolTextBox" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Draw Text Boxes" ) ) @@ -380,7 +380,7 @@ TOOL_ACTION EE_ACTIONS::drawSymbolTextBox( TOOL_ACTION_ARGS() .Icon( BITMAPS::add_textbox ) .Flags( AF_ACTIVATE ) ); -TOOL_ACTION EE_ACTIONS::drawSymbolLines( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::drawSymbolLines( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolDrawing.drawSymbolLines" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Draw Lines" ) ) @@ -390,7 +390,7 @@ TOOL_ACTION EE_ACTIONS::drawSymbolLines( TOOL_ACTION_ARGS() .Flags( AF_ACTIVATE ) .Parameter( SHAPE_T::POLY ) ); -TOOL_ACTION EE_ACTIONS::drawSymbolPolygon( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::drawSymbolPolygon( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolDrawing.drawSymbolPolygon" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Draw Polygons" ) ) @@ -399,7 +399,7 @@ TOOL_ACTION EE_ACTIONS::drawSymbolPolygon( TOOL_ACTION_ARGS() .Flags( AF_ACTIVATE ) .Parameter( SHAPE_T::POLY ) ); -TOOL_ACTION EE_ACTIONS::placeSymbolAnchor( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::placeSymbolAnchor( TOOL_ACTION_ARGS() .Name( "eeschema.SymbolDrawing.placeSymbolAnchor" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Move Symbol Anchor" ) ) @@ -409,21 +409,21 @@ TOOL_ACTION EE_ACTIONS::placeSymbolAnchor( TOOL_ACTION_ARGS() // SYMBOL_EDITOR_PIN_TOOL // -TOOL_ACTION EE_ACTIONS::pushPinLength( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::pushPinLength( TOOL_ACTION_ARGS() .Name( "eeschema.PinEditing.pushPinLength" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Push Pin Length" ) ) .Tooltip( _( "Copy pin length to other pins in symbol" ) ) .Icon( BITMAPS::pin_size_to ) ); -TOOL_ACTION EE_ACTIONS::pushPinNameSize( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::pushPinNameSize( TOOL_ACTION_ARGS() .Name( "eeschema.PinEditing.pushPinNameSize" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Push Pin Name Size" ) ) .Tooltip( _( "Copy pin name size to other pins in symbol" ) ) .Icon( BITMAPS::pin_size_to ) ); -TOOL_ACTION EE_ACTIONS::pushPinNumSize( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::pushPinNumSize( TOOL_ACTION_ARGS() .Name( "eeschema.PinEditing.pushPinNumSize" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Push Pin Number Size" ) ) @@ -433,7 +433,7 @@ TOOL_ACTION EE_ACTIONS::pushPinNumSize( TOOL_ACTION_ARGS() // SCH_DRAWING_TOOLS // -TOOL_ACTION EE_ACTIONS::placeSymbol( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::placeSymbol( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.placeSymbol" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'A' ) @@ -442,9 +442,9 @@ TOOL_ACTION EE_ACTIONS::placeSymbol( TOOL_ACTION_ARGS() .ToolbarState( TOOLBAR_STATE::TOGGLE ) .Icon( BITMAPS::add_component ) .Flags( AF_ACTIVATE ) - .Parameter( {} ) ); + .Parameter( {} ) ); -TOOL_ACTION EE_ACTIONS::placeNextSymbolUnit( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::placeNextSymbolUnit( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.placeNextSymbolUnit" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Place Next Symbol Unit" ) ) @@ -453,7 +453,7 @@ TOOL_ACTION EE_ACTIONS::placeNextSymbolUnit( TOOL_ACTION_ARGS() // The symbol to use as a reference for the next unit .Parameter( nullptr ) ); -TOOL_ACTION EE_ACTIONS::placePower( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::placePower( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.placePowerSymbol" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'P' ) @@ -462,9 +462,9 @@ TOOL_ACTION EE_ACTIONS::placePower( TOOL_ACTION_ARGS() .ToolbarState( TOOLBAR_STATE::TOGGLE ) .Icon( BITMAPS::add_power ) .Flags( AF_ACTIVATE ) - .Parameter( {} ) ); + .Parameter( {} ) ); -TOOL_ACTION EE_ACTIONS::placeDesignBlock( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::placeDesignBlock( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.placeDesignBlock" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_SHIFT + 'B' ) @@ -475,7 +475,7 @@ TOOL_ACTION EE_ACTIONS::placeDesignBlock( TOOL_ACTION_ARGS() .Parameter( nullptr ) ); -TOOL_ACTION EE_ACTIONS::placeNoConnect( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::placeNoConnect( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.placeNoConnect" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'Q' ) @@ -486,7 +486,7 @@ TOOL_ACTION EE_ACTIONS::placeNoConnect( TOOL_ACTION_ARGS() .Flags( AF_ACTIVATE ) .Parameter( SCH_NO_CONNECT_T ) ); -TOOL_ACTION EE_ACTIONS::placeJunction( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::placeJunction( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.placeJunction" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'J' ) @@ -497,7 +497,7 @@ TOOL_ACTION EE_ACTIONS::placeJunction( TOOL_ACTION_ARGS() .Flags( AF_ACTIVATE ) .Parameter( SCH_JUNCTION_T ) ); -TOOL_ACTION EE_ACTIONS::placeBusWireEntry( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::placeBusWireEntry( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.placeBusWireEntry" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'Z' ) @@ -508,7 +508,7 @@ TOOL_ACTION EE_ACTIONS::placeBusWireEntry( TOOL_ACTION_ARGS() .Flags( AF_ACTIVATE ) .Parameter( SCH_BUS_WIRE_ENTRY_T ) ); -TOOL_ACTION EE_ACTIONS::placeLabel( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::placeLabel( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.placeLabel" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'L' ) @@ -518,7 +518,7 @@ TOOL_ACTION EE_ACTIONS::placeLabel( TOOL_ACTION_ARGS() .Icon( BITMAPS::add_label ) .Flags( AF_ACTIVATE ) ); -TOOL_ACTION EE_ACTIONS::placeClassLabel( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::placeClassLabel( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.placeClassLabel" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Place Directive Labels" ) ) @@ -526,7 +526,7 @@ TOOL_ACTION EE_ACTIONS::placeClassLabel( TOOL_ACTION_ARGS() .Icon( BITMAPS::add_class_flag ) .Flags( AF_ACTIVATE ) ); -TOOL_ACTION EE_ACTIONS::placeHierLabel( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::placeHierLabel( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.placeHierarchicalLabel" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'H' ) @@ -536,7 +536,7 @@ TOOL_ACTION EE_ACTIONS::placeHierLabel( TOOL_ACTION_ARGS() .Icon( BITMAPS::add_hierarchical_label ) .Flags( AF_ACTIVATE ) ); -TOOL_ACTION EE_ACTIONS::drawSheet( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::drawSheet( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.drawSheet" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'S' ) @@ -547,7 +547,7 @@ TOOL_ACTION EE_ACTIONS::drawSheet( TOOL_ACTION_ARGS() .Flags( AF_ACTIVATE ) .Parameter( SCH_SHEET_T ) ); -TOOL_ACTION EE_ACTIONS::drawSheetFromFile( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::drawSheetFromFile( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.drawSheetFromFile" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Draw Sheet from File" ) ) @@ -556,7 +556,7 @@ TOOL_ACTION EE_ACTIONS::drawSheetFromFile( TOOL_ACTION_ARGS() .Flags( AF_ACTIVATE ) .Parameter ( nullptr ) ); -TOOL_ACTION EE_ACTIONS::drawSheetFromDesignBlock( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::drawSheetFromDesignBlock( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.drawSheetFromDesignBlock" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Draw Sheet from Design Block" ) ) @@ -565,7 +565,7 @@ TOOL_ACTION EE_ACTIONS::drawSheetFromDesignBlock( TOOL_ACTION_ARGS() .Flags( AF_ACTIVATE ) .Parameter ( nullptr ) ); -TOOL_ACTION EE_ACTIONS::placeSheetPin( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::placeSheetPin( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.placeSheetPin" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Place Sheet Pins" ) ) @@ -573,13 +573,13 @@ TOOL_ACTION EE_ACTIONS::placeSheetPin( TOOL_ACTION_ARGS() .Icon( BITMAPS::add_hierar_pin ) .Flags( AF_ACTIVATE ) ); -TOOL_ACTION EE_ACTIONS::autoplaceAllSheetPins( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::autoplaceAllSheetPins( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.autoplaceAllSheetPins" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Autoplace All Sheet Pins" ) ) .Tooltip( _( "Imports and auto places all sheet pins" ) ) ); -TOOL_ACTION EE_ACTIONS::syncSheetPins( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::syncSheetPins( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.syncSheetPins" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Sync Sheet Pins..." ) ) @@ -587,7 +587,7 @@ TOOL_ACTION EE_ACTIONS::syncSheetPins( TOOL_ACTION_ARGS() .Icon( BITMAPS::import_hierarchical_label ) .Flags( AF_ACTIVATE ) ); -TOOL_ACTION EE_ACTIONS::syncAllSheetsPins( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::syncAllSheetsPins( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.syncAllSheetsPins" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Sync Sheet Pins..." ) ) @@ -595,7 +595,7 @@ TOOL_ACTION EE_ACTIONS::syncAllSheetsPins( TOOL_ACTION_ARGS() .Icon( BITMAPS::import_hierarchical_label ) .Flags( AF_ACTIVATE ) ); -TOOL_ACTION EE_ACTIONS::importSheet( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::importSheet( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.importSheet" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Import Sheet..." ) ) @@ -604,7 +604,7 @@ TOOL_ACTION EE_ACTIONS::importSheet( TOOL_ACTION_ARGS() .Flags( AF_ACTIVATE ) .Parameter ( nullptr ) ); -TOOL_ACTION EE_ACTIONS::placeGlobalLabel( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::placeGlobalLabel( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.placeGlobalLabel" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_CTRL + 'L' ) @@ -614,7 +614,7 @@ TOOL_ACTION EE_ACTIONS::placeGlobalLabel( TOOL_ACTION_ARGS() .Icon( BITMAPS::add_glabel ) .Flags( AF_ACTIVATE ) ); -TOOL_ACTION EE_ACTIONS::placeSchematicText( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::placeSchematicText( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.placeSchematicText" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'T' ) @@ -624,7 +624,7 @@ TOOL_ACTION EE_ACTIONS::placeSchematicText( TOOL_ACTION_ARGS() .Icon( BITMAPS::text ) .Flags( AF_ACTIVATE ) ); -TOOL_ACTION EE_ACTIONS::drawTextBox( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::drawTextBox( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.drawTextBox" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Draw Text Boxes" ) ) @@ -633,7 +633,7 @@ TOOL_ACTION EE_ACTIONS::drawTextBox( TOOL_ACTION_ARGS() .Flags( AF_ACTIVATE ) .Parameter( SHAPE_T::RECTANGLE ) ); -TOOL_ACTION EE_ACTIONS::drawTable( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::drawTable( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.drawTable" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Draw Tables" ) ) @@ -641,7 +641,7 @@ TOOL_ACTION EE_ACTIONS::drawTable( TOOL_ACTION_ARGS() .Icon( BITMAPS::table ) .Flags( AF_ACTIVATE ) ); -TOOL_ACTION EE_ACTIONS::drawRectangle( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::drawRectangle( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.drawRectangle" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Draw Rectangles" ) ) @@ -650,7 +650,7 @@ TOOL_ACTION EE_ACTIONS::drawRectangle( TOOL_ACTION_ARGS() .Flags( AF_ACTIVATE ) .Parameter( SHAPE_T::RECTANGLE ) ); -TOOL_ACTION EE_ACTIONS::drawCircle( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::drawCircle( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.drawCircle" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Draw Circles" ) ) @@ -659,7 +659,7 @@ TOOL_ACTION EE_ACTIONS::drawCircle( TOOL_ACTION_ARGS() .Flags( AF_ACTIVATE ) .Parameter( SHAPE_T::CIRCLE ) ); -TOOL_ACTION EE_ACTIONS::drawArc( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::drawArc( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.drawArc" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Draw Arcs" ) ) @@ -668,7 +668,7 @@ TOOL_ACTION EE_ACTIONS::drawArc( TOOL_ACTION_ARGS() .Flags( AF_ACTIVATE ) .Parameter( SHAPE_T::ARC ) ); -TOOL_ACTION EE_ACTIONS::drawBezier( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::drawBezier( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.drawBezier" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Draw Bezier Curve" ) ) @@ -677,7 +677,7 @@ TOOL_ACTION EE_ACTIONS::drawBezier( TOOL_ACTION_ARGS() .Flags( AF_ACTIVATE ) .Parameter( SHAPE_T::BEZIER ) ); -TOOL_ACTION EE_ACTIONS::placeImage( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::placeImage( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.placeImage" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Place Images" ) ) @@ -686,7 +686,7 @@ TOOL_ACTION EE_ACTIONS::placeImage( TOOL_ACTION_ARGS() .Flags( AF_ACTIVATE ) .Parameter( nullptr ) ); -TOOL_ACTION EE_ACTIONS::drawRuleArea( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::drawRuleArea( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.drawRuleArea" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Draw Rule Areas" ) ) @@ -695,14 +695,14 @@ TOOL_ACTION EE_ACTIONS::drawRuleArea( TOOL_ACTION_ARGS() .Flags( AF_ACTIVATE ) .Parameter( SHAPE_T::RECTANGLE ) ); -TOOL_ACTION EE_ACTIONS::deleteLastPoint( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::deleteLastPoint( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.deleteLastPoint" ) .Scope( AS_CONTEXT ) .FriendlyName( _( "Delete Last Point" ) ) .Tooltip( _( "Delete the last point added to the current item" ) ) .Icon( BITMAPS::undo ) ); -TOOL_ACTION EE_ACTIONS::closeOutline( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::closeOutline( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.closeOutline" ) .Scope( AS_CONTEXT ) .FriendlyName( _( "Close Outline" ) ) @@ -712,7 +712,7 @@ TOOL_ACTION EE_ACTIONS::closeOutline( TOOL_ACTION_ARGS() // SCH_EDIT_TOOL // -TOOL_ACTION EE_ACTIONS::repeatDrawItem( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::repeatDrawItem( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.repeatDrawItem" ) .Scope( AS_GLOBAL ) #ifdef __WXMAC__ @@ -724,13 +724,13 @@ TOOL_ACTION EE_ACTIONS::repeatDrawItem( TOOL_ACTION_ARGS() .FriendlyName( _( "Repeat Last Item" ) ) .Tooltip( _( "Duplicates the last drawn item" ) ) ); -TOOL_ACTION EE_ACTIONS::rotateCW( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::rotateCW( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.rotateCW" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Rotate Clockwise" ) ) .Icon( BITMAPS::rotate_cw ) ); -TOOL_ACTION EE_ACTIONS::rotateCCW( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::rotateCCW( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.rotateCCW" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'R' ) @@ -738,7 +738,7 @@ TOOL_ACTION EE_ACTIONS::rotateCCW( TOOL_ACTION_ARGS() .FriendlyName( _( "Rotate Counterclockwise" ) ) .Icon( BITMAPS::rotate_ccw ) ); -TOOL_ACTION EE_ACTIONS::mirrorV( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::mirrorV( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.mirrorV" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'Y' ) @@ -747,7 +747,7 @@ TOOL_ACTION EE_ACTIONS::mirrorV( TOOL_ACTION_ARGS() .Tooltip( _( "Flips selected item(s) from top to bottom" ) ) .Icon( BITMAPS::mirror_v ) ); -TOOL_ACTION EE_ACTIONS::mirrorH( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::mirrorH( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.mirrorH" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'X' ) @@ -756,7 +756,7 @@ TOOL_ACTION EE_ACTIONS::mirrorH( TOOL_ACTION_ARGS() .Tooltip( _( "Flips selected item(s) from left to right" ) ) .Icon( BITMAPS::mirror_h ) ); -TOOL_ACTION EE_ACTIONS::swap( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::swap( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.swap" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_ALT + 'S' ) @@ -764,7 +764,7 @@ TOOL_ACTION EE_ACTIONS::swap( TOOL_ACTION_ARGS() .Tooltip( _( "Swap positions of selected items" ) ) .Icon( BITMAPS::swap ) ); -TOOL_ACTION EE_ACTIONS::properties( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::properties( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.properties" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'E' ) @@ -772,7 +772,7 @@ TOOL_ACTION EE_ACTIONS::properties( TOOL_ACTION_ARGS() .FriendlyName( _( "Properties..." ) ) .Icon( BITMAPS::edit ) ); -TOOL_ACTION EE_ACTIONS::editReference( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::editReference( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.editReference" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'U' ) @@ -780,7 +780,7 @@ TOOL_ACTION EE_ACTIONS::editReference( TOOL_ACTION_ARGS() .FriendlyName( _( "Edit Reference Designator..." ) ) .Icon( BITMAPS::edit_comp_ref ) ); -TOOL_ACTION EE_ACTIONS::editValue( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::editValue( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.editValue" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'V' ) @@ -788,7 +788,7 @@ TOOL_ACTION EE_ACTIONS::editValue( TOOL_ACTION_ARGS() .FriendlyName( _( "Edit Value..." ) ) .Icon( BITMAPS::edit_comp_value ) ); -TOOL_ACTION EE_ACTIONS::editFootprint( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::editFootprint( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.editFootprint" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'F' ) @@ -796,7 +796,7 @@ TOOL_ACTION EE_ACTIONS::editFootprint( TOOL_ACTION_ARGS() .FriendlyName( _( "Edit Footprint..." ) ) .Icon( BITMAPS::edit_comp_footprint ) ); -TOOL_ACTION EE_ACTIONS::autoplaceFields( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::autoplaceFields( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.autoplaceFields" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'O' ) @@ -805,49 +805,49 @@ TOOL_ACTION EE_ACTIONS::autoplaceFields( TOOL_ACTION_ARGS() .Tooltip( _( "Runs the automatic placement algorithm on the symbol's (or sheet's) fields" ) ) .Icon( BITMAPS::autoplace_fields ) ); -TOOL_ACTION EE_ACTIONS::changeSymbols( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::changeSymbols( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.changeSymbols" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Change Symbols..." ) ) .Tooltip( _( "Assign different symbols from the library" ) ) .Icon( BITMAPS::exchange ) ); -TOOL_ACTION EE_ACTIONS::updateSymbols( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::updateSymbols( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.updateSymbols" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Update Symbols from Library..." ) ) .Tooltip( _( "Update symbols to include any changes from the library" ) ) .Icon( BITMAPS::refresh ) ); -TOOL_ACTION EE_ACTIONS::changeSymbol( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::changeSymbol( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.changeSymbol" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Change Symbol..." ) ) .Tooltip( _( "Assign a different symbol from the library" ) ) .Icon( BITMAPS::exchange ) ); -TOOL_ACTION EE_ACTIONS::updateSymbol( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::updateSymbol( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.updateSymbol" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Update Symbol..." ) ) .Tooltip( _( "Update symbol to include any changes from the library" ) ) .Icon( BITMAPS::refresh ) ); -TOOL_ACTION EE_ACTIONS::assignNetclass( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::assignNetclass( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.assignNetclass" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Assign Netclass..." ) ) .Tooltip( _( "Assign a netclass to nets matching a pattern" ) ) .Icon( BITMAPS::netlist ) ); -TOOL_ACTION EE_ACTIONS::toggleDeMorgan( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::toggleDeMorgan( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.toggleDeMorgan" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "De Morgan Conversion" ) ) .Tooltip( _( "Switch between De Morgan representations" ) ) .Icon( BITMAPS::morgan2 ) ); -TOOL_ACTION EE_ACTIONS::showDeMorganStandard( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::showDeMorganStandard( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.showDeMorganStandard" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "De Morgan Standard" ) ) @@ -855,7 +855,7 @@ TOOL_ACTION EE_ACTIONS::showDeMorganStandard( TOOL_ACTION_ARGS() .ToolbarState( TOOLBAR_STATE::TOGGLE ) .Icon( BITMAPS::morgan1 ) ); -TOOL_ACTION EE_ACTIONS::showDeMorganAlternate( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::showDeMorganAlternate( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.showDeMorganAlternate" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "De Morgan Alternate" ) ) @@ -863,7 +863,7 @@ TOOL_ACTION EE_ACTIONS::showDeMorganAlternate( TOOL_ACTION_ARGS() .ToolbarState( TOOLBAR_STATE::TOGGLE ) .Icon( BITMAPS::morgan2 ) ); -TOOL_ACTION EE_ACTIONS::toLabel( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::toLabel( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.toLabel" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Change to Label" ) ) @@ -872,7 +872,7 @@ TOOL_ACTION EE_ACTIONS::toLabel( TOOL_ACTION_ARGS() .Flags( AF_NONE ) .Parameter( SCH_LABEL_T ) ); -TOOL_ACTION EE_ACTIONS::toCLabel( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::toCLabel( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.toCLabel" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Change to Directive Label" ) ) @@ -881,7 +881,7 @@ TOOL_ACTION EE_ACTIONS::toCLabel( TOOL_ACTION_ARGS() .Flags( AF_NONE ) .Parameter( SCH_DIRECTIVE_LABEL_T ) ); -TOOL_ACTION EE_ACTIONS::toHLabel( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::toHLabel( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.toHLabel" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Change to Hierarchical Label" ) ) @@ -890,7 +890,7 @@ TOOL_ACTION EE_ACTIONS::toHLabel( TOOL_ACTION_ARGS() .Flags( AF_NONE ) .Parameter( SCH_HIER_LABEL_T ) ); -TOOL_ACTION EE_ACTIONS::toGLabel( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::toGLabel( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.toGLabel" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Change to Global Label" ) ) @@ -899,7 +899,7 @@ TOOL_ACTION EE_ACTIONS::toGLabel( TOOL_ACTION_ARGS() .Flags( AF_NONE ) .Parameter( SCH_GLOBAL_LABEL_T ) ); -TOOL_ACTION EE_ACTIONS::toText( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::toText( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.toText" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Change to Text" ) ) @@ -908,7 +908,7 @@ TOOL_ACTION EE_ACTIONS::toText( TOOL_ACTION_ARGS() .Flags( AF_NONE ) .Parameter( SCH_TEXT_T ) ); -TOOL_ACTION EE_ACTIONS::toTextBox( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::toTextBox( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.toTextBox" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Change to Text Box" ) ) @@ -917,40 +917,40 @@ TOOL_ACTION EE_ACTIONS::toTextBox( TOOL_ACTION_ARGS() .Flags( AF_NONE ) .Parameter( SCH_TEXTBOX_T ) ); -TOOL_ACTION EE_ACTIONS::cleanupSheetPins( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::cleanupSheetPins( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.cleanupSheetPins" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Cleanup Sheet Pins" ) ) .Tooltip( _( "Delete unreferenced sheet pins" ) ) ); -TOOL_ACTION EE_ACTIONS::editTextAndGraphics( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::editTextAndGraphics( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.editTextAndGraphics" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Edit Text & Graphics Properties..." ) ) .Tooltip( _( "Edit text and graphics properties globally across schematic" ) ) .Icon( BITMAPS::text ) ); -TOOL_ACTION EE_ACTIONS::symbolProperties( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::symbolProperties( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.symbolProperties" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Symbol Properties..." ) ) .Icon( BITMAPS::part_properties ) ); -TOOL_ACTION EE_ACTIONS::pinTable( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::pinTable( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.pinTable" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Pin Table..." ) ) .Tooltip( _( "Displays pin table for bulk editing of pins" ) ) .Icon( BITMAPS::pin_table ) ); -TOOL_ACTION EE_ACTIONS::breakWire( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::breakWire( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.breakWire" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Break" ) ) .Tooltip( _( "Divide into connected segments" ) ) .Icon( BITMAPS::break_line ) ); -TOOL_ACTION EE_ACTIONS::slice( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::slice( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveEdit.slice" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Slice" ) ) @@ -959,11 +959,11 @@ TOOL_ACTION EE_ACTIONS::slice( TOOL_ACTION_ARGS() // SCH_EDITOR_CONTROL // -TOOL_ACTION EE_ACTIONS::restartMove( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::restartMove( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.restartMove" ) .Scope( AS_GLOBAL ) ); -TOOL_ACTION EE_ACTIONS::highlightNet( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::highlightNet( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.highlightNet" ) .Scope( AS_GLOBAL ) .DefaultHotkey( '`' ) @@ -971,18 +971,18 @@ TOOL_ACTION EE_ACTIONS::highlightNet( TOOL_ACTION_ARGS() .Tooltip( _( "Highlight net under cursor" ) ) .Icon( BITMAPS::net_highlight_schematic ) ); -TOOL_ACTION EE_ACTIONS::clearHighlight( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::clearHighlight( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.clearHighlight" ) .Scope( AS_GLOBAL ) .DefaultHotkey( '~' ) .FriendlyName( _( "Clear Net Highlighting" ) ) .Tooltip( _( "Clear any existing net highlighting" ) ) ); -TOOL_ACTION EE_ACTIONS::updateNetHighlighting( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::updateNetHighlighting( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.updateNetHighlighting" ) .Scope( AS_GLOBAL ) ); -TOOL_ACTION EE_ACTIONS::highlightNetTool( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::highlightNetTool( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.highlightNetTool" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Highlight Nets" ) ) @@ -991,13 +991,13 @@ TOOL_ACTION EE_ACTIONS::highlightNetTool( TOOL_ACTION_ARGS() .Icon( BITMAPS::net_highlight_schematic ) .Flags( AF_ACTIVATE ) ); -TOOL_ACTION EE_ACTIONS::showNetNavigator( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::showNetNavigator( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.showNetNavigator" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Net Navigator" ) ) .Tooltip( _( "Show/hide the net navigator" ) ) ); -TOOL_ACTION EE_ACTIONS::editWithLibEdit( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::editWithLibEdit( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.editWithSymbolEditor" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_CTRL + 'E' ) @@ -1006,31 +1006,31 @@ TOOL_ACTION EE_ACTIONS::editWithLibEdit( TOOL_ACTION_ARGS() .Tooltip( _( "Open the selected symbol in the Symbol Editor" ) ) .Icon( BITMAPS::libedit ) ); -TOOL_ACTION EE_ACTIONS::setExcludeFromBOM( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::setExcludeFromBOM( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.setExcludeFromBOM" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Exclude from Bill of Materials" ) ) .Tooltip( _( "Set the exclude from bill of materials attribute" ) ) ); -TOOL_ACTION EE_ACTIONS::setExcludeFromSimulation( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::setExcludeFromSimulation( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.setExcludeFromSimulation" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Exclude from Simulation" ) ) .Tooltip( _( "Set the exclude from simulation attribute" ) ) ); -TOOL_ACTION EE_ACTIONS::setExcludeFromBoard( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::setExcludeFromBoard( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.setExcludeFromBoard" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Exclude from Board" ) ) .Tooltip( _( "Set the exclude from board attribute" ) ) ); -TOOL_ACTION EE_ACTIONS::setDNP( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::setDNP( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.setDNP" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Do not Populate" ) ) .Tooltip( _( "Set the do not populate attribute" ) ) ); -TOOL_ACTION EE_ACTIONS::editLibSymbolWithLibEdit( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::editLibSymbolWithLibEdit( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.editLibSymbolWithSymbolEditor" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_CTRL + MD_SHIFT + 'E' ) @@ -1038,42 +1038,42 @@ TOOL_ACTION EE_ACTIONS::editLibSymbolWithLibEdit( TOOL_ACTION_ARGS() .Tooltip( _( "Open the library symbol in the Symbol Editor" ) ) .Icon( BITMAPS::libedit ) ); -TOOL_ACTION EE_ACTIONS::editSymbolFields( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::editSymbolFields( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.editSymbolFields" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Edit Symbol Fields..." ) ) .Tooltip( _( "Bulk-edit fields of all symbols in schematic" ) ) .Icon( BITMAPS::spreadsheet ) ); -TOOL_ACTION EE_ACTIONS::editSymbolLibraryLinks( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::editSymbolLibraryLinks( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.editSymbolLibraryLinks" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Edit Symbol Library Links..." ) ) .Tooltip( _( "Edit links between schematic and library symbols" ) ) .Icon( BITMAPS::edit_cmp_symb_links ) ); -TOOL_ACTION EE_ACTIONS::assignFootprints( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::assignFootprints( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.assignFootprints" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Assign Footprints..." ) ) .Tooltip( _( "Run footprint assignment tool" ) ) .Icon( BITMAPS::icon_cvpcb_24 ) ); -TOOL_ACTION EE_ACTIONS::importFPAssignments( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::importFPAssignments( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.importFPAssignments" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Import Footprint Assignments..." ) ) .Tooltip( _( "Import symbol footprint assignments from .cmp file created by board editor" ) ) .Icon( BITMAPS::import_footprint_names ) ); -TOOL_ACTION EE_ACTIONS::annotate( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::annotate( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.annotate" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Annotate Schematic..." ) ) .Tooltip( _( "Fill in schematic symbol reference designators" ) ) .Icon( BITMAPS::annotate ) ); -TOOL_ACTION EE_ACTIONS::incrementAnnotations( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::incrementAnnotations( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.incrementAnnotations" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Increment Annotations From..." ) ) @@ -1081,55 +1081,55 @@ TOOL_ACTION EE_ACTIONS::incrementAnnotations( TOOL_ACTION_ARGS() .Icon( BITMAPS::annotate_increment ) ); -TOOL_ACTION EE_ACTIONS::schematicSetup( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::schematicSetup( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.schematicSetup" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Schematic Setup..." ) ) .Tooltip( _( "Edit schematic setup including annotation styles and electrical rules" ) ) .Icon( BITMAPS::options_schematic ) ); -TOOL_ACTION EE_ACTIONS::editPageNumber( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::editPageNumber( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.editPageNumber" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Edit Sheet Page Number..." ) ) .Tooltip( _( "Edit the page number of the current or selected sheet" ) ) ); -TOOL_ACTION EE_ACTIONS::rescueSymbols( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::rescueSymbols( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.rescueSymbols" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Rescue Symbols..." ) ) .Tooltip( _( "Find old symbols in project and rename/rescue them" ) ) .Icon( BITMAPS::rescue ) ); -TOOL_ACTION EE_ACTIONS::remapSymbols( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::remapSymbols( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.remapSymbols" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Remap Legacy Library Symbols..." ) ) .Tooltip( _( "Remap library symbol references in legacy schematics to the symbol library table" ) ) .Icon( BITMAPS::rescue ) ); -TOOL_ACTION EE_ACTIONS::nextNetItem( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::nextNetItem( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.nextNetItem" ) .Scope( AS_GLOBAL ) .DefaultHotkey( WXK_TAB ) .FriendlyName( _( "Next Net Item" ) ) .Tooltip( _( "Select next item on the current net" ) ) ); -TOOL_ACTION EE_ACTIONS::previousNetItem( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::previousNetItem( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.previousNetItem" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_SHIFT + static_cast( WXK_TAB ) ) .FriendlyName( _( "Previous Net Item" ) ) .Tooltip( _( "Select previous item on the current net" ) ) ); -TOOL_ACTION EE_ACTIONS::drawSheetOnClipboard( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::drawSheetOnClipboard( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.drawSheetOnClipboard" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Export Drawing to Clipboard" ) ) .Tooltip( _( "Export drawing of current sheet to clipboard" ) ) .Icon( BITMAPS::copy ) ); -TOOL_ACTION EE_ACTIONS::importGraphics( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::importGraphics( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.importGraphics" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_CTRL + MD_SHIFT + 'F' ) @@ -1139,28 +1139,28 @@ TOOL_ACTION EE_ACTIONS::importGraphics( TOOL_ACTION_ARGS() .Icon( BITMAPS::import_vector ) .Flags( AF_ACTIVATE ) ); -TOOL_ACTION EE_ACTIONS::showPcbNew( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::showPcbNew( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.showPcbNew" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Switch to PCB Editor" ) ) .Tooltip( _( "Open PCB in board editor" ) ) .Icon( BITMAPS::icon_pcbnew_24 ) ); -TOOL_ACTION EE_ACTIONS::exportNetlist( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::exportNetlist( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.exportNetlist" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Export Netlist..." ) ) .Tooltip( _( "Export file containing netlist in one of several formats" ) ) .Icon( BITMAPS::netlist ) ); -TOOL_ACTION EE_ACTIONS::generateBOM( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::generateBOM( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.generateBOM" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Generate Bill of Materials..." ) ) .Tooltip( _( "Generate a bill of materials for the current schematic" ) ) .Icon( BITMAPS::post_bom ) ); -TOOL_ACTION EE_ACTIONS::generateBOMLegacy( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::generateBOMLegacy( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.generateBOMLegacy" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Generate Legacy Bill of Materials..." ) ) @@ -1168,14 +1168,14 @@ TOOL_ACTION EE_ACTIONS::generateBOMLegacy( TOOL_ACTION_ARGS() .Icon( BITMAPS::file_bom ) ); -TOOL_ACTION EE_ACTIONS::generateBOMExternal( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::generateBOMExternal( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.generateBOMExternal" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Generate Bill of Materials (External)..." ) ) .Tooltip( _( "Generate a bill of materials for the current schematic using external generator" ) ) ); -TOOL_ACTION EE_ACTIONS::exportSymbolsToLibrary( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::exportSymbolsToLibrary( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.exportSymbolsToLibrary" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Export Symbols to Library..." ) ) @@ -1183,7 +1183,7 @@ TOOL_ACTION EE_ACTIONS::exportSymbolsToLibrary( TOOL_ACTION_ARGS() "(does not remove other symbols from this library)" ) ) .Icon( BITMAPS::library_archive ) ); -TOOL_ACTION EE_ACTIONS::exportSymbolsToNewLibrary( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::exportSymbolsToNewLibrary( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.exportSymbolsToNewLibrary" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Export Symbols to New Library..." ) ) @@ -1191,82 +1191,82 @@ TOOL_ACTION EE_ACTIONS::exportSymbolsToNewLibrary( TOOL_ACTION_ARGS() "(if the library already exists it will be replaced)" ) ) .Icon( BITMAPS::library_archive_as ) ); -TOOL_ACTION EE_ACTIONS::selectOnPCB( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::selectOnPCB( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.selectOnPCB" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Select on PCB" ) ) .Tooltip( _( "Select corresponding items in PCB editor" ) ) .Icon( BITMAPS::select_same_sheet ) ); -TOOL_ACTION EE_ACTIONS::toggleHiddenPins( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::toggleHiddenPins( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.showHiddenPins" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Show Hidden Pins" ) ) .ToolbarState( TOOLBAR_STATE::TOGGLE ) .Icon( BITMAPS::hidden_pin ) ); -TOOL_ACTION EE_ACTIONS::toggleHiddenFields( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::toggleHiddenFields( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.showHiddenFields" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Show Hidden Fields" ) ) .ToolbarState( TOOLBAR_STATE::TOGGLE ) ); -TOOL_ACTION EE_ACTIONS::toggleDirectiveLabels( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::toggleDirectiveLabels( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.showDirectiveLabels" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Show Directive Labels" ) ) .ToolbarState( TOOLBAR_STATE::TOGGLE ) ); -TOOL_ACTION EE_ACTIONS::toggleERCWarnings( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::toggleERCWarnings( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.showERCWarnings" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Show ERC Warnings" ) ) .Tooltip( _( "Show markers for electrical rules checker warnings" ) ) .ToolbarState( TOOLBAR_STATE::TOGGLE ) ); -TOOL_ACTION EE_ACTIONS::toggleERCErrors( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::toggleERCErrors( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.showERCErrors" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Show ERC Errors" ) ) .Tooltip( _( "Show markers for electrical rules checker errors" ) ) .ToolbarState( TOOLBAR_STATE::TOGGLE ) ); -TOOL_ACTION EE_ACTIONS::toggleERCExclusions( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::toggleERCExclusions( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.showERCExclusions" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Show ERC Exclusions" ) ) .Tooltip( _( "Show markers for excluded electrical rules checker violations" ) ) .ToolbarState( TOOLBAR_STATE::TOGGLE ) ); -TOOL_ACTION EE_ACTIONS::markSimExclusions( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::markSimExclusions( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.markSimExclusions" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Mark items excluded from simulation" ) ) .Tooltip( _( "Draw 'X's over items which have been excluded from simulation" ) ) .ToolbarState( TOOLBAR_STATE::TOGGLE ) ); -TOOL_ACTION EE_ACTIONS::toggleOPVoltages( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::toggleOPVoltages( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.showOperatingPointVoltages" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Show OP Voltages" ) ) .Tooltip( _( "Show operating point voltage data from simulation" ) ) .ToolbarState( TOOLBAR_STATE::TOGGLE )); -TOOL_ACTION EE_ACTIONS::toggleOPCurrents( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::toggleOPCurrents( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.showOperatingPointCurrents" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Show OP Currents" ) ) .Tooltip( _( "Show operating point current data from simulation" ) ) .ToolbarState( TOOLBAR_STATE::TOGGLE ) ); -TOOL_ACTION EE_ACTIONS::togglePinAltIcons( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::togglePinAltIcons( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.togglePinAltIcons" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Show Pin Alternate Icons" ) ) .Tooltip( _( "Show indicator icons for pins with alternate modes" ) ) .ToolbarState( TOOLBAR_STATE::TOGGLE ) ); -TOOL_ACTION EE_ACTIONS::lineModeFree( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::lineModeFree( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.lineModeFree" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Line Mode for Wires and Buses" ) ) @@ -1276,7 +1276,7 @@ TOOL_ACTION EE_ACTIONS::lineModeFree( TOOL_ACTION_ARGS() .Flags( AF_NONE ) .Parameter( LINE_MODE::LINE_MODE_FREE ) ); -TOOL_ACTION EE_ACTIONS::lineMode90( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::lineMode90( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.lineModeOrthonal" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Line Mode for Wires and Buses" ) ) @@ -1286,7 +1286,7 @@ TOOL_ACTION EE_ACTIONS::lineMode90( TOOL_ACTION_ARGS() .Flags( AF_NONE ) .Parameter( LINE_MODE::LINE_MODE_90) ); -TOOL_ACTION EE_ACTIONS::lineMode45( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::lineMode45( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.lineMode45" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Line Mode for Wires and Buses" ) ) @@ -1296,14 +1296,14 @@ TOOL_ACTION EE_ACTIONS::lineMode45( TOOL_ACTION_ARGS() .Flags( AF_NONE ) .Parameter( LINE_MODE::LINE_MODE_45 ) ); -TOOL_ACTION EE_ACTIONS::lineModeNext( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::lineModeNext( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.lineModeNext" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_SHIFT + static_cast( WXK_SPACE ) ) .FriendlyName( _( "Line Mode for Wires and Buses" ) ) .Tooltip( _( "Switch to next line mode" ) ) ); -TOOL_ACTION EE_ACTIONS::toggleAnnotateAuto( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::toggleAnnotateAuto( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.annotateAutomatically" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Annotate Automatically" ) ) @@ -1311,21 +1311,21 @@ TOOL_ACTION EE_ACTIONS::toggleAnnotateAuto( TOOL_ACTION_ARGS() .ToolbarState( TOOLBAR_STATE::TOGGLE ) .Icon( BITMAPS::annotate ) ); -TOOL_ACTION EE_ACTIONS::repairSchematic( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::repairSchematic( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.repairSchematic" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Repair Schematic" ) ) .Tooltip( _( "Run various diagnostics and attempt to repair schematic" ) ) .Icon( BITMAPS::rescue ) ); -TOOL_ACTION EE_ACTIONS::previousUnit( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::previousUnit( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.previousUnit" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Previous Symbol Unit" ) ) .Tooltip( _( "Open the previous unit of the symbol" ) ) .Parameter( -1 ) ); -TOOL_ACTION EE_ACTIONS::nextUnit( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::nextUnit( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.nextUnit" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Next Symbol Unit" ) ) @@ -1334,21 +1334,21 @@ TOOL_ACTION EE_ACTIONS::nextUnit( TOOL_ACTION_ARGS() // SCH_NAVIGATE_TOOL // -TOOL_ACTION EE_ACTIONS::changeSheet( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::changeSheet( TOOL_ACTION_ARGS() .Name( "eeschema.NavigateTool.changeSheet" ) .Scope( AS_CONTEXT ) .FriendlyName( _( "Change Sheet" ) ) .Tooltip( _( "Change to provided sheet's contents in the schematic editor" ) ) .Icon( BITMAPS::enter_sheet ) ); -TOOL_ACTION EE_ACTIONS::enterSheet( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::enterSheet( TOOL_ACTION_ARGS() .Name( "eeschema.NavigateTool.enterSheet" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Enter Sheet" ) ) .Tooltip( _( "Display the selected sheet's contents in the schematic editor" ) ) .Icon( BITMAPS::enter_sheet ) ); -TOOL_ACTION EE_ACTIONS::leaveSheet( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::leaveSheet( TOOL_ACTION_ARGS() .Name( "eeschema.NavigateTool.leaveSheet" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_ALT + static_cast( WXK_BACK ) ) @@ -1357,7 +1357,7 @@ TOOL_ACTION EE_ACTIONS::leaveSheet( TOOL_ACTION_ARGS() .Tooltip( _( "Display the parent sheet in the schematic editor" ) ) .Icon( BITMAPS::leave_sheet ) ); -TOOL_ACTION EE_ACTIONS::navigateUp( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::navigateUp( TOOL_ACTION_ARGS() .Name( "eeschema.NavigateTool.up" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_ALT + static_cast( WXK_UP ) ) @@ -1365,7 +1365,7 @@ TOOL_ACTION EE_ACTIONS::navigateUp( TOOL_ACTION_ARGS() .Tooltip( _( "Navigate up one sheet in the hierarchy" ) ) .Icon( BITMAPS::up ) ); -TOOL_ACTION EE_ACTIONS::navigateBack( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::navigateBack( TOOL_ACTION_ARGS() .Name( "eeschema.NavigateTool.back" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_ALT + static_cast( WXK_LEFT ) ) @@ -1373,7 +1373,7 @@ TOOL_ACTION EE_ACTIONS::navigateBack( TOOL_ACTION_ARGS() .Tooltip( _( "Move backward in sheet navigation history" ) ) .Icon( BITMAPS::left ) ); -TOOL_ACTION EE_ACTIONS::navigateForward( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::navigateForward( TOOL_ACTION_ARGS() .Name( "eeschema.NavigateTool.forward" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_ALT + static_cast( WXK_RIGHT ) ) @@ -1381,7 +1381,7 @@ TOOL_ACTION EE_ACTIONS::navigateForward( TOOL_ACTION_ARGS() .Tooltip( _( "Move forward in sheet navigation history" ) ) .Icon( BITMAPS::right ) ); -TOOL_ACTION EE_ACTIONS::navigatePrevious( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::navigatePrevious( TOOL_ACTION_ARGS() .Name( "eeschema.NavigateTool.previous" ) .Scope( AS_GLOBAL ) .DefaultHotkey( WXK_PAGEUP ) @@ -1389,7 +1389,7 @@ TOOL_ACTION EE_ACTIONS::navigatePrevious( TOOL_ACTION_ARGS() .Tooltip( _( "Move to previous sheet by number" ) ) .Icon( BITMAPS::left ) ); -TOOL_ACTION EE_ACTIONS::navigateNext( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::navigateNext( TOOL_ACTION_ARGS() .Name( "eeschema.NavigateTool.next" ) .Scope( AS_GLOBAL ) .DefaultHotkey( WXK_PAGEDOWN ) @@ -1397,7 +1397,7 @@ TOOL_ACTION EE_ACTIONS::navigateNext( TOOL_ACTION_ARGS() .Tooltip( _( "Move to next sheet by number" ) ) .Icon( BITMAPS::right ) ); -TOOL_ACTION EE_ACTIONS::showHierarchy( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::showHierarchy( TOOL_ACTION_ARGS() .Name( "eeschema.EditorTool.showHierarchy" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_CTRL + 'H' ) @@ -1410,7 +1410,7 @@ TOOL_ACTION EE_ACTIONS::showHierarchy( TOOL_ACTION_ARGS() // SCH_LINE_WIRE_BUS_TOOL // const DRAW_SEGMENT_EVENT_PARAMS drawWireActionParam = { LAYER_WIRE, false, nullptr }; -TOOL_ACTION EE_ACTIONS::drawWire( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::drawWire( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawingLineWireBus.drawWires" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'W' ) @@ -1422,7 +1422,7 @@ TOOL_ACTION EE_ACTIONS::drawWire( TOOL_ACTION_ARGS() .Parameter( &drawWireActionParam ) ); const DRAW_SEGMENT_EVENT_PARAMS drawBusActionParam = { LAYER_BUS, false, nullptr }; -TOOL_ACTION EE_ACTIONS::drawBus( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::drawBus( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawingLineWireBus.drawBuses" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'B' ) @@ -1433,7 +1433,7 @@ TOOL_ACTION EE_ACTIONS::drawBus( TOOL_ACTION_ARGS() .Flags( AF_ACTIVATE ) .Parameter( &drawBusActionParam ) ); -TOOL_ACTION EE_ACTIONS::unfoldBus( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::unfoldBus( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawingLineWireBus.unfoldBus" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'C' ) @@ -1445,7 +1445,7 @@ TOOL_ACTION EE_ACTIONS::unfoldBus( TOOL_ACTION_ARGS() .Parameter( nullptr ) ); const DRAW_SEGMENT_EVENT_PARAMS drawLinesActionParam = { LAYER_NOTES, false, nullptr }; -TOOL_ACTION EE_ACTIONS::drawLines( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::drawLines( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawingLineWireBus.drawLines" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'I' ) @@ -1456,7 +1456,7 @@ TOOL_ACTION EE_ACTIONS::drawLines( TOOL_ACTION_ARGS() .Flags( AF_ACTIVATE ) .Parameter( &drawLinesActionParam ) ); -TOOL_ACTION EE_ACTIONS::undoLastSegment( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::undoLastSegment( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawingLineWireBus.undoLastSegment") .Scope( AS_GLOBAL ) .DefaultHotkey( WXK_BACK ) @@ -1464,7 +1464,7 @@ TOOL_ACTION EE_ACTIONS::undoLastSegment( TOOL_ACTION_ARGS() .Tooltip( _( "Walks the current line back one segment." ) ) .Icon( BITMAPS::undo ) ); -TOOL_ACTION EE_ACTIONS::switchSegmentPosture( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::switchSegmentPosture( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawingLineWireBus.switchPosture" ) .Scope( AS_GLOBAL ) .DefaultHotkey( '/' ) @@ -1475,7 +1475,7 @@ TOOL_ACTION EE_ACTIONS::switchSegmentPosture( TOOL_ACTION_ARGS() // SCH_MOVE_TOOL // -TOOL_ACTION EE_ACTIONS::move( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::move( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveMove.move" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'M' ) @@ -1484,7 +1484,7 @@ TOOL_ACTION EE_ACTIONS::move( TOOL_ACTION_ARGS() .Icon( BITMAPS::move ) .Flags( AF_ACTIVATE ) ); -TOOL_ACTION EE_ACTIONS::drag( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::drag( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveMove.drag" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'G' ) @@ -1494,7 +1494,7 @@ TOOL_ACTION EE_ACTIONS::drag( TOOL_ACTION_ARGS() .Icon( BITMAPS::drag ) .Flags( AF_ACTIVATE ) ); -TOOL_ACTION EE_ACTIONS::alignToGrid( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::alignToGrid( TOOL_ACTION_ARGS() .Name( "eeschema.AlignToGrid" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Align Items to Grid" ) ) @@ -1502,7 +1502,7 @@ TOOL_ACTION EE_ACTIONS::alignToGrid( TOOL_ACTION_ARGS() .Flags( AF_ACTIVATE ) ); // Schematic editor save copy curr sheet command -TOOL_ACTION EE_ACTIONS::saveCurrSheetCopyAs( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::saveCurrSheetCopyAs( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.saveCurrSheetCopyAs" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Save Current Sheet Copy As..." ) ) @@ -1510,12 +1510,12 @@ TOOL_ACTION EE_ACTIONS::saveCurrSheetCopyAs( TOOL_ACTION_ARGS() .Icon( BITMAPS::save_as ) ); // Drag and drop -TOOL_ACTION EE_ACTIONS::ddAppendFile( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::ddAppendFile( TOOL_ACTION_ARGS() .Name( "eeschema.EditorControl.ddAppendFile" ) .Scope( AS_GLOBAL ) ); // SIMULATOR -TOOL_ACTION EE_ACTIONS::newAnalysisTab( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::newAnalysisTab( TOOL_ACTION_ARGS() .Name( "eeschema.Simulation.newAnalysisTab" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_CTRL + 'N' ) @@ -1524,7 +1524,7 @@ TOOL_ACTION EE_ACTIONS::newAnalysisTab( TOOL_ACTION_ARGS() .Tooltip( _( "Create a new tab containing a simulation analysis" ) ) .Icon( BITMAPS::sim_add_plot ) ); -TOOL_ACTION EE_ACTIONS::openWorkbook( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::openWorkbook( TOOL_ACTION_ARGS() .Name( "eeschema.Simulation.openWorkbook" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_CTRL + 'O' ) @@ -1533,7 +1533,7 @@ TOOL_ACTION EE_ACTIONS::openWorkbook( TOOL_ACTION_ARGS() .Tooltip( _( "Open a saved set of analysis tabs and settings" ) ) .Icon( BITMAPS::directory_open ) ); -TOOL_ACTION EE_ACTIONS::saveWorkbook( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::saveWorkbook( TOOL_ACTION_ARGS() .Name( "eeschema.Simulation.saveWorkbook" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_CTRL + 'S' ) @@ -1542,7 +1542,7 @@ TOOL_ACTION EE_ACTIONS::saveWorkbook( TOOL_ACTION_ARGS() .Tooltip( _( "Save the current set of analysis tabs and settings" ) ) .Icon( BITMAPS::save ) ); -TOOL_ACTION EE_ACTIONS::saveWorkbookAs( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::saveWorkbookAs( TOOL_ACTION_ARGS() .Name( "eeschema.Simulation.saveWorkbookAs" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_CTRL + MD_SHIFT + 'S' ) @@ -1551,69 +1551,69 @@ TOOL_ACTION EE_ACTIONS::saveWorkbookAs( TOOL_ACTION_ARGS() .Tooltip( _( "Save the current set of analysis tabs and settings to another location" ) ) .Icon( BITMAPS::sim_add_signal ) ); -TOOL_ACTION EE_ACTIONS::exportPlotAsPNG( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::exportPlotAsPNG( TOOL_ACTION_ARGS() .Name( "eeschema.Simulator.exportPNG" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Export Current Plot as PNG..." ) ) .Icon( BITMAPS::export_png ) ); -TOOL_ACTION EE_ACTIONS::exportPlotAsCSV( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::exportPlotAsCSV( TOOL_ACTION_ARGS() .Name( "eeschema.Simulator.exportCSV" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Export Current Plot as CSV..." ) ) .Icon( BITMAPS::export_file ) ); -TOOL_ACTION EE_ACTIONS::exportPlotToClipboard( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::exportPlotToClipboard( TOOL_ACTION_ARGS() .Name( "eeschema.Simulator.exportToClipboard" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Export Current Plot to Clipboard" ) ) .Icon( BITMAPS::export_png ) ); -TOOL_ACTION EE_ACTIONS::exportPlotToSchematic( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::exportPlotToSchematic( TOOL_ACTION_ARGS() .Name( "eeschema.Simulator.exportPlotToSchematic" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Export Current Plot to Schematic" ) ) .Icon( BITMAPS::export_png ) ); -TOOL_ACTION EE_ACTIONS::toggleLegend( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::toggleLegend( TOOL_ACTION_ARGS() .Name( "eeschema.Simulator.toggleLegend" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Show Legend" ) ) .Icon( BITMAPS::text ) ); -TOOL_ACTION EE_ACTIONS::toggleDottedSecondary( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::toggleDottedSecondary( TOOL_ACTION_ARGS() .Name( "eeschema.Simulator.toggleDottedSecondary" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Dotted Current/Phase" ) ) .Tooltip( _( "Draw secondary signal trace (current or phase) with a dotted line" ) ) ); -TOOL_ACTION EE_ACTIONS::toggleDarkModePlots( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::toggleDarkModePlots( TOOL_ACTION_ARGS() .Name( "eeschema.Simulator.toggleDarkModePlots" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Dark Mode Plots" ) ) .Tooltip( _( "Draw plots with a black background" ) ) ); -TOOL_ACTION EE_ACTIONS::simAnalysisProperties( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::simAnalysisProperties( TOOL_ACTION_ARGS() .Name( "eeschema.Simulation.simAnalysisProperties" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Edit Analysis Tab..." ) ) .Tooltip( _( "Edit the current analysis tab's SPICE command and plot setup" ) ) .Icon( BITMAPS::sim_command ) ); -TOOL_ACTION EE_ACTIONS::runSimulation( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::runSimulation( TOOL_ACTION_ARGS() .Name( "eeschema.Simulation.runSimulation" ) .Scope( AS_GLOBAL ) .DefaultHotkey( 'R' ) .FriendlyName( _( "Run Simulation" ) ) .Icon( BITMAPS::sim_run ) ); -TOOL_ACTION EE_ACTIONS::stopSimulation( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::stopSimulation( TOOL_ACTION_ARGS() .Name( "eeschema.Simulation.stopSimulation" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Stop Simulation" ) ) .Icon( BITMAPS::sim_stop ) ); -TOOL_ACTION EE_ACTIONS::simProbe( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::simProbe( TOOL_ACTION_ARGS() .Name( "eeschema.Simulation.probe" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_SHIFT + 'P' ) @@ -1621,7 +1621,7 @@ TOOL_ACTION EE_ACTIONS::simProbe( TOOL_ACTION_ARGS() .Tooltip( _( "Add a simulator probe" ) ) .Icon( BITMAPS::sim_probe ) ); -TOOL_ACTION EE_ACTIONS::simTune( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::simTune( TOOL_ACTION_ARGS() .Name( "eeschema.Simulation.tune" ) .Scope( AS_GLOBAL ) .DefaultHotkey( MD_SHIFT + 'T' ) @@ -1629,14 +1629,14 @@ TOOL_ACTION EE_ACTIONS::simTune( TOOL_ACTION_ARGS() .Tooltip( _( "Select a value to be tuned" ) ) .Icon( BITMAPS::sim_tune ) ); -TOOL_ACTION EE_ACTIONS::editUserDefinedSignals( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::editUserDefinedSignals( TOOL_ACTION_ARGS() .Name( "eeschema.Simulation.editUserDefinedSignals" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "User-defined Signals..." ) ) .Tooltip( _( "Add, edit or delete user-defined simulation signals" ) ) .Icon( BITMAPS::sim_add_signal ) ); -TOOL_ACTION EE_ACTIONS::showNetlist( TOOL_ACTION_ARGS() +TOOL_ACTION SCH_ACTIONS::showNetlist( TOOL_ACTION_ARGS() .Name( "eeschema.Simulation.showNetlist" ) .Scope( AS_GLOBAL ) .FriendlyName( _( "Show SPICE Netlist" ) ) diff --git a/eeschema/tools/ee_actions.h b/eeschema/tools/sch_actions.h similarity index 99% rename from eeschema/tools/ee_actions.h rename to eeschema/tools/sch_actions.h index 991f018163..78e149820d 100644 --- a/eeschema/tools/ee_actions.h +++ b/eeschema/tools/sch_actions.h @@ -35,7 +35,7 @@ class TOOL_MANAGER; * Gather all the actions that are shared by tools. The instance of SCH_ACTIONS is created * inside of ACTION_MANAGER object that registers the actions. */ -class EE_ACTIONS : public ACTIONS +class SCH_ACTIONS : public ACTIONS { public: // Menu bar save curr sheet as command diff --git a/eeschema/tools/sch_design_block_control.cpp b/eeschema/tools/sch_design_block_control.cpp index a94b76667f..77e044ffb1 100644 --- a/eeschema/tools/sch_design_block_control.cpp +++ b/eeschema/tools/sch_design_block_control.cpp @@ -25,13 +25,13 @@ #include #include #include -#include +#include bool SCH_DESIGN_BLOCK_CONTROL::Init() { m_editFrame = getEditFrame(); m_frame = m_editFrame; - m_selectionTool = m_toolMgr->GetTool(); + m_selectionTool = m_toolMgr->GetTool(); auto pinnedLib = [this]( const SELECTION& aSel ) @@ -67,21 +67,21 @@ bool SCH_DESIGN_BLOCK_CONTROL::Init() CONDITIONAL_MENU& ctxMenu = m_menu->GetMenu(); - ctxMenu.AddItem( ACTIONS::pinLibrary, unpinnedLib, 1 ); - ctxMenu.AddItem( ACTIONS::unpinLibrary, pinnedLib, 1 ); - ctxMenu.AddItem( ACTIONS::newLibrary, !isDesignBlock, 1 ); + ctxMenu.AddItem( ACTIONS::pinLibrary, unpinnedLib, 1 ); + ctxMenu.AddItem( ACTIONS::unpinLibrary, pinnedLib, 1 ); + ctxMenu.AddItem( ACTIONS::newLibrary, !isDesignBlock, 1 ); ctxMenu.AddSeparator( 1 ); - ctxMenu.AddItem( EE_ACTIONS::placeDesignBlock, isDesignBlock, 50 ); + ctxMenu.AddItem( SCH_ACTIONS::placeDesignBlock, isDesignBlock, 50 ); ctxMenu.AddSeparator( 50 ); - ctxMenu.AddItem( EE_ACTIONS::editDesignBlockProperties, isDesignBlock, 100 ); - ctxMenu.AddItem( EE_ACTIONS::saveSheetAsDesignBlock, isInLibrary, 100 ); - ctxMenu.AddItem( EE_ACTIONS::saveSelectionAsDesignBlock, isInLibrary, 100 ); - ctxMenu.AddItem( EE_ACTIONS::deleteDesignBlock, isDesignBlock, 100 ); + ctxMenu.AddItem( SCH_ACTIONS::editDesignBlockProperties, isDesignBlock, 100 ); + ctxMenu.AddItem( SCH_ACTIONS::saveSheetAsDesignBlock, isInLibrary, 100 ); + ctxMenu.AddItem( SCH_ACTIONS::saveSelectionAsDesignBlock, isInLibrary, 100 ); + ctxMenu.AddItem( SCH_ACTIONS::deleteDesignBlock, isDesignBlock, 100 ); ctxMenu.AddSeparator( 100 ); - ctxMenu.AddItem( ACTIONS::hideLibraryTree, SELECTION_CONDITIONS::ShowAlways, 400 ); + ctxMenu.AddItem( ACTIONS::hideLibraryTree, SELECTION_CONDITIONS::ShowAlways, 400 ); return true; } @@ -194,10 +194,10 @@ void SCH_DESIGN_BLOCK_CONTROL::setTransitions() Go( &SCH_DESIGN_BLOCK_CONTROL::NewLibrary, ACTIONS::newLibrary.MakeEvent() ); - Go( &SCH_DESIGN_BLOCK_CONTROL::SaveSheetAsDesignBlock, EE_ACTIONS::saveSheetAsDesignBlock.MakeEvent() ); - Go( &SCH_DESIGN_BLOCK_CONTROL::SaveSelectionAsDesignBlock, EE_ACTIONS::saveSelectionAsDesignBlock.MakeEvent() ); - Go( &SCH_DESIGN_BLOCK_CONTROL::DeleteDesignBlock, EE_ACTIONS::deleteDesignBlock.MakeEvent() ); - Go( &SCH_DESIGN_BLOCK_CONTROL::EditDesignBlockProperties, EE_ACTIONS::editDesignBlockProperties.MakeEvent() ); + Go( &SCH_DESIGN_BLOCK_CONTROL::SaveSheetAsDesignBlock, SCH_ACTIONS::saveSheetAsDesignBlock.MakeEvent() ); + Go( &SCH_DESIGN_BLOCK_CONTROL::SaveSelectionAsDesignBlock, SCH_ACTIONS::saveSelectionAsDesignBlock.MakeEvent() ); + Go( &SCH_DESIGN_BLOCK_CONTROL::DeleteDesignBlock, SCH_ACTIONS::deleteDesignBlock.MakeEvent() ); + Go( &SCH_DESIGN_BLOCK_CONTROL::EditDesignBlockProperties, SCH_ACTIONS::editDesignBlockProperties.MakeEvent() ); Go( &SCH_DESIGN_BLOCK_CONTROL::HideLibraryTree, ACTIONS::hideLibraryTree.MakeEvent() ); } diff --git a/eeschema/tools/sch_design_block_control.h b/eeschema/tools/sch_design_block_control.h index 65023965a9..cb71680a70 100644 --- a/eeschema/tools/sch_design_block_control.h +++ b/eeschema/tools/sch_design_block_control.h @@ -26,15 +26,17 @@ #define SCH_DESIGN_BLOCK_CONTROL_H #include -#include +#include /** * Handle schematic design block actions in the schematic editor. */ -class SCH_DESIGN_BLOCK_CONTROL : public wxEvtHandler, public EE_TOOL_BASE +class SCH_DESIGN_BLOCK_CONTROL : public wxEvtHandler, public SCH_TOOL_BASE { public: - SCH_DESIGN_BLOCK_CONTROL() : EE_TOOL_BASE( "eeschema.SchDesignBlockControl" ) {} + SCH_DESIGN_BLOCK_CONTROL() : + SCH_TOOL_BASE( "eeschema.SchDesignBlockControl" ) + {} /// @copydoc TOOL_INTERACTIVE::Init() bool Init() override; diff --git a/eeschema/tools/sch_drawing_tools.cpp b/eeschema/tools/sch_drawing_tools.cpp index 634db8a5eb..a96e2d34cb 100644 --- a/eeschema/tools/sch_drawing_tools.cpp +++ b/eeschema/tools/sch_drawing_tools.cpp @@ -30,13 +30,13 @@ #include #include #include -#include +#include #include #include #include #include -#include -#include +#include +#include #include #include #include @@ -77,7 +77,7 @@ #include SCH_DRAWING_TOOLS::SCH_DRAWING_TOOLS() : - EE_TOOL_BASE( "eeschema.InteractiveDrawing" ), + SCH_TOOL_BASE( "eeschema.InteractiveDrawing" ), m_lastSheetPinType( LABEL_FLAG_SHAPE::L_INPUT ), m_lastGlobalLabelShape( LABEL_FLAG_SHAPE::L_INPUT ), m_lastNetClassFlagShape( LABEL_FLAG_SHAPE::F_ROUND ), @@ -106,7 +106,7 @@ SCH_DRAWING_TOOLS::SCH_DRAWING_TOOLS() : bool SCH_DRAWING_TOOLS::Init() { - EE_TOOL_BASE::Init(); + SCH_TOOL_BASE::Init(); auto belowRootSheetCondition = [&]( const SELECTION& aSel ) @@ -121,9 +121,9 @@ bool SCH_DRAWING_TOOLS::Init() }; CONDITIONAL_MENU& ctxMenu = m_menu->GetMenu(); - ctxMenu.AddItem( EE_ACTIONS::leaveSheet, belowRootSheetCondition, 150 ); - ctxMenu.AddItem( EE_ACTIONS::closeOutline, inDrawingRuleArea, 200 ); - ctxMenu.AddItem( EE_ACTIONS::deleteLastPoint, inDrawingRuleArea, 200 ); + ctxMenu.AddItem( SCH_ACTIONS::leaveSheet, belowRootSheetCondition, 150 ); + ctxMenu.AddItem( SCH_ACTIONS::closeOutline, inDrawingRuleArea, 200 ); + ctxMenu.AddItem( SCH_ACTIONS::deleteLastPoint, inDrawingRuleArea, 200 ); return true; } @@ -131,8 +131,8 @@ bool SCH_DRAWING_TOOLS::Init() int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent ) { - const EE_ACTIONS::PLACE_SYMBOL_PARAMS& toolParams = - aEvent.Parameter(); + const SCH_ACTIONS::PLACE_SYMBOL_PARAMS& toolParams = + aEvent.Parameter(); SCH_SYMBOL* symbol = toolParams.m_Symbol; // If we get an parameterised symbol, we probably just want to place @@ -168,11 +168,11 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent ) hierarchy.GetSymbols( existingRefs ); existingRefs.SortByReferenceOnly(); - if( aEvent.IsAction( &EE_ACTIONS::placeSymbol ) ) + if( aEvent.IsAction( &SCH_ACTIONS::placeSymbol ) ) { historyList = &m_symbolHistoryList; } - else if (aEvent.IsAction( &EE_ACTIONS::placePower ) ) + else if (aEvent.IsAction( &SCH_ACTIONS::placePower ) ) { historyList = &m_powerHistoryList; filter.FilterPowerSymbols( true ); @@ -187,7 +187,7 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent ) auto addSymbol = [this]( SCH_SYMBOL* aSymbol ) { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); 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( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); 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( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); SYMBOL_LIB_TABLE* libs = PROJECT_SCH::SchSymbolLibTable( &m_frame->Prj() ); SYMBOL_LIB* cache = PROJECT_SCH::SchLibs( &m_frame->Prj() )->GetCacheLibrary(); @@ -542,7 +542,7 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent ) } } else if( evt->IsAction( &ACTIONS::duplicate ) - || evt->IsAction( &EE_ACTIONS::repeatDrawItem ) ) + || evt->IsAction( &SCH_ACTIONS::repeatDrawItem ) ) { if( symbol ) { @@ -597,7 +597,7 @@ int SCH_DRAWING_TOOLS::PlaceNextSymbolUnit( const TOOL_EVENT& aEvent ) if( !symbol ) { static const std::vector symbolTypes = { SCH_SYMBOL_T }; - EE_SELECTION& selection = m_selectionTool->RequestSelection( symbolTypes ); + SCH_SELECTION& selection = m_selectionTool->RequestSelection( symbolTypes ); if( selection.Size() != 1 ) { @@ -637,15 +637,15 @@ int SCH_DRAWING_TOOLS::PlaceNextSymbolUnit( const TOOL_EVENT& aEvent ) newSymbol->SetRefProp( symbol->GetRef( &sheetPath, false ) ); // Post the new symbol - don't reannotate it - we set the reference ourselves - m_toolMgr->PostAction( EE_ACTIONS::placeSymbol, - EE_ACTIONS::PLACE_SYMBOL_PARAMS{ newSymbol.release(), false } ); + m_toolMgr->PostAction( SCH_ACTIONS::placeSymbol, + SCH_ACTIONS::PLACE_SYMBOL_PARAMS{ newSymbol.release(), false } ); return 0; } int SCH_DRAWING_TOOLS::ImportSheet( const TOOL_EVENT& aEvent ) { - bool placingDesignBlock = aEvent.IsAction( &EE_ACTIONS::placeDesignBlock ); + bool placingDesignBlock = aEvent.IsAction( &SCH_ACTIONS::placeDesignBlock ); DESIGN_BLOCK* designBlock = nullptr; wxString sheetFileName = wxEmptyString; @@ -697,10 +697,11 @@ int SCH_DRAWING_TOOLS::ImportSheet( const TOOL_EVENT& aEvent ) auto placeSheetContents = [&]() { - SCH_COMMIT commit( m_toolMgr ); - EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); - EDA_ITEMS newItems; - bool keepAnnotations = cfg->m_DesignBlockChooserPanel.keep_annotations; + SCH_COMMIT commit( m_toolMgr ); + SCH_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + + EDA_ITEMS newItems; + bool keepAnnotations = cfg->m_DesignBlockChooserPanel.keep_annotations; selectionTool->ClearSelection(); @@ -775,7 +776,7 @@ int SCH_DRAWING_TOOLS::ImportSheet( const TOOL_EVENT& aEvent ) } // Start moving selection, cancel undoes the insertion - bool placed = m_toolMgr->RunSynchronousAction( EE_ACTIONS::move, &commit ); + bool placed = m_toolMgr->RunSynchronousAction( SCH_ACTIONS::move, &commit ); // Update our cursor position to the new location in case we're placing repeated copies cursorPos = grid.Align( controls->GetMousePosition(), GRID_HELPER_GRIDS::GRID_CONNECTABLE ); @@ -839,7 +840,7 @@ int SCH_DRAWING_TOOLS::ImportSheet( const TOOL_EVENT& aEvent ) while( placeSheetContents() && cfg->m_DesignBlockChooserPanel.repeated_placement ) ; - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); m_view->ClearPreview(); delete designBlock; designBlock = nullptr; @@ -886,11 +887,13 @@ int SCH_DRAWING_TOOLS::ImportSheet( const TOOL_EVENT& aEvent ) else if( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT ) || isSyntheticClick ) { if( placingDesignBlock ) - m_toolMgr->PostAction( EE_ACTIONS::drawSheetFromDesignBlock, designBlock ); + { + m_toolMgr->PostAction( SCH_ACTIONS::drawSheetFromDesignBlock, designBlock ); + } else { // drawSheet must delete - m_toolMgr->PostAction( EE_ACTIONS::drawSheetFromFile, + m_toolMgr->PostAction( SCH_ACTIONS::drawSheetFromFile, new wxString( sheetFileName ) ); } @@ -905,7 +908,7 @@ int SCH_DRAWING_TOOLS::ImportSheet( const TOOL_EVENT& aEvent ) m_menu->ShowContextMenu( m_selectionTool->GetSelection() ); } else if( evt->IsAction( &ACTIONS::duplicate ) - || evt->IsAction( &EE_ACTIONS::repeatDrawItem ) ) + || evt->IsAction( &SCH_ACTIONS::repeatDrawItem ) ) { wxBell(); } @@ -938,7 +941,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent ) KIGFX::VIEW_CONTROLS* controls = getViewControls(); VECTOR2I cursorPos; - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); // Add all the drawable symbols to preview if( image ) @@ -962,7 +965,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent ) auto cleanup = [&] () { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); m_view->ClearPreview(); m_view->RecacheAllItems(); delete image; @@ -1057,7 +1060,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent ) { if( !image ) { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); wxFileDialog dlg( m_frame, _( "Choose Image" ), m_mruPath, wxEmptyString, _( "Image Files" ) + wxS( " " ) + wxImage::GetImageExtWildcard(), @@ -1134,7 +1137,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent ) m_menu->ShowContextMenu( m_selectionTool->GetSelection() ); } else if( evt->IsAction( &ACTIONS::duplicate ) - || evt->IsAction( &EE_ACTIONS::repeatDrawItem ) ) + || evt->IsAction( &SCH_ACTIONS::repeatDrawItem ) ) { if( image ) { @@ -1211,7 +1214,7 @@ int SCH_DRAWING_TOOLS::ImportGraphics( const TOOL_EVENT& aEvent ) KIGFX::VIEW_CONTROLS* controls = getViewControls(); std::vector newItems; // all new items, including group std::vector selectedItems; // the group, or newItems if no group - EE_SELECTION preview; + SCH_SELECTION preview; SCH_COMMIT commit( m_toolMgr ); for( std::unique_ptr& ptr : list ) @@ -1239,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( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); EDA_ITEMS selItems( selectedItems.begin(), selectedItems.end() ); - m_toolMgr->RunAction( EE_ACTIONS::addItemsToSel, &selItems ); + m_toolMgr->RunAction( SCH_ACTIONS::addItemsToSel, &selItems ); m_frame->PushTool( aEvent ); @@ -1286,7 +1289,7 @@ int SCH_DRAWING_TOOLS::ImportGraphics( const TOOL_EVENT& aEvent ) if( evt->IsCancelInteractive() || evt->IsActivate() ) { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); for( SCH_ITEM* item : newItems ) delete item; @@ -1354,8 +1357,8 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent ) if( type == SCH_JUNCTION_T && aEvent.HasPosition() ) { - EE_SELECTION& selection = m_selectionTool->GetSelection(); - SCH_LINE* wire = dynamic_cast( selection.Front() ); + SCH_SELECTION& selection = m_selectionTool->GetSelection(); + SCH_LINE* wire = dynamic_cast( selection.Front() ); if( wire ) { @@ -1393,7 +1396,7 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent ) return 0; } - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); cursorPos = aEvent.HasPosition() ? aEvent.Position() : controls->GetMousePosition(); @@ -1506,26 +1509,26 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent ) } else if( evt->Category() == TC_COMMAND ) { - if( ( type == SCH_BUS_WIRE_ENTRY_T ) && ( evt->IsAction( &EE_ACTIONS::rotateCW ) - || evt->IsAction( &EE_ACTIONS::rotateCCW ) - || evt->IsAction( &EE_ACTIONS::mirrorV ) - || evt->IsAction( &EE_ACTIONS::mirrorH ) ) ) + if( ( type == SCH_BUS_WIRE_ENTRY_T ) && ( evt->IsAction( &SCH_ACTIONS::rotateCW ) + || evt->IsAction( &SCH_ACTIONS::rotateCCW ) + || evt->IsAction( &SCH_ACTIONS::mirrorV ) + || evt->IsAction( &SCH_ACTIONS::mirrorH ) ) ) { SCH_BUS_ENTRY_BASE* busItem = static_cast( previewItem ); - if( evt->IsAction( &EE_ACTIONS::rotateCW ) ) + if( evt->IsAction( &SCH_ACTIONS::rotateCW ) ) { busItem->Rotate( busItem->GetPosition(), false ); } - else if( evt->IsAction( &EE_ACTIONS::rotateCCW ) ) + else if( evt->IsAction( &SCH_ACTIONS::rotateCCW ) ) { busItem->Rotate( busItem->GetPosition(), true ); } - else if( evt->IsAction( &EE_ACTIONS::mirrorV ) ) + else if( evt->IsAction( &SCH_ACTIONS::mirrorV ) ) { busItem->MirrorVertically( busItem->GetPosition().y ); } - else if( evt->IsAction( &EE_ACTIONS::mirrorH ) ) + else if( evt->IsAction( &SCH_ACTIONS::mirrorH ) ) { busItem->MirrorHorizontally( busItem->GetPosition().x ); } @@ -1533,7 +1536,7 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent ) m_view->ClearPreview(); m_view->AddToPreview( previewItem->Clone() ); } - else if( evt->IsAction( &EE_ACTIONS::properties ) ) + else if( evt->IsAction( &SCH_ACTIONS::properties ) ) { switch( type ) { @@ -1805,12 +1808,12 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) REENTRANCY_GUARD guard( &m_inDrawingTool ); - bool isText = aEvent.IsAction( &EE_ACTIONS::placeSchematicText ); - bool isGlobalLabel = aEvent.IsAction( &EE_ACTIONS::placeGlobalLabel ); - bool isHierLabel = aEvent.IsAction( &EE_ACTIONS::placeHierLabel ); - bool isClassLabel = aEvent.IsAction( &EE_ACTIONS::placeClassLabel ); - bool isNetLabel = aEvent.IsAction( &EE_ACTIONS::placeLabel ); - bool isSheetPin = aEvent.IsAction( &EE_ACTIONS::placeSheetPin ); + bool isText = aEvent.IsAction( &SCH_ACTIONS::placeSchematicText ); + bool isGlobalLabel = aEvent.IsAction( &SCH_ACTIONS::placeGlobalLabel ); + bool isHierLabel = aEvent.IsAction( &SCH_ACTIONS::placeHierLabel ); + bool isClassLabel = aEvent.IsAction( &SCH_ACTIONS::placeClassLabel ); + bool isNetLabel = aEvent.IsAction( &SCH_ACTIONS::placeLabel ); + bool isSheetPin = aEvent.IsAction( &SCH_ACTIONS::placeSheetPin ); GRID_HELPER_GRIDS snapGrid = isText ? GRID_TEXT : GRID_CONNECTABLE; @@ -1818,7 +1821,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) if( isSheetPin ) sheet = dynamic_cast( m_selectionTool->GetSelection().Front() ); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); m_frame->PushTool( aEvent ); @@ -1856,7 +1859,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) auto cleanup = [&]() { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); m_view->ClearPreview(); delete item; item = nullptr; @@ -1969,7 +1972,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) // First click creates... if( !item ) { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); if( isText ) { @@ -2133,7 +2136,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) } m_frame->PopTool( aEvent ); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); m_dialogSyncSheetPin->Show( true ); break; } @@ -2178,7 +2181,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) else if( item && evt->IsSelectionEvent() ) { // This happens if our text was replaced out from under us by ConvertTextType() - EE_SELECTION& selection = m_selectionTool->GetSelection(); + SCH_SELECTION& selection = m_selectionTool->GetSelection(); if( selection.GetSize() == 1 ) { @@ -2196,7 +2199,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) evt->Parameter() ); } else if( evt->IsAction( &ACTIONS::duplicate ) - || evt->IsAction( &EE_ACTIONS::repeatDrawItem ) ) + || evt->IsAction( &SCH_ACTIONS::repeatDrawItem ) ) { if( item ) { @@ -2257,7 +2260,7 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) SCHEMATIC* schematic = getModel(); SCHEMATIC_SETTINGS& sch_settings = schematic->Settings(); SCH_SHAPE* item = nullptr; - bool isTextBox = aEvent.IsAction( &EE_ACTIONS::drawTextBox ); + bool isTextBox = aEvent.IsAction( &SCH_ACTIONS::drawTextBox ); SHAPE_T type = aEvent.Parameter(); wxString description; @@ -2274,7 +2277,7 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) // gets whacked. m_toolMgr->DeactivateTool(); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); m_frame->PushTool( aEvent ); @@ -2287,7 +2290,7 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) auto cleanup = [&] () { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); m_view->ClearPreview(); delete item; item = nullptr; @@ -2359,7 +2362,7 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) } else if( evt->IsClick( BUT_LEFT ) && !item ) { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); if( isTextBox ) { @@ -2454,7 +2457,7 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) } } else if( evt->IsAction( &ACTIONS::duplicate ) - || evt->IsAction( &EE_ACTIONS::repeatDrawItem ) ) + || evt->IsAction( &SCH_ACTIONS::repeatDrawItem ) ) { if( item ) { @@ -2477,7 +2480,7 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) } else if( evt->IsDblClick( BUT_LEFT ) && !item ) { - m_toolMgr->RunAction( EE_ACTIONS::properties ); + m_toolMgr->RunAction( SCH_ACTIONS::properties ); } else if( evt->IsClick( BUT_RIGHT ) ) { @@ -2528,7 +2531,7 @@ int SCH_DRAWING_TOOLS::DrawRuleArea( const TOOL_EVENT& aEvent ) // gets whacked. m_toolMgr->DeactivateTool(); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); m_frame->PushTool( aEvent ); @@ -2544,7 +2547,7 @@ int SCH_DRAWING_TOOLS::DrawRuleArea( const TOOL_EVENT& aEvent ) started = false; getViewControls()->SetAutoPan( false ); getViewControls()->CaptureCursor( false ); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); }; Activate(); @@ -2618,11 +2621,11 @@ int SCH_DRAWING_TOOLS::DrawRuleArea( const TOOL_EVENT& aEvent ) } // events that lock in nodes else if( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT ) - || evt->IsAction( &EE_ACTIONS::closeOutline ) ) + || evt->IsAction( &SCH_ACTIONS::closeOutline ) ) { // Check if it is double click / closing line (so we have to finish the zone) const bool endPolygon = evt->IsDblClick( BUT_LEFT ) - || evt->IsAction( &EE_ACTIONS::closeOutline ) + || evt->IsAction( &SCH_ACTIONS::closeOutline ) || polyGeomMgr.NewPointClosesOutline( cursorPos ); if( endPolygon ) @@ -2647,7 +2650,7 @@ int SCH_DRAWING_TOOLS::DrawRuleArea( const TOOL_EVENT& aEvent ) } } else if( started - && ( evt->IsAction( &EE_ACTIONS::deleteLastPoint ) + && ( evt->IsAction( &SCH_ACTIONS::deleteLastPoint ) || evt->IsAction( &ACTIONS::doDelete ) || evt->IsAction( &ACTIONS::undo ) ) ) { @@ -2699,7 +2702,7 @@ int SCH_DRAWING_TOOLS::DrawTable( const TOOL_EVENT& aEvent ) // gets whacked. m_toolMgr->DeactivateTool(); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); m_frame->PushTool( aEvent ); @@ -2712,7 +2715,7 @@ int SCH_DRAWING_TOOLS::DrawTable( const TOOL_EVENT& aEvent ) auto cleanup = [&] () { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); m_view->ClearPreview(); delete table; table = nullptr; @@ -2786,7 +2789,7 @@ int SCH_DRAWING_TOOLS::DrawTable( const TOOL_EVENT& aEvent ) } else if( evt->IsClick( BUT_LEFT ) && !table ) { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); table = new SCH_TABLE( 0 ); table->SetColCount( 1 ); @@ -2807,7 +2810,7 @@ int SCH_DRAWING_TOOLS::DrawTable( const TOOL_EVENT& aEvent ) else if( table && ( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT ) || isSyntheticClick - || evt->IsAction( &EE_ACTIONS::finishInteractive ) ) ) + || evt->IsAction( &SCH_ACTIONS::finishInteractive ) ) ) { table->ClearEditFlags(); table->SetFlags( IS_NEW ); @@ -2877,7 +2880,7 @@ int SCH_DRAWING_TOOLS::DrawTable( const TOOL_EVENT& aEvent ) } else if( evt->IsDblClick( BUT_LEFT ) && !table ) { - m_toolMgr->RunAction( EE_ACTIONS::properties ); + m_toolMgr->RunAction( SCH_ACTIONS::properties ); } else if( evt->IsClick( BUT_RIGHT ) ) { @@ -2910,8 +2913,8 @@ int SCH_DRAWING_TOOLS::DrawTable( const TOOL_EVENT& aEvent ) int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent ) { - bool isDrawSheetCopy = aEvent.IsAction( &EE_ACTIONS::drawSheetFromFile ); - bool isDrawSheetFromDesignBlock = aEvent.IsAction( &EE_ACTIONS::drawSheetFromDesignBlock ); + bool isDrawSheetCopy = aEvent.IsAction( &SCH_ACTIONS::drawSheetFromFile ); + bool isDrawSheetFromDesignBlock = aEvent.IsAction( &SCH_ACTIONS::drawSheetFromDesignBlock ); DESIGN_BLOCK* designBlock = nullptr; SCH_SHEET* sheet = nullptr; @@ -2950,7 +2953,7 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent ) EE_GRID_HELPER grid( m_toolMgr ); VECTOR2I cursorPos; - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); m_frame->PushTool( aEvent ); @@ -2963,7 +2966,7 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent ) auto cleanup = [&] () { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); m_view->ClearPreview(); delete sheet; sheet = nullptr; @@ -3041,7 +3044,7 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent ) } else if( !sheet && ( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT ) ) ) { - EE_SELECTION& selection = m_selectionTool->GetSelection(); + SCH_SELECTION& selection = m_selectionTool->GetSelection(); if( selection.Size() == 1 && selection.Front()->Type() == SCH_SHEET_T @@ -3054,13 +3057,13 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent ) } else if( evt->IsDblClick( BUT_LEFT ) ) { - m_toolMgr->PostAction( EE_ACTIONS::enterSheet ); + m_toolMgr->PostAction( SCH_ACTIONS::enterSheet ); m_frame->PopTool( aEvent ); break; } } - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); sheet = new SCH_SHEET( m_frame->GetCurrentSheet().Last(), cursorPos ); sheet->SetScreen( nullptr ); @@ -3170,7 +3173,7 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent ) sheet = nullptr; } else if( evt->IsAction( &ACTIONS::duplicate ) - || evt->IsAction( &EE_ACTIONS::repeatDrawItem ) ) + || evt->IsAction( &SCH_ACTIONS::repeatDrawItem ) ) { if( sheet ) { @@ -3268,8 +3271,8 @@ int SCH_DRAWING_TOOLS::doSyncSheetsPins( std::list sheetPaths ) [&]( EDA_ITEM* aItem, SCH_SHEET_PATH aPath ) { m_frame->GetToolManager()->RunAction( - EE_ACTIONS::changeSheet, &aPath ); - EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + SCH_ACTIONS::changeSheet, &aPath ); + SCH_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); selectionTool->UnbrightenItem( aItem ); selectionTool->AddItemToSel( aItem, true ); m_toolMgr->RunAction( ACTIONS::doDelete ); @@ -3288,8 +3291,8 @@ int SCH_DRAWING_TOOLS::doSyncSheetsPins( std::list sheetPaths ) sheet, DIALOG_SYNC_SHEET_PINS::PlaceItemKind::HIERLABEL, aTemplates ); m_frame->GetToolManager()->RunAction( - EE_ACTIONS::changeSheet, &aPath ); - m_toolMgr->RunAction( EE_ACTIONS::placeHierLabel ); + SCH_ACTIONS::changeSheet, &aPath ); + m_toolMgr->RunAction( SCH_ACTIONS::placeHierLabel ); break; } case SHEET_SYNCHRONIZATION_AGENT::PLACE_SHEET_PIN: @@ -3300,10 +3303,10 @@ int SCH_DRAWING_TOOLS::doSyncSheetsPins( std::list sheetPaths ) sheet, DIALOG_SYNC_SHEET_PINS::PlaceItemKind::SHEET_PIN, aTemplates ); m_frame->GetToolManager()->RunAction( - EE_ACTIONS::changeSheet, &aPath ); - m_toolMgr->GetTool()->SyncSelection( {}, nullptr, - { sheet } ); - m_toolMgr->RunAction( EE_ACTIONS::placeSheetPin ); + SCH_ACTIONS::changeSheet, &aPath ); + m_toolMgr->GetTool()->SyncSelection( {}, nullptr, + { sheet } ); + m_toolMgr->RunAction( SCH_ACTIONS::placeSheetPin ); break; } } @@ -3357,12 +3360,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( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); m_view->ClearPreview(); return 0; } - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); SCH_COMMIT commit( m_toolMgr ); BOX2I boundingBox = sheet->GetBoundingBox(); @@ -3535,34 +3538,34 @@ std::vector SCH_DRAWING_TOOLS::importHierLabels( SCH_SHEET* aShe void SCH_DRAWING_TOOLS::setTransitions() { // clang-format off - Go( &SCH_DRAWING_TOOLS::PlaceSymbol, EE_ACTIONS::placeSymbol.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::PlaceSymbol, EE_ACTIONS::placePower.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::PlaceNextSymbolUnit, EE_ACTIONS::placeNextSymbolUnit.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::SingleClickPlace, EE_ACTIONS::placeNoConnect.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::SingleClickPlace, EE_ACTIONS::placeJunction.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::SingleClickPlace, EE_ACTIONS::placeBusWireEntry.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::TwoClickPlace, EE_ACTIONS::placeLabel.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::TwoClickPlace, EE_ACTIONS::placeClassLabel.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::TwoClickPlace, EE_ACTIONS::placeHierLabel.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::TwoClickPlace, EE_ACTIONS::placeGlobalLabel.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::DrawSheet, EE_ACTIONS::drawSheet.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::DrawSheet, EE_ACTIONS::drawSheetFromFile.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::DrawSheet, EE_ACTIONS::drawSheetFromDesignBlock.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::TwoClickPlace, EE_ACTIONS::placeSheetPin.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::ImportSheet, EE_ACTIONS::placeDesignBlock.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::ImportSheet, EE_ACTIONS::importSheet.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::TwoClickPlace, EE_ACTIONS::placeSchematicText.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawRectangle.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawCircle.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawArc.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawBezier.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawTextBox.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::DrawRuleArea, EE_ACTIONS::drawRuleArea.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::DrawTable, EE_ACTIONS::drawTable.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::PlaceImage, EE_ACTIONS::placeImage.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::ImportGraphics, EE_ACTIONS::importGraphics.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::SyncSheetsPins, EE_ACTIONS::syncSheetPins.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::SyncAllSheetsPins, EE_ACTIONS::syncAllSheetsPins.MakeEvent() ); - Go( &SCH_DRAWING_TOOLS::AutoPlaceAllSheetPins, EE_ACTIONS::autoplaceAllSheetPins.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::PlaceSymbol, SCH_ACTIONS::placeSymbol.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::PlaceSymbol, SCH_ACTIONS::placePower.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::PlaceNextSymbolUnit, SCH_ACTIONS::placeNextSymbolUnit.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::SingleClickPlace, SCH_ACTIONS::placeNoConnect.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::SingleClickPlace, SCH_ACTIONS::placeJunction.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::SingleClickPlace, SCH_ACTIONS::placeBusWireEntry.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::TwoClickPlace, SCH_ACTIONS::placeLabel.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::TwoClickPlace, SCH_ACTIONS::placeClassLabel.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::TwoClickPlace, SCH_ACTIONS::placeHierLabel.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::TwoClickPlace, SCH_ACTIONS::placeGlobalLabel.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::DrawSheet, SCH_ACTIONS::drawSheet.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::DrawSheet, SCH_ACTIONS::drawSheetFromFile.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::DrawSheet, SCH_ACTIONS::drawSheetFromDesignBlock.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::TwoClickPlace, SCH_ACTIONS::placeSheetPin.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::ImportSheet, SCH_ACTIONS::placeDesignBlock.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::ImportSheet, SCH_ACTIONS::importSheet.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::TwoClickPlace, SCH_ACTIONS::placeSchematicText.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::DrawShape, SCH_ACTIONS::drawRectangle.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::DrawShape, SCH_ACTIONS::drawCircle.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::DrawShape, SCH_ACTIONS::drawArc.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::DrawShape, SCH_ACTIONS::drawBezier.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::DrawShape, SCH_ACTIONS::drawTextBox.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::DrawRuleArea, SCH_ACTIONS::drawRuleArea.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::DrawTable, SCH_ACTIONS::drawTable.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::PlaceImage, SCH_ACTIONS::placeImage.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::ImportGraphics, SCH_ACTIONS::importGraphics.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::SyncSheetsPins, SCH_ACTIONS::syncSheetPins.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::SyncAllSheetsPins, SCH_ACTIONS::syncAllSheetsPins.MakeEvent() ); + Go( &SCH_DRAWING_TOOLS::AutoPlaceAllSheetPins, SCH_ACTIONS::autoplaceAllSheetPins.MakeEvent() ); // clang-format on } diff --git a/eeschema/tools/sch_drawing_tools.h b/eeschema/tools/sch_drawing_tools.h index d904702749..29364630d7 100644 --- a/eeschema/tools/sch_drawing_tools.h +++ b/eeschema/tools/sch_drawing_tools.h @@ -26,7 +26,7 @@ #define SCH_DRAWING_TOOLS_H #include "sch_sheet_path.h" -#include +#include #include #include #include @@ -35,7 +35,7 @@ class SCH_SYMBOL; class SCH_BUS_WIRE_ENTRY; class SCH_EDIT_FRAME; -class EE_SELECTION_TOOL; +class SCH_SELECTION_TOOL; class DIALOG_SYNC_SHEET_PINS; @@ -43,7 +43,7 @@ class DIALOG_SYNC_SHEET_PINS; * Tool responsible for drawing/placing items (symbols, wires, buses, labels, etc.). */ -class SCH_DRAWING_TOOLS : public EE_TOOL_BASE +class SCH_DRAWING_TOOLS : public SCH_TOOL_BASE { public: SCH_DRAWING_TOOLS(); diff --git a/eeschema/tools/sch_edit_table_tool.cpp b/eeschema/tools/sch_edit_table_tool.cpp index 5c48691412..1eec90b42e 100644 --- a/eeschema/tools/sch_edit_table_tool.cpp +++ b/eeschema/tools/sch_edit_table_tool.cpp @@ -21,20 +21,20 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include +#include #include #include SCH_EDIT_TABLE_TOOL::SCH_EDIT_TABLE_TOOL() : - EE_TOOL_BASE( "eeschema.TableEditor" ) + SCH_TOOL_BASE( "eeschema.TableEditor" ) { } bool SCH_EDIT_TABLE_TOOL::Init() { - EE_TOOL_BASE::Init(); + SCH_TOOL_BASE::Init(); addMenus( m_selectionTool->GetToolMenu().GetMenu() ); @@ -44,9 +44,9 @@ bool SCH_EDIT_TABLE_TOOL::Init() int SCH_EDIT_TABLE_TOOL::EditTable( const TOOL_EVENT& aEvent ) { - EE_SELECTION& selection = m_selectionTool->RequestSelection( EE_COLLECTOR::EditableItems ); - bool clearSelection = selection.IsHover(); - SCH_TABLE* parentTable = nullptr; + SCH_SELECTION& selection = m_selectionTool->RequestSelection( SCH_COLLECTOR::EditableItems ); + bool clearSelection = selection.IsHover(); + SCH_TABLE* parentTable = nullptr; for( EDA_ITEM* item : selection.Items() ) { @@ -75,7 +75,7 @@ int SCH_EDIT_TABLE_TOOL::EditTable( const TOOL_EVENT& aEvent ) } if( clearSelection ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); return 0; } diff --git a/eeschema/tools/sch_edit_table_tool.h b/eeschema/tools/sch_edit_table_tool.h index f4cdf5d830..81244c7759 100644 --- a/eeschema/tools/sch_edit_table_tool.h +++ b/eeschema/tools/sch_edit_table_tool.h @@ -24,7 +24,7 @@ #ifndef SCH_EDIT_TABLE_TOOL_H #define SCH_EDIT_TABLE_TOOL_H -#include +#include #include #include #include @@ -34,7 +34,7 @@ class SCH_EDIT_FRAME; -class SCH_EDIT_TABLE_TOOL : public EE_TOOL_BASE, +class SCH_EDIT_TABLE_TOOL : public SCH_TOOL_BASE, public EDIT_TABLE_TOOL_BASE { public: @@ -65,7 +65,7 @@ private: BASE_SCREEN* getScreen() override { return m_frame->GetScreen(); } const SELECTION& getTableCellSelection() override; - void clearSelection() override { m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); }; + void clearSelection() override { m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); }; SCH_TABLECELL* copyCell( SCH_TABLECELL* aSource ) override; }; diff --git a/eeschema/tools/sch_edit_tool.cpp b/eeschema/tools/sch_edit_tool.cpp index caa836053e..6660022086 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -26,13 +26,13 @@ #include #include #include -#include +#include #include #include #include #include -#include -#include +#include +#include #include #include #include @@ -87,9 +87,9 @@ protected: private: void update() override { - EE_SELECTION_TOOL* selTool = getToolManager()->GetTool(); - EE_SELECTION& selection = selTool->GetSelection(); - SCH_SYMBOL* symbol = dynamic_cast( selection.Front() ); + SCH_SELECTION_TOOL* selTool = getToolManager()->GetTool(); + SCH_SELECTION& selection = selTool->GetSelection(); + SCH_SYMBOL* symbol = dynamic_cast( selection.Front() ); Clear(); @@ -126,7 +126,7 @@ private: { AppendSeparator(); - wxMenuItem* item = Add( EE_ACTIONS::placeNextSymbolUnit ); + wxMenuItem* item = Add( SCH_ACTIONS::placeNextSymbolUnit ); item->Enable( missingUnits.size() ); } } @@ -152,10 +152,10 @@ protected: private: void update() override { - EE_SELECTION_TOOL* selTool = getToolManager()->GetTool(); - EE_SELECTION& selection = selTool->GetSelection(); - SCH_SYMBOL* symbol = dynamic_cast( selection.Front() ); - wxMenuItem* item; + SCH_SELECTION_TOOL* selTool = getToolManager()->GetTool(); + SCH_SELECTION& selection = selTool->GetSelection(); + SCH_SYMBOL* symbol = dynamic_cast( selection.Front() ); + wxMenuItem* item; Clear(); @@ -189,10 +189,10 @@ protected: private: void update() override { - EE_SELECTION_TOOL* selTool = getToolManager()->GetTool(); - EE_SELECTION& selection = selTool->GetSelection(); - SCH_PIN* pin = dynamic_cast( selection.Front() ); - SCH_PIN* libPin = pin ? pin->GetLibPin() : nullptr; + SCH_SELECTION_TOOL* selTool = getToolManager()->GetTool(); + SCH_SELECTION& selection = selTool->GetSelection(); + SCH_PIN* pin = dynamic_cast( selection.Front() ); + SCH_PIN* libPin = pin ? pin->GetLibPin() : nullptr; Clear(); @@ -237,10 +237,10 @@ protected: private: void update() override { - EE_SELECTION_TOOL* selTool = getToolManager()->GetTool(); - EE_SELECTION& selection = selTool->GetSelection(); - SCH_PIN* pin = dynamic_cast( selection.Front() ); - SCH_SHEET_PIN* sheetPin = dynamic_cast( selection.Front() ); + SCH_SELECTION_TOOL* selTool = getToolManager()->GetTool(); + SCH_SELECTION& selection = selTool->GetSelection(); + SCH_PIN* pin = dynamic_cast( selection.Front() ); + SCH_SHEET_PIN* sheetPin = dynamic_cast( selection.Front() ); Clear(); @@ -257,17 +257,17 @@ private: SCH_EDIT_TOOL::SCH_EDIT_TOOL() : - EE_TOOL_BASE( "eeschema.InteractiveEdit" ) + SCH_TOOL_BASE( "eeschema.InteractiveEdit" ) { m_pickerItem = nullptr; } -using E_C = EE_CONDITIONS; +using S_C = SCH_CONDITIONS; bool SCH_EDIT_TOOL::Init() { - EE_TOOL_BASE::Init(); + SCH_TOOL_BASE::Init(); SCH_DRAWING_TOOLS* drawingTools = m_toolMgr->GetTool(); SCH_MOVE_TOOL* moveTool = m_toolMgr->GetTool(); @@ -336,7 +336,7 @@ bool SCH_EDIT_TOOL::Init() static const std::vector sheetTypes = { SCH_SHEET_T }; - auto sheetSelection = E_C::Count( 1 ) && E_C::OnlyTypes( sheetTypes ); + auto sheetSelection = S_C::Count( 1 ) && S_C::OnlyTypes( sheetTypes ); auto haveHighlight = [&]( const SELECTION& sel ) @@ -349,11 +349,11 @@ bool SCH_EDIT_TOOL::Init() auto anyTextTool = [this]( const SELECTION& aSel ) { - return ( m_frame->IsCurrentTool( EE_ACTIONS::placeLabel ) - || m_frame->IsCurrentTool( EE_ACTIONS::placeClassLabel ) - || m_frame->IsCurrentTool( EE_ACTIONS::placeGlobalLabel ) - || m_frame->IsCurrentTool( EE_ACTIONS::placeHierLabel ) - || m_frame->IsCurrentTool( EE_ACTIONS::placeSchematicText ) ); + return ( m_frame->IsCurrentTool( SCH_ACTIONS::placeLabel ) + || m_frame->IsCurrentTool( SCH_ACTIONS::placeClassLabel ) + || m_frame->IsCurrentTool( SCH_ACTIONS::placeGlobalLabel ) + || m_frame->IsCurrentTool( SCH_ACTIONS::placeHierLabel ) + || m_frame->IsCurrentTool( SCH_ACTIONS::placeSchematicText ) ); }; auto duplicateCondition = @@ -391,8 +391,8 @@ bool SCH_EDIT_TOOL::Init() return false; } - SCH_ITEM* firstItem = dynamic_cast( aSel.Front() ); - const EE_SELECTION* eeSelection = dynamic_cast( &aSel ); + SCH_ITEM* firstItem = dynamic_cast( aSel.Front() ); + const SCH_SELECTION* eeSelection = dynamic_cast( &aSel ); if( !firstItem || !eeSelection ) return false; @@ -462,7 +462,7 @@ bool SCH_EDIT_TOOL::Init() { for( const EDA_ITEM* item : aSel ) { - if( item->IsType( EE_COLLECTOR::FieldOwners ) ) + if( item->IsType( SCH_COLLECTOR::FieldOwners ) ) return true; } @@ -478,7 +478,7 @@ bool SCH_EDIT_TOOL::Init() SCH_TEXT_T, SCH_TEXTBOX_T }; - auto toChangeCondition = ( E_C::OnlyTypes( allTextTypes ) ); + auto toChangeCondition = ( S_C::OnlyTypes( allTextTypes ) ); static const std::vector toLabelTypes = { SCH_DIRECTIVE_LABEL_T, SCH_GLOBAL_LABEL_T, @@ -486,8 +486,8 @@ bool SCH_EDIT_TOOL::Init() SCH_TEXT_T, SCH_TEXTBOX_T }; - auto toLabelCondition = ( E_C::Count( 1 ) && E_C::OnlyTypes( toLabelTypes ) ) - || ( E_C::MoreThan( 1 ) && E_C::OnlyTypes( allTextTypes ) ); + auto toLabelCondition = ( S_C::Count( 1 ) && S_C::OnlyTypes( toLabelTypes ) ) + || ( S_C::MoreThan( 1 ) && S_C::OnlyTypes( allTextTypes ) ); static const std::vector toCLabelTypes = { SCH_LABEL_T, SCH_HIER_LABEL_T, @@ -495,8 +495,8 @@ bool SCH_EDIT_TOOL::Init() SCH_TEXT_T, SCH_TEXTBOX_T }; - auto toCLabelCondition = ( E_C::Count( 1 ) && E_C::OnlyTypes( toCLabelTypes ) ) - || ( E_C::MoreThan( 1 ) && E_C::OnlyTypes( allTextTypes ) ); + auto toCLabelCondition = ( S_C::Count( 1 ) && S_C::OnlyTypes( toCLabelTypes ) ) + || ( S_C::MoreThan( 1 ) && S_C::OnlyTypes( allTextTypes ) ); static const std::vector toHLabelTypes = { SCH_LABEL_T, SCH_DIRECTIVE_LABEL_T, @@ -504,8 +504,8 @@ bool SCH_EDIT_TOOL::Init() SCH_TEXT_T, SCH_TEXTBOX_T }; - auto toHLabelCondition = ( E_C::Count( 1 ) && E_C::OnlyTypes( toHLabelTypes ) ) - || ( E_C::MoreThan( 1 ) && E_C::OnlyTypes( allTextTypes ) ); + auto toHLabelCondition = ( S_C::Count( 1 ) && S_C::OnlyTypes( toHLabelTypes ) ) + || ( S_C::MoreThan( 1 ) && S_C::OnlyTypes( allTextTypes ) ); static const std::vector toGLabelTypes = { SCH_LABEL_T, SCH_DIRECTIVE_LABEL_T, @@ -513,8 +513,8 @@ bool SCH_EDIT_TOOL::Init() SCH_TEXT_T, SCH_TEXTBOX_T }; - auto toGLabelCondition = ( E_C::Count( 1 ) && E_C::OnlyTypes( toGLabelTypes ) ) - || ( E_C::MoreThan( 1 ) && E_C::OnlyTypes( allTextTypes ) ); + auto toGLabelCondition = ( S_C::Count( 1 ) && S_C::OnlyTypes( toGLabelTypes ) ) + || ( S_C::MoreThan( 1 ) && S_C::OnlyTypes( allTextTypes ) ); static const std::vector toTextTypes = { SCH_LABEL_T, SCH_DIRECTIVE_LABEL_T, @@ -522,8 +522,8 @@ bool SCH_EDIT_TOOL::Init() SCH_HIER_LABEL_T, SCH_TEXTBOX_T }; - auto toTextCondition = ( E_C::Count( 1 ) && E_C::OnlyTypes( toTextTypes ) ) - || ( E_C::MoreThan( 1 ) && E_C::OnlyTypes( allTextTypes ) ); + auto toTextCondition = ( S_C::Count( 1 ) && S_C::OnlyTypes( toTextTypes ) ) + || ( S_C::MoreThan( 1 ) && S_C::OnlyTypes( allTextTypes ) ); static const std::vector toTextBoxTypes = { SCH_LABEL_T, SCH_DIRECTIVE_LABEL_T, @@ -531,14 +531,14 @@ bool SCH_EDIT_TOOL::Init() SCH_HIER_LABEL_T, SCH_TEXT_T }; - auto toTextBoxCondition = ( E_C::Count( 1 ) && E_C::OnlyTypes( toTextBoxTypes ) ) - || ( E_C::MoreThan( 1 ) && E_C::OnlyTypes( allTextTypes ) ); + auto toTextBoxCondition = ( S_C::Count( 1 ) && S_C::OnlyTypes( toTextBoxTypes ) ) + || ( S_C::MoreThan( 1 ) && S_C::OnlyTypes( allTextTypes ) ); static const std::vector busEntryTypes = { SCH_BUS_WIRE_ENTRY_T, SCH_BUS_BUS_ENTRY_T}; - auto entryCondition = E_C::MoreThan( 0 ) && E_C::OnlyTypes( busEntryTypes ); + auto entryCondition = S_C::MoreThan( 0 ) && S_C::OnlyTypes( busEntryTypes ); - auto singleSheetCondition = E_C::Count( 1 ) && E_C::OnlyTypes( sheetTypes ); + auto singleSheetCondition = S_C::Count( 1 ) && S_C::OnlyTypes( sheetTypes ); auto makeSymbolUnitMenu = [&]( TOOL_INTERACTIVE* tool ) @@ -582,10 +582,10 @@ bool SCH_EDIT_TOOL::Init() CONDITIONAL_MENU* menu = new CONDITIONAL_MENU( moveTool ); menu->SetTitle( _( "Transform Selection" ) ); - menu->AddItem( EE_ACTIONS::rotateCCW, orientCondition ); - menu->AddItem( EE_ACTIONS::rotateCW, orientCondition ); - menu->AddItem( EE_ACTIONS::mirrorV, orientCondition ); - menu->AddItem( EE_ACTIONS::mirrorH, orientCondition ); + menu->AddItem( SCH_ACTIONS::rotateCCW, orientCondition ); + menu->AddItem( SCH_ACTIONS::rotateCW, orientCondition ); + menu->AddItem( SCH_ACTIONS::mirrorV, orientCondition ); + menu->AddItem( SCH_ACTIONS::mirrorH, orientCondition ); return menu; }; @@ -596,10 +596,10 @@ bool SCH_EDIT_TOOL::Init() CONDITIONAL_MENU* menu = new CONDITIONAL_MENU( moveTool ); menu->SetTitle( _( "Attributes" ) ); - menu->AddCheckItem( EE_ACTIONS::setExcludeFromSimulation, E_C::ShowAlways ); - menu->AddCheckItem( EE_ACTIONS::setExcludeFromBOM, E_C::ShowAlways ); - menu->AddCheckItem( EE_ACTIONS::setExcludeFromBoard, E_C::ShowAlways ); - menu->AddCheckItem( EE_ACTIONS::setDNP, E_C::ShowAlways ); + menu->AddCheckItem( SCH_ACTIONS::setExcludeFromSimulation, S_C::ShowAlways ); + menu->AddCheckItem( SCH_ACTIONS::setExcludeFromBOM, S_C::ShowAlways ); + menu->AddCheckItem( SCH_ACTIONS::setExcludeFromBoard, S_C::ShowAlways ); + menu->AddCheckItem( SCH_ACTIONS::setDNP, S_C::ShowAlways ); return menu; }; @@ -610,9 +610,9 @@ bool SCH_EDIT_TOOL::Init() CONDITIONAL_MENU* menu = new CONDITIONAL_MENU( m_selectionTool ); menu->SetTitle( _( "Edit Main Fields" ) ); - menu->AddItem( EE_ACTIONS::editReference, E_C::SingleSymbol, 200 ); - menu->AddItem( EE_ACTIONS::editValue, E_C::SingleSymbol, 200 ); - menu->AddItem( EE_ACTIONS::editFootprint, E_C::SingleSymbol, 200 ); + menu->AddItem( SCH_ACTIONS::editReference, S_C::SingleSymbol, 200 ); + menu->AddItem( SCH_ACTIONS::editValue, S_C::SingleSymbol, 200 ); + menu->AddItem( SCH_ACTIONS::editFootprint, S_C::SingleSymbol, 200 ); return menu; }; @@ -624,17 +624,17 @@ bool SCH_EDIT_TOOL::Init() menu->SetTitle( _( "Change To" ) ); menu->SetIcon( BITMAPS::right ); - menu->AddItem( EE_ACTIONS::toLabel, toLabelCondition ); - menu->AddItem( EE_ACTIONS::toCLabel, toCLabelCondition ); - menu->AddItem( EE_ACTIONS::toHLabel, toHLabelCondition ); - menu->AddItem( EE_ACTIONS::toGLabel, toGLabelCondition ); - menu->AddItem( EE_ACTIONS::toText, toTextCondition ); - menu->AddItem( EE_ACTIONS::toTextBox, toTextBoxCondition ); + menu->AddItem( SCH_ACTIONS::toLabel, toLabelCondition ); + menu->AddItem( SCH_ACTIONS::toCLabel, toCLabelCondition ); + menu->AddItem( SCH_ACTIONS::toHLabel, toHLabelCondition ); + menu->AddItem( SCH_ACTIONS::toGLabel, toGLabelCondition ); + menu->AddItem( SCH_ACTIONS::toText, toTextCondition ); + menu->AddItem( SCH_ACTIONS::toTextBox, toTextBoxCondition ); return menu; }; - const auto canCopyText = EE_CONDITIONS::OnlyTypes( { + const auto canCopyText = SCH_CONDITIONS::OnlyTypes( { SCH_TEXT_T, SCH_TEXTBOX_T, SCH_FIELD_T, @@ -654,20 +654,20 @@ bool SCH_EDIT_TOOL::Init() CONDITIONAL_MENU& moveMenu = moveTool->GetToolMenu().GetMenu(); moveMenu.AddSeparator(); - moveMenu.AddMenu( makeSymbolUnitMenu( moveTool ), E_C::SingleMultiUnitSymbol, 1 ); - moveMenu.AddMenu( makeBodyStyleMenu( moveTool ), E_C::SingleDeMorganSymbol, 1 ); + moveMenu.AddMenu( makeSymbolUnitMenu( moveTool ), S_C::SingleMultiUnitSymbol, 1 ); + moveMenu.AddMenu( makeBodyStyleMenu( moveTool ), S_C::SingleDeMorganSymbol, 1 ); moveMenu.AddMenu( makeTransformMenu(), orientCondition, 200 ); - moveMenu.AddMenu( makeAttributesMenu(), E_C::HasType( SCH_SYMBOL_T ), 200 ); - moveMenu.AddItem( EE_ACTIONS::swap, SELECTION_CONDITIONS::MoreThan( 1 ), 200); - moveMenu.AddItem( EE_ACTIONS::properties, propertiesCondition, 200 ); - moveMenu.AddMenu( makeEditFieldsMenu(), E_C::SingleSymbol, 200 ); + moveMenu.AddMenu( makeAttributesMenu(), S_C::HasType( SCH_SYMBOL_T ), 200 ); + moveMenu.AddItem( SCH_ACTIONS::swap, SELECTION_CONDITIONS::MoreThan( 1 ), 200); + moveMenu.AddItem( SCH_ACTIONS::properties, propertiesCondition, 200 ); + moveMenu.AddMenu( makeEditFieldsMenu(), S_C::SingleSymbol, 200 ); moveMenu.AddSeparator(); - moveMenu.AddItem( ACTIONS::cut, E_C::IdleSelection ); - moveMenu.AddItem( ACTIONS::copy, E_C::IdleSelection ); - moveMenu.AddItem( ACTIONS::copyAsText, canCopyText && E_C::IdleSelection ); - moveMenu.AddItem( ACTIONS::doDelete, E_C::NotEmpty ); + moveMenu.AddItem( ACTIONS::cut, S_C::IdleSelection ); + moveMenu.AddItem( ACTIONS::copy, S_C::IdleSelection ); + moveMenu.AddItem( ACTIONS::copyAsText, canCopyText && S_C::IdleSelection ); + moveMenu.AddItem( ACTIONS::doDelete, S_C::NotEmpty ); moveMenu.AddItem( ACTIONS::duplicate, duplicateCondition ); // @@ -675,62 +675,62 @@ bool SCH_EDIT_TOOL::Init() // CONDITIONAL_MENU& drawMenu = drawingTools->GetToolMenu().GetMenu(); - drawMenu.AddItem( EE_ACTIONS::clearHighlight, haveHighlight && EE_CONDITIONS::Idle, 1 ); - drawMenu.AddSeparator( haveHighlight && EE_CONDITIONS::Idle, 1 ); + drawMenu.AddItem( SCH_ACTIONS::clearHighlight, haveHighlight && SCH_CONDITIONS::Idle, 1 ); + drawMenu.AddSeparator( haveHighlight && SCH_CONDITIONS::Idle, 1 ); - drawMenu.AddItem( EE_ACTIONS::enterSheet, sheetSelection && EE_CONDITIONS::Idle, 1 ); - drawMenu.AddSeparator( sheetSelection && EE_CONDITIONS::Idle, 1 ); + drawMenu.AddItem( SCH_ACTIONS::enterSheet, sheetSelection && SCH_CONDITIONS::Idle, 1 ); + drawMenu.AddSeparator( sheetSelection && SCH_CONDITIONS::Idle, 1 ); - drawMenu.AddMenu( makeSymbolUnitMenu( drawingTools ), E_C::SingleMultiUnitSymbol, 1 ); - drawMenu.AddMenu( makeBodyStyleMenu( drawingTools ), E_C::SingleDeMorganSymbol, 1 ); + drawMenu.AddMenu( makeSymbolUnitMenu( drawingTools ), S_C::SingleMultiUnitSymbol, 1 ); + drawMenu.AddMenu( makeBodyStyleMenu( drawingTools ), S_C::SingleDeMorganSymbol, 1 ); drawMenu.AddMenu( makeTransformMenu(), orientCondition, 200 ); - drawMenu.AddMenu( makeAttributesMenu(), E_C::HasType( SCH_SYMBOL_T ), 200 ); - drawMenu.AddItem( EE_ACTIONS::properties, propertiesCondition, 200 ); - drawMenu.AddMenu( makeEditFieldsMenu(), E_C::SingleSymbol, 200 ); - drawMenu.AddItem( EE_ACTIONS::autoplaceFields, autoplaceCondition, 200 ); + drawMenu.AddMenu( makeAttributesMenu(), S_C::HasType( SCH_SYMBOL_T ), 200 ); + drawMenu.AddItem( SCH_ACTIONS::properties, propertiesCondition, 200 ); + drawMenu.AddMenu( makeEditFieldsMenu(), S_C::SingleSymbol, 200 ); + drawMenu.AddItem( SCH_ACTIONS::autoplaceFields, autoplaceCondition, 200 ); - drawMenu.AddItem( EE_ACTIONS::editWithLibEdit, E_C::SingleSymbolOrPower && E_C::Idle, 200 ); + drawMenu.AddItem( SCH_ACTIONS::editWithLibEdit, S_C::SingleSymbolOrPower && S_C::Idle, 200 ); - drawMenu.AddItem( EE_ACTIONS::toLabel, anyTextTool && E_C::Idle, 200 ); - drawMenu.AddItem( EE_ACTIONS::toHLabel, anyTextTool && E_C::Idle, 200 ); - drawMenu.AddItem( EE_ACTIONS::toGLabel, anyTextTool && E_C::Idle, 200 ); - drawMenu.AddItem( EE_ACTIONS::toText, anyTextTool && E_C::Idle, 200 ); - drawMenu.AddItem( EE_ACTIONS::toTextBox, anyTextTool && E_C::Idle, 200 ); + drawMenu.AddItem( SCH_ACTIONS::toLabel, anyTextTool && S_C::Idle, 200 ); + drawMenu.AddItem( SCH_ACTIONS::toHLabel, anyTextTool && S_C::Idle, 200 ); + drawMenu.AddItem( SCH_ACTIONS::toGLabel, anyTextTool && S_C::Idle, 200 ); + drawMenu.AddItem( SCH_ACTIONS::toText, anyTextTool && S_C::Idle, 200 ); + drawMenu.AddItem( SCH_ACTIONS::toTextBox, anyTextTool && S_C::Idle, 200 ); // // Add editing actions to the selection tool menu // CONDITIONAL_MENU& selToolMenu = m_selectionTool->GetToolMenu().GetMenu(); - selToolMenu.AddMenu( makeSymbolUnitMenu( m_selectionTool ), E_C::SingleMultiUnitSymbol, 1 ); - selToolMenu.AddMenu( makeBodyStyleMenu( m_selectionTool ), E_C::SingleDeMorganSymbol, 1 ); - selToolMenu.AddMenu( makePinFunctionMenu( m_selectionTool ), E_C::SingleMultiFunctionPin, 1 ); - selToolMenu.AddMenu( makePinTricksMenu( m_selectionTool ), E_C::AllPinsOrSheetPins, 1 ); + selToolMenu.AddMenu( makeSymbolUnitMenu( m_selectionTool ), S_C::SingleMultiUnitSymbol, 1 ); + selToolMenu.AddMenu( makeBodyStyleMenu( m_selectionTool ), S_C::SingleDeMorganSymbol, 1 ); + selToolMenu.AddMenu( makePinFunctionMenu( m_selectionTool ), S_C::SingleMultiFunctionPin, 1 ); + selToolMenu.AddMenu( makePinTricksMenu( m_selectionTool ), S_C::AllPinsOrSheetPins, 1 ); selToolMenu.AddMenu( makeTransformMenu(), orientCondition, 200 ); - selToolMenu.AddMenu( makeAttributesMenu(), E_C::HasType( SCH_SYMBOL_T ), 200 ); - selToolMenu.AddItem( EE_ACTIONS::swap, SELECTION_CONDITIONS::MoreThan( 1 ), 200 ); - selToolMenu.AddItem( EE_ACTIONS::properties, propertiesCondition, 200 ); - selToolMenu.AddMenu( makeEditFieldsMenu(), E_C::SingleSymbol, 200 ); - selToolMenu.AddItem( EE_ACTIONS::autoplaceFields, autoplaceCondition, 200 ); + selToolMenu.AddMenu( makeAttributesMenu(), S_C::HasType( SCH_SYMBOL_T ), 200 ); + selToolMenu.AddItem( SCH_ACTIONS::swap, SELECTION_CONDITIONS::MoreThan( 1 ), 200 ); + selToolMenu.AddItem( SCH_ACTIONS::properties, propertiesCondition, 200 ); + selToolMenu.AddMenu( makeEditFieldsMenu(), S_C::SingleSymbol, 200 ); + selToolMenu.AddItem( SCH_ACTIONS::autoplaceFields, autoplaceCondition, 200 ); - selToolMenu.AddItem( EE_ACTIONS::editWithLibEdit, E_C::SingleSymbolOrPower && E_C::Idle, 200 ); - selToolMenu.AddItem( EE_ACTIONS::changeSymbol, E_C::SingleSymbolOrPower, 200 ); - selToolMenu.AddItem( EE_ACTIONS::updateSymbol, E_C::SingleSymbolOrPower, 200 ); - selToolMenu.AddItem( EE_ACTIONS::changeSymbols, E_C::MultipleSymbolsOrPower, 200 ); - selToolMenu.AddItem( EE_ACTIONS::updateSymbols, E_C::MultipleSymbolsOrPower, 200 ); + selToolMenu.AddItem( SCH_ACTIONS::editWithLibEdit, S_C::SingleSymbolOrPower && S_C::Idle, 200 ); + selToolMenu.AddItem( SCH_ACTIONS::changeSymbol, S_C::SingleSymbolOrPower, 200 ); + selToolMenu.AddItem( SCH_ACTIONS::updateSymbol, S_C::SingleSymbolOrPower, 200 ); + selToolMenu.AddItem( SCH_ACTIONS::changeSymbols, S_C::MultipleSymbolsOrPower, 200 ); + selToolMenu.AddItem( SCH_ACTIONS::updateSymbols, S_C::MultipleSymbolsOrPower, 200 ); selToolMenu.AddMenu( makeConvertToMenu(), toChangeCondition, 200 ); - selToolMenu.AddItem( EE_ACTIONS::cleanupSheetPins, sheetHasUndefinedPins, 250 ); + selToolMenu.AddItem( SCH_ACTIONS::cleanupSheetPins, sheetHasUndefinedPins, 250 ); selToolMenu.AddSeparator( 300 ); - selToolMenu.AddItem( ACTIONS::cut, E_C::IdleSelection, 300 ); - selToolMenu.AddItem( ACTIONS::copy, E_C::IdleSelection, 300 ); - selToolMenu.AddItem( ACTIONS::copyAsText, canCopyText && E_C::IdleSelection, 300 ); - selToolMenu.AddItem( ACTIONS::paste, E_C::Idle, 300 ); - selToolMenu.AddItem( ACTIONS::pasteSpecial, E_C::Idle, 300 ); - selToolMenu.AddItem( ACTIONS::doDelete, E_C::NotEmpty, 300 ); + selToolMenu.AddItem( ACTIONS::cut, S_C::IdleSelection, 300 ); + selToolMenu.AddItem( ACTIONS::copy, S_C::IdleSelection, 300 ); + selToolMenu.AddItem( ACTIONS::copyAsText, canCopyText && S_C::IdleSelection, 300 ); + selToolMenu.AddItem( ACTIONS::paste, S_C::Idle, 300 ); + selToolMenu.AddItem( ACTIONS::pasteSpecial, S_C::Idle, 300 ); + selToolMenu.AddItem( ACTIONS::doDelete, S_C::NotEmpty, 300 ); selToolMenu.AddItem( ACTIONS::duplicate, duplicateCondition, 300 ); selToolMenu.AddSeparator( 400 ); @@ -738,14 +738,12 @@ bool SCH_EDIT_TOOL::Init() selToolMenu.AddItem( ACTIONS::unselectAll, hasElements, 400 ); ACTION_MANAGER* mgr = m_toolMgr->GetActionManager(); - mgr->SetConditions( EE_ACTIONS::setDNP, - ACTION_CONDITIONS().Check( attribDNPCond ) ); - mgr->SetConditions( EE_ACTIONS::setExcludeFromSimulation, - ACTION_CONDITIONS().Check( attribExcludeFromSimCond ) ); - mgr->SetConditions( EE_ACTIONS::setExcludeFromBOM, - ACTION_CONDITIONS().Check( attribExcludeFromBOMCond ) ); - mgr->SetConditions( EE_ACTIONS::setExcludeFromBoard, - ACTION_CONDITIONS().Check( attribExcludeFromBoardCond ) ); + // clang-format off + mgr->SetConditions( SCH_ACTIONS::setDNP, ACTION_CONDITIONS().Check( attribDNPCond ) ); + mgr->SetConditions( SCH_ACTIONS::setExcludeFromSimulation, ACTION_CONDITIONS().Check( attribExcludeFromSimCond ) ); + mgr->SetConditions( SCH_ACTIONS::setExcludeFromBOM, ACTION_CONDITIONS().Check( attribExcludeFromBOMCond ) ); + mgr->SetConditions( SCH_ACTIONS::setExcludeFromBoard, ACTION_CONDITIONS().Check( attribExcludeFromBoardCond ) ); + // clang-format on return true; } @@ -777,8 +775,8 @@ const std::vector SCH_EDIT_TOOL::RotatableItems = { int SCH_EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) { - bool clockwise = ( aEvent.Matches( EE_ACTIONS::rotateCW.MakeEvent() ) ); - EE_SELECTION& selection = m_selectionTool->RequestSelection( RotatableItems, true ); + bool clockwise = ( aEvent.Matches( SCH_ACTIONS::rotateCW.MakeEvent() ) ); + SCH_SELECTION& selection = m_selectionTool->RequestSelection( RotatableItems, true ); if( selection.GetSize() == 0 ) return 0; @@ -1040,10 +1038,10 @@ int SCH_EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) } else { - EE_SELECTION selectionCopy = selection; + SCH_SELECTION selectionCopy = selection; if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); SCH_LINE_WIRE_BUS_TOOL* lwbTool = m_toolMgr->GetTool(); lwbTool->TrimOverLappingWires( commit, &selectionCopy ); @@ -1061,12 +1059,12 @@ int SCH_EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) int SCH_EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent ) { - EE_SELECTION& selection = m_selectionTool->RequestSelection( RotatableItems ); + SCH_SELECTION& selection = m_selectionTool->RequestSelection( RotatableItems ); if( selection.GetSize() == 0 ) return 0; - bool vertical = ( aEvent.Matches( EE_ACTIONS::mirrorV.MakeEvent() ) ); + bool vertical = ( aEvent.Matches( SCH_ACTIONS::mirrorV.MakeEvent() ) ); SCH_ITEM* item = static_cast( selection.Front() ); bool connections = false; bool moving = item->IsMoving(); @@ -1235,10 +1233,10 @@ int SCH_EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent ) } else { - EE_SELECTION selectionCopy = selection; + SCH_SELECTION selectionCopy = selection; if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); if( connections ) { @@ -1362,7 +1360,7 @@ static void swapFieldPositionsWithMatching( std::vector& aAFields, int SCH_EDIT_TOOL::Swap( const TOOL_EVENT& aEvent ) { - EE_SELECTION& selection = m_selectionTool->RequestSelection( swappableItems ); + SCH_SELECTION& selection = m_selectionTool->RequestSelection( swappableItems ); std::vector sorted = selection.GetItemsSortedBySelectionOrder(); // Sheet pins are special, we need to make sure if we have any sheet pins, @@ -1477,7 +1475,7 @@ int SCH_EDIT_TOOL::Swap( const TOOL_EVENT& aEvent ) else { if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); if( connections ) m_frame->TestDanglingEnds(); @@ -1496,10 +1494,10 @@ int SCH_EDIT_TOOL::RepeatDrawItem( const TOOL_EVENT& aEvent ) if( sourceItems.empty() ) return 0; - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); - SCH_COMMIT commit( m_toolMgr ); - EE_SELECTION newItems; + SCH_COMMIT commit( m_toolMgr ); + SCH_SELECTION newItems; for( const std::unique_ptr& item : sourceItems ) { @@ -1556,7 +1554,7 @@ int SCH_EDIT_TOOL::RepeatDrawItem( const TOOL_EVENT& aEvent ) } } - m_toolMgr->RunAction( EE_ACTIONS::addItemToSel, newItem ); + m_toolMgr->RunAction( SCH_ACTIONS::addItemToSel, newItem ); newItem->SetFlags( IS_NEW ); m_frame->AddToScreen( newItem, m_frame->GetScreen() ); commit.Added( newItem, m_frame->GetScreen() ); @@ -1578,9 +1576,9 @@ int SCH_EDIT_TOOL::RepeatDrawItem( const TOOL_EVENT& aEvent ) } // Annotation clears the selection so re-add the item - m_toolMgr->RunAction( EE_ACTIONS::addItemToSel, newItem ); + m_toolMgr->RunAction( SCH_ACTIONS::addItemToSel, newItem ); - restore_state = !m_toolMgr->RunSynchronousAction( EE_ACTIONS::move, &commit ); + restore_state = !m_toolMgr->RunSynchronousAction( SCH_ACTIONS::move, &commit ); } if( restore_state ) @@ -1649,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( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); for( EDA_ITEM* item : items ) item->ClearFlags( STRUCT_DELETED ); @@ -1735,7 +1733,7 @@ int SCH_EDIT_TOOL::InteractiveDelete( const TOOL_EVENT& aEvent ) { PICKER_TOOL* picker = m_toolMgr->GetTool(); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); m_pickerItem = nullptr; // Deactivate other tools; particularly important if another PICKER is currently running @@ -1749,7 +1747,7 @@ int SCH_EDIT_TOOL::InteractiveDelete( const TOOL_EVENT& aEvent ) { if( m_pickerItem ) { - EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + SCH_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); selectionTool->UnbrightenItem( m_pickerItem ); selectionTool->AddItemToSel( m_pickerItem, true /*quiet mode*/ ); m_toolMgr->RunAction( ACTIONS::doDelete ); @@ -1762,11 +1760,11 @@ int SCH_EDIT_TOOL::InteractiveDelete( const TOOL_EVENT& aEvent ) picker->SetMotionHandler( [this]( const VECTOR2D& aPos ) { - EE_COLLECTOR collector; + SCH_COLLECTOR collector; collector.m_Threshold = KiROUND( getView()->ToWorld( HITTEST_THRESHOLD_PIXELS ) ); collector.Collect( m_frame->GetScreen(), deletableItems, aPos ); - EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + SCH_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); selectionTool->GuessSelectionCandidates( collector, aPos ); EDA_ITEM* item = collector.GetCount() == 1 ? collector[ 0 ] : nullptr; @@ -1787,10 +1785,10 @@ int SCH_EDIT_TOOL::InteractiveDelete( const TOOL_EVENT& aEvent ) [this]( const int& aFinalState ) { if( m_pickerItem ) - m_toolMgr->GetTool()->UnbrightenItem( m_pickerItem ); + m_toolMgr->GetTool()->UnbrightenItem( m_pickerItem ); // Wake the selection tool after exiting to ensure the cursor gets updated - m_toolMgr->PostAction( EE_ACTIONS::selectionActivate ); + m_toolMgr->PostAction( SCH_ACTIONS::selectionActivate ); } ); m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent ); @@ -1848,9 +1846,9 @@ void SCH_EDIT_TOOL::editFieldText( SCH_FIELD* aField ) int SCH_EDIT_TOOL::EditField( const TOOL_EVENT& aEvent ) { - EE_SELECTION sel = m_selectionTool->RequestSelection( { SCH_FIELD_T, - SCH_SYMBOL_T, - SCH_PIN_T } ); + SCH_SELECTION sel = m_selectionTool->RequestSelection( { SCH_FIELD_T, + SCH_SYMBOL_T, + SCH_PIN_T } ); if( sel.Size() != 1 ) return 0; @@ -1862,9 +1860,9 @@ int SCH_EDIT_TOOL::EditField( const TOOL_EVENT& aEvent ) { SCH_FIELD* field = static_cast( item ); - if( ( aEvent.IsAction( &EE_ACTIONS::editReference ) && field->GetId() != FIELD_T::REFERENCE ) - || ( aEvent.IsAction( &EE_ACTIONS::editValue ) && field->GetId() != FIELD_T::VALUE ) - || ( aEvent.IsAction( &EE_ACTIONS::editFootprint ) && field->GetId() != FIELD_T::FOOTPRINT ) ) + if( ( aEvent.IsAction( &SCH_ACTIONS::editReference ) && field->GetId() != FIELD_T::REFERENCE ) + || ( aEvent.IsAction( &SCH_ACTIONS::editValue ) && field->GetId() != FIELD_T::VALUE ) + || ( aEvent.IsAction( &SCH_ACTIONS::editFootprint ) && field->GetId() != FIELD_T::FOOTPRINT ) ) { item = field->GetParentSymbol(); m_selectionTool->ClearSelection( true ); @@ -1876,15 +1874,15 @@ int SCH_EDIT_TOOL::EditField( const TOOL_EVENT& aEvent ) { SCH_SYMBOL* symbol = static_cast( item ); - if( aEvent.IsAction( &EE_ACTIONS::editReference ) ) + if( aEvent.IsAction( &SCH_ACTIONS::editReference ) ) { editFieldText( symbol->GetField( FIELD_T::REFERENCE ) ); } - else if( aEvent.IsAction( &EE_ACTIONS::editValue ) ) + else if( aEvent.IsAction( &SCH_ACTIONS::editValue ) ) { editFieldText( symbol->GetField( FIELD_T::VALUE ) ); } - else if( aEvent.IsAction( &EE_ACTIONS::editFootprint ) ) + else if( aEvent.IsAction( &SCH_ACTIONS::editFootprint ) ) { if( !symbol->IsPower() ) editFieldText( symbol->GetField( FIELD_T::FOOTPRINT ) ); @@ -1905,15 +1903,15 @@ int SCH_EDIT_TOOL::EditField( const TOOL_EVENT& aEvent ) if( symbol ) { - if( aEvent.IsAction( &EE_ACTIONS::editReference ) ) + if( aEvent.IsAction( &SCH_ACTIONS::editReference ) ) { editFieldText( symbol->GetField( FIELD_T::REFERENCE ) ); } - else if( aEvent.IsAction( &EE_ACTIONS::editValue ) ) + else if( aEvent.IsAction( &SCH_ACTIONS::editValue ) ) { editFieldText( symbol->GetField( FIELD_T::VALUE ) ); } - else if( aEvent.IsAction( &EE_ACTIONS::editFootprint ) ) + else if( aEvent.IsAction( &SCH_ACTIONS::editFootprint ) ) { if( !symbol->IsPower() ) editFieldText( symbol->GetField( FIELD_T::FOOTPRINT ) ); @@ -1922,7 +1920,7 @@ int SCH_EDIT_TOOL::EditField( const TOOL_EVENT& aEvent ) } if( clearSelection ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); return 0; } @@ -1930,10 +1928,10 @@ int SCH_EDIT_TOOL::EditField( const TOOL_EVENT& aEvent ) int SCH_EDIT_TOOL::AutoplaceFields( const TOOL_EVENT& aEvent ) { - EE_SELECTION& selection = m_selectionTool->RequestSelection( RotatableItems ); - SCH_COMMIT commit( m_toolMgr ); - SCH_ITEM* head = static_cast( selection.Front() ); - bool moving = head && head->IsMoving(); + SCH_SELECTION& selection = m_selectionTool->RequestSelection( RotatableItems ); + SCH_COMMIT commit( m_toolMgr ); + SCH_ITEM* head = static_cast( selection.Front() ); + bool moving = head && head->IsMoving(); if( selection.Empty() ) return 0; @@ -1944,9 +1942,9 @@ int SCH_EDIT_TOOL::AutoplaceFields( const TOOL_EVENT& aEvent ) { SCH_ITEM* item = static_cast( selection.GetItem( ii ) ); - if( item->IsType( EE_COLLECTOR::FieldOwners ) ) + if( item->IsType( SCH_COLLECTOR::FieldOwners ) ) autoplaceItems.push_back( item ); - else if( item->GetParent() && item->GetParent()->IsType( EE_COLLECTOR::FieldOwners ) ) + else if( item->GetParent() && item->GetParent()->IsType( SCH_COLLECTOR::FieldOwners ) ) autoplaceItems.push_back( static_cast( item->GetParent() ) ); } @@ -1970,7 +1968,7 @@ int SCH_EDIT_TOOL::AutoplaceFields( const TOOL_EVENT& aEvent ) commit.Push( _( "Autoplace Fields" ) ); if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); } return 0; @@ -1979,16 +1977,16 @@ int SCH_EDIT_TOOL::AutoplaceFields( const TOOL_EVENT& aEvent ) int SCH_EDIT_TOOL::ChangeSymbols( const TOOL_EVENT& aEvent ) { - SCH_SYMBOL* selectedSymbol = nullptr; - EE_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_SYMBOL_T } ); + SCH_SYMBOL* selectedSymbol = nullptr; + SCH_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_SYMBOL_T } ); if( !selection.Empty() ) selectedSymbol = dynamic_cast( selection.Front() ); DIALOG_CHANGE_SYMBOLS::MODE mode = DIALOG_CHANGE_SYMBOLS::MODE::UPDATE; - if( aEvent.IsAction( &EE_ACTIONS::changeSymbol ) - || aEvent.IsAction( &EE_ACTIONS::changeSymbols ) ) + if( aEvent.IsAction( &SCH_ACTIONS::changeSymbol ) + || aEvent.IsAction( &SCH_ACTIONS::changeSymbols ) ) { mode = DIALOG_CHANGE_SYMBOLS::MODE::CHANGE; } @@ -1999,7 +1997,7 @@ int SCH_EDIT_TOOL::ChangeSymbols( const TOOL_EVENT& aEvent ) dlg.ShowQuasiModal(); if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); return 0; } @@ -2007,20 +2005,20 @@ int SCH_EDIT_TOOL::ChangeSymbols( const TOOL_EVENT& aEvent ) int SCH_EDIT_TOOL::ChangeBodyStyle( const TOOL_EVENT& aEvent ) { - EE_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_SYMBOL_T } ); + SCH_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_SYMBOL_T } ); if( selection.Empty() ) return 0; SCH_SYMBOL* symbol = (SCH_SYMBOL*) selection.Front(); - if( aEvent.IsAction( &EE_ACTIONS::showDeMorganStandard ) + if( aEvent.IsAction( &SCH_ACTIONS::showDeMorganStandard ) && symbol->GetBodyStyle() == BODY_STYLE::BASE ) { return 0; } - if( aEvent.IsAction( &EE_ACTIONS::showDeMorganAlternate ) + if( aEvent.IsAction( &SCH_ACTIONS::showDeMorganAlternate ) && symbol->GetBodyStyle() == BODY_STYLE::DEMORGAN ) { return 0; @@ -2040,7 +2038,7 @@ int SCH_EDIT_TOOL::ChangeBodyStyle( const TOOL_EVENT& aEvent ) commit.Push( _( "Change Body Style" ) ); if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); return 0; } @@ -2048,8 +2046,8 @@ int SCH_EDIT_TOOL::ChangeBodyStyle( const TOOL_EVENT& aEvent ) int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) { - EE_SELECTION& selection = m_selectionTool->RequestSelection(); - bool clearSelection = selection.IsHover(); + SCH_SELECTION& selection = m_selectionTool->RequestSelection(); + bool clearSelection = selection.IsHover(); if( selection.Empty() ) { @@ -2393,7 +2391,7 @@ int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) case SCH_MARKER_T: if( SELECTION_CONDITIONS::OnlyTypes( { SCH_MARKER_T } )( selection ) ) { - EE_INSPECTION_TOOL* inspectionTool = m_toolMgr->GetTool(); + SCH_INSPECTION_TOOL* inspectionTool = m_toolMgr->GetTool(); if( inspectionTool ) inspectionTool->CrossProbe( static_cast ( selection.Front() ) ); @@ -2411,7 +2409,7 @@ int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) updateItem( curr_item, true ); if( clearSelection ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); return 0; } @@ -2420,7 +2418,7 @@ int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent ) { KICAD_T convertTo = aEvent.Parameter(); - EE_SELECTION selection = m_selectionTool->RequestSelection( { SCH_LABEL_LOCATE_ANY_T, + SCH_SELECTION selection = m_selectionTool->RequestSelection( { SCH_LABEL_LOCATE_ANY_T, SCH_TEXT_T, SCH_TEXTBOX_T } ); SCH_COMMIT commit( m_toolMgr ); @@ -2757,7 +2755,7 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent ) } if( selected ) - m_toolMgr->RunAction( EE_ACTIONS::removeItemFromSel, item ); + m_toolMgr->RunAction( SCH_ACTIONS::removeItemFromSel, item ); if( !item->IsNew() ) { @@ -2769,7 +2767,7 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent ) } if( selected ) - m_toolMgr->RunAction( EE_ACTIONS::addItemToSel, newtext ); + m_toolMgr->RunAction( SCH_ACTIONS::addItemToSel, newtext ); // Otherwise, pointer is owned by the undo stack if( item->IsNew() ) @@ -2781,7 +2779,7 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent ) commit.Push( _( "Change To" ) ); if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); return 0; } @@ -2796,7 +2794,7 @@ int SCH_EDIT_TOOL::JustifyText( const TOOL_EVENT& aEvent ) SCH_LABEL_T }; - EE_SELECTION& selection = m_selectionTool->RequestSelection( justifiableItems ); + SCH_SELECTION& selection = m_selectionTool->RequestSelection( justifiableItems ); if( selection.GetSize() == 0 ) return 0; @@ -2863,10 +2861,10 @@ int SCH_EDIT_TOOL::JustifyText( const TOOL_EVENT& aEvent ) } else { - EE_SELECTION selectionCopy = selection; + SCH_SELECTION selectionCopy = selection; if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); if( !localCommit.Empty() ) { @@ -2885,11 +2883,11 @@ int SCH_EDIT_TOOL::JustifyText( const TOOL_EVENT& aEvent ) int SCH_EDIT_TOOL::BreakWire( const TOOL_EVENT& aEvent ) { - bool isSlice = aEvent.Matches( EE_ACTIONS::slice.MakeEvent() ); - VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !aEvent.DisableGridSnapping() ); - EE_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_LINE_T } ); - SCH_SCREEN* screen = m_frame->GetScreen(); - SCH_COMMIT commit( m_toolMgr ); + bool isSlice = aEvent.Matches( SCH_ACTIONS::slice.MakeEvent() ); + VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !aEvent.DisableGridSnapping() ); + SCH_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_LINE_T } ); + SCH_SCREEN* screen = m_frame->GetScreen(); + SCH_COMMIT commit( m_toolMgr ); std::vector lines; for( EDA_ITEM* item : selection ) @@ -2937,14 +2935,14 @@ int SCH_EDIT_TOOL::BreakWire( const TOOL_EVENT& aEvent ) { m_frame->TestDanglingEnds(); - if( m_toolMgr->RunSynchronousAction( EE_ACTIONS::drag, &commit, isSlice ) ) + if( m_toolMgr->RunSynchronousAction( SCH_ACTIONS::drag, &commit, isSlice ) ) commit.Push( isSlice ? _( "Slice Wire" ) : _( "Break Wire" ) ); else commit.Revert(); } if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); return 0; } @@ -2952,9 +2950,9 @@ int SCH_EDIT_TOOL::BreakWire( const TOOL_EVENT& aEvent ) int SCH_EDIT_TOOL::CleanupSheetPins( const TOOL_EVENT& aEvent ) { - EE_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_SHEET_T } ); - SCH_SHEET* sheet = (SCH_SHEET*) selection.Front(); - SCH_COMMIT commit( m_toolMgr ); + SCH_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_SHEET_T } ); + SCH_SHEET* sheet = (SCH_SHEET*) selection.Front(); + SCH_COMMIT commit( m_toolMgr ); if( !sheet || !sheet->HasUndefinedPins() ) return 0; @@ -2971,7 +2969,7 @@ int SCH_EDIT_TOOL::CleanupSheetPins( const TOOL_EVENT& aEvent ) commit.Push( _( "Cleanup Sheet Pins" ) ); if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); return 0; } @@ -2979,7 +2977,7 @@ int SCH_EDIT_TOOL::CleanupSheetPins( const TOOL_EVENT& aEvent ) int SCH_EDIT_TOOL::EditPageNumber( const TOOL_EVENT& aEvent ) { - EE_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_SHEET_T } ); + SCH_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_SHEET_T } ); if( selection.GetSize() > 1 ) return 0; @@ -3045,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( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); return 0; } @@ -3056,7 +3054,7 @@ int SCH_EDIT_TOOL::Increment( const TOOL_EVENT& aEvent ) const ACTIONS::INCREMENT incParam = aEvent.Parameter(); static const std::vector incrementable = { SCH_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_TEXT_T }; - EE_SELECTION& selection = m_selectionTool->RequestSelection( incrementable ); + SCH_SELECTION& selection = m_selectionTool->RequestSelection( incrementable ); if( selection.Empty() ) return 0; @@ -3130,7 +3128,7 @@ int SCH_EDIT_TOOL::Increment( const TOOL_EVENT& aEvent ) commit->Push( _( "Increment" ) ); if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); return 0; } @@ -3138,11 +3136,11 @@ int SCH_EDIT_TOOL::Increment( const TOOL_EVENT& aEvent ) int SCH_EDIT_TOOL::DdAppendFile( const TOOL_EVENT& aEvent ) { - return m_toolMgr->RunAction( EE_ACTIONS::importSheet, aEvent.Parameter() ); + return m_toolMgr->RunAction( SCH_ACTIONS::importSheet, aEvent.Parameter() ); } -void SCH_EDIT_TOOL::collectUnits( const EE_SELECTION& aSelection, +void SCH_EDIT_TOOL::collectUnits( const SCH_SELECTION& aSelection, std::set>& aCollectedUnits ) { for( EDA_ITEM* item : aSelection ) @@ -3179,8 +3177,8 @@ void SCH_EDIT_TOOL::collectUnits( const EE_SELECTION& aSelection, int SCH_EDIT_TOOL::SetAttribute( const TOOL_EVENT& aEvent ) { - EE_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_SYMBOL_T } ); - SCH_COMMIT commit( m_toolMgr ); + SCH_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_SYMBOL_T } ); + SCH_COMMIT commit( m_toolMgr ); std::set> collectedUnits; @@ -3189,10 +3187,10 @@ int SCH_EDIT_TOOL::SetAttribute( const TOOL_EVENT& aEvent ) for( const auto& [symbol, _] : collectedUnits ) { - if( ( aEvent.IsAction( &EE_ACTIONS::setDNP ) && !symbol->GetDNP() ) - || ( aEvent.IsAction( &EE_ACTIONS::setExcludeFromSimulation ) && !symbol->GetExcludedFromSim() ) - || ( aEvent.IsAction( &EE_ACTIONS::setExcludeFromBOM ) && !symbol->GetExcludedFromBOM() ) - || ( aEvent.IsAction( &EE_ACTIONS::setExcludeFromBoard ) && !symbol->GetExcludedFromBoard() ) ) + if( ( aEvent.IsAction( &SCH_ACTIONS::setDNP ) && !symbol->GetDNP() ) + || ( aEvent.IsAction( &SCH_ACTIONS::setExcludeFromSimulation ) && !symbol->GetExcludedFromSim() ) + || ( aEvent.IsAction( &SCH_ACTIONS::setExcludeFromBOM ) && !symbol->GetExcludedFromBOM() ) + || ( aEvent.IsAction( &SCH_ACTIONS::setExcludeFromBoard ) && !symbol->GetExcludedFromBoard() ) ) { new_state = true; break; @@ -3203,16 +3201,16 @@ int SCH_EDIT_TOOL::SetAttribute( const TOOL_EVENT& aEvent ) { commit.Modify( symbol, screen ); - if( aEvent.IsAction( &EE_ACTIONS::setDNP ) ) + if( aEvent.IsAction( &SCH_ACTIONS::setDNP ) ) symbol->SetDNP( new_state ); - if( aEvent.IsAction( &EE_ACTIONS::setExcludeFromSimulation ) ) + if( aEvent.IsAction( &SCH_ACTIONS::setExcludeFromSimulation ) ) symbol->SetExcludedFromSim( new_state ); - if( aEvent.IsAction( &EE_ACTIONS::setExcludeFromBOM ) ) + if( aEvent.IsAction( &SCH_ACTIONS::setExcludeFromBOM ) ) symbol->SetExcludedFromBOM( new_state ); - if( aEvent.IsAction( &EE_ACTIONS::setExcludeFromBoard ) ) + if( aEvent.IsAction( &SCH_ACTIONS::setExcludeFromBoard ) ) symbol->SetExcludedFromBoard( new_state ); } @@ -3220,7 +3218,7 @@ int SCH_EDIT_TOOL::SetAttribute( const TOOL_EVENT& aEvent ) commit.Push( _( "Toggle Attribute" ) ); if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); return 0; } @@ -3229,12 +3227,12 @@ int SCH_EDIT_TOOL::SetAttribute( const TOOL_EVENT& aEvent ) void SCH_EDIT_TOOL::setTransitions() { // clang-format off - Go( &SCH_EDIT_TOOL::RepeatDrawItem, EE_ACTIONS::repeatDrawItem.MakeEvent() ); - Go( &SCH_EDIT_TOOL::Rotate, EE_ACTIONS::rotateCW.MakeEvent() ); - Go( &SCH_EDIT_TOOL::Rotate, EE_ACTIONS::rotateCCW.MakeEvent() ); - Go( &SCH_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorV.MakeEvent() ); - Go( &SCH_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorH.MakeEvent() ); - Go( &SCH_EDIT_TOOL::Swap, EE_ACTIONS::swap.MakeEvent() ); + Go( &SCH_EDIT_TOOL::RepeatDrawItem, SCH_ACTIONS::repeatDrawItem.MakeEvent() ); + Go( &SCH_EDIT_TOOL::Rotate, SCH_ACTIONS::rotateCW.MakeEvent() ); + Go( &SCH_EDIT_TOOL::Rotate, SCH_ACTIONS::rotateCCW.MakeEvent() ); + Go( &SCH_EDIT_TOOL::Mirror, SCH_ACTIONS::mirrorV.MakeEvent() ); + Go( &SCH_EDIT_TOOL::Mirror, SCH_ACTIONS::mirrorH.MakeEvent() ); + Go( &SCH_EDIT_TOOL::Swap, SCH_ACTIONS::swap.MakeEvent() ); Go( &SCH_EDIT_TOOL::DoDelete, ACTIONS::doDelete.MakeEvent() ); Go( &SCH_EDIT_TOOL::InteractiveDelete, ACTIONS::deleteTool.MakeEvent() ); @@ -3244,40 +3242,40 @@ void SCH_EDIT_TOOL::setTransitions() Go( &SCH_EDIT_TOOL::Increment, ACTIONS::incrementSecondary.MakeEvent() ); Go( &SCH_EDIT_TOOL::Increment, ACTIONS::decrementSecondary.MakeEvent() ); - Go( &SCH_EDIT_TOOL::Properties, EE_ACTIONS::properties.MakeEvent() ); - Go( &SCH_EDIT_TOOL::EditField, EE_ACTIONS::editReference.MakeEvent() ); - Go( &SCH_EDIT_TOOL::EditField, EE_ACTIONS::editValue.MakeEvent() ); - Go( &SCH_EDIT_TOOL::EditField, EE_ACTIONS::editFootprint.MakeEvent() ); - Go( &SCH_EDIT_TOOL::AutoplaceFields, EE_ACTIONS::autoplaceFields.MakeEvent() ); - Go( &SCH_EDIT_TOOL::ChangeSymbols, EE_ACTIONS::changeSymbols.MakeEvent() ); - Go( &SCH_EDIT_TOOL::ChangeSymbols, EE_ACTIONS::updateSymbols.MakeEvent() ); - Go( &SCH_EDIT_TOOL::ChangeSymbols, EE_ACTIONS::changeSymbol.MakeEvent() ); - Go( &SCH_EDIT_TOOL::ChangeSymbols, EE_ACTIONS::updateSymbol.MakeEvent() ); - Go( &SCH_EDIT_TOOL::ChangeBodyStyle, EE_ACTIONS::toggleDeMorgan.MakeEvent() ); - Go( &SCH_EDIT_TOOL::ChangeBodyStyle, EE_ACTIONS::showDeMorganStandard.MakeEvent() ); - Go( &SCH_EDIT_TOOL::ChangeBodyStyle, EE_ACTIONS::showDeMorganAlternate.MakeEvent() ); - Go( &SCH_EDIT_TOOL::ChangeTextType, EE_ACTIONS::toLabel.MakeEvent() ); - Go( &SCH_EDIT_TOOL::ChangeTextType, EE_ACTIONS::toHLabel.MakeEvent() ); - Go( &SCH_EDIT_TOOL::ChangeTextType, EE_ACTIONS::toGLabel.MakeEvent() ); - Go( &SCH_EDIT_TOOL::ChangeTextType, EE_ACTIONS::toCLabel.MakeEvent() ); - Go( &SCH_EDIT_TOOL::ChangeTextType, EE_ACTIONS::toText.MakeEvent() ); - Go( &SCH_EDIT_TOOL::ChangeTextType, EE_ACTIONS::toTextBox.MakeEvent() ); + Go( &SCH_EDIT_TOOL::Properties, SCH_ACTIONS::properties.MakeEvent() ); + Go( &SCH_EDIT_TOOL::EditField, SCH_ACTIONS::editReference.MakeEvent() ); + Go( &SCH_EDIT_TOOL::EditField, SCH_ACTIONS::editValue.MakeEvent() ); + Go( &SCH_EDIT_TOOL::EditField, SCH_ACTIONS::editFootprint.MakeEvent() ); + Go( &SCH_EDIT_TOOL::AutoplaceFields, SCH_ACTIONS::autoplaceFields.MakeEvent() ); + Go( &SCH_EDIT_TOOL::ChangeSymbols, SCH_ACTIONS::changeSymbols.MakeEvent() ); + Go( &SCH_EDIT_TOOL::ChangeSymbols, SCH_ACTIONS::updateSymbols.MakeEvent() ); + Go( &SCH_EDIT_TOOL::ChangeSymbols, SCH_ACTIONS::changeSymbol.MakeEvent() ); + Go( &SCH_EDIT_TOOL::ChangeSymbols, SCH_ACTIONS::updateSymbol.MakeEvent() ); + Go( &SCH_EDIT_TOOL::ChangeBodyStyle, SCH_ACTIONS::toggleDeMorgan.MakeEvent() ); + Go( &SCH_EDIT_TOOL::ChangeBodyStyle, SCH_ACTIONS::showDeMorganStandard.MakeEvent() ); + Go( &SCH_EDIT_TOOL::ChangeBodyStyle, SCH_ACTIONS::showDeMorganAlternate.MakeEvent() ); + Go( &SCH_EDIT_TOOL::ChangeTextType, SCH_ACTIONS::toLabel.MakeEvent() ); + Go( &SCH_EDIT_TOOL::ChangeTextType, SCH_ACTIONS::toHLabel.MakeEvent() ); + Go( &SCH_EDIT_TOOL::ChangeTextType, SCH_ACTIONS::toGLabel.MakeEvent() ); + Go( &SCH_EDIT_TOOL::ChangeTextType, SCH_ACTIONS::toCLabel.MakeEvent() ); + Go( &SCH_EDIT_TOOL::ChangeTextType, SCH_ACTIONS::toText.MakeEvent() ); + Go( &SCH_EDIT_TOOL::ChangeTextType, SCH_ACTIONS::toTextBox.MakeEvent() ); Go( &SCH_EDIT_TOOL::JustifyText, ACTIONS::leftJustify.MakeEvent() ); Go( &SCH_EDIT_TOOL::JustifyText, ACTIONS::centerJustify.MakeEvent() ); Go( &SCH_EDIT_TOOL::JustifyText, ACTIONS::rightJustify.MakeEvent() ); - Go( &SCH_EDIT_TOOL::BreakWire, EE_ACTIONS::breakWire.MakeEvent() ); - Go( &SCH_EDIT_TOOL::BreakWire, EE_ACTIONS::slice.MakeEvent() ); + Go( &SCH_EDIT_TOOL::BreakWire, SCH_ACTIONS::breakWire.MakeEvent() ); + Go( &SCH_EDIT_TOOL::BreakWire, SCH_ACTIONS::slice.MakeEvent() ); - Go( &SCH_EDIT_TOOL::SetAttribute, EE_ACTIONS::setDNP.MakeEvent() ); - Go( &SCH_EDIT_TOOL::SetAttribute, EE_ACTIONS::setExcludeFromBOM.MakeEvent() ); - Go( &SCH_EDIT_TOOL::SetAttribute, EE_ACTIONS::setExcludeFromBoard.MakeEvent() ); - Go( &SCH_EDIT_TOOL::SetAttribute, EE_ACTIONS::setExcludeFromSimulation.MakeEvent() ); + Go( &SCH_EDIT_TOOL::SetAttribute, SCH_ACTIONS::setDNP.MakeEvent() ); + Go( &SCH_EDIT_TOOL::SetAttribute, SCH_ACTIONS::setExcludeFromBOM.MakeEvent() ); + Go( &SCH_EDIT_TOOL::SetAttribute, SCH_ACTIONS::setExcludeFromBoard.MakeEvent() ); + Go( &SCH_EDIT_TOOL::SetAttribute, SCH_ACTIONS::setExcludeFromSimulation.MakeEvent() ); - Go( &SCH_EDIT_TOOL::CleanupSheetPins, EE_ACTIONS::cleanupSheetPins.MakeEvent() ); - Go( &SCH_EDIT_TOOL::GlobalEdit, EE_ACTIONS::editTextAndGraphics.MakeEvent() ); - Go( &SCH_EDIT_TOOL::EditPageNumber, EE_ACTIONS::editPageNumber.MakeEvent() ); + Go( &SCH_EDIT_TOOL::CleanupSheetPins, SCH_ACTIONS::cleanupSheetPins.MakeEvent() ); + Go( &SCH_EDIT_TOOL::GlobalEdit, SCH_ACTIONS::editTextAndGraphics.MakeEvent() ); + Go( &SCH_EDIT_TOOL::EditPageNumber, SCH_ACTIONS::editPageNumber.MakeEvent() ); - Go( &SCH_EDIT_TOOL::DdAppendFile, EE_ACTIONS::ddAppendFile.MakeEvent() ); + Go( &SCH_EDIT_TOOL::DdAppendFile, SCH_ACTIONS::ddAppendFile.MakeEvent() ); // clang-format on } diff --git a/eeschema/tools/sch_edit_tool.h b/eeschema/tools/sch_edit_tool.h index 4d1295f5de..9bc241b6d3 100644 --- a/eeschema/tools/sch_edit_tool.h +++ b/eeschema/tools/sch_edit_tool.h @@ -25,15 +25,15 @@ #ifndef KICAD_SCH_EDIT_TOOL_H #define KICAD_SCH_EDIT_TOOL_H -#include +#include #include class SCH_EDIT_FRAME; -class EE_SELECTION_TOOL; +class SCH_SELECTION_TOOL; -class SCH_EDIT_TOOL : public EE_TOOL_BASE +class SCH_EDIT_TOOL : public SCH_TOOL_BASE { public: SCH_EDIT_TOOL(); @@ -97,7 +97,7 @@ public: private: void editFieldText( SCH_FIELD* aField ); - void collectUnits( const EE_SELECTION& aSelection, + void collectUnits( const SCH_SELECTION& aSelection, std::set>& aCollectedUnits ); ///< Set up handlers for various events. diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 9847d4a4db..2755c1c471 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -64,10 +64,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -149,7 +149,7 @@ int SCH_EDITOR_CONTROL::Revert( const TOOL_EVENT& aEvent ) if( m_frame->GetCurrentSheet().Last() != &root ) { m_toolMgr->RunAction( ACTIONS::cancelInteractive ); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); // Store the current zoom level into the current screen before switching m_frame->GetScreen()->m_LastZoomLevel = m_frame->GetCanvas()->GetView()->GetScale(); @@ -345,9 +345,8 @@ void SCH_EDITOR_CONTROL::doCrossProbeSchToPcb( const TOOL_EVENT& aEvent, bool aF if( m_probingPcbToSch || m_frame->IsSyncingSelection() ) return; - EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - - EE_SELECTION& selection = aForce ? selTool->RequestSelection() : selTool->GetSelection(); + SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + SCH_SELECTION& selection = aForce ? selTool->RequestSelection() : selTool->GetSelection(); m_frame->SendSelectItemsToPcb( selection.GetItemsSortedBySelectionOrder(), aForce ); } @@ -358,7 +357,7 @@ int SCH_EDITOR_CONTROL::ExportSymbolsToLibrary( const TOOL_EVENT& aEvent ) bool savePowerSymbols = IsOK( m_frame, _( "Include power symbols in schematic to the library?" ) ); - bool createNew = aEvent.IsAction( &EE_ACTIONS::exportSymbolsToNewLibrary ); + bool createNew = aEvent.IsAction( &SCH_ACTIONS::exportSymbolsToNewLibrary ); SCH_SHEET_LIST sheets = m_frame->Schematic().BuildSheetListSortedByPageNumbers(); SCH_REFERENCE_LIST symbols; @@ -567,7 +566,7 @@ int SCH_EDITOR_CONTROL::SimProbe( const TOOL_EVENT& aEvent ) picker->SetClickHandler( [this, simFrame]( const VECTOR2D& aPosition ) { - EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); // We do not really want to keep an item selected in schematic, // so clear the current selection @@ -640,13 +639,13 @@ int SCH_EDITOR_CONTROL::SimProbe( const TOOL_EVENT& aEvent ) picker->SetMotionHandler( [this, picker]( const VECTOR2D& aPos ) { - EE_COLLECTOR collector; + SCH_COLLECTOR collector; collector.m_Threshold = KiROUND( getView()->ToWorld( HITTEST_THRESHOLD_PIXELS ) ); collector.Collect( m_frame->GetScreen(), { SCH_ITEM_LOCATE_WIRE_T, SCH_PIN_T, SCH_SHEET_PIN_T }, aPos ); - EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + SCH_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); selectionTool->GuessSelectionCandidates( collector, aPos ); EDA_ITEM* item = collector.GetCount() == 1 ? collector[ 0 ] : nullptr; @@ -691,7 +690,7 @@ int SCH_EDITOR_CONTROL::SimProbe( const TOOL_EVENT& aEvent ) [this]( const int& aFinalState ) { if( m_pickerItem ) - m_toolMgr->GetTool()->UnbrightenItem( m_pickerItem ); + m_toolMgr->GetTool()->UnbrightenItem( m_pickerItem ); if( !m_frame->GetHighlightedConnection().IsEmpty() ) { @@ -704,9 +703,9 @@ int SCH_EDITOR_CONTROL::SimProbe( const TOOL_EVENT& aEvent ) // Wake the selection tool after exiting to ensure the cursor gets updated // and deselect previous selection from simulator to avoid any issue // ( avoid crash in some cases when the SimProbe tool is deselected ) - EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + SCH_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); selectionTool->ClearSelection(); - m_toolMgr->PostAction( EE_ACTIONS::selectionActivate ); + m_toolMgr->PostAction( SCH_ACTIONS::selectionActivate ); } ); m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent ); @@ -728,8 +727,8 @@ int SCH_EDITOR_CONTROL::SimTune( const TOOL_EVENT& aEvent ) picker->SetClickHandler( [this]( const VECTOR2D& aPosition ) { - EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - EDA_ITEM* item = nullptr; + SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + EDA_ITEM* item = nullptr; selTool->SelectPoint( aPosition, { SCH_SYMBOL_T, SCH_FIELD_T }, &item ); if( !item ) @@ -764,11 +763,11 @@ int SCH_EDITOR_CONTROL::SimTune( const TOOL_EVENT& aEvent ) picker->SetMotionHandler( [this]( const VECTOR2D& aPos ) { - EE_COLLECTOR collector; + SCH_COLLECTOR collector; collector.m_Threshold = KiROUND( getView()->ToWorld( HITTEST_THRESHOLD_PIXELS ) ); collector.Collect( m_frame->GetScreen(), { SCH_SYMBOL_T, SCH_FIELD_T }, aPos ); - EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + SCH_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); selectionTool->GuessSelectionCandidates( collector, aPos ); EDA_ITEM* item = collector.GetCount() == 1 ? collector[ 0 ] : nullptr; @@ -792,14 +791,14 @@ int SCH_EDITOR_CONTROL::SimTune( const TOOL_EVENT& aEvent ) [this]( const int& aFinalState ) { if( m_pickerItem ) - m_toolMgr->GetTool()->UnbrightenItem( m_pickerItem ); + m_toolMgr->GetTool()->UnbrightenItem( m_pickerItem ); // Wake the selection tool after exiting to ensure the cursor gets updated // and deselect previous selection from simulator to avoid any issue // ( avoid crash in some cases when the SimTune tool is deselected ) - EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + SCH_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); selectionTool->ClearSelection(); - m_toolMgr->PostAction( EE_ACTIONS::selectionActivate ); + m_toolMgr->PostAction( SCH_ACTIONS::selectionActivate ); } ); m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent ); @@ -815,7 +814,7 @@ static VECTOR2D CLEAR; static bool highlightNet( TOOL_MANAGER* aToolMgr, const VECTOR2D& aPosition ) { SCH_EDIT_FRAME* editFrame = static_cast( aToolMgr->GetToolHolder() ); - EE_SELECTION_TOOL* selTool = aToolMgr->GetTool(); + SCH_SELECTION_TOOL* selTool = aToolMgr->GetTool(); SCH_EDITOR_CONTROL* editorControl = aToolMgr->GetTool(); SCH_CONNECTION* conn = nullptr; SCH_ITEM* item = nullptr; @@ -916,9 +915,9 @@ int SCH_EDITOR_CONTROL::ClearHighlight( const TOOL_EVENT& aEvent ) int SCH_EDITOR_CONTROL::AssignNetclass( const TOOL_EVENT& aEvent ) { - EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); - SCHEMATIC& schematic = m_frame->Schematic(); - SCH_SCREEN* screen = m_frame->GetCurrentSheet().LastScreen(); + SCH_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + SCHEMATIC& schematic = m_frame->Schematic(); + SCH_SCREEN* screen = m_frame->GetCurrentSheet().LastScreen(); const SCH_CONNECTION* conn = nullptr; VECTOR2D connPos; @@ -1290,7 +1289,7 @@ int SCH_EDITOR_CONTROL::Undo( const TOOL_EVENT& aEvent ) undo_list->ReversePickersListOrder(); m_frame->PushCommandToRedoList( undo_list ); - m_toolMgr->GetTool()->RebuildSelection(); + m_toolMgr->GetTool()->RebuildSelection(); m_frame->GetCanvas()->Refresh(); m_frame->OnModify(); @@ -1321,7 +1320,7 @@ int SCH_EDITOR_CONTROL::Redo( const TOOL_EVENT& aEvent ) list->ReversePickersListOrder(); m_frame->PushCommandToUndoList( list ); - m_toolMgr->GetTool()->RebuildSelection(); + m_toolMgr->GetTool()->RebuildSelection(); m_frame->GetCanvas()->Refresh(); m_frame->OnModify(); @@ -1332,9 +1331,9 @@ int SCH_EDITOR_CONTROL::Redo( const TOOL_EVENT& aEvent ) bool SCH_EDITOR_CONTROL::doCopy( bool aUseDuplicateClipboard ) { - EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - EE_SELECTION& selection = selTool->RequestSelection(); - SCHEMATIC& schematic = m_frame->Schematic(); + SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + SCH_SELECTION& selection = selTool->RequestSelection(); + SCHEMATIC& schematic = m_frame->Schematic(); if( selection.Empty() ) return false; @@ -1375,7 +1374,7 @@ bool SCH_EDITOR_CONTROL::doCopy( bool aUseDuplicateClipboard ) KICAD_FORMAT::Prettify( prettyData, true ); if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); if( aUseDuplicateClipboard ) { @@ -1444,8 +1443,8 @@ int SCH_EDITOR_CONTROL::Copy( const TOOL_EVENT& aEvent ) int SCH_EDITOR_CONTROL::CopyAsText( const TOOL_EVENT& aEvent ) { - EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - EE_SELECTION& selection = selTool->RequestSelection(); + SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + SCH_SELECTION& selection = selTool->RequestSelection(); if( selection.Empty() ) return false; @@ -1453,7 +1452,7 @@ int SCH_EDITOR_CONTROL::CopyAsText( const TOOL_EVENT& aEvent ) wxString itemsAsText = GetSelectedItemsAsText( selection ); if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); return SaveClipboard( itemsAsText.ToStdString() ); } @@ -1653,9 +1652,9 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent ) return 0; } - EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - std::string content; - VECTOR2I eventPos; + SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + std::string content; + VECTOR2I eventPos; SCH_SHEET tempSheet; SCH_SCREEN* tempScreen = new SCH_SCREEN( &m_frame->Schematic() ); @@ -2175,10 +2174,10 @@ 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( EE_ACTIONS::clearSelection ); - m_toolMgr->RunAction( EE_ACTIONS::addItemsToSel, &loadedItems ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::addItemsToSel, &loadedItems ); - EE_SELECTION& selection = selTool->GetSelection(); + SCH_SELECTION& selection = selTool->GetSelection(); if( !selection.Empty() ) { @@ -2279,7 +2278,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent ) selection.SetReferencePoint( item->GetPosition() ); } - if( m_toolMgr->RunSynchronousAction( EE_ACTIONS::move, &commit ) ) + if( m_toolMgr->RunSynchronousAction( SCH_ACTIONS::move, &commit ) ) { // Pushing the commit will update the connectivity. commit.Push( _( "Paste" ) ); @@ -2302,16 +2301,16 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent ) int SCH_EDITOR_CONTROL::EditWithSymbolEditor( const TOOL_EVENT& aEvent ) { - EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - EE_SELECTION& selection = selTool->RequestSelection( { SCH_SYMBOL_T } ); - SCH_SYMBOL* symbol = nullptr; - SYMBOL_EDIT_FRAME* symbolEditor; + SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + SCH_SELECTION& selection = selTool->RequestSelection( { SCH_SYMBOL_T } ); + SCH_SYMBOL* symbol = nullptr; + SYMBOL_EDIT_FRAME* symbolEditor; if( selection.GetSize() >= 1 ) symbol = (SCH_SYMBOL*) selection.Front(); if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); if( !symbol ) { @@ -2341,11 +2340,11 @@ int SCH_EDITOR_CONTROL::EditWithSymbolEditor( const TOOL_EVENT& aEvent ) if( wxWindow* blocking_win = symbolEditor->Kiway().GetBlockingDialog() ) blocking_win->Close( true ); - if( aEvent.IsAction( &EE_ACTIONS::editWithLibEdit ) ) + if( aEvent.IsAction( &SCH_ACTIONS::editWithLibEdit ) ) { symbolEditor->LoadSymbolFromSchematic( symbol ); } - else if( aEvent.IsAction( &EE_ACTIONS::editLibSymbolWithLibEdit ) ) + else if( aEvent.IsAction( &SCH_ACTIONS::editLibSymbolWithLibEdit ) ) { symbolEditor->LoadSymbol( symbol->GetLibId(), symbol->GetUnit(), symbol->GetBodyStyle() ); @@ -2891,33 +2890,33 @@ void SCH_EDITOR_CONTROL::setTransitions() Go( &SCH_EDITOR_CONTROL::Open, ACTIONS::open.MakeEvent() ); Go( &SCH_EDITOR_CONTROL::Save, ACTIONS::save.MakeEvent() ); Go( &SCH_EDITOR_CONTROL::SaveAs, ACTIONS::saveAs.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::SaveCurrSheetCopyAs, EE_ACTIONS::saveCurrSheetCopyAs.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::SaveCurrSheetCopyAs, SCH_ACTIONS::saveCurrSheetCopyAs.MakeEvent() ); Go( &SCH_EDITOR_CONTROL::Revert, ACTIONS::revert.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ShowSchematicSetup, EE_ACTIONS::schematicSetup.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ShowSchematicSetup, SCH_ACTIONS::schematicSetup.MakeEvent() ); Go( &SCH_EDITOR_CONTROL::PageSetup, ACTIONS::pageSettings.MakeEvent() ); Go( &SCH_EDITOR_CONTROL::Print, ACTIONS::print.MakeEvent() ); Go( &SCH_EDITOR_CONTROL::Plot, ACTIONS::plot.MakeEvent() ); Go( &SCH_EDITOR_CONTROL::Quit, ACTIONS::quit.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::RescueSymbols, EE_ACTIONS::rescueSymbols.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::RemapSymbols, EE_ACTIONS::remapSymbols.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::RescueSymbols, SCH_ACTIONS::rescueSymbols.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::RemapSymbols, SCH_ACTIONS::remapSymbols.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::CrossProbeToPcb, EVENTS::PointSelectedEvent ); - Go( &SCH_EDITOR_CONTROL::CrossProbeToPcb, EVENTS::SelectedEvent ); - Go( &SCH_EDITOR_CONTROL::CrossProbeToPcb, EVENTS::UnselectedEvent ); - Go( &SCH_EDITOR_CONTROL::CrossProbeToPcb, EVENTS::ClearedEvent ); - Go( &SCH_EDITOR_CONTROL::ExplicitCrossProbeToPcb, EE_ACTIONS::selectOnPCB.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::CrossProbeToPcb, EVENTS::PointSelectedEvent ); + Go( &SCH_EDITOR_CONTROL::CrossProbeToPcb, EVENTS::SelectedEvent ); + Go( &SCH_EDITOR_CONTROL::CrossProbeToPcb, EVENTS::UnselectedEvent ); + Go( &SCH_EDITOR_CONTROL::CrossProbeToPcb, EVENTS::ClearedEvent ); + Go( &SCH_EDITOR_CONTROL::ExplicitCrossProbeToPcb, SCH_ACTIONS::selectOnPCB.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::SimProbe, EE_ACTIONS::simProbe.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::SimTune, EE_ACTIONS::simTune.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::SimProbe, SCH_ACTIONS::simProbe.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::SimTune, SCH_ACTIONS::simTune.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::HighlightNet, EE_ACTIONS::highlightNet.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ClearHighlight, EE_ACTIONS::clearHighlight.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::HighlightNetCursor, EE_ACTIONS::highlightNetTool.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::HighlightNet, SCH_ACTIONS::highlightNet.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ClearHighlight, SCH_ACTIONS::clearHighlight.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::HighlightNetCursor, SCH_ACTIONS::highlightNetTool.MakeEvent() ); Go( &SCH_EDITOR_CONTROL::UpdateNetHighlighting, EVENTS::SelectedItemsModified ); - Go( &SCH_EDITOR_CONTROL::UpdateNetHighlighting, EE_ACTIONS::updateNetHighlighting.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::UpdateNetHighlighting, SCH_ACTIONS::updateNetHighlighting.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::AssignNetclass, EE_ACTIONS::assignNetclass.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::AssignNetclass, SCH_ACTIONS::assignNetclass.MakeEvent() ); Go( &SCH_EDITOR_CONTROL::Undo, ACTIONS::undo.MakeEvent() ); Go( &SCH_EDITOR_CONTROL::Redo, ACTIONS::redo.MakeEvent() ); @@ -2930,53 +2929,49 @@ void SCH_EDITOR_CONTROL::setTransitions() Go( &SCH_EDITOR_CONTROL::GridFeedback, EVENTS::GridChangedByKeyEvent ); - Go( &SCH_EDITOR_CONTROL::EditWithSymbolEditor, EE_ACTIONS::editWithLibEdit.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::EditWithSymbolEditor, - EE_ACTIONS::editLibSymbolWithLibEdit.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ShowCvpcb, EE_ACTIONS::assignFootprints.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ImportFPAssignments, EE_ACTIONS::importFPAssignments.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::Annotate, EE_ACTIONS::annotate.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::IncrementAnnotations, EE_ACTIONS::incrementAnnotations.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::EditSymbolFields, EE_ACTIONS::editSymbolFields.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::EditSymbolLibraryLinks, - EE_ACTIONS::editSymbolLibraryLinks.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ShowPcbNew, EE_ACTIONS::showPcbNew.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::UpdatePCB, ACTIONS::updatePcbFromSchematic.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::UpdateFromPCB, ACTIONS::updateSchematicFromPcb.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ExportNetlist, EE_ACTIONS::exportNetlist.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::GenerateBOM, EE_ACTIONS::generateBOM.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::GenerateBOMLegacy, EE_ACTIONS::generateBOMLegacy.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::DrawSheetOnClipboard, EE_ACTIONS::drawSheetOnClipboard.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::EditWithSymbolEditor, SCH_ACTIONS::editWithLibEdit.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::EditWithSymbolEditor, SCH_ACTIONS::editLibSymbolWithLibEdit.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ShowCvpcb, SCH_ACTIONS::assignFootprints.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ImportFPAssignments, SCH_ACTIONS::importFPAssignments.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::Annotate, SCH_ACTIONS::annotate.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::IncrementAnnotations, SCH_ACTIONS::incrementAnnotations.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::EditSymbolFields, SCH_ACTIONS::editSymbolFields.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::EditSymbolLibraryLinks, SCH_ACTIONS::editSymbolLibraryLinks.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ShowPcbNew, SCH_ACTIONS::showPcbNew.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::UpdatePCB, ACTIONS::updatePcbFromSchematic.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::UpdateFromPCB, ACTIONS::updateSchematicFromPcb.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ExportNetlist, SCH_ACTIONS::exportNetlist.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::GenerateBOM, SCH_ACTIONS::generateBOM.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::GenerateBOMLegacy, SCH_ACTIONS::generateBOMLegacy.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::DrawSheetOnClipboard, SCH_ACTIONS::drawSheetOnClipboard.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ShowSearch, EE_ACTIONS::showSearch.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ShowHierarchy, EE_ACTIONS::showHierarchy.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ShowNetNavigator, EE_ACTIONS::showNetNavigator.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ToggleProperties, ACTIONS::showProperties.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ToggleLibraryTree, EE_ACTIONS::showDesignBlockPanel.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ToggleLibraryTree, EE_ACTIONS::showDesignBlockPanel.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ShowSearch, SCH_ACTIONS::showSearch.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ShowHierarchy, SCH_ACTIONS::showHierarchy.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ShowNetNavigator, SCH_ACTIONS::showNetNavigator.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ToggleProperties, ACTIONS::showProperties.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ToggleLibraryTree, SCH_ACTIONS::showDesignBlockPanel.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ToggleLibraryTree, SCH_ACTIONS::showDesignBlockPanel.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ToggleHiddenPins, EE_ACTIONS::toggleHiddenPins.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ToggleHiddenFields, EE_ACTIONS::toggleHiddenFields.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ToggleDirectiveLabels, EE_ACTIONS::toggleDirectiveLabels.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ToggleERCWarnings, EE_ACTIONS::toggleERCWarnings.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ToggleERCErrors, EE_ACTIONS::toggleERCErrors.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ToggleERCExclusions, EE_ACTIONS::toggleERCExclusions.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::MarkSimExclusions, EE_ACTIONS::markSimExclusions.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ToggleOPVoltages, EE_ACTIONS::toggleOPVoltages.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ToggleOPCurrents, EE_ACTIONS::toggleOPCurrents.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::TogglePinAltIcons, EE_ACTIONS::togglePinAltIcons.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ChangeLineMode, EE_ACTIONS::lineModeFree.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ChangeLineMode, EE_ACTIONS::lineMode90.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ChangeLineMode, EE_ACTIONS::lineMode45.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::NextLineMode, EE_ACTIONS::lineModeNext.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ToggleAnnotateAuto, EE_ACTIONS::toggleAnnotateAuto.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ToggleHiddenPins, SCH_ACTIONS::toggleHiddenPins.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ToggleHiddenFields, SCH_ACTIONS::toggleHiddenFields.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ToggleDirectiveLabels, SCH_ACTIONS::toggleDirectiveLabels.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ToggleERCWarnings, SCH_ACTIONS::toggleERCWarnings.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ToggleERCErrors, SCH_ACTIONS::toggleERCErrors.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ToggleERCExclusions, SCH_ACTIONS::toggleERCExclusions.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::MarkSimExclusions, SCH_ACTIONS::markSimExclusions.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ToggleOPVoltages, SCH_ACTIONS::toggleOPVoltages.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ToggleOPCurrents, SCH_ACTIONS::toggleOPCurrents.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::TogglePinAltIcons, SCH_ACTIONS::togglePinAltIcons.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ChangeLineMode, SCH_ACTIONS::lineModeFree.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ChangeLineMode, SCH_ACTIONS::lineMode90.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ChangeLineMode, SCH_ACTIONS::lineMode45.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::NextLineMode, SCH_ACTIONS::lineModeNext.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ToggleAnnotateAuto, SCH_ACTIONS::toggleAnnotateAuto.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ReloadPlugins, ACTIONS::pluginsReload.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ReloadPlugins, ACTIONS::pluginsReload.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::RepairSchematic, EE_ACTIONS::repairSchematic.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::RepairSchematic, SCH_ACTIONS::repairSchematic.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ExportSymbolsToLibrary, - EE_ACTIONS::exportSymbolsToLibrary.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::ExportSymbolsToLibrary, - EE_ACTIONS::exportSymbolsToNewLibrary.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ExportSymbolsToLibrary, SCH_ACTIONS::exportSymbolsToLibrary.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::ExportSymbolsToLibrary, SCH_ACTIONS::exportSymbolsToNewLibrary.MakeEvent() ); } diff --git a/eeschema/tools/sch_editor_control.h b/eeschema/tools/sch_editor_control.h index 90510a202f..6e3b3558be 100644 --- a/eeschema/tools/sch_editor_control.h +++ b/eeschema/tools/sch_editor_control.h @@ -27,7 +27,7 @@ #define SCH_EDITOR_CONTROL_H #include -#include +#include #include class SCH_EDIT_FRAME; @@ -35,11 +35,11 @@ class SCH_EDIT_FRAME; /** * Handle actions specific to the schematic editor. */ -class SCH_EDITOR_CONTROL : public wxEvtHandler, public EE_TOOL_BASE +class SCH_EDITOR_CONTROL : public wxEvtHandler, public SCH_TOOL_BASE { public: SCH_EDITOR_CONTROL() : - EE_TOOL_BASE( "eeschema.EditorControl" ), + SCH_TOOL_BASE( "eeschema.EditorControl" ), m_probingPcbToSch( false ), m_pickerItem( nullptr ), m_duplicateIsHoverSelection( false ), diff --git a/eeschema/tools/sch_find_replace_tool.cpp b/eeschema/tools/sch_find_replace_tool.cpp index 89d4297289..a1778e3857 100644 --- a/eeschema/tools/sch_find_replace_tool.cpp +++ b/eeschema/tools/sch_find_replace_tool.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include diff --git a/eeschema/tools/sch_find_replace_tool.h b/eeschema/tools/sch_find_replace_tool.h index 9bbca0ad4b..b23d65540d 100644 --- a/eeschema/tools/sch_find_replace_tool.h +++ b/eeschema/tools/sch_find_replace_tool.h @@ -27,18 +27,18 @@ #define SCH_FIND_REPLACE_TOOL_H #include -#include +#include class SCH_EDIT_FRAME; /** * Handle actions specific to the schematic editor. */ -class SCH_FIND_REPLACE_TOOL : public wxEvtHandler, public EE_TOOL_BASE +class SCH_FIND_REPLACE_TOOL : public wxEvtHandler, public SCH_TOOL_BASE { public: SCH_FIND_REPLACE_TOOL() : - EE_TOOL_BASE( "eeschema.FindReplace" ), + SCH_TOOL_BASE( "eeschema.FindReplace" ), m_foundItemHighlighted( false ) { } diff --git a/eeschema/tools/ee_inspection_tool.cpp b/eeschema/tools/sch_inspection_tool.cpp similarity index 78% rename from eeschema/tools/ee_inspection_tool.cpp rename to eeschema/tools/sch_inspection_tool.cpp index d94feef297..86eac545e1 100644 --- a/eeschema/tools/ee_inspection_tool.cpp +++ b/eeschema/tools/sch_inspection_tool.cpp @@ -22,7 +22,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "tools/ee_inspection_tool.h" +#include "tools/sch_inspection_tool.h" #include #include @@ -33,9 +33,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -53,32 +53,32 @@ #include // for KiROUND -EE_INSPECTION_TOOL::EE_INSPECTION_TOOL() : - EE_TOOL_BASE( "eeschema.InspectionTool" ), m_busSyntaxHelp( nullptr ) +SCH_INSPECTION_TOOL::SCH_INSPECTION_TOOL() : + SCH_TOOL_BASE( "eeschema.InspectionTool" ), m_busSyntaxHelp( nullptr ) { } -bool EE_INSPECTION_TOOL::Init() +bool SCH_INSPECTION_TOOL::Init() { - EE_TOOL_BASE::Init(); + SCH_TOOL_BASE::Init(); // Add inspection actions to the selection tool menu // CONDITIONAL_MENU& selToolMenu = m_selectionTool->GetToolMenu().GetMenu(); - selToolMenu.AddItem( EE_ACTIONS::excludeMarker, EE_CONDITIONS::SingleNonExcludedMarker, 100 ); + selToolMenu.AddItem( SCH_ACTIONS::excludeMarker, SCH_CONDITIONS::SingleNonExcludedMarker, 100 ); selToolMenu.AddItem( ACTIONS::showDatasheet, - EE_CONDITIONS::SingleSymbol && EE_CONDITIONS::Idle, 220 ); + SCH_CONDITIONS::SingleSymbol && SCH_CONDITIONS::Idle, 220 ); return true; } -void EE_INSPECTION_TOOL::Reset( RESET_REASON aReason ) +void SCH_INSPECTION_TOOL::Reset( RESET_REASON aReason ) { - EE_TOOL_BASE::Reset( aReason ); + SCH_TOOL_BASE::Reset( aReason ); if( aReason == SUPERMODEL_RELOAD || aReason == RESET_REASON::SHUTDOWN ) { @@ -89,14 +89,14 @@ void EE_INSPECTION_TOOL::Reset( RESET_REASON aReason ) } -int EE_INSPECTION_TOOL::RunERC( const TOOL_EVENT& aEvent ) +int SCH_INSPECTION_TOOL::RunERC( const TOOL_EVENT& aEvent ) { ShowERCDialog(); return 0; } -void EE_INSPECTION_TOOL::ShowERCDialog() +void SCH_INSPECTION_TOOL::ShowERCDialog() { SCH_EDIT_FRAME* frame = dynamic_cast( m_frame ); @@ -120,7 +120,7 @@ void EE_INSPECTION_TOOL::ShowERCDialog() } -int EE_INSPECTION_TOOL::PrevMarker( const TOOL_EVENT& aEvent ) +int SCH_INSPECTION_TOOL::PrevMarker( const TOOL_EVENT& aEvent ) { SCH_EDIT_FRAME* frame = dynamic_cast( m_frame ); @@ -139,7 +139,7 @@ int EE_INSPECTION_TOOL::PrevMarker( const TOOL_EVENT& aEvent ) } -int EE_INSPECTION_TOOL::NextMarker( const TOOL_EVENT& aEvent ) +int SCH_INSPECTION_TOOL::NextMarker( const TOOL_EVENT& aEvent ) { SCH_EDIT_FRAME* frame = dynamic_cast( m_frame ); @@ -157,13 +157,13 @@ int EE_INSPECTION_TOOL::NextMarker( const TOOL_EVENT& aEvent ) } -int EE_INSPECTION_TOOL::CrossProbe( const TOOL_EVENT& aEvent ) +int SCH_INSPECTION_TOOL::CrossProbe( const TOOL_EVENT& aEvent ) { - EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + SCH_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); wxCHECK( selectionTool, 0 ); - EE_SELECTION& selection = selectionTool->GetSelection(); + SCH_SELECTION& selection = selectionTool->GetSelection(); if( selection.GetSize() == 1 && selection.Front()->Type() == SCH_MARKER_T ) { @@ -181,7 +181,7 @@ int EE_INSPECTION_TOOL::CrossProbe( const TOOL_EVENT& aEvent ) } -void EE_INSPECTION_TOOL::CrossProbe( const SCH_MARKER* aMarker ) +void SCH_INSPECTION_TOOL::CrossProbe( const SCH_MARKER* aMarker ) { SCH_EDIT_FRAME* frame = dynamic_cast( m_frame ); @@ -202,7 +202,7 @@ void EE_INSPECTION_TOOL::CrossProbe( const SCH_MARKER* aMarker ) } -wxString EE_INSPECTION_TOOL::InspectERCErrorMenuText( const std::shared_ptr& aERCItem ) +wxString SCH_INSPECTION_TOOL::InspectERCErrorMenuText( const std::shared_ptr& aERCItem ) { auto menuDescription = [&]( const TOOL_ACTION& aAction ) @@ -233,18 +233,18 @@ wxString EE_INSPECTION_TOOL::InspectERCErrorMenuText( const std::shared_ptrGetErrorCode() == ERCE_BUS_TO_NET_CONFLICT ) { - return menuDescription( EE_ACTIONS::showBusSyntaxHelp ); + return menuDescription( SCH_ACTIONS::showBusSyntaxHelp ); } else if( aERCItem->GetErrorCode() == ERCE_LIB_SYMBOL_MISMATCH ) { - return menuDescription( EE_ACTIONS::diffSymbol ); + return menuDescription( SCH_ACTIONS::diffSymbol ); } return wxEmptyString; } -void EE_INSPECTION_TOOL::InspectERCError( const std::shared_ptr& aERCItem ) +void SCH_INSPECTION_TOOL::InspectERCError( const std::shared_ptr& aERCItem ) { SCH_EDIT_FRAME* frame = dynamic_cast( m_frame ); @@ -254,7 +254,7 @@ void EE_INSPECTION_TOOL::InspectERCError( const std::shared_ptr& aERCIt if( aERCItem->GetErrorCode() == ERCE_BUS_TO_NET_CONFLICT ) { - m_toolMgr->RunAction( EE_ACTIONS::showBusSyntaxHelp ); + m_toolMgr->RunAction( SCH_ACTIONS::showBusSyntaxHelp ); } else if( aERCItem->GetErrorCode() == ERCE_LIB_SYMBOL_MISMATCH ) { @@ -264,11 +264,11 @@ void EE_INSPECTION_TOOL::InspectERCError( const std::shared_ptr& aERCIt } -int EE_INSPECTION_TOOL::ExcludeMarker( const TOOL_EVENT& aEvent ) +int SCH_INSPECTION_TOOL::ExcludeMarker( const TOOL_EVENT& aEvent ) { - EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - EE_SELECTION& selection = selTool->GetSelection(); - SCH_MARKER* marker = nullptr; + SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + SCH_SELECTION& selection = selTool->GetSelection(); + SCH_MARKER* marker = nullptr; if( selection.GetSize() == 1 && selection.Front()->Type() == SCH_MARKER_T ) marker = static_cast( selection.Front() ); @@ -301,7 +301,7 @@ int EE_INSPECTION_TOOL::ExcludeMarker( const TOOL_EVENT& aEvent ) extern void CheckLibSymbol( LIB_SYMBOL* aSymbol, std::vector& aMessages, int aGridForPins, UNITS_PROVIDER* aUnitsProvider ); -int EE_INSPECTION_TOOL::CheckSymbol( const TOOL_EVENT& aEvent ) +int SCH_INSPECTION_TOOL::CheckSymbol( const TOOL_EVENT& aEvent ) { LIB_SYMBOL* symbol = static_cast( m_frame )->GetCurSymbol(); @@ -331,7 +331,7 @@ int EE_INSPECTION_TOOL::CheckSymbol( const TOOL_EVENT& aEvent ) } -int EE_INSPECTION_TOOL::ShowBusSyntaxHelp( const TOOL_EVENT& aEvent ) +int SCH_INSPECTION_TOOL::ShowBusSyntaxHelp( const TOOL_EVENT& aEvent ) { if( m_busSyntaxHelp ) { @@ -345,13 +345,13 @@ int EE_INSPECTION_TOOL::ShowBusSyntaxHelp( const TOOL_EVENT& aEvent ) } -int EE_INSPECTION_TOOL::DiffSymbol( const TOOL_EVENT& aEvent ) +int SCH_INSPECTION_TOOL::DiffSymbol( const TOOL_EVENT& aEvent ) { SCH_EDIT_FRAME* schEditorFrame = dynamic_cast( m_frame ); wxCHECK( schEditorFrame, 0 ); - EE_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_SYMBOL_T } ); + SCH_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_SYMBOL_T } ); if( selection.Empty() ) { @@ -364,7 +364,7 @@ int EE_INSPECTION_TOOL::DiffSymbol( const TOOL_EVENT& aEvent ) } -void EE_INSPECTION_TOOL::DiffSymbol( SCH_SYMBOL* symbol ) +void SCH_INSPECTION_TOOL::DiffSymbol( SCH_SYMBOL* symbol ) { SCH_EDIT_FRAME* schEditorFrame = dynamic_cast( m_frame ); @@ -462,7 +462,7 @@ void EE_INSPECTION_TOOL::DiffSymbol( SCH_SYMBOL* symbol ) } -SYMBOL_DIFF_WIDGET* EE_INSPECTION_TOOL::constructDiffPanel( wxPanel* aParentPanel ) +SYMBOL_DIFF_WIDGET* SCH_INSPECTION_TOOL::constructDiffPanel( wxPanel* aParentPanel ) { wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL ); @@ -477,7 +477,7 @@ SYMBOL_DIFF_WIDGET* EE_INSPECTION_TOOL::constructDiffPanel( wxPanel* aParentPane } -int EE_INSPECTION_TOOL::RunSimulation( const TOOL_EVENT& aEvent ) +int SCH_INSPECTION_TOOL::RunSimulation( const TOOL_EVENT& aEvent ) { SIMULATOR_FRAME* simFrame = (SIMULATOR_FRAME*) m_frame->Kiway().Player( FRAME_SIMULATOR, true ); @@ -499,7 +499,7 @@ int EE_INSPECTION_TOOL::RunSimulation( const TOOL_EVENT& aEvent ) } -int EE_INSPECTION_TOOL::ShowDatasheet( const TOOL_EVENT& aEvent ) +int SCH_INSPECTION_TOOL::ShowDatasheet( const TOOL_EVENT& aEvent ) { wxString datasheet; EMBEDDED_FILES* files = nullptr; @@ -526,7 +526,7 @@ int EE_INSPECTION_TOOL::ShowDatasheet( const TOOL_EVENT& aEvent ) } else if( m_frame->IsType( FRAME_SCH ) ) { - EE_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_SYMBOL_T } ); + SCH_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_SYMBOL_T } ); if( selection.Empty() ) return 0; @@ -554,12 +554,12 @@ int EE_INSPECTION_TOOL::ShowDatasheet( const TOOL_EVENT& aEvent ) } -int EE_INSPECTION_TOOL::UpdateMessagePanel( const TOOL_EVENT& aEvent ) +int SCH_INSPECTION_TOOL::UpdateMessagePanel( const TOOL_EVENT& aEvent ) { - SYMBOL_EDIT_FRAME* symbolEditFrame = dynamic_cast( m_frame ); - SCH_EDIT_FRAME* schEditFrame = dynamic_cast( m_frame ); - EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - EE_SELECTION& selection = selTool->GetSelection(); + SYMBOL_EDIT_FRAME* symbolEditFrame = dynamic_cast( m_frame ); + SCH_EDIT_FRAME* schEditFrame = dynamic_cast( m_frame ); + SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + SCH_SELECTION& selection = selTool->GetSelection(); // Note: the symbol viewer manages its own message panel @@ -592,29 +592,29 @@ int EE_INSPECTION_TOOL::UpdateMessagePanel( const TOOL_EVENT& aEvent ) } -void EE_INSPECTION_TOOL::setTransitions() +void SCH_INSPECTION_TOOL::setTransitions() { - Go( &EE_INSPECTION_TOOL::RunERC, EE_ACTIONS::runERC.MakeEvent() ); - Go( &EE_INSPECTION_TOOL::PrevMarker, EE_ACTIONS::prevMarker.MakeEvent() ); - Go( &EE_INSPECTION_TOOL::NextMarker, EE_ACTIONS::nextMarker.MakeEvent() ); + Go( &SCH_INSPECTION_TOOL::RunERC, SCH_ACTIONS::runERC.MakeEvent() ); + Go( &SCH_INSPECTION_TOOL::PrevMarker, SCH_ACTIONS::prevMarker.MakeEvent() ); + Go( &SCH_INSPECTION_TOOL::NextMarker, SCH_ACTIONS::nextMarker.MakeEvent() ); // See note 1: - Go( &EE_INSPECTION_TOOL::CrossProbe, EVENTS::PointSelectedEvent ); - Go( &EE_INSPECTION_TOOL::CrossProbe, EVENTS::SelectedEvent ); - Go( &EE_INSPECTION_TOOL::ExcludeMarker, EE_ACTIONS::excludeMarker.MakeEvent() ); + Go( &SCH_INSPECTION_TOOL::CrossProbe, EVENTS::PointSelectedEvent ); + Go( &SCH_INSPECTION_TOOL::CrossProbe, EVENTS::SelectedEvent ); + Go( &SCH_INSPECTION_TOOL::ExcludeMarker, SCH_ACTIONS::excludeMarker.MakeEvent() ); - Go( &EE_INSPECTION_TOOL::CheckSymbol, EE_ACTIONS::checkSymbol.MakeEvent() ); - Go( &EE_INSPECTION_TOOL::DiffSymbol, EE_ACTIONS::diffSymbol.MakeEvent() ); - Go( &EE_INSPECTION_TOOL::RunSimulation, EE_ACTIONS::showSimulator.MakeEvent() ); - Go( &EE_INSPECTION_TOOL::ShowBusSyntaxHelp, EE_ACTIONS::showBusSyntaxHelp.MakeEvent() ); + Go( &SCH_INSPECTION_TOOL::CheckSymbol, SCH_ACTIONS::checkSymbol.MakeEvent() ); + Go( &SCH_INSPECTION_TOOL::DiffSymbol, SCH_ACTIONS::diffSymbol.MakeEvent() ); + Go( &SCH_INSPECTION_TOOL::RunSimulation, SCH_ACTIONS::showSimulator.MakeEvent() ); + Go( &SCH_INSPECTION_TOOL::ShowBusSyntaxHelp, SCH_ACTIONS::showBusSyntaxHelp.MakeEvent() ); - Go( &EE_INSPECTION_TOOL::ShowDatasheet, ACTIONS::showDatasheet.MakeEvent() ); + Go( &SCH_INSPECTION_TOOL::ShowDatasheet, ACTIONS::showDatasheet.MakeEvent() ); // Note 1: tUpdateMessagePanel is called by CrossProbe. So uncomment this line if // call to CrossProbe is modifiied - // Go( &EE_INSPECTION_TOOL::UpdateMessagePanel, EVENTS::SelectedEvent ); - Go( &EE_INSPECTION_TOOL::UpdateMessagePanel, EVENTS::UnselectedEvent ); - Go( &EE_INSPECTION_TOOL::UpdateMessagePanel, EVENTS::ClearedEvent ); - Go( &EE_INSPECTION_TOOL::UpdateMessagePanel, EVENTS::SelectedItemsModified ); + // Go( &SCH_INSPECTION_TOOL::UpdateMessagePanel, EVENTS::SelectedEvent ); + Go( &SCH_INSPECTION_TOOL::UpdateMessagePanel, EVENTS::UnselectedEvent ); + Go( &SCH_INSPECTION_TOOL::UpdateMessagePanel, EVENTS::ClearedEvent ); + Go( &SCH_INSPECTION_TOOL::UpdateMessagePanel, EVENTS::SelectedItemsModified ); } diff --git a/eeschema/tools/ee_inspection_tool.h b/eeschema/tools/sch_inspection_tool.h similarity index 89% rename from eeschema/tools/ee_inspection_tool.h rename to eeschema/tools/sch_inspection_tool.h index ebc2368d93..62b0245643 100644 --- a/eeschema/tools/ee_inspection_tool.h +++ b/eeschema/tools/sch_inspection_tool.h @@ -22,25 +22,25 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef EE_INSPECTION_TOOL_H -#define EE_INSPECTION_TOOL_H +#ifndef SCH_INSPECTION_TOOL_H +#define SCH_INSPECTION_TOOL_H -#include +#include #include #include -class EE_SELECTION_TOOL; +class SCH_SELECTION_TOOL; class SCH_BASE_FRAME; class DIALOG_ERC; class SYMBOL_DIFF_WIDGET; -class EE_INSPECTION_TOOL : public wxEvtHandler, public EE_TOOL_BASE +class SCH_INSPECTION_TOOL : public wxEvtHandler, public SCH_TOOL_BASE { public: - EE_INSPECTION_TOOL(); - ~EE_INSPECTION_TOOL() {} + SCH_INSPECTION_TOOL(); + ~SCH_INSPECTION_TOOL() {} /// @copydoc TOOL_INTERACTIVE::Init() bool Init() override; @@ -86,4 +86,4 @@ private: HTML_MESSAGE_BOX* m_busSyntaxHelp; }; -#endif /* EE_INSPECTION_TOOL_H */ +#endif /* SCH_INSPECTION_TOOL_H */ diff --git a/eeschema/tools/sch_line_wire_bus_tool.cpp b/eeschema/tools/sch_line_wire_bus_tool.cpp index 07dada7770..0c2bfbc8e7 100644 --- a/eeschema/tools/sch_line_wire_bus_tool.cpp +++ b/eeschema/tools/sch_line_wire_bus_tool.cpp @@ -56,10 +56,10 @@ #include #include #include -#include +#include #include -#include -#include +#include +#include using BUS_GETTER = std::function; @@ -169,8 +169,8 @@ static BUS_UNFOLD_PERSISTENT_SETTINGS busUnfoldPersistentSettings = { SCH_LINE_WIRE_BUS_TOOL::SCH_LINE_WIRE_BUS_TOOL() : - EE_TOOL_BASE( "eeschema.InteractiveDrawingLineWireBus" ), - m_inDrawingTool( false ) + SCH_TOOL_BASE( "eeschema.InteractiveDrawingLineWireBus" ), + m_inDrawingTool( false ) { m_busUnfold = {}; m_wires.reserve( 16 ); @@ -184,7 +184,7 @@ SCH_LINE_WIRE_BUS_TOOL::~SCH_LINE_WIRE_BUS_TOOL() bool SCH_LINE_WIRE_BUS_TOOL::Init() { - EE_TOOL_BASE::Init(); + SCH_TOOL_BASE::Init(); const auto busGetter = [this]() { @@ -203,14 +203,14 @@ bool SCH_LINE_WIRE_BUS_TOOL::Init() auto wireOrBusTool = [this]( const SELECTION& aSel ) { - return ( m_frame->IsCurrentTool( EE_ACTIONS::drawWire ) - || m_frame->IsCurrentTool( EE_ACTIONS::drawBus ) ); + return ( m_frame->IsCurrentTool( SCH_ACTIONS::drawWire ) + || m_frame->IsCurrentTool( SCH_ACTIONS::drawBus ) ); }; auto lineTool = [this]( const SELECTION& aSel ) { - return m_frame->IsCurrentTool( EE_ACTIONS::drawLines ); + return m_frame->IsCurrentTool( SCH_ACTIONS::drawLines ); }; auto belowRootSheetCondition = @@ -219,8 +219,8 @@ bool SCH_LINE_WIRE_BUS_TOOL::Init() return m_frame->GetCurrentSheet().Last() != &m_frame->Schematic().Root(); }; - auto busSelection = EE_CONDITIONS::MoreThan( 0 ) - && EE_CONDITIONS::OnlyTypes( { SCH_ITEM_LOCATE_BUS_T } ); + auto busSelection = SCH_CONDITIONS::MoreThan( 0 ) + && SCH_CONDITIONS::OnlyTypes( { SCH_ITEM_LOCATE_BUS_T } ); auto haveHighlight = [&]( const SELECTION& sel ) @@ -234,40 +234,40 @@ bool SCH_LINE_WIRE_BUS_TOOL::Init() // Build the tool menu // - ctxMenu.AddItem( EE_ACTIONS::clearHighlight, haveHighlight && EE_CONDITIONS::Idle, 1 ); - ctxMenu.AddSeparator( haveHighlight && EE_CONDITIONS::Idle, 1 ); + ctxMenu.AddItem( SCH_ACTIONS::clearHighlight, haveHighlight && SCH_CONDITIONS::Idle, 1 ); + ctxMenu.AddSeparator( haveHighlight && SCH_CONDITIONS::Idle, 1 ); ctxMenu.AddSeparator( 10 ); - ctxMenu.AddItem( EE_ACTIONS::drawWire, wireOrBusTool && EE_CONDITIONS::Idle, 10 ); - ctxMenu.AddItem( EE_ACTIONS::drawBus, wireOrBusTool && EE_CONDITIONS::Idle, 10 ); - ctxMenu.AddItem( EE_ACTIONS::drawLines, lineTool && EE_CONDITIONS::Idle, 10 ); + ctxMenu.AddItem( SCH_ACTIONS::drawWire, wireOrBusTool && SCH_CONDITIONS::Idle, 10 ); + ctxMenu.AddItem( SCH_ACTIONS::drawBus, wireOrBusTool && SCH_CONDITIONS::Idle, 10 ); + ctxMenu.AddItem( SCH_ACTIONS::drawLines, lineTool && SCH_CONDITIONS::Idle, 10 ); - ctxMenu.AddItem( EE_ACTIONS::undoLastSegment, EE_CONDITIONS::ShowAlways, 10 ); - ctxMenu.AddItem( EE_ACTIONS::switchSegmentPosture, EE_CONDITIONS::ShowAlways, 10 ); - ctxMenu.AddItem( ACTIONS::finishInteractive, IsDrawingLineWireOrBus, 10 ); + ctxMenu.AddItem( SCH_ACTIONS::undoLastSegment, SCH_CONDITIONS::ShowAlways, 10 ); + ctxMenu.AddItem( SCH_ACTIONS::switchSegmentPosture, SCH_CONDITIONS::ShowAlways, 10 ); + ctxMenu.AddItem( ACTIONS::finishInteractive, IsDrawingLineWireOrBus, 10 ); - ctxMenu.AddMenu( busUnfoldMenu.get(), EE_CONDITIONS::Idle, 10 ); + ctxMenu.AddMenu( busUnfoldMenu.get(), SCH_CONDITIONS::Idle, 10 ); ctxMenu.AddSeparator( 100 ); - ctxMenu.AddItem( EE_ACTIONS::placeJunction, wireOrBusTool && EE_CONDITIONS::Idle, 100 ); - ctxMenu.AddItem( EE_ACTIONS::placeLabel, wireOrBusTool && EE_CONDITIONS::Idle, 100 ); - ctxMenu.AddItem( EE_ACTIONS::placeClassLabel, wireOrBusTool && EE_CONDITIONS::Idle, 100 ); - ctxMenu.AddItem( EE_ACTIONS::placeGlobalLabel, wireOrBusTool && EE_CONDITIONS::Idle, 100 ); - ctxMenu.AddItem( EE_ACTIONS::placeHierLabel, wireOrBusTool && EE_CONDITIONS::Idle, 100 ); - ctxMenu.AddItem( EE_ACTIONS::breakWire, wireOrBusTool && EE_CONDITIONS::Idle, 100 ); - ctxMenu.AddItem( EE_ACTIONS::slice, ( wireOrBusTool || lineTool ) - && EE_CONDITIONS::Idle, 100 ); - ctxMenu.AddItem( EE_ACTIONS::leaveSheet, belowRootSheetCondition, 150 ); + ctxMenu.AddItem( SCH_ACTIONS::placeJunction, wireOrBusTool && SCH_CONDITIONS::Idle, 100 ); + ctxMenu.AddItem( SCH_ACTIONS::placeLabel, wireOrBusTool && SCH_CONDITIONS::Idle, 100 ); + ctxMenu.AddItem( SCH_ACTIONS::placeClassLabel, wireOrBusTool && SCH_CONDITIONS::Idle, 100 ); + ctxMenu.AddItem( SCH_ACTIONS::placeGlobalLabel, wireOrBusTool && SCH_CONDITIONS::Idle, 100 ); + ctxMenu.AddItem( SCH_ACTIONS::placeHierLabel, wireOrBusTool && SCH_CONDITIONS::Idle, 100 ); + ctxMenu.AddItem( SCH_ACTIONS::breakWire, wireOrBusTool && SCH_CONDITIONS::Idle, 100 ); + ctxMenu.AddItem( SCH_ACTIONS::slice, ( wireOrBusTool || lineTool ) + && SCH_CONDITIONS::Idle, 100 ); + ctxMenu.AddItem( SCH_ACTIONS::leaveSheet, belowRootSheetCondition, 150 ); ctxMenu.AddSeparator( 200 ); - ctxMenu.AddItem( EE_ACTIONS::selectNode, wireOrBusTool && EE_CONDITIONS::Idle, 200 ); - ctxMenu.AddItem( EE_ACTIONS::selectConnection, wireOrBusTool && EE_CONDITIONS::Idle, 200 ); + ctxMenu.AddItem( SCH_ACTIONS::selectNode, wireOrBusTool && SCH_CONDITIONS::Idle, 200 ); + ctxMenu.AddItem( SCH_ACTIONS::selectConnection, wireOrBusTool && SCH_CONDITIONS::Idle, 200 ); // Add bus unfolding to the selection tool // CONDITIONAL_MENU& selToolMenu = m_selectionTool->GetToolMenu().GetMenu(); - selToolMenu.AddMenu( selBusUnfoldMenu.get(), busSelection && EE_CONDITIONS::Idle, 100 ); + selToolMenu.AddMenu( selBusUnfoldMenu.get(), busSelection && SCH_CONDITIONS::Idle, 100 ); return true; } @@ -292,7 +292,7 @@ int SCH_LINE_WIRE_BUS_TOOL::DrawSegments( const TOOL_EVENT& aEvent ) const DRAW_SEGMENT_EVENT_PARAMS* params = aEvent.Parameter(); m_frame->PushTool( aEvent ); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); if( aEvent.HasPosition() ) { @@ -382,7 +382,7 @@ int SCH_LINE_WIRE_BUS_TOOL::UnfoldBus( const TOOL_EVENT& aEvent ) SCH_LINE* SCH_LINE_WIRE_BUS_TOOL::getBusForUnfolding() { - EE_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_ITEM_LOCATE_BUS_T } ); + SCH_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_ITEM_LOCATE_BUS_T } ); return static_cast( selection.Front() ); } @@ -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( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); 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( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); for( SCH_LINE* wire : m_wires ) delete wire; @@ -931,7 +931,7 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const TOOL_EVENT& aTool, int aType, m_view->AddToPreview( wire->Clone() ); } } - else if( evt->IsAction( &EE_ACTIONS::undoLastSegment ) + else if( evt->IsAction( &SCH_ACTIONS::undoLastSegment ) || evt->IsAction( &ACTIONS::doDelete ) || evt->IsAction( &ACTIONS::undo ) ) { @@ -975,7 +975,7 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const TOOL_EVENT& aTool, int aType, wxBell(); } } - else if( evt->IsAction( &EE_ACTIONS::switchSegmentPosture ) && m_wires.size() >= 2 ) + else if( evt->IsAction( &SCH_ACTIONS::switchSegmentPosture ) && m_wires.size() >= 2 ) { posture = !posture; @@ -1036,11 +1036,11 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const TOOL_EVENT& aTool, int aType, //------------------------------------------------------------------------ // Handle TOOL_ACTION special cases // - else if( evt->IsAction( &EE_ACTIONS::rotateCW ) || evt->IsAction( &EE_ACTIONS::rotateCCW ) ) + else if( evt->IsAction( &SCH_ACTIONS::rotateCW ) || evt->IsAction( &SCH_ACTIONS::rotateCCW ) ) { if( m_busUnfold.in_progress ) { - m_busUnfold.label->Rotate90( evt->IsAction( &EE_ACTIONS::rotateCW ) ); + m_busUnfold.label->Rotate90( evt->IsAction( &SCH_ACTIONS::rotateCW ) ); busUnfoldPersistentSettings.label_spin_style = m_busUnfold.label->GetSpinStyle(); m_toolMgr->PostAction( ACTIONS::refreshPreview ); @@ -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( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); SCH_SCREEN* screen = m_frame->GetScreen(); SCH_COMMIT commit( m_toolMgr ); @@ -1275,7 +1275,7 @@ void SCH_LINE_WIRE_BUS_TOOL::finishSegments() } -int SCH_LINE_WIRE_BUS_TOOL::TrimOverLappingWires( SCH_COMMIT* aCommit, EE_SELECTION* aSelection ) +int SCH_LINE_WIRE_BUS_TOOL::TrimOverLappingWires( SCH_COMMIT* aCommit, SCH_SELECTION* aSelection ) { SCHEMATIC* sch = getModel(); SCH_SCREEN* screen = sch->CurrentSheet().LastScreen(); @@ -1319,7 +1319,7 @@ int SCH_LINE_WIRE_BUS_TOOL::TrimOverLappingWires( SCH_COMMIT* aCommit, EE_SELECT } -int SCH_LINE_WIRE_BUS_TOOL::AddJunctionsIfNeeded( SCH_COMMIT* aCommit, EE_SELECTION* aSelection ) +int SCH_LINE_WIRE_BUS_TOOL::AddJunctionsIfNeeded( SCH_COMMIT* aCommit, SCH_SELECTION* aSelection ) { SCH_SCREEN* screen = m_frame->GetScreen(); @@ -1332,9 +1332,9 @@ int SCH_LINE_WIRE_BUS_TOOL::AddJunctionsIfNeeded( SCH_COMMIT* aCommit, EE_SELECT void SCH_LINE_WIRE_BUS_TOOL::setTransitions() { - Go( &SCH_LINE_WIRE_BUS_TOOL::DrawSegments, EE_ACTIONS::drawWire.MakeEvent() ); - Go( &SCH_LINE_WIRE_BUS_TOOL::DrawSegments, EE_ACTIONS::drawBus.MakeEvent() ); - Go( &SCH_LINE_WIRE_BUS_TOOL::DrawSegments, EE_ACTIONS::drawLines.MakeEvent() ); + Go( &SCH_LINE_WIRE_BUS_TOOL::DrawSegments, SCH_ACTIONS::drawWire.MakeEvent() ); + Go( &SCH_LINE_WIRE_BUS_TOOL::DrawSegments, SCH_ACTIONS::drawBus.MakeEvent() ); + Go( &SCH_LINE_WIRE_BUS_TOOL::DrawSegments, SCH_ACTIONS::drawLines.MakeEvent() ); - Go( &SCH_LINE_WIRE_BUS_TOOL::UnfoldBus, EE_ACTIONS::unfoldBus.MakeEvent() ); + Go( &SCH_LINE_WIRE_BUS_TOOL::UnfoldBus, SCH_ACTIONS::unfoldBus.MakeEvent() ); } diff --git a/eeschema/tools/sch_line_wire_bus_tool.h b/eeschema/tools/sch_line_wire_bus_tool.h index 8135703f17..1b19533f48 100644 --- a/eeschema/tools/sch_line_wire_bus_tool.h +++ b/eeschema/tools/sch_line_wire_bus_tool.h @@ -33,14 +33,14 @@ #include #include -#include +#include class TOOL_EVENT; class SCH_BUS_WIRE_ENTRY; class SCH_LABEL; class SCH_EDIT_FRAME; -class EE_SELECTION_TOOL; +class SCH_SELECTION_TOOL; /// Collection of data related to the bus unfolding tool @@ -70,7 +70,7 @@ struct DRAW_SEGMENT_EVENT_PARAMS * Tool responsible for drawing/placing items (symbols, wires, buses, labels, etc.) */ -class SCH_LINE_WIRE_BUS_TOOL : public EE_TOOL_BASE +class SCH_LINE_WIRE_BUS_TOOL : public SCH_TOOL_BASE { public: SCH_LINE_WIRE_BUS_TOOL(); @@ -88,12 +88,12 @@ public: /** * Handle the addition of junctions to a selection of objects */ - int AddJunctionsIfNeeded( SCH_COMMIT* aCommit, EE_SELECTION* aSelection ); + int AddJunctionsIfNeeded( SCH_COMMIT* aCommit, SCH_SELECTION* aSelection ); /** * Logic to remove wires when overlapping correct items */ - int TrimOverLappingWires( SCH_COMMIT* aCommit, EE_SELECTION* aSelection ); + int TrimOverLappingWires( SCH_COMMIT* aCommit, SCH_SELECTION* aSelection ); private: int doDrawSegments( const TOOL_EVENT& aTool, int aType, bool aQuitOnDraw ); diff --git a/eeschema/tools/sch_move_tool.cpp b/eeschema/tools/sch_move_tool.cpp index b709db1f2b..9cb727996e 100644 --- a/eeschema/tools/sch_move_tool.cpp +++ b/eeschema/tools/sch_move_tool.cpp @@ -28,9 +28,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include @@ -52,7 +52,7 @@ SCH_MOVE_TOOL::SCH_MOVE_TOOL() : - EE_TOOL_BASE( "eeschema.InteractiveMove" ), + SCH_TOOL_BASE( "eeschema.InteractiveMove" ), m_inMoveTool( false ), m_moveInProgress( false ), m_isDrag( false ), @@ -63,7 +63,7 @@ SCH_MOVE_TOOL::SCH_MOVE_TOOL() : bool SCH_MOVE_TOOL::Init() { - EE_TOOL_BASE::Init(); + SCH_TOOL_BASE::Init(); auto moveCondition = []( const SELECTION& aSel ) @@ -81,9 +81,9 @@ bool SCH_MOVE_TOOL::Init() // CONDITIONAL_MENU& selToolMenu = m_selectionTool->GetToolMenu().GetMenu(); - selToolMenu.AddItem( EE_ACTIONS::move, moveCondition, 150 ); - selToolMenu.AddItem( EE_ACTIONS::drag, moveCondition, 150 ); - selToolMenu.AddItem( EE_ACTIONS::alignToGrid, moveCondition, 150 ); + selToolMenu.AddItem( SCH_ACTIONS::move, moveCondition, 150 ); + selToolMenu.AddItem( SCH_ACTIONS::drag, moveCondition, 150 ); + selToolMenu.AddItem( SCH_ACTIONS::alignToGrid, moveCondition, 150 ); return true; } @@ -371,7 +371,7 @@ void SCH_MOVE_TOOL::orthoLineDrag( SCH_COMMIT* aCommit, SCH_LINE* line, const VE int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent ) { - m_isDrag = aEvent.IsAction( &EE_ACTIONS::drag ); + m_isDrag = aEvent.IsAction( &SCH_ACTIONS::drag ); if( SCH_COMMIT* commit = dynamic_cast( aEvent.Commit() ) ) { @@ -431,7 +431,7 @@ bool SCH_MOVE_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, SCH_COMMIT* aComm // And give it a kick so it doesn't have to wait for the first mouse movement // to refresh. - m_toolMgr->PostAction( EE_ACTIONS::restartMove ); + m_toolMgr->PostAction( SCH_ACTIONS::restartMove ); } } else @@ -448,7 +448,7 @@ bool SCH_MOVE_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, SCH_COMMIT* aComm REENTRANCY_GUARD guard( &m_inMoveTool ); - EE_SELECTION& userSelection = m_selectionTool->GetSelection(); + SCH_SELECTION& userSelection = m_selectionTool->GetSelection(); // If a single pin is selected, promote the move selection to its parent symbol if( userSelection.GetSize() == 1 ) @@ -469,9 +469,9 @@ bool SCH_MOVE_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, SCH_COMMIT* aComm // Be sure that there is at least one item that we can move. If there's no selection try // looking for the stuff under mouse cursor (i.e. Kicad old-style hover selection). - EE_SELECTION& selection = m_selectionTool->RequestSelection( EE_COLLECTOR::MovableItems, - true ); - bool unselect = selection.IsHover(); + SCH_SELECTION& selection = m_selectionTool->RequestSelection( SCH_COLLECTOR::MovableItems, + true ); + bool unselect = selection.IsHover(); // Keep an original copy of the starting points for cleanup after the move std::vector internalPoints; @@ -506,9 +506,9 @@ bool SCH_MOVE_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, SCH_COMMIT* aComm grid.SetSnap( !evt->Modifier( MD_SHIFT ) ); grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() ); - if( evt->IsAction( &EE_ACTIONS::restartMove ) - || evt->IsAction( &EE_ACTIONS::move ) - || evt->IsAction( &EE_ACTIONS::drag ) + if( evt->IsAction( &SCH_ACTIONS::restartMove ) + || evt->IsAction( &SCH_ACTIONS::move ) + || evt->IsAction( &SCH_ACTIONS::drag ) || evt->IsMotion() || evt->IsDrag( BUT_LEFT ) || evt->IsAction( &ACTIONS::refreshPreview ) ) @@ -649,7 +649,7 @@ bool SCH_MOVE_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, SCH_COMMIT* aComm // m_cursor = controls->GetCursorPosition(); - if( evt->IsAction( &EE_ACTIONS::restartMove ) ) + if( evt->IsAction( &SCH_ACTIONS::restartMove ) ) { wxASSERT_MSG( m_anchorPos, "Should be already set from previous cmd" ); } @@ -858,13 +858,13 @@ bool SCH_MOVE_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, SCH_COMMIT* aComm { wxBell(); } - else if( evt->IsAction( &EE_ACTIONS::rotateCW ) ) + else if( evt->IsAction( &SCH_ACTIONS::rotateCW ) ) { - m_toolMgr->RunSynchronousAction( EE_ACTIONS::rotateCW, aCommit ); + m_toolMgr->RunSynchronousAction( SCH_ACTIONS::rotateCW, aCommit ); } - else if( evt->IsAction( &EE_ACTIONS::rotateCCW ) ) + else if( evt->IsAction( &SCH_ACTIONS::rotateCCW ) ) { - m_toolMgr->RunSynchronousAction( EE_ACTIONS::rotateCCW, aCommit ); + m_toolMgr->RunSynchronousAction( SCH_ACTIONS::rotateCCW, aCommit ); } else if( evt->IsAction( &ACTIONS::increment ) ) { @@ -898,8 +898,8 @@ bool SCH_MOVE_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, SCH_COMMIT* aComm } } } - else if( evt->IsAction( &EE_ACTIONS::highlightNet ) - || evt->IsAction( &EE_ACTIONS::selectOnPCB ) ) + else if( evt->IsAction( &SCH_ACTIONS::highlightNet ) + || evt->IsAction( &SCH_ACTIONS::selectOnPCB ) ) { // These don't make any sense during a move. Eat them. } @@ -931,7 +931,7 @@ bool SCH_MOVE_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, SCH_COMMIT* aComm // Create a selection of original selection, drag selected/changed items, and new // bend lines for later before we clear them in the aCommit. We'll need these // to check for new junctions needed, etc. - EE_SELECTION selectionCopy( selection ); + SCH_SELECTION selectionCopy( selection ); for( SCH_LINE* line : m_newDragLines ) selectionCopy.Add( line ); @@ -1014,7 +1014,7 @@ bool SCH_MOVE_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, SCH_COMMIT* aComm item->ClearEditFlags(); if( unselect ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); else m_selectionTool->RebuildSelection(); // Schematic cleanup might have merged lines, etc. @@ -1651,7 +1651,7 @@ void SCH_MOVE_TOOL::moveItem( EDA_ITEM* aItem, const VECTOR2I& aDelta ) int SCH_MOVE_TOOL::AlignToGrid( const TOOL_EVENT& aEvent ) { EE_GRID_HELPER grid( m_toolMgr); - EE_SELECTION& selection = m_selectionTool->RequestSelection( EE_COLLECTOR::MovableItems ); + SCH_SELECTION& selection = m_selectionTool->RequestSelection( SCH_COLLECTOR::MovableItems ); GRID_HELPER_GRIDS selectionGrid = grid.GetSelectionGrid( selection ); SCH_COMMIT commit( m_toolMgr ); @@ -1840,9 +1840,9 @@ void SCH_MOVE_TOOL::clearNewDragLines() void SCH_MOVE_TOOL::setTransitions() { - Go( &SCH_MOVE_TOOL::Main, EE_ACTIONS::move.MakeEvent() ); - Go( &SCH_MOVE_TOOL::Main, EE_ACTIONS::drag.MakeEvent() ); - Go( &SCH_MOVE_TOOL::AlignToGrid, EE_ACTIONS::alignToGrid.MakeEvent() ); + Go( &SCH_MOVE_TOOL::Main, SCH_ACTIONS::move.MakeEvent() ); + Go( &SCH_MOVE_TOOL::Main, SCH_ACTIONS::drag.MakeEvent() ); + Go( &SCH_MOVE_TOOL::AlignToGrid, SCH_ACTIONS::alignToGrid.MakeEvent() ); } diff --git a/eeschema/tools/sch_move_tool.h b/eeschema/tools/sch_move_tool.h index 8524025916..2e4af10a2b 100644 --- a/eeschema/tools/sch_move_tool.h +++ b/eeschema/tools/sch_move_tool.h @@ -25,12 +25,12 @@ #ifndef KICAD_SCH_MOVE_TOOL_H #define KICAD_SCH_MOVE_TOOL_H -#include +#include #include class SCH_EDIT_FRAME; -class EE_SELECTION_TOOL; +class SCH_SELECTION_TOOL; struct SPECIAL_CASE_LABEL_INFO @@ -40,7 +40,7 @@ struct SPECIAL_CASE_LABEL_INFO }; -class SCH_MOVE_TOOL : public EE_TOOL_BASE +class SCH_MOVE_TOOL : public SCH_TOOL_BASE { public: SCH_MOVE_TOOL(); diff --git a/eeschema/tools/sch_navigate_tool.cpp b/eeschema/tools/sch_navigate_tool.cpp index a35c09bdac..936fe970fb 100644 --- a/eeschema/tools/sch_navigate_tool.cpp +++ b/eeschema/tools/sch_navigate_tool.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "eda_doc.h" @@ -123,7 +123,7 @@ int SCH_NAVIGATE_TOOL::Forward( const TOOL_EVENT& aEvent ) m_navIndex++; m_frame->GetToolManager()->RunAction( ACTIONS::cancelInteractive ); - m_frame->GetToolManager()->RunAction( EE_ACTIONS::clearSelection ); + m_frame->GetToolManager()->RunAction( SCH_ACTIONS::clearSelection ); m_frame->SetCurrentSheet( *m_navIndex ); m_frame->DisplayCurrentSheet(); @@ -144,7 +144,7 @@ int SCH_NAVIGATE_TOOL::Back( const TOOL_EVENT& aEvent ) m_navIndex--; m_frame->GetToolManager()->RunAction( ACTIONS::cancelInteractive ); - m_frame->GetToolManager()->RunAction( EE_ACTIONS::clearSelection ); + m_frame->GetToolManager()->RunAction( SCH_ACTIONS::clearSelection ); m_frame->SetCurrentSheet( *m_navIndex ); m_frame->DisplayCurrentSheet(); @@ -234,8 +234,8 @@ int SCH_NAVIGATE_TOOL::ChangeSheet( const TOOL_EVENT& aEvent ) int SCH_NAVIGATE_TOOL::EnterSheet( const TOOL_EVENT& aEvent ) { - EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - const EE_SELECTION& selection = selTool->RequestSelection( { SCH_SHEET_T } ); + SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + const SCH_SELECTION& selection = selTool->RequestSelection( { SCH_SHEET_T } ); if( selection.GetSize() == 1 ) { @@ -269,16 +269,16 @@ int SCH_NAVIGATE_TOOL::LeaveSheet( const TOOL_EVENT& aEvent ) void SCH_NAVIGATE_TOOL::setTransitions() { - Go( &SCH_NAVIGATE_TOOL::ChangeSheet, EE_ACTIONS::changeSheet.MakeEvent() ); - Go( &SCH_NAVIGATE_TOOL::EnterSheet, EE_ACTIONS::enterSheet.MakeEvent() ); - Go( &SCH_NAVIGATE_TOOL::LeaveSheet, EE_ACTIONS::leaveSheet.MakeEvent() ); + Go( &SCH_NAVIGATE_TOOL::ChangeSheet, SCH_ACTIONS::changeSheet.MakeEvent() ); + Go( &SCH_NAVIGATE_TOOL::EnterSheet, SCH_ACTIONS::enterSheet.MakeEvent() ); + Go( &SCH_NAVIGATE_TOOL::LeaveSheet, SCH_ACTIONS::leaveSheet.MakeEvent() ); - Go( &SCH_NAVIGATE_TOOL::Up, EE_ACTIONS::navigateUp.MakeEvent() ); - Go( &SCH_NAVIGATE_TOOL::Forward, EE_ACTIONS::navigateForward.MakeEvent() ); - Go( &SCH_NAVIGATE_TOOL::Back, EE_ACTIONS::navigateBack.MakeEvent() ); + Go( &SCH_NAVIGATE_TOOL::Up, SCH_ACTIONS::navigateUp.MakeEvent() ); + Go( &SCH_NAVIGATE_TOOL::Forward, SCH_ACTIONS::navigateForward.MakeEvent() ); + Go( &SCH_NAVIGATE_TOOL::Back, SCH_ACTIONS::navigateBack.MakeEvent() ); - Go( &SCH_NAVIGATE_TOOL::Previous, EE_ACTIONS::navigatePrevious.MakeEvent() ); - Go( &SCH_NAVIGATE_TOOL::Next, EE_ACTIONS::navigateNext.MakeEvent() ); + Go( &SCH_NAVIGATE_TOOL::Previous, SCH_ACTIONS::navigatePrevious.MakeEvent() ); + Go( &SCH_NAVIGATE_TOOL::Next, SCH_ACTIONS::navigateNext.MakeEvent() ); } @@ -297,7 +297,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( EE_ACTIONS::clearSelection ); + m_frame->GetToolManager()->RunAction( SCH_ACTIONS::clearSelection ); // Store the current zoom level into the current screen before switching m_frame->GetScreen()->m_LastZoomLevel = m_frame->GetCanvas()->GetView()->GetScale(); diff --git a/eeschema/tools/sch_navigate_tool.h b/eeschema/tools/sch_navigate_tool.h index a5ea47011b..6cacfc45e1 100644 --- a/eeschema/tools/sch_navigate_tool.h +++ b/eeschema/tools/sch_navigate_tool.h @@ -27,7 +27,7 @@ #define SCH_NAVIGATE_TOOL_H #include -#include +#include #include class SCH_EDIT_FRAME; @@ -35,10 +35,10 @@ class SCH_EDIT_FRAME; /** * Handle actions specific to the schematic editor. */ -class SCH_NAVIGATE_TOOL : public wxEvtHandler, public EE_TOOL_BASE +class SCH_NAVIGATE_TOOL : public wxEvtHandler, public SCH_TOOL_BASE { public: - SCH_NAVIGATE_TOOL() : EE_TOOL_BASE( "eeschema.NavigateTool" ) {} + SCH_NAVIGATE_TOOL() : SCH_TOOL_BASE( "eeschema.NavigateTool" ) {} ~SCH_NAVIGATE_TOOL() { } diff --git a/eeschema/tools/ee_point_editor.cpp b/eeschema/tools/sch_point_editor.cpp similarity index 94% rename from eeschema/tools/ee_point_editor.cpp rename to eeschema/tools/sch_point_editor.cpp index 1e14f9db1f..6f5bd19aba 100644 --- a/eeschema/tools/ee_point_editor.cpp +++ b/eeschema/tools/sch_point_editor.cpp @@ -22,7 +22,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "ee_point_editor.h" +#include "sch_point_editor.h" #include using namespace std::placeholders; @@ -35,8 +35,8 @@ using namespace std::placeholders; #include #include #include -#include -#include +#include +#include #include #include #include @@ -95,7 +95,8 @@ class LINE_POINT_EDIT_BEHAVIOR : public POINT_EDIT_BEHAVIOR { public: LINE_POINT_EDIT_BEHAVIOR( SCH_LINE& aLine, SCH_SCREEN& aScreen ) : - m_line( aLine ), m_screen( aScreen ) + m_line( aLine ), + m_screen( aScreen ) { } @@ -237,7 +238,9 @@ private: class BITMAP_POINT_EDIT_BEHAVIOR : public POINT_EDIT_BEHAVIOR { public: - BITMAP_POINT_EDIT_BEHAVIOR( SCH_BITMAP& aBitmap ) : m_bitmap( aBitmap ) {} + BITMAP_POINT_EDIT_BEHAVIOR( SCH_BITMAP& aBitmap ) : + m_bitmap( aBitmap ) + {} void MakePoints( EDIT_POINTS& aPoints ) override { @@ -434,7 +437,8 @@ class RECTANGLE_POINT_EDIT_BEHAVIOR : public POINT_EDIT_BEHAVIOR { public: RECTANGLE_POINT_EDIT_BEHAVIOR( SCH_SHAPE& aRect, EDA_DRAW_FRAME& aFrame ) : - m_rect( aRect ), m_frame( aFrame ) + m_rect( aRect ), + m_frame( aFrame ) { } @@ -744,7 +748,9 @@ private: class TEXTBOX_POINT_EDIT_BEHAVIOR : public POINT_EDIT_BEHAVIOR { public: - TEXTBOX_POINT_EDIT_BEHAVIOR( SCH_TEXTBOX& aTextbox ) : m_textbox( aTextbox ) {} + TEXTBOX_POINT_EDIT_BEHAVIOR( SCH_TEXTBOX& aTextbox ) : + m_textbox( aTextbox ) + {} void MakePoints( EDIT_POINTS& aPoints ) override { @@ -776,7 +782,9 @@ private: class SHEET_POINT_EDIT_BEHAVIOR : public POINT_EDIT_BEHAVIOR { public: - SHEET_POINT_EDIT_BEHAVIOR( SCH_SHEET& aSheet ) : m_sheet( aSheet ) {} + SHEET_POINT_EDIT_BEHAVIOR( SCH_SHEET& aSheet ) : + m_sheet( aSheet ) + {} void MakePoints( EDIT_POINTS& aPoints ) override { @@ -880,7 +888,7 @@ private: }; -void EE_POINT_EDITOR::makePointsAndBehavior( EDA_ITEM* aItem ) +void SCH_POINT_EDITOR::makePointsAndBehavior( EDA_ITEM* aItem ) { m_editBehavior = nullptr; m_editPoints = std::make_shared( aItem ); @@ -971,38 +979,38 @@ void EE_POINT_EDITOR::makePointsAndBehavior( EDA_ITEM* aItem ) } -EE_POINT_EDITOR::EE_POINT_EDITOR() : - EE_TOOL_BASE( "eeschema.PointEditor" ), - m_editedPoint( nullptr ), - m_inPointEditor( false ) +SCH_POINT_EDITOR::SCH_POINT_EDITOR() : + SCH_TOOL_BASE( "eeschema.PointEditor" ), + m_editedPoint( nullptr ), + m_inPointEditor( false ) { } -void EE_POINT_EDITOR::Reset( RESET_REASON aReason ) +void SCH_POINT_EDITOR::Reset( RESET_REASON aReason ) { - EE_TOOL_BASE::Reset( aReason ); + SCH_TOOL_BASE::Reset( aReason ); m_editPoints.reset(); m_editedPoint = nullptr; } -bool EE_POINT_EDITOR::Init() +bool SCH_POINT_EDITOR::Init() { - EE_TOOL_BASE::Init(); + SCH_TOOL_BASE::Init(); auto& menu = m_selectionTool->GetToolMenu().GetMenu(); - menu.AddItem( EE_ACTIONS::pointEditorAddCorner, - std::bind( &EE_POINT_EDITOR::addCornerCondition, this, _1 ) ); - menu.AddItem( EE_ACTIONS::pointEditorRemoveCorner, - std::bind( &EE_POINT_EDITOR::removeCornerCondition, this, _1 ) ); + menu.AddItem( SCH_ACTIONS::pointEditorAddCorner, + std::bind( &SCH_POINT_EDITOR::addCornerCondition, this, _1 ) ); + menu.AddItem( SCH_ACTIONS::pointEditorRemoveCorner, + std::bind( &SCH_POINT_EDITOR::removeCornerCondition, this, _1 ) ); return true; } -int EE_POINT_EDITOR::clearEditedPoints( const TOOL_EVENT& aEvent ) +int SCH_POINT_EDITOR::clearEditedPoints( const TOOL_EVENT& aEvent ) { setEditedPoint( nullptr ); @@ -1010,7 +1018,7 @@ int EE_POINT_EDITOR::clearEditedPoints( const TOOL_EVENT& aEvent ) } -void EE_POINT_EDITOR::updateEditedPoint( const TOOL_EVENT& aEvent ) +void SCH_POINT_EDITOR::updateEditedPoint( const TOOL_EVENT& aEvent ) { EDIT_POINT* point = m_editedPoint; @@ -1036,7 +1044,7 @@ void EE_POINT_EDITOR::updateEditedPoint( const TOOL_EVENT& aEvent ) } -int EE_POINT_EDITOR::Main( const TOOL_EVENT& aEvent ) +int SCH_POINT_EDITOR::Main( const TOOL_EVENT& aEvent ) { if( !m_selectionTool ) return 0; @@ -1054,12 +1062,10 @@ int EE_POINT_EDITOR::Main( const TOOL_EVENT& aEvent ) return 0; } - const EE_SELECTION& selection = m_selectionTool->GetSelection(); + const SCH_SELECTION& selection = m_selectionTool->GetSelection(); if( selection.Size() != 1 || !selection.Front()->IsType( pointEditorTypes ) ) - { return 0; - } // Wait till drawing tool is done if( selection.Front()->IsNew() ) @@ -1185,7 +1191,7 @@ int EE_POINT_EDITOR::Main( const TOOL_EVENT& aEvent ) } -void EE_POINT_EDITOR::updateParentItem( bool aSnapToGrid, SCH_COMMIT& aCommit ) const +void SCH_POINT_EDITOR::updateParentItem( bool aSnapToGrid, SCH_COMMIT& aCommit ) const { EDA_ITEM* item = m_editPoints->GetParent(); @@ -1205,7 +1211,7 @@ void EE_POINT_EDITOR::updateParentItem( bool aSnapToGrid, SCH_COMMIT& aCommit ) } -void EE_POINT_EDITOR::updatePoints() +void SCH_POINT_EDITOR::updatePoints() { if( !m_editPoints || !m_editBehavior ) return; @@ -1215,7 +1221,7 @@ void EE_POINT_EDITOR::updatePoints() } -void EE_POINT_EDITOR::setEditedPoint( EDIT_POINT* aPoint ) +void SCH_POINT_EDITOR::setEditedPoint( EDIT_POINT* aPoint ) { KIGFX::VIEW_CONTROLS* controls = getViewControls(); @@ -1237,7 +1243,7 @@ void EE_POINT_EDITOR::setEditedPoint( EDIT_POINT* aPoint ) } -bool EE_POINT_EDITOR::removeCornerCondition( const SELECTION& ) +bool SCH_POINT_EDITOR::removeCornerCondition( const SELECTION& ) { bool isRuleArea = false; @@ -1272,7 +1278,7 @@ bool EE_POINT_EDITOR::removeCornerCondition( const SELECTION& ) } -bool EE_POINT_EDITOR::addCornerCondition( const SELECTION& ) +bool SCH_POINT_EDITOR::addCornerCondition( const SELECTION& ) { if( !m_editPoints || !( m_editPoints->GetParent()->Type() == SCH_SHAPE_T @@ -1293,12 +1299,14 @@ bool EE_POINT_EDITOR::addCornerCondition( const SELECTION& ) } -int EE_POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent ) +int SCH_POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent ) { if( !m_editPoints || !( m_editPoints->GetParent()->Type() == SCH_SHAPE_T || m_editPoints->GetParent()->Type() == SCH_RULE_AREA_T ) ) + { return 0; + } SCH_SHAPE* shape = static_cast( m_editPoints->GetParent() ); SHAPE_LINE_CHAIN& poly = shape->GetPolyShape().Outline( 0 ); @@ -1336,7 +1344,7 @@ int EE_POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent ) } -int EE_POINT_EDITOR::removeCorner( const TOOL_EVENT& aEvent ) +int SCH_POINT_EDITOR::removeCorner( const TOOL_EVENT& aEvent ) { if( !m_editPoints || !m_editedPoint || !m_editPoints->GetParent()->IsType( { SCH_SHAPE_T, SCH_RULE_AREA_T } ) ) @@ -1380,22 +1388,22 @@ int EE_POINT_EDITOR::removeCorner( const TOOL_EVENT& aEvent ) } -int EE_POINT_EDITOR::modifiedSelection( const TOOL_EVENT& aEvent ) +int SCH_POINT_EDITOR::modifiedSelection( const TOOL_EVENT& aEvent ) { updatePoints(); return 0; } -void EE_POINT_EDITOR::setTransitions() +void SCH_POINT_EDITOR::setTransitions() { - Go( &EE_POINT_EDITOR::Main, EVENTS::PointSelectedEvent ); - Go( &EE_POINT_EDITOR::Main, EVENTS::SelectedEvent ); - Go( &EE_POINT_EDITOR::Main, ACTIONS::activatePointEditor.MakeEvent() ); - Go( &EE_POINT_EDITOR::addCorner, EE_ACTIONS::pointEditorAddCorner.MakeEvent() ); - Go( &EE_POINT_EDITOR::removeCorner, EE_ACTIONS::pointEditorRemoveCorner.MakeEvent() ); - Go( &EE_POINT_EDITOR::modifiedSelection, EVENTS::SelectedItemsModified ); - Go( &EE_POINT_EDITOR::clearEditedPoints, EVENTS::ClearedEvent ); + Go( &SCH_POINT_EDITOR::Main, EVENTS::PointSelectedEvent ); + Go( &SCH_POINT_EDITOR::Main, EVENTS::SelectedEvent ); + Go( &SCH_POINT_EDITOR::Main, ACTIONS::activatePointEditor.MakeEvent() ); + Go( &SCH_POINT_EDITOR::addCorner, SCH_ACTIONS::pointEditorAddCorner.MakeEvent() ); + Go( &SCH_POINT_EDITOR::removeCorner, SCH_ACTIONS::pointEditorRemoveCorner.MakeEvent() ); + Go( &SCH_POINT_EDITOR::modifiedSelection, EVENTS::SelectedItemsModified ); + Go( &SCH_POINT_EDITOR::clearEditedPoints, EVENTS::ClearedEvent ); } diff --git a/eeschema/tools/ee_point_editor.h b/eeschema/tools/sch_point_editor.h similarity index 94% rename from eeschema/tools/ee_point_editor.h rename to eeschema/tools/sch_point_editor.h index 99739e4d4a..d15a30fd83 100644 --- a/eeschema/tools/ee_point_editor.h +++ b/eeschema/tools/sch_point_editor.h @@ -22,14 +22,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef EE_POINT_EDITOR_H -#define EE_POINT_EDITOR_H +#ifndef SCH_POINT_EDITOR_H +#define SCH_POINT_EDITOR_H -#include +#include #include #include -class EE_SELECTION_TOOL; +class SCH_SELECTION_TOOL; class POINT_EDIT_BEHAVIOR; class SCH_BASE_FRAME; class SCH_COMMIT; @@ -37,10 +37,10 @@ class SCH_COMMIT; /** * Tool that displays edit points allowing to modify items by dragging the points. */ -class EE_POINT_EDITOR : public EE_TOOL_BASE +class SCH_POINT_EDITOR : public SCH_TOOL_BASE { public: - EE_POINT_EDITOR(); + SCH_POINT_EDITOR(); /// @copydoc TOOL_INTERACTIVE::Reset() void Reset( RESET_REASON aReason ) override; @@ -123,4 +123,4 @@ private: std::unique_ptr m_editBehavior; }; -#endif // EE_POINT_EDITOR_H +#endif // SCH_POINT_EDITOR_H diff --git a/eeschema/tools/ee_selection.cpp b/eeschema/tools/sch_selection.cpp similarity index 92% rename from eeschema/tools/ee_selection.cpp rename to eeschema/tools/sch_selection.cpp index 06891d514f..e6b82b73ab 100644 --- a/eeschema/tools/ee_selection.cpp +++ b/eeschema/tools/sch_selection.cpp @@ -22,7 +22,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include +#include #include #include #include @@ -30,14 +30,14 @@ #include -EE_SELECTION::EE_SELECTION( SCH_SCREEN* aScreen ) : - SELECTION() +SCH_SELECTION::SCH_SELECTION( SCH_SCREEN* aScreen ) : + SELECTION() { m_screen = aScreen; } -EDA_ITEM* EE_SELECTION::GetTopLeftItem( bool onlyModules ) const +EDA_ITEM* SCH_SELECTION::GetTopLeftItem( bool onlyModules ) const { EDA_ITEM* topLeftConnectedItem = nullptr; VECTOR2I topLeftConnectedPos; @@ -82,7 +82,7 @@ EDA_ITEM* EE_SELECTION::GetTopLeftItem( bool onlyModules ) const } -BOX2I EE_SELECTION::GetBoundingBox() const +BOX2I SCH_SELECTION::GetBoundingBox() const { BOX2I bbox; @@ -115,7 +115,7 @@ BOX2I EE_SELECTION::GetBoundingBox() const } -const std::vector EE_SELECTION::updateDrawList() const +const std::vector SCH_SELECTION::updateDrawList() const { std::vector items; diff --git a/eeschema/tools/ee_selection.h b/eeschema/tools/sch_selection.h similarity index 91% rename from eeschema/tools/ee_selection.h rename to eeschema/tools/sch_selection.h index d20b6b4f06..9c91093035 100644 --- a/eeschema/tools/ee_selection.h +++ b/eeschema/tools/sch_selection.h @@ -22,8 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef EE_SELECTION_H -#define EE_SELECTION_H +#ifndef SCH_SELECTION_H +#define SCH_SELECTION_H class SCH_REFERENCE_LIST; class SCH_SCREEN; @@ -34,7 +34,7 @@ class SCH_SHEET_PATH; #include // SCH_MULTI_UNIT_REFERENCE_MAP -class EE_SELECTION : public SELECTION +class SCH_SELECTION : public SELECTION { /** * Screen of selected objects. Used to fetch library symbols for copy. @@ -42,7 +42,7 @@ class EE_SELECTION : public SELECTION SCH_SCREEN* m_screen; public: - EE_SELECTION( SCH_SCREEN* aScreen = nullptr ); + SCH_SELECTION( SCH_SCREEN* aScreen = nullptr ); EDA_ITEM* GetTopLeftItem( bool onlyModules = false ) const override; @@ -54,4 +54,4 @@ public: const std::vector updateDrawList() const override; }; -#endif // EE_SELECTION_H +#endif // SCH_SELECTION_H diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/sch_selection_tool.cpp similarity index 88% rename from eeschema/tools/ee_selection_tool.cpp rename to eeschema/tools/sch_selection_tool.cpp index f7f7e8c763..c517be750f 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/sch_selection_tool.cpp @@ -27,9 +27,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -37,26 +37,18 @@ #include #include #include -#include #include -#include -#include #include -#include #include #include #include #include -#include -#include #include #include -#include -#include #include #include #include -#include +#include #include #include #include @@ -67,7 +59,7 @@ #include "symb_transforms_utils.h" -SELECTION_CONDITION EE_CONDITIONS::SingleSymbol = []( const SELECTION& aSel ) +SELECTION_CONDITION SCH_CONDITIONS::SingleSymbol = []( const SELECTION& aSel ) { if( aSel.GetSize() == 1 ) { @@ -81,13 +73,13 @@ SELECTION_CONDITION EE_CONDITIONS::SingleSymbol = []( const SELECTION& aSel ) }; -SELECTION_CONDITION EE_CONDITIONS::SingleSymbolOrPower = []( const SELECTION& aSel ) +SELECTION_CONDITION SCH_CONDITIONS::SingleSymbolOrPower = []( const SELECTION& aSel ) { return aSel.GetSize() == 1 && aSel.Front()->Type() == SCH_SYMBOL_T; }; -SELECTION_CONDITION EE_CONDITIONS::SingleDeMorganSymbol = []( const SELECTION& aSel ) +SELECTION_CONDITION SCH_CONDITIONS::SingleDeMorganSymbol = []( const SELECTION& aSel ) { if( aSel.GetSize() == 1 ) { @@ -101,7 +93,7 @@ SELECTION_CONDITION EE_CONDITIONS::SingleDeMorganSymbol = []( const SELECTION& a }; -SELECTION_CONDITION EE_CONDITIONS::SingleMultiUnitSymbol = []( const SELECTION& aSel ) +SELECTION_CONDITION SCH_CONDITIONS::SingleMultiUnitSymbol = []( const SELECTION& aSel ) { if( aSel.GetSize() == 1 ) { @@ -115,7 +107,7 @@ SELECTION_CONDITION EE_CONDITIONS::SingleMultiUnitSymbol = []( const SELECTION& }; -SELECTION_CONDITION EE_CONDITIONS::SingleMultiFunctionPin = []( const SELECTION& aSel ) +SELECTION_CONDITION SCH_CONDITIONS::SingleMultiFunctionPin = []( const SELECTION& aSel ) { if( aSel.GetSize() == 1 ) { @@ -129,7 +121,7 @@ SELECTION_CONDITION EE_CONDITIONS::SingleMultiFunctionPin = []( const SELECTION& }; -SELECTION_CONDITION EE_CONDITIONS::SingleNonExcludedMarker = []( const SELECTION& aSel ) +SELECTION_CONDITION SCH_CONDITIONS::SingleNonExcludedMarker = []( const SELECTION& aSel ) { if( aSel.CountType( SCH_MARKER_T ) != 1 ) return false; @@ -138,19 +130,19 @@ SELECTION_CONDITION EE_CONDITIONS::SingleNonExcludedMarker = []( const SELECTION }; -SELECTION_CONDITION EE_CONDITIONS::MultipleSymbolsOrPower = []( const SELECTION& aSel ) +SELECTION_CONDITION SCH_CONDITIONS::MultipleSymbolsOrPower = []( const SELECTION& aSel ) { return aSel.GetSize() > 1 && aSel.OnlyContains( { SCH_SYMBOL_T } ); }; -SELECTION_CONDITION EE_CONDITIONS::AllPins = []( const SELECTION& aSel ) +SELECTION_CONDITION SCH_CONDITIONS::AllPins = []( const SELECTION& aSel ) { return aSel.GetSize() >= 1 && aSel.OnlyContains( { SCH_PIN_T } ); }; -SELECTION_CONDITION EE_CONDITIONS::AllPinsOrSheetPins = []( const SELECTION& aSel ) +SELECTION_CONDITION SCH_CONDITIONS::AllPinsOrSheetPins = []( const SELECTION& aSel ) { return aSel.GetSize() >= 1 && aSel.OnlyContains( { SCH_PIN_T, SCH_SHEET_PIN_T } ); }; @@ -159,7 +151,7 @@ SELECTION_CONDITION EE_CONDITIONS::AllPinsOrSheetPins = []( const SELECTION& aSe #define HITTEST_THRESHOLD_PIXELS 5 -EE_SELECTION_TOOL::EE_SELECTION_TOOL() : +SCH_SELECTION_TOOL::SCH_SELECTION_TOOL() : SELECTION_TOOL( "eeschema.InteractiveSelection" ), m_frame( nullptr ), m_nonModifiedCursor( KICURSOR::ARROW ), @@ -173,15 +165,12 @@ EE_SELECTION_TOOL::EE_SELECTION_TOOL() : } -EE_SELECTION_TOOL::~EE_SELECTION_TOOL() +SCH_SELECTION_TOOL::~SCH_SELECTION_TOOL() { getView()->Remove( &m_selection ); } -using E_C = EE_CONDITIONS; - - static std::vector connectedTypes = { SCH_SYMBOL_LOCATE_POWER_T, @@ -215,7 +204,7 @@ static std::vector lineTypes = { SCH_LINE_T }; static std::vector sheetTypes = { SCH_SHEET_T }; static std::vector tableCellTypes = { SCH_TABLECELL_T }; -bool EE_SELECTION_TOOL::Init() +bool SCH_SELECTION_TOOL::Init() { m_frame = getEditFrame(); @@ -233,12 +222,14 @@ bool EE_SELECTION_TOOL::Init() m_isSymbolViewer = symbolViewerFrame != nullptr; } - auto linesSelection = E_C::MoreThan( 0 ) && E_C::OnlyTypes( lineTypes ); - auto wireOrBusSelection = E_C::Count( 1 ) && E_C::OnlyTypes( connectedLineTypes ); - auto connectedSelection = E_C::Count( 1 ) && E_C::OnlyTypes( connectedTypes ); - auto sheetSelection = E_C::Count( 1 ) && E_C::OnlyTypes( sheetTypes ); - auto crossProbingSelection = E_C::MoreThan( 0 ) && E_C::HasTypes( crossProbingTypes ); - auto tableCellSelection = E_C::MoreThan( 0 ) && E_C::OnlyTypes( tableCellTypes ); + // clang-format off + auto linesSelection = SCH_CONDITIONS::MoreThan( 0 ) && SCH_CONDITIONS::OnlyTypes( lineTypes ); + auto wireOrBusSelection = SCH_CONDITIONS::Count( 1 ) && SCH_CONDITIONS::OnlyTypes( connectedLineTypes ); + auto connectedSelection = SCH_CONDITIONS::Count( 1 ) && SCH_CONDITIONS::OnlyTypes( connectedTypes ); + auto sheetSelection = SCH_CONDITIONS::Count( 1 ) && SCH_CONDITIONS::OnlyTypes( sheetTypes ); + auto crossProbingSelection = SCH_CONDITIONS::MoreThan( 0 ) && SCH_CONDITIONS::HasTypes( crossProbingTypes ); + auto tableCellSelection = SCH_CONDITIONS::MoreThan( 0 ) && SCH_CONDITIONS::OnlyTypes( tableCellTypes ); + // clang-format on auto schEditSheetPageNumberCondition = [&] ( const SELECTION& aSel ) @@ -246,7 +237,8 @@ bool EE_SELECTION_TOOL::Init() if( m_isSymbolEditor || m_isSymbolViewer ) return false; - return E_C::LessThan( 2 )( aSel ) && E_C::OnlyTypes( sheetTypes )( aSel ); + return SCH_CONDITIONS::LessThan( 2 )( aSel ) + && SCH_CONDITIONS::OnlyTypes( sheetTypes )( aSel ); }; auto schEditCondition = @@ -296,58 +288,57 @@ bool EE_SELECTION_TOOL::Init() auto& menu = m_menu->GetMenu(); - menu.AddItem( EE_ACTIONS::clearHighlight, haveHighlight && EE_CONDITIONS::Idle, 1 ); - menu.AddSeparator( haveHighlight && EE_CONDITIONS::Idle, 1 ); + // clang-format off + menu.AddItem( SCH_ACTIONS::clearHighlight, haveHighlight && SCH_CONDITIONS::Idle, 1 ); + menu.AddSeparator( haveHighlight && SCH_CONDITIONS::Idle, 1 ); - menu.AddItem( ACTIONS::selectColumns, tableCellSelection && EE_CONDITIONS::Idle, 2 ); - menu.AddItem( ACTIONS::selectRows, tableCellSelection && EE_CONDITIONS::Idle, 2 ); - menu.AddItem( ACTIONS::selectTable, tableCellSelection && EE_CONDITIONS::Idle, 2 ); + menu.AddItem( ACTIONS::selectColumns, tableCellSelection && SCH_CONDITIONS::Idle, 2 ); + menu.AddItem( ACTIONS::selectRows, tableCellSelection && SCH_CONDITIONS::Idle, 2 ); + menu.AddItem( ACTIONS::selectTable, tableCellSelection && SCH_CONDITIONS::Idle, 2 ); menu.AddSeparator( 100 ); - menu.AddItem( EE_ACTIONS::drawWire, schEditCondition && EE_CONDITIONS::Empty, 100 ); - menu.AddItem( EE_ACTIONS::drawBus, schEditCondition && EE_CONDITIONS::Empty, 100 ); + menu.AddItem( SCH_ACTIONS::drawWire, schEditCondition && SCH_CONDITIONS::Empty, 100 ); + menu.AddItem( SCH_ACTIONS::drawBus, schEditCondition && SCH_CONDITIONS::Empty, 100 ); menu.AddSeparator( 100 ); - menu.AddItem( ACTIONS::finishInteractive, - SCH_LINE_WIRE_BUS_TOOL::IsDrawingLineWireOrBus, 100 ); + menu.AddItem( ACTIONS::finishInteractive, SCH_LINE_WIRE_BUS_TOOL::IsDrawingLineWireOrBus, 100 ); - menu.AddItem( EE_ACTIONS::enterSheet, sheetSelection && EE_CONDITIONS::Idle, 150 ); - menu.AddItem( EE_ACTIONS::selectOnPCB, - crossProbingSelection && schEditCondition && EE_CONDITIONS::Idle, 150 ); - menu.AddItem( EE_ACTIONS::leaveSheet, belowRootSheetCondition, 150 ); + menu.AddItem( SCH_ACTIONS::enterSheet, sheetSelection && SCH_CONDITIONS::Idle, 150 ); + menu.AddItem( SCH_ACTIONS::selectOnPCB, crossProbingSelection && schEditCondition && SCH_CONDITIONS::Idle, 150 ); + menu.AddItem( SCH_ACTIONS::leaveSheet, belowRootSheetCondition, 150 ); menu.AddSeparator( 200 ); - menu.AddItem( EE_ACTIONS::placeJunction, wireOrBusSelection && EE_CONDITIONS::Idle, 250 ); - menu.AddItem( EE_ACTIONS::placeLabel, wireOrBusSelection && EE_CONDITIONS::Idle, 250 ); - menu.AddItem( EE_ACTIONS::placeClassLabel, wireOrBusSelection && EE_CONDITIONS::Idle, 250 ); - menu.AddItem( EE_ACTIONS::placeGlobalLabel, wireOrBusSelection && EE_CONDITIONS::Idle, 250 ); - menu.AddItem( EE_ACTIONS::placeHierLabel, wireOrBusSelection && EE_CONDITIONS::Idle, 250 ); - menu.AddItem( EE_ACTIONS::breakWire, linesSelection && EE_CONDITIONS::Idle, 250 ); - menu.AddItem( EE_ACTIONS::slice, linesSelection && EE_CONDITIONS::Idle, 250 ); - menu.AddItem( EE_ACTIONS::placeSheetPin, sheetSelection && EE_CONDITIONS::Idle, 250 ); - menu.AddItem( EE_ACTIONS::autoplaceAllSheetPins, sheetSelection && EE_CONDITIONS::Idle, 250 ); - menu.AddItem( EE_ACTIONS::syncSheetPins, sheetSelection && EE_CONDITIONS::Idle, 250 ); - menu.AddItem( EE_ACTIONS::assignNetclass, connectedSelection && EE_CONDITIONS::Idle, 250 ); - menu.AddItem( EE_ACTIONS::editPageNumber, schEditSheetPageNumberCondition, 250 ); + menu.AddItem( SCH_ACTIONS::placeJunction, wireOrBusSelection && SCH_CONDITIONS::Idle, 250 ); + menu.AddItem( SCH_ACTIONS::placeLabel, wireOrBusSelection && SCH_CONDITIONS::Idle, 250 ); + menu.AddItem( SCH_ACTIONS::placeClassLabel, wireOrBusSelection && SCH_CONDITIONS::Idle, 250 ); + menu.AddItem( SCH_ACTIONS::placeGlobalLabel, wireOrBusSelection && SCH_CONDITIONS::Idle, 250 ); + menu.AddItem( SCH_ACTIONS::placeHierLabel, wireOrBusSelection && SCH_CONDITIONS::Idle, 250 ); + menu.AddItem( SCH_ACTIONS::breakWire, linesSelection && SCH_CONDITIONS::Idle, 250 ); + menu.AddItem( SCH_ACTIONS::slice, linesSelection && SCH_CONDITIONS::Idle, 250 ); + menu.AddItem( SCH_ACTIONS::placeSheetPin, sheetSelection && SCH_CONDITIONS::Idle, 250 ); + menu.AddItem( SCH_ACTIONS::autoplaceAllSheetPins, sheetSelection && SCH_CONDITIONS::Idle, 250 ); + menu.AddItem( SCH_ACTIONS::syncSheetPins, sheetSelection && SCH_CONDITIONS::Idle, 250 ); + menu.AddItem( SCH_ACTIONS::assignNetclass, connectedSelection && SCH_CONDITIONS::Idle, 250 ); + menu.AddItem( SCH_ACTIONS::editPageNumber, schEditSheetPageNumberCondition, 250 ); menu.AddSeparator( 400 ); - menu.AddItem( EE_ACTIONS::symbolProperties, haveSymbol && EE_CONDITIONS::Empty, 400 ); - menu.AddItem( EE_ACTIONS::pinTable, haveSymbol && EE_CONDITIONS::Empty, 400 ); - menu.AddItem( EE_ACTIONS::setUnitDisplayName, - haveSymbol && symbolDisplayNameIsEditable && EE_CONDITIONS::Empty, 400 ); + menu.AddItem( SCH_ACTIONS::symbolProperties, haveSymbol && SCH_CONDITIONS::Empty, 400 ); + menu.AddItem( SCH_ACTIONS::pinTable, haveSymbol && SCH_CONDITIONS::Empty, 400 ); + menu.AddItem( SCH_ACTIONS::setUnitDisplayName, haveSymbol && symbolDisplayNameIsEditable && SCH_CONDITIONS::Empty, 400 ); menu.AddSeparator( 1000 ); m_frame->AddStandardSubMenus( *m_menu.get() ); + // clang-format on m_disambiguateTimer.SetOwner( this ); - Connect( wxEVT_TIMER, wxTimerEventHandler( EE_SELECTION_TOOL::onDisambiguationExpire ), + Connect( wxEVT_TIMER, wxTimerEventHandler( SCH_SELECTION_TOOL::onDisambiguationExpire ), nullptr, this ); return true; } -void EE_SELECTION_TOOL::Reset( RESET_REASON aReason ) +void SCH_SELECTION_TOOL::Reset( RESET_REASON aReason ) { m_frame = getEditFrame(); @@ -386,7 +377,7 @@ void EE_SELECTION_TOOL::Reset( RESET_REASON aReason ) } -int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) +int SCH_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) { m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW ); @@ -450,8 +441,8 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) { // Avoid triggering when running under other tools } - else if( m_toolMgr->GetTool() - && m_toolMgr->GetTool()->HasPoint() ) + else if( m_toolMgr->GetTool() + && m_toolMgr->GetTool()->HasPoint() ) { // Distinguish point editor from selection modification by checking modifiers if( hasModifier() ) @@ -483,7 +474,7 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) schframe->FocusOnItem( nullptr ); // Collect items at the clicked location (doesn't select them yet) - EE_COLLECTOR collector; + SCH_COLLECTOR collector; CollectHits( collector, evt->Position() ); narrowSelection( collector, evt->Position(), false ); @@ -547,7 +538,7 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) else if( !m_selection.GetBoundingBox().Inflate( grid.GetGrid().x, grid.GetGrid().y ) .Contains( evt->Position() ) ) { - EE_COLLECTOR collector; + SCH_COLLECTOR collector; if( CollectHits( collector, evt->Position(), { SCH_LOCATE_ANY_T } ) ) { @@ -575,9 +566,9 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) EDA_ITEM* item = m_selection.Front(); if( item && item->Type() == SCH_SHEET_T ) - m_toolMgr->PostAction( EE_ACTIONS::enterSheet ); + m_toolMgr->PostAction( SCH_ACTIONS::enterSheet ); else - m_toolMgr->PostAction( EE_ACTIONS::properties ); + m_toolMgr->PostAction( SCH_ACTIONS::properties ); } else if( evt->IsDblClick( BUT_MIDDLE ) ) { @@ -605,11 +596,11 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) if( SCH_EDIT_FRAME* schframe = dynamic_cast( m_frame ) ) schframe->FocusOnItem( nullptr ); - EE_COLLECTOR collector; + SCH_COLLECTOR collector; if( m_selection.GetSize() == 1 && dynamic_cast( m_selection.GetItem( 0 ) ) ) { - m_toolMgr->RunAction( EE_ACTIONS::move ); + m_toolMgr->RunAction( SCH_ACTIONS::move ); } else if( CollectHits( collector, evt->DragOrigin(), { SCH_TABLECELL_T } ) ) { @@ -642,7 +633,7 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) } else { - m_selection = RequestSelection( EE_COLLECTOR::MovableItems ); + m_selection = RequestSelection( SCH_COLLECTOR::MovableItems ); } // Check if dragging has started within any of selected items bounding box @@ -651,9 +642,9 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) // drag_is_move option exists only in schematic editor, not in symbol editor // (m_frame->eeconfig() returns nullptr in Symbol Editor) if( m_isSymbolEditor || m_frame->eeconfig()->m_Input.drag_is_move ) - m_toolMgr->RunAction( EE_ACTIONS::move ); + m_toolMgr->RunAction( SCH_ACTIONS::move ); else - m_toolMgr->RunAction( EE_ACTIONS::drag ); + m_toolMgr->RunAction( SCH_ACTIONS::drag ); } else { @@ -664,11 +655,11 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) } else if( evt->IsMouseDown( BUT_AUX1 ) ) { - m_toolMgr->RunAction( EE_ACTIONS::navigateBack ); + m_toolMgr->RunAction( SCH_ACTIONS::navigateBack ); } else if( evt->IsMouseDown( BUT_AUX2 ) ) { - m_toolMgr->RunAction( EE_ACTIONS::navigateForward ); + m_toolMgr->RunAction( SCH_ACTIONS::navigateForward ); } else if( evt->Action() == TA_MOUSE_WHEEL ) { @@ -807,7 +798,7 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) vc->WarpMouseCursor( vc->GetCursorPosition(), true ); // Start the drag tool, canceling will remove the wires - if( m_toolMgr->RunSynchronousAction( EE_ACTIONS::drag, &commit, false ) ) + if( m_toolMgr->RunSynchronousAction( SCH_ACTIONS::drag, &commit, false ) ) commit.Push( wxS( "Wire Pins" ) ); else commit.Revert(); @@ -936,7 +927,7 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) && *evt->GetCommandId() <= ID_POPUP_SCH_UNFOLD_BUS_END ) { wxString* net = new wxString( *evt->Parameter() ); - m_toolMgr->RunAction( EE_ACTIONS::unfoldBus, net ); + m_toolMgr->RunAction( SCH_ACTIONS::unfoldBus, net ); } } else if( evt->IsCancelInteractive() ) @@ -972,7 +963,7 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) { // Update cursor and rollover item rolloverItem = niluuid; - EE_COLLECTOR collector; + SCH_COLLECTOR collector; getViewControls()->ForceCursorPosition( false ); @@ -986,11 +977,11 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) if( autostartEvt ) { - if( autostartEvt->Matches( EE_ACTIONS::drawBus.MakeEvent() ) ) + if( autostartEvt->Matches( SCH_ACTIONS::drawBus.MakeEvent() ) ) displayBusCursor = true; - else if( autostartEvt->Matches( EE_ACTIONS::drawWire.MakeEvent() ) ) + else if( autostartEvt->Matches( SCH_ACTIONS::drawWire.MakeEvent() ) ) displayWireCursor = true; - else if( autostartEvt->Matches( EE_ACTIONS::drawLines.MakeEvent() ) ) + else if( autostartEvt->Matches( SCH_ACTIONS::drawLines.MakeEvent() ) ) displayLineCursor = true; } else if( collector[0]->IsHypertext() && !collector[0]->IsSelected() ) @@ -1078,36 +1069,36 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) } -OPT_TOOL_EVENT EE_SELECTION_TOOL::autostartEvent( TOOL_EVENT* aEvent, EE_GRID_HELPER& aGrid, - SCH_ITEM* aItem ) +OPT_TOOL_EVENT SCH_SELECTION_TOOL::autostartEvent( TOOL_EVENT* aEvent, EE_GRID_HELPER& aGrid, + SCH_ITEM* aItem ) { VECTOR2I pos = aGrid.BestSnapAnchor( aEvent->Position(), aGrid.GetItemGrid( aItem ) ); if( m_frame->eeconfig()->m_Drawing.auto_start_wires - && !m_toolMgr->GetTool()->HasPoint() + && !m_toolMgr->GetTool()->HasPoint() && aItem->IsPointClickableAnchor( pos ) ) { - OPT_TOOL_EVENT newEvt = EE_ACTIONS::drawWire.MakeEvent(); + OPT_TOOL_EVENT newEvt = SCH_ACTIONS::drawWire.MakeEvent(); if( aItem->Type() == SCH_BUS_BUS_ENTRY_T ) { - newEvt = EE_ACTIONS::drawBus.MakeEvent(); + newEvt = SCH_ACTIONS::drawBus.MakeEvent(); } else if( aItem->Type() == SCH_BUS_WIRE_ENTRY_T ) { SCH_BUS_WIRE_ENTRY* busEntry = static_cast( aItem ); if( !busEntry->m_connected_bus_item ) - newEvt = EE_ACTIONS::drawBus.MakeEvent(); + newEvt = SCH_ACTIONS::drawBus.MakeEvent(); } else if( aItem->Type() == SCH_LINE_T ) { SCH_LINE* line = static_cast( aItem ); if( line->IsBus() ) - newEvt = EE_ACTIONS::drawBus.MakeEvent(); + newEvt = SCH_ACTIONS::drawBus.MakeEvent(); else if( line->IsGraphicLine() ) - newEvt = EE_ACTIONS::drawLines.MakeEvent(); + newEvt = SCH_ACTIONS::drawLines.MakeEvent(); } else if( aItem->Type() == SCH_LABEL_T || aItem->Type() == SCH_HIER_LABEL_T || aItem->Type() == SCH_SHEET_PIN_T || aItem->Type() == SCH_GLOBAL_LABEL_T ) @@ -1117,7 +1108,7 @@ OPT_TOOL_EVENT EE_SELECTION_TOOL::autostartEvent( TOOL_EVENT* aEvent, EE_GRID_HE possibleConnection.ConfigureFromLabel( label->GetShownText( false ) ); if( possibleConnection.IsBus() ) - newEvt = EE_ACTIONS::drawBus.MakeEvent(); + newEvt = SCH_ACTIONS::drawBus.MakeEvent(); } else if( aItem->Type() == SCH_SYMBOL_T ) { @@ -1148,7 +1139,7 @@ OPT_TOOL_EVENT EE_SELECTION_TOOL::autostartEvent( TOOL_EVENT* aEvent, EE_GRID_HE } -int EE_SELECTION_TOOL::disambiguateCursor( const TOOL_EVENT& aEvent ) +int SCH_SELECTION_TOOL::disambiguateCursor( const TOOL_EVENT& aEvent ) { wxMouseState keyboardState = wxGetMouseState(); @@ -1164,7 +1155,7 @@ int EE_SELECTION_TOOL::disambiguateCursor( const TOOL_EVENT& aEvent ) } -void EE_SELECTION_TOOL::OnIdle( wxIdleEvent& aEvent ) +void SCH_SELECTION_TOOL::OnIdle( wxIdleEvent& aEvent ) { if( m_frame->ToolStackIsEmpty() && !m_multiple ) { @@ -1185,14 +1176,14 @@ void EE_SELECTION_TOOL::OnIdle( wxIdleEvent& aEvent ) } -EE_SELECTION& EE_SELECTION_TOOL::GetSelection() +SCH_SELECTION& SCH_SELECTION_TOOL::GetSelection() { return m_selection; } -bool EE_SELECTION_TOOL::CollectHits( EE_COLLECTOR& aCollector, const VECTOR2I& aWhere, - const std::vector& aScanTypes ) +bool SCH_SELECTION_TOOL::CollectHits( SCH_COLLECTOR& aCollector, const VECTOR2I& aWhere, + const std::vector& aScanTypes ) { int pixelThreshold = KiROUND( getView()->ToWorld( HITTEST_THRESHOLD_PIXELS ) ); int gridThreshold = KiROUND( getView()->GetGAL()->GetGridSize().EuclideanNorm() / 2 ); @@ -1235,8 +1226,8 @@ bool EE_SELECTION_TOOL::CollectHits( EE_COLLECTOR& aCollector, const VECTOR2I& a } -void EE_SELECTION_TOOL::narrowSelection( EE_COLLECTOR& collector, const VECTOR2I& aWhere, - bool aCheckLocked, bool aSelectedOnly ) +void SCH_SELECTION_TOOL::narrowSelection( SCH_COLLECTOR& collector, const VECTOR2I& aWhere, + bool aCheckLocked, bool aSelectedOnly ) { SYMBOL_EDIT_FRAME* symbolEditorFrame = dynamic_cast( m_frame ); @@ -1298,9 +1289,9 @@ void EE_SELECTION_TOOL::narrowSelection( EE_COLLECTOR& collector, const VECTOR2I } -bool EE_SELECTION_TOOL::selectPoint( EE_COLLECTOR& aCollector, const VECTOR2I& aWhere, - EDA_ITEM** aItem, bool* aSelectionCancelledFlag, bool aAdd, - bool aSubtract, bool aExclusiveOr ) +bool SCH_SELECTION_TOOL::selectPoint( SCH_COLLECTOR& aCollector, const VECTOR2I& aWhere, + EDA_ITEM** aItem, bool* aSelectionCancelledFlag, bool aAdd, + bool aSubtract, bool aExclusiveOr ) { m_selection.ClearReferencePoint(); @@ -1310,7 +1301,7 @@ bool EE_SELECTION_TOOL::selectPoint( EE_COLLECTOR& aCollector, const VECTOR2I& a // Try to call selectionMenu via RunAction() to avoid event-loop contention // But it we cannot handle the event, then we don't have an active tool loop, so // handle it directly. - if( !m_toolMgr->RunAction( EE_ACTIONS::selectionMenu, &aCollector ) ) + if( !m_toolMgr->RunAction( SCH_ACTIONS::selectionMenu, &aCollector ) ) { if( !doSelectionMenu( &aCollector ) ) aCollector.m_MenuCancelled = true; @@ -1402,13 +1393,13 @@ bool EE_SELECTION_TOOL::selectPoint( EE_COLLECTOR& aCollector, const VECTOR2I& a } -bool EE_SELECTION_TOOL::SelectPoint( const VECTOR2I& aWhere, - const std::vector& aScanTypes, - EDA_ITEM** aItem, bool* aSelectionCancelledFlag, - bool aCheckLocked, bool aAdd, bool aSubtract, - bool aExclusiveOr ) +bool SCH_SELECTION_TOOL::SelectPoint( const VECTOR2I& aWhere, + const std::vector& aScanTypes, + EDA_ITEM** aItem, bool* aSelectionCancelledFlag, + bool aCheckLocked, bool aAdd, bool aSubtract, + bool aExclusiveOr ) { - EE_COLLECTOR collector; + SCH_COLLECTOR collector; if( !CollectHits( collector, aWhere, aScanTypes ) ) return false; @@ -1420,7 +1411,7 @@ bool EE_SELECTION_TOOL::SelectPoint( const VECTOR2I& aWhere, } -int EE_SELECTION_TOOL::SelectAll( const TOOL_EVENT& aEvent ) +int SCH_SELECTION_TOOL::SelectAll( const TOOL_EVENT& aEvent ) { m_multiple = true; // Multiple selection mode is active KIGFX::VIEW* view = getView(); @@ -1472,7 +1463,7 @@ int EE_SELECTION_TOOL::SelectAll( const TOOL_EVENT& aEvent ) return 0; } -int EE_SELECTION_TOOL::UnselectAll( const TOOL_EVENT& aEvent ) +int SCH_SELECTION_TOOL::UnselectAll( const TOOL_EVENT& aEvent ) { m_multiple = true; // Multiple selection mode is active KIGFX::VIEW* view = getView(); @@ -1516,7 +1507,7 @@ int EE_SELECTION_TOOL::UnselectAll( const TOOL_EVENT& aEvent ) } -void EE_SELECTION_TOOL::GuessSelectionCandidates( EE_COLLECTOR& collector, const VECTOR2I& aPos ) +void SCH_SELECTION_TOOL::GuessSelectionCandidates( SCH_COLLECTOR& collector, const VECTOR2I& aPos ) { // Prefer exact hits to sloppy ones std::set exactHits; @@ -1701,8 +1692,8 @@ void EE_SELECTION_TOOL::GuessSelectionCandidates( EE_COLLECTOR& collector, const } -EE_SELECTION& EE_SELECTION_TOOL::RequestSelection( const std::vector& aScanTypes, - bool aPromoteCellSelections ) +SCH_SELECTION& SCH_SELECTION_TOOL::RequestSelection( const std::vector& aScanTypes, + bool aPromoteCellSelections ) { bool anyUnselected = false; bool anySelected = false; @@ -1772,7 +1763,7 @@ EE_SELECTION& EE_SELECTION_TOOL::RequestSelection( const std::vector& a } -bool EE_SELECTION_TOOL::itemPassesFilter( EDA_ITEM* aItem ) +bool SCH_SELECTION_TOOL::itemPassesFilter( EDA_ITEM* aItem ) { if( !aItem ) return false; @@ -1862,7 +1853,7 @@ bool EE_SELECTION_TOOL::itemPassesFilter( EDA_ITEM* aItem ) } -void EE_SELECTION_TOOL::updateReferencePoint() +void SCH_SELECTION_TOOL::updateReferencePoint() { VECTOR2I refP( 0, 0 ); @@ -1886,7 +1877,7 @@ const TOOL_ACTION* allowedActions[] = { &ACTIONS::panUp, &ACTIONS::panD &ACTIONS::zoomFitObjects, nullptr }; -bool EE_SELECTION_TOOL::selectMultiple() +bool SCH_SELECTION_TOOL::selectMultiple() { // Block selection not allowed in symbol viewer frame: no actual code to handle // a selection, so return to avoid to draw a selection rectangle, and to avoid crashes. @@ -2129,7 +2120,7 @@ bool EE_SELECTION_TOOL::selectMultiple() } -bool EE_SELECTION_TOOL::selectTableCells( SCH_TABLE* aTable ) +bool SCH_SELECTION_TOOL::selectTableCells( SCH_TABLE* aTable ) { bool cancelled = false; // Was the tool canceled while it was running? m_multiple = true; // Multiple selection mode is active @@ -2235,9 +2226,9 @@ bool EE_SELECTION_TOOL::selectTableCells( SCH_TABLE* aTable ) } -EDA_ITEM* EE_SELECTION_TOOL::GetNode( const VECTOR2I& aPosition ) +EDA_ITEM* SCH_SELECTION_TOOL::GetNode( const VECTOR2I& aPosition ) { - EE_COLLECTOR collector; + SCH_COLLECTOR collector; //TODO(snh): Reimplement after exposing KNN interface int pixelThreshold = KiROUND( getView()->ToWorld( HITTEST_THRESHOLD_PIXELS ) ); @@ -2257,7 +2248,7 @@ EDA_ITEM* EE_SELECTION_TOOL::GetNode( const VECTOR2I& aPosition ) } -int EE_SELECTION_TOOL::SelectNode( const TOOL_EVENT& aEvent ) +int SCH_SELECTION_TOOL::SelectNode( const TOOL_EVENT& aEvent ) { VECTOR2I cursorPos = getViewControls()->GetCursorPosition( false ); @@ -2266,7 +2257,7 @@ int EE_SELECTION_TOOL::SelectNode( const TOOL_EVENT& aEvent ) } -int EE_SELECTION_TOOL::SelectConnection( const TOOL_EVENT& aEvent ) +int SCH_SELECTION_TOOL::SelectConnection( const TOOL_EVENT& aEvent ) { RequestSelection( { SCH_ITEM_LOCATE_WIRE_T, SCH_ITEM_LOCATE_BUS_T, SCH_ITEM_LOCATE_GRAPHIC_LINE_T } ); @@ -2314,7 +2305,7 @@ int EE_SELECTION_TOOL::SelectConnection( const TOOL_EVENT& aEvent ) } -int EE_SELECTION_TOOL::SelectColumns( const TOOL_EVENT& aEvent ) +int SCH_SELECTION_TOOL::SelectColumns( const TOOL_EVENT& aEvent ) { std::set> columns; bool added = false; @@ -2349,7 +2340,7 @@ int EE_SELECTION_TOOL::SelectColumns( const TOOL_EVENT& aEvent ) } -int EE_SELECTION_TOOL::SelectRows( const TOOL_EVENT& aEvent ) +int SCH_SELECTION_TOOL::SelectRows( const TOOL_EVENT& aEvent ) { std::set> rows; bool added = false; @@ -2384,7 +2375,7 @@ int EE_SELECTION_TOOL::SelectRows( const TOOL_EVENT& aEvent ) } -int EE_SELECTION_TOOL::SelectTable( const TOOL_EVENT& aEvent ) +int SCH_SELECTION_TOOL::SelectTable( const TOOL_EVENT& aEvent ) { std::set tables; bool added = false; @@ -2413,14 +2404,14 @@ int EE_SELECTION_TOOL::SelectTable( const TOOL_EVENT& aEvent ) } -int EE_SELECTION_TOOL::ClearSelection( const TOOL_EVENT& aEvent ) +int SCH_SELECTION_TOOL::ClearSelection( const TOOL_EVENT& aEvent ) { ClearSelection(); return 0; } -void EE_SELECTION_TOOL::ZoomFitCrossProbeBBox( const BOX2I& aBBox ) +void SCH_SELECTION_TOOL::ZoomFitCrossProbeBBox( const BOX2I& aBBox ) { if( aBBox.GetWidth() == 0 ) return; @@ -2522,8 +2513,8 @@ void EE_SELECTION_TOOL::ZoomFitCrossProbeBBox( const BOX2I& aBBox ) } -void EE_SELECTION_TOOL::SyncSelection( const std::optional& targetSheetPath, - SCH_ITEM* focusItem, const std::vector& items ) +void SCH_SELECTION_TOOL::SyncSelection( const std::optional& targetSheetPath, + SCH_ITEM* focusItem, const std::vector& items ) { SCH_EDIT_FRAME* editFrame = dynamic_cast( m_frame ); @@ -2572,7 +2563,7 @@ void EE_SELECTION_TOOL::SyncSelection( const std::optional& targ } -void EE_SELECTION_TOOL::RebuildSelection() +void SCH_SELECTION_TOOL::RebuildSelection() { m_selection.Clear(); @@ -2614,8 +2605,8 @@ void EE_SELECTION_TOOL::RebuildSelection() } -bool EE_SELECTION_TOOL::Selectable( const EDA_ITEM* aItem, const VECTOR2I* aPos, - bool checkVisibilityOnly ) const +bool SCH_SELECTION_TOOL::Selectable( const EDA_ITEM* aItem, const VECTOR2I* aPos, + bool checkVisibilityOnly ) const { // NOTE: in the future this is where Eeschema layer/itemtype visibility will be handled @@ -2721,7 +2712,7 @@ bool EE_SELECTION_TOOL::Selectable( const EDA_ITEM* aItem, const VECTOR2I* aPos, } -void EE_SELECTION_TOOL::ClearSelection( bool aQuietMode ) +void SCH_SELECTION_TOOL::ClearSelection( bool aQuietMode ) { if( m_selection.Empty() ) return; @@ -2740,19 +2731,19 @@ void EE_SELECTION_TOOL::ClearSelection( bool aQuietMode ) } -void EE_SELECTION_TOOL::select( EDA_ITEM* aItem ) +void SCH_SELECTION_TOOL::select( EDA_ITEM* aItem ) { highlight( aItem, SELECTED, &m_selection ); } -void EE_SELECTION_TOOL::unselect( EDA_ITEM* aItem ) +void SCH_SELECTION_TOOL::unselect( EDA_ITEM* aItem ) { unhighlight( aItem, SELECTED, &m_selection ); } -void EE_SELECTION_TOOL::highlight( EDA_ITEM* aItem, int aMode, SELECTION* aGroup ) +void SCH_SELECTION_TOOL::highlight( EDA_ITEM* aItem, int aMode, SELECTION* aGroup ) { if( aMode == SELECTED ) aItem->SetSelected(); @@ -2791,7 +2782,7 @@ void EE_SELECTION_TOOL::highlight( EDA_ITEM* aItem, int aMode, SELECTION* aGroup } -void EE_SELECTION_TOOL::unhighlight( EDA_ITEM* aItem, int aMode, SELECTION* aGroup ) +void SCH_SELECTION_TOOL::unhighlight( EDA_ITEM* aItem, int aMode, SELECTION* aGroup ) { if( aMode == SELECTED ) { @@ -2840,7 +2831,7 @@ void EE_SELECTION_TOOL::unhighlight( EDA_ITEM* aItem, int aMode, SELECTION* aGro } -bool EE_SELECTION_TOOL::selectionContains( const VECTOR2I& aPoint ) const +bool SCH_SELECTION_TOOL::selectionContains( const VECTOR2I& aPoint ) const { const unsigned GRIP_MARGIN = 20; int margin = KiROUND( getView()->ToWorld( GRIP_MARGIN ) ); @@ -2859,7 +2850,7 @@ bool EE_SELECTION_TOOL::selectionContains( const VECTOR2I& aPoint ) const } -int EE_SELECTION_TOOL::SelectNext( const TOOL_EVENT& aEvent ) +int SCH_SELECTION_TOOL::SelectNext( const TOOL_EVENT& aEvent ) { SCH_EDIT_FRAME* editFrame = dynamic_cast( m_frame ); @@ -2881,7 +2872,7 @@ int EE_SELECTION_TOOL::SelectNext( const TOOL_EVENT& aEvent ) } -int EE_SELECTION_TOOL::SelectPrevious( const TOOL_EVENT& aEvent ) +int SCH_SELECTION_TOOL::SelectPrevious( const TOOL_EVENT& aEvent ) { SCH_EDIT_FRAME* editFrame = dynamic_cast( m_frame ); @@ -2903,32 +2894,32 @@ int EE_SELECTION_TOOL::SelectPrevious( const TOOL_EVENT& aEvent ) } -void EE_SELECTION_TOOL::setTransitions() +void SCH_SELECTION_TOOL::setTransitions() { - Go( &EE_SELECTION_TOOL::UpdateMenu, ACTIONS::updateMenu.MakeEvent() ); + Go( &SCH_SELECTION_TOOL::UpdateMenu, ACTIONS::updateMenu.MakeEvent() ); - Go( &EE_SELECTION_TOOL::Main, EE_ACTIONS::selectionActivate.MakeEvent() ); - Go( &EE_SELECTION_TOOL::SelectNode, EE_ACTIONS::selectNode.MakeEvent() ); - Go( &EE_SELECTION_TOOL::SelectConnection, EE_ACTIONS::selectConnection.MakeEvent() ); - Go( &EE_SELECTION_TOOL::SelectColumns, ACTIONS::selectColumns.MakeEvent() ); - Go( &EE_SELECTION_TOOL::SelectRows, ACTIONS::selectRows.MakeEvent() ); - Go( &EE_SELECTION_TOOL::SelectTable, ACTIONS::selectTable.MakeEvent() ); + Go( &SCH_SELECTION_TOOL::Main, SCH_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( &EE_SELECTION_TOOL::ClearSelection, EE_ACTIONS::clearSelection.MakeEvent() ); + Go( &SCH_SELECTION_TOOL::ClearSelection, SCH_ACTIONS::clearSelection.MakeEvent() ); - Go( &EE_SELECTION_TOOL::AddItemToSel, EE_ACTIONS::addItemToSel.MakeEvent() ); - Go( &EE_SELECTION_TOOL::AddItemsToSel, EE_ACTIONS::addItemsToSel.MakeEvent() ); - Go( &EE_SELECTION_TOOL::RemoveItemFromSel, EE_ACTIONS::removeItemFromSel.MakeEvent() ); - Go( &EE_SELECTION_TOOL::RemoveItemsFromSel, EE_ACTIONS::removeItemsFromSel.MakeEvent() ); - Go( &EE_SELECTION_TOOL::SelectionMenu, EE_ACTIONS::selectionMenu.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( &EE_SELECTION_TOOL::SelectAll, EE_ACTIONS::selectAll.MakeEvent() ); - Go( &EE_SELECTION_TOOL::UnselectAll, EE_ACTIONS::unselectAll.MakeEvent() ); + Go( &SCH_SELECTION_TOOL::SelectAll, SCH_ACTIONS::selectAll.MakeEvent() ); + Go( &SCH_SELECTION_TOOL::UnselectAll, SCH_ACTIONS::unselectAll.MakeEvent() ); - Go( &EE_SELECTION_TOOL::SelectNext, EE_ACTIONS::nextNetItem.MakeEvent() ); - Go( &EE_SELECTION_TOOL::SelectPrevious, EE_ACTIONS::previousNetItem.MakeEvent() ); + Go( &SCH_SELECTION_TOOL::SelectNext, SCH_ACTIONS::nextNetItem.MakeEvent() ); + Go( &SCH_SELECTION_TOOL::SelectPrevious, SCH_ACTIONS::previousNetItem.MakeEvent() ); - Go( &EE_SELECTION_TOOL::disambiguateCursor, EVENTS::DisambiguatePoint ); + Go( &SCH_SELECTION_TOOL::disambiguateCursor, EVENTS::DisambiguatePoint ); } diff --git a/eeschema/tools/ee_selection_tool.h b/eeschema/tools/sch_selection_tool.h similarity index 92% rename from eeschema/tools/ee_selection_tool.h rename to eeschema/tools/sch_selection_tool.h index 9360544f4e..3ba31d140a 100644 --- a/eeschema/tools/ee_selection_tool.h +++ b/eeschema/tools/sch_selection_tool.h @@ -22,15 +22,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef KICAD_SCH_SELECTION_TOOL_H -#define KICAD_SCH_SELECTION_TOOL_H +#ifndef SCH_SELECTION_TOOL_H +#define SCH_SELECTION_TOOL_H #include #include #include #include -#include -#include +#include +#include #include #include @@ -45,7 +45,7 @@ namespace KIGFX } -class EE_CONDITIONS : public SELECTION_CONDITIONS +class SCH_CONDITIONS : public SELECTION_CONDITIONS { public: static SELECTION_CONDITION SingleSymbol; @@ -60,11 +60,11 @@ public: }; -class EE_SELECTION_TOOL : public SELECTION_TOOL +class SCH_SELECTION_TOOL : public SELECTION_TOOL { public: - EE_SELECTION_TOOL(); - ~EE_SELECTION_TOOL(); + SCH_SELECTION_TOOL(); + ~SCH_SELECTION_TOOL(); /// @copydoc TOOL_BASE::Init() bool Init() override; @@ -85,7 +85,7 @@ public: /** * @return the set of currently selected items. */ - EE_SELECTION& GetSelection(); + SCH_SELECTION& GetSelection(); /** * Return either an existing selection (filtered), or the selection at the current cursor @@ -94,8 +94,8 @@ public: * @param aScanTypes [optional] List of item types that are acceptable for selection. * @return either the current selection or, if empty, the selection at the cursor. */ - EE_SELECTION& RequestSelection( const std::vector& aScanTypes = { SCH_LOCATE_ANY_T }, - bool aPromoteCellSelections = false ); + SCH_SELECTION& RequestSelection( const std::vector& aScanTypes = { SCH_LOCATE_ANY_T }, + bool aPromoteCellSelections = false ); /** * Perform a click-type selection at a point (usually the cursor position). @@ -172,7 +172,7 @@ public: * Apply heuristics to try and determine a single object when multiple are found under the * cursor. */ - void GuessSelectionCandidates( EE_COLLECTOR& collector, const VECTOR2I& aPos ); + void GuessSelectionCandidates( SCH_COLLECTOR& collector, const VECTOR2I& aPos ); /** * Rebuild the selection from the EDA_ITEMs' selection flags. @@ -190,7 +190,7 @@ public: * @param aWhere Point from which the collection should be made. * @param aScanTypes [optional] A list of item types that are acceptable for collection. */ - bool CollectHits( EE_COLLECTOR& aCollector, const VECTOR2I& aWhere, + bool CollectHits( SCH_COLLECTOR& aCollector, const VECTOR2I& aWhere, const std::vector& aScanTypes = { SCH_LOCATE_ANY_T } ); ///< Set selection to items passed by parameter. @@ -215,7 +215,7 @@ private: * @param aCheckLocked If false, remove locked elements from #collector * @param aSelectedOnly If true, remove non-selected items from #collector */ - void narrowSelection( EE_COLLECTOR& collector, const VECTOR2I& aWhere, bool aCheckLocked, + void narrowSelection( SCH_COLLECTOR& collector, const VECTOR2I& aWhere, bool aCheckLocked, bool aSelectedOnly = false ); /** @@ -233,7 +233,7 @@ private: * @param aExclusiveOr Indicates if found item(s) should be toggle in the selection. * @return true if the selection was modified. */ - bool selectPoint( EE_COLLECTOR& aCollector, const VECTOR2I& aWhere, EDA_ITEM** aItem = nullptr, + bool selectPoint( SCH_COLLECTOR& aCollector, const VECTOR2I& aWhere, EDA_ITEM** aItem = nullptr, bool* aSelectionCancelledFlag = nullptr, bool aAdd = false, bool aSubtract = false, bool aExclusiveOr = false ); @@ -309,7 +309,7 @@ private: private: SCH_BASE_FRAME* m_frame; // Pointer to the parent frame - EE_SELECTION m_selection; // Current state of selection + SCH_SELECTION m_selection; // Current state of selection KICURSOR m_nonModifiedCursor; // Cursor in the absence of shift/ctrl/alt @@ -321,4 +321,4 @@ private: SCH_SELECTION_FILTER_OPTIONS m_filter; }; -#endif //KICAD_SCH_SELECTION_TOOL_H +#endif //SCH_SELECTION_TOOL_H diff --git a/eeschema/tools/ee_tool_base.h b/eeschema/tools/sch_tool_base.h similarity index 93% rename from eeschema/tools/ee_tool_base.h rename to eeschema/tools/sch_tool_base.h index dd85ae3ad9..a4a91c378e 100644 --- a/eeschema/tools/ee_tool_base.h +++ b/eeschema/tools/sch_tool_base.h @@ -22,8 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef EE_TOOL_BASE_H -#define EE_TOOL_BASE_H +#ifndef SCH_TOOL_BASE_H +#define SCH_TOOL_BASE_H #include #include @@ -31,12 +31,12 @@ #include #include #include -#include +#include #include #include #include -class EE_SELECTION; +class SCH_SELECTION; /** * A foundation class for a tool operating on a schematic or symbol. @@ -44,13 +44,13 @@ class EE_SELECTION; template -class EE_TOOL_BASE : public TOOL_INTERACTIVE +class SCH_TOOL_BASE : public TOOL_INTERACTIVE { public: /** * Create a tool with given name. The name must be unique. */ - EE_TOOL_BASE( const std::string& aName ) : + SCH_TOOL_BASE( const std::string& aName ) : TOOL_INTERACTIVE ( aName ), m_frame( nullptr ), m_view( nullptr ), @@ -58,13 +58,13 @@ public: m_isSymbolEditor( false ) {}; - ~EE_TOOL_BASE() override {}; + ~SCH_TOOL_BASE() override {}; /// @copydoc TOOL_INTERACTIVE::Init() bool Init() override { m_frame = getEditFrame(); - m_selectionTool = m_toolMgr->GetTool(); + m_selectionTool = m_toolMgr->GetTool(); m_isSymbolEditor = m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ); // A basic context menu. Many (but not all) tools will choose to override this. @@ -195,10 +195,10 @@ protected: } protected: - T* m_frame; - KIGFX::SCH_VIEW* m_view; - EE_SELECTION_TOOL* m_selectionTool; - bool m_isSymbolEditor; + T* m_frame; + KIGFX::SCH_VIEW* m_view; + SCH_SELECTION_TOOL* m_selectionTool; + bool m_isSymbolEditor; }; diff --git a/eeschema/tools/ee_tool_utils.cpp b/eeschema/tools/sch_tool_utils.cpp similarity index 99% rename from eeschema/tools/ee_tool_utils.cpp rename to eeschema/tools/sch_tool_utils.cpp index 5cdf113ee8..c90d179989 100644 --- a/eeschema/tools/ee_tool_utils.cpp +++ b/eeschema/tools/sch_tool_utils.cpp @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "ee_tool_utils.h" +#include "sch_tool_utils.h" #include #include diff --git a/eeschema/tools/ee_tool_utils.h b/eeschema/tools/sch_tool_utils.h similarity index 100% rename from eeschema/tools/ee_tool_utils.h rename to eeschema/tools/sch_tool_utils.h diff --git a/eeschema/tools/simulator_control.cpp b/eeschema/tools/simulator_control.cpp index 3fc478040e..7f659596f1 100644 --- a/eeschema/tools/simulator_control.cpp +++ b/eeschema/tools/simulator_control.cpp @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include @@ -153,7 +153,7 @@ int SIMULATOR_CONTROL::SaveWorkbook( const TOOL_EVENT& aEvent ) { wxString filename; - if( aEvent.IsAction( &EE_ACTIONS::saveWorkbook ) ) + if( aEvent.IsAction( &SCH_ACTIONS::saveWorkbook ) ) filename = m_simulator->Settings()->GetWorkbookFilename(); if( filename.IsEmpty() ) @@ -497,7 +497,7 @@ int SIMULATOR_CONTROL::Probe( const TOOL_EVENT& aEvent ) if( blocking_dialog ) blocking_dialog->Close( true ); - m_schematicFrame->GetToolManager()->PostAction( EE_ACTIONS::simProbe ); + m_schematicFrame->GetToolManager()->PostAction( SCH_ACTIONS::simProbe ); m_schematicFrame->Raise(); return 0; @@ -514,7 +514,7 @@ int SIMULATOR_CONTROL::Tune( const TOOL_EVENT& aEvent ) if( blocking_dialog ) blocking_dialog->Close( true ); - m_schematicFrame->GetToolManager()->PostAction( EE_ACTIONS::simTune ); + m_schematicFrame->GetToolManager()->PostAction( SCH_ACTIONS::simTune ); m_schematicFrame->Raise(); return 0; @@ -641,14 +641,14 @@ int SIMULATOR_CONTROL::ShowNetlist( const TOOL_EVENT& aEvent ) void SIMULATOR_CONTROL::setTransitions() { - Go( &SIMULATOR_CONTROL::NewAnalysisTab, EE_ACTIONS::newAnalysisTab.MakeEvent() ); - Go( &SIMULATOR_CONTROL::OpenWorkbook, EE_ACTIONS::openWorkbook.MakeEvent() ); - Go( &SIMULATOR_CONTROL::SaveWorkbook, EE_ACTIONS::saveWorkbook.MakeEvent() ); - Go( &SIMULATOR_CONTROL::SaveWorkbook, EE_ACTIONS::saveWorkbookAs.MakeEvent() ); - Go( &SIMULATOR_CONTROL::ExportPlotAsPNG, EE_ACTIONS::exportPlotAsPNG.MakeEvent() ); - Go( &SIMULATOR_CONTROL::ExportPlotAsCSV, EE_ACTIONS::exportPlotAsCSV.MakeEvent() ); - Go( &SIMULATOR_CONTROL::ExportPlotToClipboard, EE_ACTIONS::exportPlotToClipboard.MakeEvent() ); - Go( &SIMULATOR_CONTROL::ExportPlotToSchematic, EE_ACTIONS::exportPlotToSchematic.MakeEvent() ); + Go( &SIMULATOR_CONTROL::NewAnalysisTab, SCH_ACTIONS::newAnalysisTab.MakeEvent() ); + Go( &SIMULATOR_CONTROL::OpenWorkbook, SCH_ACTIONS::openWorkbook.MakeEvent() ); + Go( &SIMULATOR_CONTROL::SaveWorkbook, SCH_ACTIONS::saveWorkbook.MakeEvent() ); + Go( &SIMULATOR_CONTROL::SaveWorkbook, SCH_ACTIONS::saveWorkbookAs.MakeEvent() ); + Go( &SIMULATOR_CONTROL::ExportPlotAsPNG, SCH_ACTIONS::exportPlotAsPNG.MakeEvent() ); + Go( &SIMULATOR_CONTROL::ExportPlotAsCSV, SCH_ACTIONS::exportPlotAsCSV.MakeEvent() ); + Go( &SIMULATOR_CONTROL::ExportPlotToClipboard, SCH_ACTIONS::exportPlotToClipboard.MakeEvent() ); + Go( &SIMULATOR_CONTROL::ExportPlotToSchematic, SCH_ACTIONS::exportPlotToSchematic.MakeEvent() ); Go( &SIMULATOR_CONTROL::Close, ACTIONS::quit.MakeEvent() ); @@ -666,16 +666,16 @@ void SIMULATOR_CONTROL::setTransitions() Go( &SIMULATOR_CONTROL::UndoZoom, ACTIONS::zoomUndo.MakeEvent() ); Go( &SIMULATOR_CONTROL::RedoZoom, ACTIONS::zoomRedo.MakeEvent() ); Go( &SIMULATOR_CONTROL::ToggleGrid, ACTIONS::toggleGrid.MakeEvent() ); - Go( &SIMULATOR_CONTROL::ToggleLegend, EE_ACTIONS::toggleLegend.MakeEvent() ); - Go( &SIMULATOR_CONTROL::ToggleDottedSecondary, EE_ACTIONS::toggleDottedSecondary.MakeEvent() ); - Go( &SIMULATOR_CONTROL::ToggleDarkModePlots, EE_ACTIONS::toggleDarkModePlots.MakeEvent() ); + Go( &SIMULATOR_CONTROL::ToggleLegend, SCH_ACTIONS::toggleLegend.MakeEvent() ); + Go( &SIMULATOR_CONTROL::ToggleDottedSecondary, SCH_ACTIONS::toggleDottedSecondary.MakeEvent() ); + Go( &SIMULATOR_CONTROL::ToggleDarkModePlots, SCH_ACTIONS::toggleDarkModePlots.MakeEvent() ); - Go( &SIMULATOR_CONTROL::EditAnalysisTab, EE_ACTIONS::simAnalysisProperties.MakeEvent() ); - Go( &SIMULATOR_CONTROL::RunSimulation, EE_ACTIONS::runSimulation.MakeEvent() ); - Go( &SIMULATOR_CONTROL::RunSimulation, EE_ACTIONS::stopSimulation.MakeEvent() ); - Go( &SIMULATOR_CONTROL::Probe, EE_ACTIONS::simProbe.MakeEvent() ); - Go( &SIMULATOR_CONTROL::Tune, EE_ACTIONS::simTune.MakeEvent() ); + Go( &SIMULATOR_CONTROL::EditAnalysisTab, SCH_ACTIONS::simAnalysisProperties.MakeEvent() ); + Go( &SIMULATOR_CONTROL::RunSimulation, SCH_ACTIONS::runSimulation.MakeEvent() ); + Go( &SIMULATOR_CONTROL::RunSimulation, SCH_ACTIONS::stopSimulation.MakeEvent() ); + Go( &SIMULATOR_CONTROL::Probe, SCH_ACTIONS::simProbe.MakeEvent() ); + Go( &SIMULATOR_CONTROL::Tune, SCH_ACTIONS::simTune.MakeEvent() ); - Go( &SIMULATOR_CONTROL::EditUserDefinedSignals, EE_ACTIONS::editUserDefinedSignals.MakeEvent() ); - Go( &SIMULATOR_CONTROL::ShowNetlist, EE_ACTIONS::showNetlist.MakeEvent() ); + Go( &SIMULATOR_CONTROL::EditUserDefinedSignals, SCH_ACTIONS::editUserDefinedSignals.MakeEvent() ); + Go( &SIMULATOR_CONTROL::ShowNetlist, SCH_ACTIONS::showNetlist.MakeEvent() ); } diff --git a/eeschema/tools/symbol_editor_control.cpp b/eeschema/tools/symbol_editor_control.cpp index a9b64cdd19..480ba14e06 100644 --- a/eeschema/tools/symbol_editor_control.cpp +++ b/eeschema/tools/symbol_editor_control.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include @@ -48,7 +48,7 @@ bool SYMBOL_EDITOR_CONTROL::Init() { m_frame = getEditFrame(); - m_selectionTool = m_toolMgr->GetTool(); + m_selectionTool = m_toolMgr->GetTool(); m_isSymbolEditor = m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ); if( m_isSymbolEditor ) @@ -131,27 +131,27 @@ bool SYMBOL_EDITOR_CONTROL::Init() }; // clang-format off - ctxMenu.AddItem( EE_ACTIONS::newSymbol, libInferredCondition, 10 ); - ctxMenu.AddItem( EE_ACTIONS::deriveFromExistingSymbol, symbolSelectedCondition, 10 ); + ctxMenu.AddItem( SCH_ACTIONS::newSymbol, libInferredCondition, 10 ); + ctxMenu.AddItem( SCH_ACTIONS::deriveFromExistingSymbol, symbolSelectedCondition, 10 ); ctxMenu.AddSeparator( 10 ); ctxMenu.AddItem( ACTIONS::save, symbolSelectedCondition || libInferredCondition, 10 ); - ctxMenu.AddItem( EE_ACTIONS::saveLibraryAs, libSelectedCondition, 10 ); - ctxMenu.AddItem( EE_ACTIONS::saveSymbolAs, symbolSelectedCondition, 10 ); - ctxMenu.AddItem( EE_ACTIONS::saveSymbolCopyAs, symbolSelectedCondition, 10 ); + ctxMenu.AddItem( SCH_ACTIONS::saveLibraryAs, libSelectedCondition, 10 ); + ctxMenu.AddItem( SCH_ACTIONS::saveSymbolAs, symbolSelectedCondition, 10 ); + ctxMenu.AddItem( SCH_ACTIONS::saveSymbolCopyAs, symbolSelectedCondition, 10 ); ctxMenu.AddItem( ACTIONS::revert, symbolSelectedCondition || libInferredCondition, 10 ); ctxMenu.AddSeparator( 10 ); - ctxMenu.AddItem( EE_ACTIONS::cutSymbol, symbolSelectedCondition || multiSymbolSelectedCondition, 10 ); - ctxMenu.AddItem( EE_ACTIONS::copySymbol, symbolSelectedCondition || multiSymbolSelectedCondition, 10 ); - ctxMenu.AddItem( EE_ACTIONS::pasteSymbol, libInferredCondition, 10 ); - ctxMenu.AddItem( EE_ACTIONS::duplicateSymbol, symbolSelectedCondition, 10 ); - ctxMenu.AddItem( EE_ACTIONS::renameSymbol, symbolSelectedCondition, 10 ); - ctxMenu.AddItem( EE_ACTIONS::deleteSymbol, symbolSelectedCondition || multiSymbolSelectedCondition, 10 ); + ctxMenu.AddItem( SCH_ACTIONS::cutSymbol, symbolSelectedCondition || multiSymbolSelectedCondition, 10 ); + ctxMenu.AddItem( SCH_ACTIONS::copySymbol, symbolSelectedCondition || multiSymbolSelectedCondition, 10 ); + ctxMenu.AddItem( SCH_ACTIONS::pasteSymbol, libInferredCondition, 10 ); + ctxMenu.AddItem( SCH_ACTIONS::duplicateSymbol, symbolSelectedCondition, 10 ); + ctxMenu.AddItem( SCH_ACTIONS::renameSymbol, symbolSelectedCondition, 10 ); + ctxMenu.AddItem( SCH_ACTIONS::deleteSymbol, symbolSelectedCondition || multiSymbolSelectedCondition, 10 ); ctxMenu.AddSeparator( 100 ); - ctxMenu.AddItem( EE_ACTIONS::importSymbol, libInferredCondition, 100 ); - ctxMenu.AddItem( EE_ACTIONS::exportSymbol, symbolSelectedCondition ); + ctxMenu.AddItem( SCH_ACTIONS::importSymbol, libInferredCondition, 100 ); + ctxMenu.AddItem( SCH_ACTIONS::exportSymbol, symbolSelectedCondition ); if( ADVANCED_CFG::GetCfg().m_EnableLibWithText ) { @@ -265,11 +265,11 @@ int SYMBOL_EDITOR_CONTROL::AddSymbol( const TOOL_EVENT& aEvent ) return 0; } - if( aEvent.IsAction( &EE_ACTIONS::newSymbol ) ) + if( aEvent.IsAction( &SCH_ACTIONS::newSymbol ) ) editFrame->CreateNewSymbol(); - else if( aEvent.IsAction( &EE_ACTIONS::deriveFromExistingSymbol ) ) + else if( aEvent.IsAction( &SCH_ACTIONS::deriveFromExistingSymbol ) ) editFrame->CreateNewSymbol( target.GetLibItemName() ); - else if( aEvent.IsAction( &EE_ACTIONS::importSymbol ) ) + else if( aEvent.IsAction( &SCH_ACTIONS::importSymbol ) ) editFrame->ImportSymbol(); return 0; @@ -283,15 +283,15 @@ int SYMBOL_EDITOR_CONTROL::Save( const TOOL_EVENT& aEvt ) SYMBOL_EDIT_FRAME* editFrame = getEditFrame(); - if( aEvt.IsAction( &EE_ACTIONS::save ) ) + if( aEvt.IsAction( &SCH_ACTIONS::save ) ) editFrame->Save(); - else if( aEvt.IsAction( &EE_ACTIONS::saveLibraryAs ) ) + else if( aEvt.IsAction( &SCH_ACTIONS::saveLibraryAs ) ) editFrame->SaveLibraryAs(); - else if( aEvt.IsAction( &EE_ACTIONS::saveSymbolAs ) ) + else if( aEvt.IsAction( &SCH_ACTIONS::saveSymbolAs ) ) editFrame->SaveSymbolCopyAs( true ); - else if( aEvt.IsAction( &EE_ACTIONS::saveSymbolCopyAs ) ) + else if( aEvt.IsAction( &SCH_ACTIONS::saveSymbolCopyAs ) ) editFrame->SaveSymbolCopyAs( false ); - else if( aEvt.IsAction( &EE_ACTIONS::saveAll ) ) + else if( aEvt.IsAction( &SCH_ACTIONS::saveAll ) ) editFrame->SaveAll(); return 0; @@ -390,10 +390,10 @@ int SYMBOL_EDITOR_CONTROL::CutCopyDelete( const TOOL_EVENT& aEvt ) SYMBOL_EDIT_FRAME* editFrame = getEditFrame(); - if( aEvt.IsAction( &EE_ACTIONS::cutSymbol ) || aEvt.IsAction( &EE_ACTIONS::copySymbol ) ) + if( aEvt.IsAction( &SCH_ACTIONS::cutSymbol ) || aEvt.IsAction( &SCH_ACTIONS::copySymbol ) ) editFrame->CopySymbolToClipboard(); - if( aEvt.IsAction( &EE_ACTIONS::cutSymbol ) || aEvt.IsAction( &EE_ACTIONS::deleteSymbol ) ) + if( aEvt.IsAction( &SCH_ACTIONS::cutSymbol ) || aEvt.IsAction( &SCH_ACTIONS::deleteSymbol ) ) { bool hasWritableLibs = false; wxString msg; @@ -430,7 +430,7 @@ int SYMBOL_EDITOR_CONTROL::DuplicateSymbol( const TOOL_EVENT& aEvent ) LIB_ID sel = editFrame->GetTargetLibId(); // DuplicateSymbol() is called to duplicate a symbol, or to paste a previously // saved symbol in clipboard - bool isPasteAction = aEvent.IsAction( &EE_ACTIONS::pasteSymbol ); + bool isPasteAction = aEvent.IsAction( &SCH_ACTIONS::pasteSymbol ); wxString msg; if( !sel.IsValid() && !isPasteAction ) @@ -567,13 +567,13 @@ int SYMBOL_EDITOR_CONTROL::RenameSymbol( const TOOL_EVENT& aEvent ) int SYMBOL_EDITOR_CONTROL::OnDeMorgan( const TOOL_EVENT& aEvent ) { - int bodyStyle = aEvent.IsAction( &EE_ACTIONS::showDeMorganStandard ) ? BODY_STYLE::BASE - : BODY_STYLE::DEMORGAN; + int bodyStyle = aEvent.IsAction( &SCH_ACTIONS::showDeMorganStandard ) ? BODY_STYLE::BASE + : BODY_STYLE::DEMORGAN; if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) ) { m_toolMgr->RunAction( ACTIONS::cancelInteractive ); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); SYMBOL_EDIT_FRAME* symbolEditor = static_cast( m_frame ); symbolEditor->SetBodyStyle( bodyStyle ); @@ -848,8 +848,8 @@ int SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic( const TOOL_EVENT& aEvent ) } schframe->Raise(); - schframe->GetToolManager()->PostAction( EE_ACTIONS::placeSymbol, - EE_ACTIONS::PLACE_SYMBOL_PARAMS{ symbol, true } ); + schframe->GetToolManager()->PostAction( SCH_ACTIONS::placeSymbol, + SCH_ACTIONS::PLACE_SYMBOL_PARAMS{ symbol, true } ); } return 0; @@ -878,49 +878,49 @@ void SYMBOL_EDITOR_CONTROL::setTransitions() // clang-format off Go( &SYMBOL_EDITOR_CONTROL::AddLibrary, ACTIONS::newLibrary.MakeEvent() ); Go( &SYMBOL_EDITOR_CONTROL::AddLibrary, ACTIONS::addLibrary.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::AddSymbol, EE_ACTIONS::newSymbol.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::AddSymbol, EE_ACTIONS::deriveFromExistingSymbol.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::AddSymbol, EE_ACTIONS::importSymbol.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::EditSymbol, EE_ACTIONS::editSymbol.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::EditLibrarySymbol, EE_ACTIONS::editLibSymbolWithLibEdit.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::AddSymbol, SCH_ACTIONS::newSymbol.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::AddSymbol, SCH_ACTIONS::deriveFromExistingSymbol.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::AddSymbol, SCH_ACTIONS::importSymbol.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::EditSymbol, SCH_ACTIONS::editSymbol.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::EditLibrarySymbol, SCH_ACTIONS::editLibSymbolWithLibEdit.MakeEvent() ); Go( &SYMBOL_EDITOR_CONTROL::DdAddLibrary, ACTIONS::ddAddLibrary.MakeEvent() ); Go( &SYMBOL_EDITOR_CONTROL::Save, ACTIONS::save.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::Save, EE_ACTIONS::saveLibraryAs.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::Save, EE_ACTIONS::saveSymbolAs.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::Save, EE_ACTIONS::saveSymbolCopyAs.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::Save, SCH_ACTIONS::saveLibraryAs.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::Save, SCH_ACTIONS::saveSymbolAs.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::Save, SCH_ACTIONS::saveSymbolCopyAs.MakeEvent() ); Go( &SYMBOL_EDITOR_CONTROL::Save, ACTIONS::saveAll.MakeEvent() ); Go( &SYMBOL_EDITOR_CONTROL::Revert, ACTIONS::revert.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::DuplicateSymbol, EE_ACTIONS::duplicateSymbol.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::RenameSymbol, EE_ACTIONS::renameSymbol.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::CutCopyDelete, EE_ACTIONS::deleteSymbol.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::CutCopyDelete, EE_ACTIONS::cutSymbol.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::CutCopyDelete, EE_ACTIONS::copySymbol.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::DuplicateSymbol, EE_ACTIONS::pasteSymbol.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::ExportSymbol, EE_ACTIONS::exportSymbol.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::DuplicateSymbol, SCH_ACTIONS::duplicateSymbol.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::RenameSymbol, SCH_ACTIONS::renameSymbol.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::CutCopyDelete, SCH_ACTIONS::deleteSymbol.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::CutCopyDelete, SCH_ACTIONS::cutSymbol.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::CutCopyDelete, SCH_ACTIONS::copySymbol.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::DuplicateSymbol, SCH_ACTIONS::pasteSymbol.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::ExportSymbol, SCH_ACTIONS::exportSymbol.MakeEvent() ); Go( &SYMBOL_EDITOR_CONTROL::OpenWithTextEditor, ACTIONS::openWithTextEditor.MakeEvent() ); Go( &SYMBOL_EDITOR_CONTROL::OpenDirectory, ACTIONS::openDirectory.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::ExportView, EE_ACTIONS::exportSymbolView.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::ExportSymbolAsSVG, EE_ACTIONS::exportSymbolAsSVG.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic, EE_ACTIONS::addSymbolToSchematic.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::ExportView, SCH_ACTIONS::exportSymbolView.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::ExportSymbolAsSVG, SCH_ACTIONS::exportSymbolAsSVG.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic, SCH_ACTIONS::addSymbolToSchematic.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::OnDeMorgan, EE_ACTIONS::showDeMorganStandard.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::OnDeMorgan, EE_ACTIONS::showDeMorganAlternate.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::OnDeMorgan, SCH_ACTIONS::showDeMorganStandard.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::OnDeMorgan, SCH_ACTIONS::showDeMorganAlternate.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::ShowElectricalTypes, EE_ACTIONS::showElectricalTypes.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::ShowPinNumbers, EE_ACTIONS::showPinNumbers.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::ToggleSyncedPinsMode, EE_ACTIONS::toggleSyncedPinsMode.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::ShowElectricalTypes, SCH_ACTIONS::showElectricalTypes.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::ShowPinNumbers, SCH_ACTIONS::showPinNumbers.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::ToggleSyncedPinsMode, SCH_ACTIONS::toggleSyncedPinsMode.MakeEvent() ); Go( &SYMBOL_EDITOR_CONTROL::ToggleProperties, ACTIONS::showProperties.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::ToggleHiddenPins, EE_ACTIONS::showHiddenPins.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::ToggleHiddenFields, EE_ACTIONS::showHiddenFields.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::TogglePinAltIcons, EE_ACTIONS::togglePinAltIcons.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::ToggleHiddenPins, SCH_ACTIONS::showHiddenPins.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::ToggleHiddenFields, SCH_ACTIONS::showHiddenFields.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::TogglePinAltIcons, SCH_ACTIONS::togglePinAltIcons.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::ChangeUnit, EE_ACTIONS::previousUnit.MakeEvent() ); - Go( &SYMBOL_EDITOR_CONTROL::ChangeUnit, EE_ACTIONS::nextUnit.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::ChangeUnit, SCH_ACTIONS::previousUnit.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::ChangeUnit, SCH_ACTIONS::nextUnit.MakeEvent() ); // clang-format on } diff --git a/eeschema/tools/symbol_editor_control.h b/eeschema/tools/symbol_editor_control.h index bbf03b520d..29ca6788ef 100644 --- a/eeschema/tools/symbol_editor_control.h +++ b/eeschema/tools/symbol_editor_control.h @@ -27,18 +27,18 @@ #define SYMBOL_EDITOR_CONTROL_H #include -#include +#include class SYMBOL_EDIT_FRAME; /** * Handle actions for the various symbol editor and viewers. */ -class SYMBOL_EDITOR_CONTROL : public wxEvtHandler, public EE_TOOL_BASE +class SYMBOL_EDITOR_CONTROL : public wxEvtHandler, public SCH_TOOL_BASE { public: SYMBOL_EDITOR_CONTROL() : - EE_TOOL_BASE( "eeschema.SymbolLibraryControl" ) + SCH_TOOL_BASE( "eeschema.SymbolLibraryControl" ) { } /// @copydoc TOOL_INTERACTIVE::Init() diff --git a/eeschema/tools/symbol_editor_drawing_tools.cpp b/eeschema/tools/symbol_editor_drawing_tools.cpp index f3513466cf..c8aeb89b1a 100644 --- a/eeschema/tools/symbol_editor_drawing_tools.cpp +++ b/eeschema/tools/symbol_editor_drawing_tools.cpp @@ -22,7 +22,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include +#include #include #include #include @@ -46,7 +46,7 @@ KIID SYMBOL_EDITOR_DRAWING_TOOLS::g_lastPin; SYMBOL_EDITOR_DRAWING_TOOLS::SYMBOL_EDITOR_DRAWING_TOOLS() : - EE_TOOL_BASE( "eeschema.SymbolDrawing" ), + SCH_TOOL_BASE( "eeschema.SymbolDrawing" ), m_lastTextBold( false ), m_lastTextItalic( false ), m_lastTextAngle( ANGLE_HORIZONTAL ), @@ -64,7 +64,7 @@ SYMBOL_EDITOR_DRAWING_TOOLS::SYMBOL_EDITOR_DRAWING_TOOLS() : bool SYMBOL_EDITOR_DRAWING_TOOLS::Init() { - EE_TOOL_BASE::Init(); + SCH_TOOL_BASE::Init(); auto isDrawingCondition = [] ( const SELECTION& aSel ) @@ -98,10 +98,10 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) VECTOR2I cursorPos; bool ignorePrimePosition = false; SCH_ITEM* item = nullptr; - bool isText = aEvent.IsAction( &EE_ACTIONS::placeSymbolText ); + bool isText = aEvent.IsAction( &SCH_ACTIONS::placeSymbolText ); COMMON_SETTINGS* common_settings = Pgm().GetCommonSettings(); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); m_frame->PushTool( aEvent ); @@ -119,7 +119,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) auto cleanup = [&] () { - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); 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( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); 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( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); 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( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); 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( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); int lineWidth = schIUScale.MilsToIU( cfg->m_Defaults.line_width ); @@ -579,7 +579,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::doDrawShape( const TOOL_EVENT& aEvent, std::opt } else if( evt->IsDblClick( BUT_LEFT ) && !item ) { - m_toolMgr->RunAction( EE_ACTIONS::properties ); + m_toolMgr->RunAction( SCH_ACTIONS::properties ); } else if( evt->IsClick( BUT_RIGHT ) ) { @@ -697,7 +697,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::ImportGraphics( const TOOL_EVENT& aEvent ) KIGFX::VIEW_CONTROLS* controls = getViewControls(); std::vector newItems; // all new items, including group std::vector selectedItems; // the group, or newItems if no group - EE_SELECTION preview; + SCH_SELECTION preview; SCH_COMMIT commit( m_toolMgr ); for( std::unique_ptr& ptr : list ) @@ -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( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); EDA_ITEMS selItems( selectedItems.begin(), selectedItems.end() ); - m_toolMgr->RunAction( EE_ACTIONS::addItemsToSel, &selItems ); + m_toolMgr->RunAction( SCH_ACTIONS::addItemsToSel, &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( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); 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( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); if( pin ) - m_toolMgr->RunAction( EE_ACTIONS::addItemToSel, pin ); + m_toolMgr->RunAction( SCH_ACTIONS::addItemToSel, pin ); } return 0; @@ -873,17 +873,17 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::RepeatDrawItem( const TOOL_EVENT& aEvent ) void SYMBOL_EDITOR_DRAWING_TOOLS::setTransitions() { // clang-format off - Go( &SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace, EE_ACTIONS::placeSymbolPin.MakeEvent() ); - Go( &SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace, EE_ACTIONS::placeSymbolText.MakeEvent() ); - Go( &SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawRectangle.MakeEvent() ); - Go( &SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawCircle.MakeEvent() ); - Go( &SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawArc.MakeEvent() ); - Go( &SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawBezier.MakeEvent() ); - Go( &SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawSymbolLines.MakeEvent() ); - Go( &SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawSymbolPolygon.MakeEvent() ); - Go( &SYMBOL_EDITOR_DRAWING_TOOLS::DrawSymbolTextBox, EE_ACTIONS::drawSymbolTextBox.MakeEvent() ); - Go( &SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor, EE_ACTIONS::placeSymbolAnchor.MakeEvent() ); - Go( &SYMBOL_EDITOR_DRAWING_TOOLS::ImportGraphics, EE_ACTIONS::importGraphics.MakeEvent() ); - Go( &SYMBOL_EDITOR_DRAWING_TOOLS::RepeatDrawItem, EE_ACTIONS::repeatDrawItem.MakeEvent() ); + Go( &SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace, SCH_ACTIONS::placeSymbolPin.MakeEvent() ); + Go( &SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace, SCH_ACTIONS::placeSymbolText.MakeEvent() ); + Go( &SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape, SCH_ACTIONS::drawRectangle.MakeEvent() ); + Go( &SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape, SCH_ACTIONS::drawCircle.MakeEvent() ); + Go( &SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape, SCH_ACTIONS::drawArc.MakeEvent() ); + Go( &SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape, SCH_ACTIONS::drawBezier.MakeEvent() ); + Go( &SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape, SCH_ACTIONS::drawSymbolLines.MakeEvent() ); + Go( &SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape, SCH_ACTIONS::drawSymbolPolygon.MakeEvent() ); + Go( &SYMBOL_EDITOR_DRAWING_TOOLS::DrawSymbolTextBox, SCH_ACTIONS::drawSymbolTextBox.MakeEvent() ); + Go( &SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor, SCH_ACTIONS::placeSymbolAnchor.MakeEvent() ); + Go( &SYMBOL_EDITOR_DRAWING_TOOLS::ImportGraphics, SCH_ACTIONS::importGraphics.MakeEvent() ); + Go( &SYMBOL_EDITOR_DRAWING_TOOLS::RepeatDrawItem, SCH_ACTIONS::repeatDrawItem.MakeEvent() ); // clang-format on } diff --git a/eeschema/tools/symbol_editor_drawing_tools.h b/eeschema/tools/symbol_editor_drawing_tools.h index 0bf6046461..8fbc9256b3 100644 --- a/eeschema/tools/symbol_editor_drawing_tools.h +++ b/eeschema/tools/symbol_editor_drawing_tools.h @@ -27,7 +27,7 @@ #include -#include +#include class SYMBOL_EDIT_FRAME; @@ -39,7 +39,7 @@ class SYMBOL_EDIT_FRAME; * Tool responsible for drawing/placing items (body outlines, pins, etc.) */ -class SYMBOL_EDITOR_DRAWING_TOOLS : public EE_TOOL_BASE +class SYMBOL_EDITOR_DRAWING_TOOLS : public SCH_TOOL_BASE { public: SYMBOL_EDITOR_DRAWING_TOOLS(); diff --git a/eeschema/tools/symbol_editor_edit_tool.cpp b/eeschema/tools/symbol_editor_edit_tool.cpp index 5554e11950..08b6795802 100644 --- a/eeschema/tools/symbol_editor_edit_tool.cpp +++ b/eeschema/tools/symbol_editor_edit_tool.cpp @@ -25,13 +25,13 @@ #include "symbol_editor_edit_tool.h" #include -#include -#include +#include +#include #include #include #include #include -#include +#include #include #include #include @@ -52,7 +52,7 @@ #include SYMBOL_EDITOR_EDIT_TOOL::SYMBOL_EDITOR_EDIT_TOOL() : - EE_TOOL_BASE( "eeschema.SymbolEditTool" ), + SCH_TOOL_BASE( "eeschema.SymbolEditTool" ), m_pickerItem( nullptr ) { } @@ -60,7 +60,7 @@ SYMBOL_EDITOR_EDIT_TOOL::SYMBOL_EDITOR_EDIT_TOOL() : bool SYMBOL_EDITOR_EDIT_TOOL::Init() { - EE_TOOL_BASE::Init(); + SCH_TOOL_BASE::Init(); SYMBOL_EDITOR_DRAWING_TOOLS* drawingTools = m_toolMgr->GetTool(); SYMBOL_EDITOR_MOVE_TOOL* moveTool = m_toolMgr->GetTool(); @@ -91,7 +91,7 @@ bool SYMBOL_EDITOR_EDIT_TOOL::Init() return true; }; - const auto canCopyText = EE_CONDITIONS::OnlyTypes( { + const auto canCopyText = SCH_CONDITIONS::OnlyTypes( { SCH_TEXT_T, SCH_TEXTBOX_T, SCH_FIELD_T, @@ -100,26 +100,27 @@ bool SYMBOL_EDITOR_EDIT_TOOL::Init() SCH_TABLECELL_T, } ); + // clang-format off // Add edit actions to the move tool menu if( moveTool ) { CONDITIONAL_MENU& moveMenu = moveTool->GetToolMenu().GetMenu(); moveMenu.AddSeparator( 200 ); - moveMenu.AddItem( EE_ACTIONS::rotateCCW, canEdit && EE_CONDITIONS::NotEmpty, 200 ); - moveMenu.AddItem( EE_ACTIONS::rotateCW, canEdit && EE_CONDITIONS::NotEmpty, 200 ); - moveMenu.AddItem( EE_ACTIONS::mirrorV, canEdit && EE_CONDITIONS::NotEmpty, 200 ); - moveMenu.AddItem( EE_ACTIONS::mirrorH, canEdit && EE_CONDITIONS::NotEmpty, 200 ); + moveMenu.AddItem( SCH_ACTIONS::rotateCCW, canEdit && SCH_CONDITIONS::NotEmpty, 200 ); + moveMenu.AddItem( SCH_ACTIONS::rotateCW, canEdit && SCH_CONDITIONS::NotEmpty, 200 ); + moveMenu.AddItem( SCH_ACTIONS::mirrorV, canEdit && SCH_CONDITIONS::NotEmpty, 200 ); + moveMenu.AddItem( SCH_ACTIONS::mirrorH, canEdit && SCH_CONDITIONS::NotEmpty, 200 ); - moveMenu.AddItem( EE_ACTIONS::swap, canEdit && SELECTION_CONDITIONS::MoreThan( 1 ), 200); - moveMenu.AddItem( EE_ACTIONS::properties, canEdit && EE_CONDITIONS::Count( 1 ), 200 ); + moveMenu.AddItem( SCH_ACTIONS::swap, canEdit && SELECTION_CONDITIONS::MoreThan( 1 ), 200); + moveMenu.AddItem( SCH_ACTIONS::properties, canEdit && SCH_CONDITIONS::Count( 1 ), 200 ); moveMenu.AddSeparator( 300 ); - moveMenu.AddItem( ACTIONS::cut, EE_CONDITIONS::IdleSelection, 300 ); - moveMenu.AddItem( ACTIONS::copy, EE_CONDITIONS::IdleSelection, 300 ); - moveMenu.AddItem( ACTIONS::copyAsText, canCopyText && EE_CONDITIONS::IdleSelection, 300 ); - moveMenu.AddItem( ACTIONS::duplicate, canEdit && EE_CONDITIONS::NotEmpty, 300 ); - moveMenu.AddItem( ACTIONS::doDelete, canEdit && EE_CONDITIONS::NotEmpty, 200 ); + moveMenu.AddItem( ACTIONS::cut, SCH_CONDITIONS::IdleSelection, 300 ); + moveMenu.AddItem( ACTIONS::copy, SCH_CONDITIONS::IdleSelection, 300 ); + moveMenu.AddItem( ACTIONS::copyAsText, canCopyText && SCH_CONDITIONS::IdleSelection, 300 ); + moveMenu.AddItem( ACTIONS::duplicate, canEdit && SCH_CONDITIONS::NotEmpty, 300 ); + moveMenu.AddItem( ACTIONS::doDelete, canEdit && SCH_CONDITIONS::NotEmpty, 200 ); moveMenu.AddSeparator( 400 ); moveMenu.AddItem( ACTIONS::selectAll, haveSymbolCondition, 400 ); @@ -130,35 +131,36 @@ bool SYMBOL_EDITOR_EDIT_TOOL::Init() CONDITIONAL_MENU& drawMenu = drawingTools->GetToolMenu().GetMenu(); drawMenu.AddSeparator( 200 ); - drawMenu.AddItem( EE_ACTIONS::rotateCCW, canEdit && EE_CONDITIONS::IdleSelection, 200 ); - drawMenu.AddItem( EE_ACTIONS::rotateCW, canEdit && EE_CONDITIONS::IdleSelection, 200 ); - drawMenu.AddItem( EE_ACTIONS::mirrorV, canEdit && EE_CONDITIONS::IdleSelection, 200 ); - drawMenu.AddItem( EE_ACTIONS::mirrorH, canEdit && EE_CONDITIONS::IdleSelection, 200 ); + drawMenu.AddItem( SCH_ACTIONS::rotateCCW, canEdit && SCH_CONDITIONS::IdleSelection, 200 ); + drawMenu.AddItem( SCH_ACTIONS::rotateCW, canEdit && SCH_CONDITIONS::IdleSelection, 200 ); + drawMenu.AddItem( SCH_ACTIONS::mirrorV, canEdit && SCH_CONDITIONS::IdleSelection, 200 ); + drawMenu.AddItem( SCH_ACTIONS::mirrorH, canEdit && SCH_CONDITIONS::IdleSelection, 200 ); - drawMenu.AddItem( EE_ACTIONS::properties, canEdit && EE_CONDITIONS::Count( 1 ), 200 ); + drawMenu.AddItem( SCH_ACTIONS::properties, canEdit && SCH_CONDITIONS::Count( 1 ), 200 ); // Add editing actions to the selection tool menu CONDITIONAL_MENU& selToolMenu = m_selectionTool->GetToolMenu().GetMenu(); - selToolMenu.AddItem( EE_ACTIONS::rotateCCW, canEdit && EE_CONDITIONS::NotEmpty, 200 ); - selToolMenu.AddItem( EE_ACTIONS::rotateCW, canEdit && EE_CONDITIONS::NotEmpty, 200 ); - selToolMenu.AddItem( EE_ACTIONS::mirrorV, canEdit && EE_CONDITIONS::NotEmpty, 200 ); - selToolMenu.AddItem( EE_ACTIONS::mirrorH, canEdit && EE_CONDITIONS::NotEmpty, 200 ); + selToolMenu.AddItem( SCH_ACTIONS::rotateCCW, canEdit && SCH_CONDITIONS::NotEmpty, 200 ); + selToolMenu.AddItem( SCH_ACTIONS::rotateCW, canEdit && SCH_CONDITIONS::NotEmpty, 200 ); + selToolMenu.AddItem( SCH_ACTIONS::mirrorV, canEdit && SCH_CONDITIONS::NotEmpty, 200 ); + selToolMenu.AddItem( SCH_ACTIONS::mirrorH, canEdit && SCH_CONDITIONS::NotEmpty, 200 ); - selToolMenu.AddItem( EE_ACTIONS::swap, canEdit && SELECTION_CONDITIONS::MoreThan( 1 ), 200 ); - selToolMenu.AddItem( EE_ACTIONS::properties, canEdit && EE_CONDITIONS::Count( 1 ), 200 ); + selToolMenu.AddItem( SCH_ACTIONS::swap, canEdit && SELECTION_CONDITIONS::MoreThan( 1 ), 200 ); + selToolMenu.AddItem( SCH_ACTIONS::properties, canEdit && SCH_CONDITIONS::Count( 1 ), 200 ); selToolMenu.AddSeparator( 300 ); - selToolMenu.AddItem( ACTIONS::cut, EE_CONDITIONS::IdleSelection, 300 ); - selToolMenu.AddItem( ACTIONS::copy, EE_CONDITIONS::IdleSelection, 300 ); - selToolMenu.AddItem( ACTIONS::copyAsText, canCopyText && EE_CONDITIONS::IdleSelection, 300 ); - selToolMenu.AddItem( ACTIONS::paste, canEdit && EE_CONDITIONS::Idle, 300 ); - selToolMenu.AddItem( ACTIONS::duplicate, canEdit && EE_CONDITIONS::NotEmpty, 300 ); - selToolMenu.AddItem( ACTIONS::doDelete, canEdit && EE_CONDITIONS::NotEmpty, 300 ); + selToolMenu.AddItem( ACTIONS::cut, SCH_CONDITIONS::IdleSelection, 300 ); + selToolMenu.AddItem( ACTIONS::copy, SCH_CONDITIONS::IdleSelection, 300 ); + selToolMenu.AddItem( ACTIONS::copyAsText, canCopyText && SCH_CONDITIONS::IdleSelection, 300 ); + selToolMenu.AddItem( ACTIONS::paste, canEdit && SCH_CONDITIONS::Idle, 300 ); + selToolMenu.AddItem( ACTIONS::duplicate, canEdit && SCH_CONDITIONS::NotEmpty, 300 ); + selToolMenu.AddItem( ACTIONS::doDelete, canEdit && SCH_CONDITIONS::NotEmpty, 300 ); selToolMenu.AddSeparator( 400 ); selToolMenu.AddItem( ACTIONS::selectAll, haveSymbolCondition, 400 ); selToolMenu.AddItem( ACTIONS::unselectAll, haveSymbolCondition, 400 ); + // clang-format on return true; } @@ -166,13 +168,13 @@ bool SYMBOL_EDITOR_EDIT_TOOL::Init() int SYMBOL_EDITOR_EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) { - EE_SELECTION& selection = m_selectionTool->RequestSelection(); + SCH_SELECTION& selection = m_selectionTool->RequestSelection(); if( selection.GetSize() == 0 ) return 0; VECTOR2I rotPoint; - bool ccw = ( aEvent.Matches( EE_ACTIONS::rotateCCW.MakeEvent() ) ); + bool ccw = ( aEvent.Matches( SCH_ACTIONS::rotateCCW.MakeEvent() ) ); SCH_ITEM* item = static_cast( selection.Front() ); SCH_COMMIT localCommit( m_toolMgr ); SCH_COMMIT* commit = dynamic_cast( aEvent.Commit() ); @@ -202,7 +204,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) else { if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); if( !localCommit.Empty() ) localCommit.Push( _( "Rotate" ) ); @@ -214,13 +216,13 @@ int SYMBOL_EDITOR_EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) int SYMBOL_EDITOR_EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent ) { - EE_SELECTION& selection = m_selectionTool->RequestSelection(); + SCH_SELECTION& selection = m_selectionTool->RequestSelection(); if( selection.GetSize() == 0 ) return 0; VECTOR2I mirrorPoint; - bool xAxis = ( aEvent.Matches( EE_ACTIONS::mirrorV.MakeEvent() ) ); + bool xAxis = ( aEvent.Matches( SCH_ACTIONS::mirrorV.MakeEvent() ) ); SCH_ITEM* item = static_cast( selection.Front() ); if( !item->IsMoving() ) @@ -280,7 +282,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent ) else { if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); m_frame->OnModify(); } @@ -301,7 +303,7 @@ const std::vector swappableItems = { int SYMBOL_EDITOR_EDIT_TOOL::Swap( const TOOL_EVENT& aEvent ) { - EE_SELECTION& selection = m_selectionTool->RequestSelection( swappableItems ); + SCH_SELECTION& selection = m_selectionTool->RequestSelection( swappableItems ); std::vector sorted = selection.GetItemsSortedBySelectionOrder(); if( selection.Size() < 2 ) @@ -362,7 +364,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::Swap( const TOOL_EVENT& aEvent ) else { if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); m_frame->OnModify(); } @@ -391,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( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); commit.Modify( symbol, m_frame->GetScreen() ); @@ -488,7 +490,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::InteractiveDelete( const TOOL_EVENT& aEvent ) { PICKER_TOOL* picker = m_toolMgr->GetTool(); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); m_pickerItem = nullptr; // Deactivate other tools; particularly important if another PICKER is currently running @@ -501,7 +503,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::InteractiveDelete( const TOOL_EVENT& aEvent ) { if( m_pickerItem ) { - EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + SCH_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); selectionTool->UnbrightenItem( m_pickerItem ); selectionTool->AddItemToSel( m_pickerItem, true /*quiet mode*/ ); m_toolMgr->RunAction( ACTIONS::doDelete ); @@ -514,8 +516,8 @@ int SYMBOL_EDITOR_EDIT_TOOL::InteractiveDelete( const TOOL_EVENT& aEvent ) picker->SetMotionHandler( [this]( const VECTOR2D& aPos ) { - EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); - EE_COLLECTOR collector; + SCH_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + SCH_COLLECTOR collector; selectionTool->CollectHits( collector, aPos, nonFields ); @@ -547,10 +549,10 @@ int SYMBOL_EDITOR_EDIT_TOOL::InteractiveDelete( const TOOL_EVENT& aEvent ) [this]( const int& aFinalState ) { if( m_pickerItem ) - m_toolMgr->GetTool()->UnbrightenItem( m_pickerItem ); + m_toolMgr->GetTool()->UnbrightenItem( m_pickerItem ); // Wake the selection tool after exiting to ensure the cursor gets updated - m_toolMgr->PostAction( EE_ACTIONS::selectionActivate ); + m_toolMgr->PostAction( SCH_ACTIONS::selectionActivate ); } ); m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent ); @@ -561,9 +563,9 @@ int SYMBOL_EDITOR_EDIT_TOOL::InteractiveDelete( const TOOL_EVENT& aEvent ) int SYMBOL_EDITOR_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) { - EE_SELECTION& selection = m_selectionTool->RequestSelection(); + SCH_SELECTION& selection = m_selectionTool->RequestSelection(); - if( selection.Empty() || aEvent.IsAction( &EE_ACTIONS::symbolProperties ) ) + if( selection.Empty() || aEvent.IsAction( &SCH_ACTIONS::symbolProperties ) ) { if( m_frame->GetCurSymbol() ) editSymbolProperties(); @@ -620,7 +622,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) } if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); return 0; } @@ -719,7 +721,7 @@ void SYMBOL_EDITOR_EDIT_TOOL::editSymbolProperties() bool partLocked = symbol->UnitsLocked(); m_toolMgr->RunAction( ACTIONS::cancelInteractive ); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); DIALOG_LIB_SYMBOL_PROPERTIES dlg( m_frame, symbol ); @@ -770,7 +772,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::PinTable( const TOOL_EVENT& aEvent ) commit.Modify( symbol ); - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); DIALOG_LIB_EDIT_PIN_TABLE dlg( m_frame, symbol ); @@ -850,7 +852,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::SetUnitDisplayName( const TOOL_EVENT& aEvent ) int SYMBOL_EDITOR_EDIT_TOOL::Undo( const TOOL_EVENT& aEvent ) { - EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); // Nuke the selection for later rebuilding. This does *not* clear the flags on any items; // it just clears the SELECTION's reference to them. @@ -866,7 +868,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::Undo( const TOOL_EVENT& aEvent ) int SYMBOL_EDITOR_EDIT_TOOL::Redo( const TOOL_EVENT& aEvent ) { - EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); // Nuke the selection for later rebuilding. This does *not* clear the flags on any items; // it just clears the SELECTION's reference to them. @@ -893,8 +895,8 @@ int SYMBOL_EDITOR_EDIT_TOOL::Cut( const TOOL_EVENT& aEvent ) int SYMBOL_EDITOR_EDIT_TOOL::Copy( const TOOL_EVENT& aEvent ) { - LIB_SYMBOL* symbol = m_frame->GetCurSymbol(); - EE_SELECTION& selection = m_selectionTool->RequestSelection( nonFields ); + LIB_SYMBOL* symbol = m_frame->GetCurSymbol(); + SCH_SELECTION& selection = m_selectionTool->RequestSelection( nonFields ); if( !symbol || !selection.GetSize() ) return 0; @@ -932,8 +934,8 @@ int SYMBOL_EDITOR_EDIT_TOOL::Copy( const TOOL_EVENT& aEvent ) int SYMBOL_EDITOR_EDIT_TOOL::CopyAsText( const TOOL_EVENT& aEvent ) { - EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - EE_SELECTION& selection = selTool->RequestSelection(); + SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + SCH_SELECTION& selection = selTool->RequestSelection(); if( selection.Empty() ) return 0; @@ -941,7 +943,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::CopyAsText( const TOOL_EVENT& aEvent ) wxString itemsAsText = GetSelectedItemsAsText( selection ); if( selection.IsHover() ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); return SaveClipboard( itemsAsText.ToStdString() ); } @@ -1010,13 +1012,13 @@ int SYMBOL_EDITOR_EDIT_TOOL::Paste( const TOOL_EVENT& aEvent ) m_selectionTool->RebuildSelection(); - EE_SELECTION& selection = m_selectionTool->GetSelection(); + SCH_SELECTION& selection = m_selectionTool->GetSelection(); if( !selection.Empty() ) { selection.SetReferencePoint( getViewControls()->GetCursorPosition( true ) ); - if( m_toolMgr->RunSynchronousAction( EE_ACTIONS::move, &commit ) ) + if( m_toolMgr->RunSynchronousAction( SCH_ACTIONS::move, &commit ) ) commit.Push( _( "Paste" ) ); else commit.Revert(); @@ -1028,9 +1030,9 @@ int SYMBOL_EDITOR_EDIT_TOOL::Paste( const TOOL_EVENT& aEvent ) int SYMBOL_EDITOR_EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent ) { - LIB_SYMBOL* symbol = m_frame->GetCurSymbol(); - EE_SELECTION& selection = m_selectionTool->RequestSelection( nonFields ); - SCH_COMMIT commit( m_toolMgr ); + LIB_SYMBOL* symbol = m_frame->GetCurSymbol(); + SCH_SELECTION& selection = m_selectionTool->RequestSelection( nonFields ); + SCH_COMMIT commit( m_toolMgr ); if( selection.GetSize() == 0 ) return 0; @@ -1092,12 +1094,12 @@ int SYMBOL_EDITOR_EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent ) getView()->Add( newItem ); } - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); - m_toolMgr->RunAction( EE_ACTIONS::addItemsToSel, &newItems ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::addItemsToSel, &newItems ); selection.SetReferencePoint( getViewControls()->GetCursorPosition( true ) ); - if( m_toolMgr->RunSynchronousAction( EE_ACTIONS::move, &commit ) ) + if( m_toolMgr->RunSynchronousAction( SCH_ACTIONS::move, &commit ) ) commit.Push( _( "Duplicate" ) ); else commit.Revert(); @@ -1109,7 +1111,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent ) int SYMBOL_EDITOR_EDIT_TOOL::Increment( const TOOL_EVENT& aEvent ) { const ACTIONS::INCREMENT incParam = aEvent.Parameter(); - EE_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_PIN_T, SCH_TEXT_T } ); + SCH_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_PIN_T, SCH_TEXT_T } ); if( selection.Empty() ) return 0; @@ -1228,11 +1230,11 @@ void SYMBOL_EDITOR_EDIT_TOOL::setTransitions() Go( &SYMBOL_EDITOR_EDIT_TOOL::Paste, ACTIONS::paste.MakeEvent() ); Go( &SYMBOL_EDITOR_EDIT_TOOL::Duplicate, ACTIONS::duplicate.MakeEvent() ); - Go( &SYMBOL_EDITOR_EDIT_TOOL::Rotate, EE_ACTIONS::rotateCW.MakeEvent() ); - Go( &SYMBOL_EDITOR_EDIT_TOOL::Rotate, EE_ACTIONS::rotateCCW.MakeEvent() ); - Go( &SYMBOL_EDITOR_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorV.MakeEvent() ); - Go( &SYMBOL_EDITOR_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorH.MakeEvent() ); - Go( &SYMBOL_EDITOR_EDIT_TOOL::Swap, EE_ACTIONS::swap.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::Rotate, SCH_ACTIONS::rotateCW.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::Rotate, SCH_ACTIONS::rotateCCW.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::Mirror, SCH_ACTIONS::mirrorV.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::Mirror, SCH_ACTIONS::mirrorH.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::Swap, SCH_ACTIONS::swap.MakeEvent() ); Go( &SYMBOL_EDITOR_EDIT_TOOL::DoDelete, ACTIONS::doDelete.MakeEvent() ); Go( &SYMBOL_EDITOR_EDIT_TOOL::InteractiveDelete, ACTIONS::deleteTool.MakeEvent() ); @@ -1242,10 +1244,10 @@ void SYMBOL_EDITOR_EDIT_TOOL::setTransitions() Go( &SYMBOL_EDITOR_EDIT_TOOL::Increment, ACTIONS::incrementSecondary.MakeEvent() ); Go( &SYMBOL_EDITOR_EDIT_TOOL::Increment, ACTIONS::decrementSecondary.MakeEvent() ); - Go( &SYMBOL_EDITOR_EDIT_TOOL::Properties, EE_ACTIONS::properties.MakeEvent() ); - Go( &SYMBOL_EDITOR_EDIT_TOOL::Properties, EE_ACTIONS::symbolProperties.MakeEvent() ); - Go( &SYMBOL_EDITOR_EDIT_TOOL::PinTable, EE_ACTIONS::pinTable.MakeEvent() ); - Go( &SYMBOL_EDITOR_EDIT_TOOL::UpdateSymbolFields, EE_ACTIONS::updateSymbolFields.MakeEvent() ); - Go( &SYMBOL_EDITOR_EDIT_TOOL::SetUnitDisplayName, EE_ACTIONS::setUnitDisplayName.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::Properties, SCH_ACTIONS::properties.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::Properties, SCH_ACTIONS::symbolProperties.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::PinTable, SCH_ACTIONS::pinTable.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::UpdateSymbolFields, SCH_ACTIONS::updateSymbolFields.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::SetUnitDisplayName, SCH_ACTIONS::setUnitDisplayName.MakeEvent() ); // clang-format on } diff --git a/eeschema/tools/symbol_editor_edit_tool.h b/eeschema/tools/symbol_editor_edit_tool.h index 14bcec0a0f..822196cffa 100644 --- a/eeschema/tools/symbol_editor_edit_tool.h +++ b/eeschema/tools/symbol_editor_edit_tool.h @@ -24,7 +24,7 @@ #pragma once -#include +#include class SCH_PIN; @@ -32,7 +32,7 @@ class SCH_SHAPE; class SYMBOL_EDIT_FRAME; -class SYMBOL_EDITOR_EDIT_TOOL : public EE_TOOL_BASE +class SYMBOL_EDITOR_EDIT_TOOL : public SCH_TOOL_BASE { public: SYMBOL_EDITOR_EDIT_TOOL(); diff --git a/eeschema/tools/symbol_editor_move_tool.cpp b/eeschema/tools/symbol_editor_move_tool.cpp index 63c0f86fb1..aaabf3f65c 100644 --- a/eeschema/tools/symbol_editor_move_tool.cpp +++ b/eeschema/tools/symbol_editor_move_tool.cpp @@ -23,8 +23,8 @@ */ #include -#include -#include +#include +#include #include #include #include @@ -37,7 +37,7 @@ SYMBOL_EDITOR_MOVE_TOOL::SYMBOL_EDITOR_MOVE_TOOL() : - EE_TOOL_BASE( "eeschema.SymbolMoveTool" ), + SCH_TOOL_BASE( "eeschema.SymbolMoveTool" ), m_moveInProgress( false ) { } @@ -45,7 +45,7 @@ SYMBOL_EDITOR_MOVE_TOOL::SYMBOL_EDITOR_MOVE_TOOL() : bool SYMBOL_EDITOR_MOVE_TOOL::Init() { - EE_TOOL_BASE::Init(); + SCH_TOOL_BASE::Init(); // // Add move actions to the selection tool menu @@ -73,8 +73,8 @@ bool SYMBOL_EDITOR_MOVE_TOOL::Init() return true; }; - selToolMenu.AddItem( EE_ACTIONS::move, canMove && EE_CONDITIONS::IdleSelection, 150 ); - selToolMenu.AddItem( EE_ACTIONS::alignToGrid, canMove && EE_CONDITIONS::IdleSelection, 150 ); + selToolMenu.AddItem( SCH_ACTIONS::move, canMove && SCH_CONDITIONS::IdleSelection, 150 ); + selToolMenu.AddItem( SCH_ACTIONS::alignToGrid, canMove && SCH_CONDITIONS::IdleSelection, 150 ); return true; } @@ -82,7 +82,7 @@ bool SYMBOL_EDITOR_MOVE_TOOL::Init() void SYMBOL_EDITOR_MOVE_TOOL::Reset( RESET_REASON aReason ) { - EE_TOOL_BASE::Reset( aReason ); + SCH_TOOL_BASE::Reset( aReason ); if( aReason == MODEL_RELOAD ) m_moveInProgress = false; @@ -124,7 +124,7 @@ bool SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, SCH_COM // Be sure that there is at least one item that we can move. If there's no selection try // looking for the stuff under mouse cursor (i.e. Kicad old-style hover selection). - EE_SELECTION& selection = m_frame->IsSymbolAlias() + SCH_SELECTION& selection = m_frame->IsSymbolAlias() ? m_selectionTool->RequestSelection( { SCH_FIELD_T } ) : m_selectionTool->RequestSelection(); bool unselect = selection.IsHover(); @@ -164,7 +164,7 @@ bool SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, SCH_COM grid.SetSnap( !evt->Modifier( MD_SHIFT ) ); grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() ); - if( evt->IsAction( &EE_ACTIONS::move ) + if( evt->IsAction( &SCH_ACTIONS::move ) || evt->IsMotion() || evt->IsDrag( BUT_LEFT ) || evt->IsAction( &ACTIONS::refreshPreview ) ) @@ -368,7 +368,7 @@ bool SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, SCH_COM item->ClearEditFlags(); if( unselect ) - m_toolMgr->RunAction( EE_ACTIONS::clearSelection ); + m_toolMgr->RunAction( SCH_ACTIONS::clearSelection ); m_moveInProgress = false; m_frame->PopTool( aEvent ); @@ -379,9 +379,9 @@ bool SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, SCH_COM int SYMBOL_EDITOR_MOVE_TOOL::AlignElements( const TOOL_EVENT& aEvent ) { - EE_GRID_HELPER grid( m_toolMgr); - EE_SELECTION& selection = m_selectionTool->RequestSelection(); - SCH_COMMIT commit( m_toolMgr ); + EE_GRID_HELPER grid( m_toolMgr); + SCH_SELECTION& selection = m_selectionTool->RequestSelection(); + SCH_COMMIT commit( m_toolMgr ); auto doMoveItem = [&]( EDA_ITEM* item, const VECTOR2I& delta ) @@ -437,6 +437,6 @@ void SYMBOL_EDITOR_MOVE_TOOL::moveItem( EDA_ITEM* aItem, const VECTOR2I& aDelta void SYMBOL_EDITOR_MOVE_TOOL::setTransitions() { - Go( &SYMBOL_EDITOR_MOVE_TOOL::Main, EE_ACTIONS::move.MakeEvent() ); - Go( &SYMBOL_EDITOR_MOVE_TOOL::AlignElements, EE_ACTIONS::alignToGrid.MakeEvent() ); + Go( &SYMBOL_EDITOR_MOVE_TOOL::Main, SCH_ACTIONS::move.MakeEvent() ); + Go( &SYMBOL_EDITOR_MOVE_TOOL::AlignElements, SCH_ACTIONS::alignToGrid.MakeEvent() ); } diff --git a/eeschema/tools/symbol_editor_move_tool.h b/eeschema/tools/symbol_editor_move_tool.h index e189814d27..336cab7358 100644 --- a/eeschema/tools/symbol_editor_move_tool.h +++ b/eeschema/tools/symbol_editor_move_tool.h @@ -25,14 +25,14 @@ #ifndef SYMBOL_EDITOR_MOVE_TOOL_H #define SYMBOL_EDITOR_MOVE_TOOL_H -#include +#include #include class SYMBOL_EDIT_FRAME; -class EE_SELECTION_TOOL; +class SCH_SELECTION_TOOL; -class SYMBOL_EDITOR_MOVE_TOOL : public EE_TOOL_BASE +class SYMBOL_EDITOR_MOVE_TOOL : public SCH_TOOL_BASE { public: SYMBOL_EDITOR_MOVE_TOOL(); diff --git a/eeschema/tools/symbol_editor_pin_tool.cpp b/eeschema/tools/symbol_editor_pin_tool.cpp index dc23efc318..81fdce77de 100644 --- a/eeschema/tools/symbol_editor_pin_tool.cpp +++ b/eeschema/tools/symbol_editor_pin_tool.cpp @@ -24,11 +24,11 @@ #include "symbol_editor_pin_tool.h" -#include +#include #include #include #include -#include +#include #include #include #include @@ -90,14 +90,14 @@ static int GetLastPinNumSize() SYMBOL_EDITOR_PIN_TOOL::SYMBOL_EDITOR_PIN_TOOL() : - EE_TOOL_BASE( "eeschema.PinEditing" ) + SCH_TOOL_BASE( "eeschema.PinEditing" ) { } bool SYMBOL_EDITOR_PIN_TOOL::Init() { - EE_TOOL_BASE::Init(); + SCH_TOOL_BASE::Init(); auto canEdit = [&]( const SELECTION& sel ) @@ -110,14 +110,14 @@ bool SYMBOL_EDITOR_PIN_TOOL::Init() static const std::vector pinTypes = { SCH_PIN_T }; - auto singlePinCondition = EE_CONDITIONS::Count( 1 ) && EE_CONDITIONS::OnlyTypes( pinTypes ); + auto singlePinCondition = SCH_CONDITIONS::Count( 1 ) && SCH_CONDITIONS::OnlyTypes( pinTypes ); CONDITIONAL_MENU& selToolMenu = m_selectionTool->GetToolMenu().GetMenu(); selToolMenu.AddSeparator( 250 ); - selToolMenu.AddItem( EE_ACTIONS::pushPinLength, canEdit && singlePinCondition, 250 ); - selToolMenu.AddItem( EE_ACTIONS::pushPinNameSize, canEdit && singlePinCondition, 250 ); - selToolMenu.AddItem( EE_ACTIONS::pushPinNumSize, canEdit && singlePinCondition, 250 ); + selToolMenu.AddItem( SCH_ACTIONS::pushPinLength, canEdit && singlePinCondition, 250 ); + selToolMenu.AddItem( SCH_ACTIONS::pushPinNameSize, canEdit && singlePinCondition, 250 ); + selToolMenu.AddItem( SCH_ACTIONS::pushPinNumSize, canEdit && singlePinCondition, 250 ); return true; } @@ -379,9 +379,9 @@ void SYMBOL_EDITOR_PIN_TOOL::CreateImagePins( SCH_PIN* aPin ) int SYMBOL_EDITOR_PIN_TOOL::PushPinProperties( const TOOL_EVENT& aEvent ) { - LIB_SYMBOL* symbol = m_frame->GetCurSymbol(); - EE_SELECTION& selection = m_selectionTool->GetSelection(); - SCH_PIN* sourcePin = dynamic_cast( selection.Front() ); + LIB_SYMBOL* symbol = m_frame->GetCurSymbol(); + SCH_SELECTION& selection = m_selectionTool->GetSelection(); + SCH_PIN* sourcePin = dynamic_cast( selection.Front() ); if( !sourcePin ) return 0; @@ -393,16 +393,16 @@ int SYMBOL_EDITOR_PIN_TOOL::PushPinProperties( const TOOL_EVENT& aEvent ) if( pin == sourcePin ) continue; - if( aEvent.IsAction( &EE_ACTIONS::pushPinLength ) ) + if( aEvent.IsAction( &SCH_ACTIONS::pushPinLength ) ) { if( !pin->GetBodyStyle() || pin->GetBodyStyle() == m_frame->GetBodyStyle() ) pin->ChangeLength( sourcePin->GetLength() ); } - else if( aEvent.IsAction( &EE_ACTIONS::pushPinNameSize ) ) + else if( aEvent.IsAction( &SCH_ACTIONS::pushPinNameSize ) ) { pin->SetNameTextSize( sourcePin->GetNameTextSize() ); } - else if( aEvent.IsAction( &EE_ACTIONS::pushPinNumSize ) ) + else if( aEvent.IsAction( &SCH_ACTIONS::pushPinNumSize ) ) { pin->SetNumberTextSize( sourcePin->GetNumberTextSize() ); } @@ -435,10 +435,10 @@ SCH_PIN* SYMBOL_EDITOR_PIN_TOOL::RepeatPin( const SCH_PIN* aSourcePin ) switch( pin->GetOrientation() ) { default: - case PIN_ORIENTATION::PIN_RIGHT: step.y = schIUScale.MilsToIU( cfg->m_Repeat.pin_step ); break; - case PIN_ORIENTATION::PIN_UP: step.x = schIUScale.MilsToIU( cfg->m_Repeat.pin_step ); break; - case PIN_ORIENTATION::PIN_DOWN: step.x = schIUScale.MilsToIU( cfg->m_Repeat.pin_step) ; break; - case PIN_ORIENTATION::PIN_LEFT: step.y = schIUScale.MilsToIU( cfg->m_Repeat.pin_step ); break; + case PIN_ORIENTATION::PIN_RIGHT: step.y = schIUScale.MilsToIU( cfg->m_Repeat.pin_step ); break; + case PIN_ORIENTATION::PIN_UP: step.x = schIUScale.MilsToIU( cfg->m_Repeat.pin_step ); break; + case PIN_ORIENTATION::PIN_DOWN: step.x = schIUScale.MilsToIU( cfg->m_Repeat.pin_step) ; break; + case PIN_ORIENTATION::PIN_LEFT: step.y = schIUScale.MilsToIU( cfg->m_Repeat.pin_step ); break; } pin->Move( step ); @@ -466,7 +466,7 @@ SCH_PIN* SYMBOL_EDITOR_PIN_TOOL::RepeatPin( const SCH_PIN* aSourcePin ) void SYMBOL_EDITOR_PIN_TOOL::setTransitions() { - Go( &SYMBOL_EDITOR_PIN_TOOL::PushPinProperties, EE_ACTIONS::pushPinLength.MakeEvent() ); - Go( &SYMBOL_EDITOR_PIN_TOOL::PushPinProperties, EE_ACTIONS::pushPinNameSize.MakeEvent() ); - Go( &SYMBOL_EDITOR_PIN_TOOL::PushPinProperties, EE_ACTIONS::pushPinNumSize.MakeEvent() ); + Go( &SYMBOL_EDITOR_PIN_TOOL::PushPinProperties, SCH_ACTIONS::pushPinLength.MakeEvent() ); + Go( &SYMBOL_EDITOR_PIN_TOOL::PushPinProperties, SCH_ACTIONS::pushPinNameSize.MakeEvent() ); + Go( &SYMBOL_EDITOR_PIN_TOOL::PushPinProperties, SCH_ACTIONS::pushPinNumSize.MakeEvent() ); } diff --git a/eeschema/tools/symbol_editor_pin_tool.h b/eeschema/tools/symbol_editor_pin_tool.h index 0c01d0cfce..ef2f03fecc 100644 --- a/eeschema/tools/symbol_editor_pin_tool.h +++ b/eeschema/tools/symbol_editor_pin_tool.h @@ -25,14 +25,14 @@ #ifndef SYMBOL_EDITOR_PIN_TOOL_H #define SYMBOL_EDITOR_PIN_TOOL_H -#include +#include #include class SYMBOL_EDIT_FRAME; -class SYMBOL_EDITOR_PIN_TOOL : public EE_TOOL_BASE +class SYMBOL_EDITOR_PIN_TOOL : public SCH_TOOL_BASE { public: SYMBOL_EDITOR_PIN_TOOL(); diff --git a/eeschema/widgets/design_block_pane.cpp b/eeschema/widgets/design_block_pane.cpp index e85a279128..459d7bdf39 100644 --- a/eeschema/widgets/design_block_pane.cpp +++ b/eeschema/widgets/design_block_pane.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include @@ -51,7 +51,7 @@ DESIGN_BLOCK_PANE::DESIGN_BLOCK_PANE( SCH_EDIT_FRAME* aParent, const LIB_ID* aPr // Accept handler [this]() { - m_frame->GetToolManager()->RunAction( EE_ACTIONS::placeDesignBlock ); + m_frame->GetToolManager()->RunAction( SCH_ACTIONS::placeDesignBlock ); } ); sizer->Add( m_chooserPanel, 1, wxEXPAND, 5 ); diff --git a/eeschema/widgets/hierarchy_pane.cpp b/eeschema/widgets/hierarchy_pane.cpp index 53c87908d3..e015f5897c 100644 --- a/eeschema/widgets/hierarchy_pane.cpp +++ b/eeschema/widgets/hierarchy_pane.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include @@ -321,7 +321,7 @@ void HIERARCHY_PANE::onSelectSheetPath( wxTreeEvent& aEvent ) return; SetCursor( wxCURSOR_ARROWWAIT ); - m_frame->GetToolManager()->RunAction( EE_ACTIONS::changeSheet, + m_frame->GetToolManager()->RunAction( SCH_ACTIONS::changeSheet, &itemData->m_SheetPath ); SetCursor( wxCURSOR_ARROW ); } diff --git a/eeschema/widgets/panel_sch_selection_filter.cpp b/eeschema/widgets/panel_sch_selection_filter.cpp index e3e8f16798..11d690d709 100644 --- a/eeschema/widgets/panel_sch_selection_filter.cpp +++ b/eeschema/widgets/panel_sch_selection_filter.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include @@ -45,7 +45,7 @@ PANEL_SCH_SELECTION_FILTER::PANEL_SCH_SELECTION_FILTER( wxWindow* aParent ) : SetBorders( true, false, false, false ); wxASSERT( m_frame ); - m_tool = m_frame->GetToolManager()->GetTool(); + m_tool = m_frame->GetToolManager()->GetTool(); wxASSERT( m_tool ); SCH_SELECTION_FILTER_OPTIONS& opts = m_tool->GetFilter(); diff --git a/eeschema/widgets/panel_sch_selection_filter.h b/eeschema/widgets/panel_sch_selection_filter.h index 0620e7caa7..846a04d371 100644 --- a/eeschema/widgets/panel_sch_selection_filter.h +++ b/eeschema/widgets/panel_sch_selection_filter.h @@ -24,7 +24,7 @@ #include class SCH_BASE_FRAME; -class EE_SELECTION_TOOL; +class SCH_SELECTION_TOOL; struct SCH_SELECTION_FILTER_OPTIONS; @@ -49,9 +49,9 @@ private: void onPopupSelection( wxCommandEvent& aEvent ); private: - SCH_BASE_FRAME* m_frame; - EE_SELECTION_TOOL* m_tool; - wxCheckBox* m_onlyCheckbox; + SCH_BASE_FRAME* m_frame; + SCH_SELECTION_TOOL* m_tool; + wxCheckBox* m_onlyCheckbox; }; #endif //KICAD_PANEL_SCH_SELECTION_FILTER_H diff --git a/eeschema/widgets/sch_properties_panel.cpp b/eeschema/widgets/sch_properties_panel.cpp index 8ee19740b6..f750264cf1 100644 --- a/eeschema/widgets/sch_properties_panel.cpp +++ b/eeschema/widgets/sch_properties_panel.cpp @@ -36,7 +36,7 @@ #include #include #include -#include +#include SCH_PROPERTIES_PANEL::SCH_PROPERTIES_PANEL( wxWindow* aParent, SCH_BASE_FRAME* aFrame ) : @@ -103,8 +103,8 @@ SCH_PROPERTIES_PANEL::~SCH_PROPERTIES_PANEL() void SCH_PROPERTIES_PANEL::UpdateData() { - EE_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool(); - const SELECTION& selection = selectionTool->GetSelection(); + SCH_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool(); + const SELECTION& selection = selectionTool->GetSelection(); // Will actually just be updatePropertyValues() if selection hasn't changed rebuildProperties( selection ); @@ -113,8 +113,8 @@ void SCH_PROPERTIES_PANEL::UpdateData() void SCH_PROPERTIES_PANEL::AfterCommit() { - EE_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool(); - const SELECTION& selection = selectionTool->GetSelection(); + SCH_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool(); + const SELECTION& selection = selectionTool->GetSelection(); rebuildProperties( selection ); } @@ -136,9 +136,9 @@ wxPGProperty* SCH_PROPERTIES_PANEL::createPGProperty( const PROPERTY_BASE* aProp PROPERTY_BASE* SCH_PROPERTIES_PANEL::getPropertyFromEvent( const wxPropertyGridEvent& aEvent ) const { - EE_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool(); - const SELECTION& selection = selectionTool->GetSelection(); - SCH_ITEM* firstItem = static_cast( selection.Front() ); + SCH_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool(); + const SELECTION& selection = selectionTool->GetSelection(); + SCH_ITEM* firstItem = static_cast( selection.Front() ); wxCHECK_MSG( firstItem, nullptr, wxT( "getPropertyFromEvent for a property with nothing selected!") ); @@ -154,9 +154,9 @@ PROPERTY_BASE* SCH_PROPERTIES_PANEL::getPropertyFromEvent( const wxPropertyGridE void SCH_PROPERTIES_PANEL::valueChanging( wxPropertyGridEvent& aEvent ) { - EE_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool(); - const SELECTION& selection = selectionTool->GetSelection(); - EDA_ITEM* item = selection.Front(); + SCH_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool(); + const SELECTION& selection = selectionTool->GetSelection(); + EDA_ITEM* item = selection.Front(); PROPERTY_BASE* property = getPropertyFromEvent( aEvent ); wxCHECK( property, /* void */ ); @@ -179,14 +179,13 @@ void SCH_PROPERTIES_PANEL::valueChanging( wxPropertyGridEvent& aEvent ) void SCH_PROPERTIES_PANEL::valueChanged( wxPropertyGridEvent& aEvent ) { - EE_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool(); - const SELECTION& selection = selectionTool->GetSelection(); - - PROPERTY_BASE* property = getPropertyFromEvent( aEvent ); + SCH_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool(); + const SELECTION& selection = selectionTool->GetSelection(); + PROPERTY_BASE* property = getPropertyFromEvent( aEvent ); wxCHECK( property, /* void */ ); - wxVariant newValue = aEvent.GetPropertyValue(); - SCH_COMMIT changes( m_frame ); + wxVariant newValue = aEvent.GetPropertyValue(); + SCH_COMMIT changes( m_frame ); SCH_SCREEN* screen = m_frame->GetScreen(); PROPERTY_COMMIT_HANDLER handler( &changes ); diff --git a/eeschema/widgets/search_handlers.cpp b/eeschema/widgets/search_handlers.cpp index 4402cea205..79f50e5cf9 100644 --- a/eeschema/widgets/search_handlers.cpp +++ b/eeschema/widgets/search_handlers.cpp @@ -17,7 +17,7 @@ * with this program. If not, see . */ -#include +#include #include #include #include @@ -35,7 +35,7 @@ void SCH_SEARCH_HANDLER::ActivateItem( long aItemRow ) std::vector item = { aItemRow }; SelectItems( item ); - m_frame->GetToolManager()->RunAction( EE_ACTIONS::properties, true ); + m_frame->GetToolManager()->RunAction( SCH_ACTIONS::properties, true ); } @@ -104,7 +104,7 @@ void SCH_SEARCH_HANDLER::SelectItems( std::vector& aItemRows ) EDA_ITEMS selectedItems; std::vector selectedHits; - m_frame->GetToolManager()->RunAction( EE_ACTIONS::clearSelection ); + m_frame->GetToolManager()->RunAction( SCH_ACTIONS::clearSelection ); for( long row : aItemRows ) { @@ -135,7 +135,7 @@ void SCH_SEARCH_HANDLER::SelectItems( std::vector& aItemRows ) } if( selectedItems.size() ) - m_frame->GetToolManager()->RunAction( EE_ACTIONS::addItemsToSel, &selectedItems ); + m_frame->GetToolManager()->RunAction( SCH_ACTIONS::addItemsToSel, &selectedItems ); switch( settings.selection_zoom ) { diff --git a/eeschema/widgets/symbol_tree_pane.cpp b/eeschema/widgets/symbol_tree_pane.cpp index 8851e1150b..e05bbc04c9 100644 --- a/eeschema/widgets/symbol_tree_pane.cpp +++ b/eeschema/widgets/symbol_tree_pane.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include SYMBOL_TREE_PANE::SYMBOL_TREE_PANE( SYMBOL_EDIT_FRAME* aParent, LIB_SYMBOL_LIBRARY_MANAGER* aLibMgr ) @@ -84,7 +84,7 @@ void SYMBOL_TREE_PANE::onMenuClose( wxMenuEvent& aEvent ) void SYMBOL_TREE_PANE::onSymbolSelected( wxCommandEvent& aEvent ) { - m_symbolEditFrame->GetToolManager()->RunAction( EE_ACTIONS::editSymbol ); + m_symbolEditFrame->GetToolManager()->RunAction( SCH_ACTIONS::editSymbol ); // Make sure current-part highlighting doesn't get lost in selection highlighting m_tree->Unselect();