Naming changes to reflect sharing between SchEdit and LibEdit.

This commit is contained in:
Jeff Young 2019-05-10 18:19:48 +01:00
parent f3c95ad83c
commit c1539ae014
63 changed files with 908 additions and 909 deletions

View File

@ -158,7 +158,7 @@ set( EESCHEMA_SRCS
generate_alias_info.cpp
getpart.cpp
hierarch.cpp
hotkeys.cpp
ee_hotkeys.cpp
lib_arc.cpp
lib_bezier.cpp
lib_circle.cpp
@ -233,16 +233,16 @@ set( EESCHEMA_SRCS
tools/lib_edit_tool.cpp
tools/lib_move_tool.cpp
tools/lib_pin_tool.cpp
tools/point_editor.cpp
tools/sch_actions.cpp
tools/ee_point_editor.cpp
tools/ee_actions.cpp
tools/sch_drawing_tools.cpp
tools/sch_edit_tool.cpp
tools/sch_editor_control.cpp
tools/inspection_tool.cpp
tools/ee_inspection_tool.cpp
tools/sch_wire_bus_tool.cpp
tools/sch_move_tool.cpp
tools/picker_tool.cpp
tools/sch_selection_tool.cpp
tools/ee_picker_tool.cpp
tools/ee_selection_tool.cpp
tools/selection.cpp
)

View File

@ -64,7 +64,7 @@
#include <vector>
#include <algorithm>
#include <tool/tool_manager.h>
#include <tools/sch_selection_tool.h>
#include <tools/ee_selection_tool.h>
#define FIELD_PADDING 10 // arbitrarily chosen for aesthetics
#define FIELD_PADDING_ALIGNED 18 // aligns 50 mil text to a 100 mil grid

View File

@ -33,8 +33,8 @@
#include <sch_component.h>
#include <sch_sheet.h>
#include <sch_view.h>
#include <tools/sch_actions.h>
#include <tools/sch_selection_tool.h>
#include <tools/ee_actions.h>
#include <tools/ee_selection_tool.h>
#include <tool/tool_manager.h>
#include "eeschema_id.h"

View File

@ -27,7 +27,7 @@
#include <sch_draw_panel.h>
#include <sch_edit_frame.h>
#include <eeschema_id.h>
#include <hotkeys.h>
#include <ee_hotkeys.h>
#include <lib_edit_frame.h>
#include <viewlib_frame.h>
#include <sch_view.h>

View File

@ -41,7 +41,7 @@
#include <sch_view.h>
#include <reporter.h>
#include <netlist_exporters/netlist_exporter_kicad.h>
#include <tools/sch_actions.h>
#include <tools/ee_actions.h>
/**
* Execute a remote command sent by Pcbnew via a socket connection.
@ -82,7 +82,7 @@ void SCH_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
SetStatusText( _( "Selected net: " ) + UnescapeString( m_SelectedNetName ) );
GetToolManager()->RunAction( SCH_ACTIONS::highlightNetSelection, true );
GetToolManager()->RunAction( EE_ACTIONS::highlightNetSelection, true );
}
return;

View File

@ -31,7 +31,7 @@
#include <sch_edit_frame.h>
#include <kicad_device_context.h>
#include <tool/tool_manager.h>
#include <tools/sch_actions.h>
#include <tools/ee_actions.h>
#include <general.h>
#include <sch_text.h>
#include <eeschema_id.h>
@ -141,7 +141,7 @@ void SCH_EDIT_FRAME::ConvertTextType( SCH_TEXT* aText, KICAD_T aType )
newtext->SetIsDangling( aText->IsDangling() );
if( selected )
m_toolManager->RunAction( SCH_ACTIONS::removeItemFromSel, true, aText );
m_toolManager->RunAction( EE_ACTIONS::removeItemFromSel, true, aText );
if( !aText->IsNew() )
{
@ -153,7 +153,7 @@ void SCH_EDIT_FRAME::ConvertTextType( SCH_TEXT* aText, KICAD_T aType )
}
if( selected )
m_toolManager->RunAction( SCH_ACTIONS::addItemToSel, true, newtext );
m_toolManager->RunAction( EE_ACTIONS::addItemToSel, true, newtext );
delete aText;

View File

@ -26,7 +26,7 @@
#include <fctsys.h>
#include <id.h>
#include <eeschema_id.h>
#include <hotkeys.h>
#include <ee_hotkeys.h>
#include <sch_edit_frame.h>
#include <sch_draw_panel.h>
@ -41,8 +41,8 @@
#include <dialogs/dialog_schematic_find.h>
#include <tool/tool_manager.h>
#include <tools/sch_selection_tool.h>
#include <tools/sch_actions.h>
#include <tools/ee_selection_tool.h>
#include <tools/ee_actions.h>
// Remark: the hotkey message info is used as keyword in hotkey config files and
// as comments in help windows, therefore translated only when displayed
@ -448,9 +448,9 @@ bool SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
if( aHotKey == 0 )
return false;
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
SCH_SELECTION_TOOL* selTool = GetToolManager()->GetTool<SCH_SELECTION_TOOL>();
SELECTION& selection = selTool->GetSelection();
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
EE_SELECTION_TOOL* selTool = GetToolManager()->GetTool<EE_SELECTION_TOOL>();
SELECTION& selection = selTool->GetSelection();
/* Convert lower to upper case (the usual toupper function has problem
* with non ascii codes like function keys */
@ -489,7 +489,7 @@ bool SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
case HK_REDO: // while busy performing another command.
case HK_FIND_ITEM:
case HK_FIND_REPLACE:
if( SCH_CONDITIONS::Idle( selection ) )
if( EE_CONDITIONS::Idle( selection ) )
{
cmd.SetId( hotKey->m_IdMenuEvent );
GetEventHandler()->ProcessEvent( cmd );
@ -498,7 +498,7 @@ bool SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
case HK_FIND_NEXT_ITEM:
case HK_FIND_NEXT_DRC_MARKER:
if( SCH_CONDITIONS::Idle( selection ) )
if( EE_CONDITIONS::Idle( selection ) )
{
wxFindDialogEvent event( hotKey->m_IdMenuEvent, GetId() );
event.SetEventObject( this );
@ -541,9 +541,9 @@ bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
if( aHotKey == 0 )
return false;
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
SCH_SELECTION_TOOL* selTool = GetToolManager()->GetTool<SCH_SELECTION_TOOL>();
SELECTION& selection = selTool->GetSelection();
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
EE_SELECTION_TOOL* selTool = GetToolManager()->GetTool<EE_SELECTION_TOOL>();
SELECTION& selection = selTool->GetSelection();
cmd.SetEventObject( this );
@ -588,7 +588,7 @@ bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
case HK_UNDO:
case HK_REDO:
if( SCH_CONDITIONS::Idle( selection ) )
if( EE_CONDITIONS::Idle( selection ) )
{
cmd.SetId( hotKey->m_IdMenuEvent );
GetEventHandler()->ProcessEvent( cmd );

View File

@ -42,7 +42,7 @@
#include <general.h>
#include <class_libentry.h>
#include <hotkeys.h>
#include <ee_hotkeys.h>
#include <transform.h>
#include <wildcards_and_files_ext.h>
#include <symbol_lib_table.h>

View File

@ -36,7 +36,7 @@
#include <invoke_sch_dialog.h>
#include <lib_edit_frame.h>
#include <eeschema_config.h>
#include <hotkeys.h>
#include <ee_hotkeys.h>
#include <worksheet_shape_builder.h>
#include <class_library.h>
#include <symbol_lib_table.h>

View File

@ -34,7 +34,7 @@
#include <kicad_device_context.h>
#include <msgpanel.h>
#include <tool/tool_manager.h>
#include <tools/sch_actions.h>
#include <tools/ee_actions.h>
#include <general.h>
#include <class_library.h>
#include <sch_component.h>
@ -287,7 +287,7 @@ void SCH_EDIT_FRAME::ConvertPart( SCH_COMPONENT* aComponent )
// If selected make sure all the now-included pins are selected
if( aComponent->IsSelected() )
m_toolManager->RunAction( SCH_ACTIONS::addItemToSel, true, aComponent );
m_toolManager->RunAction( EE_ACTIONS::addItemToSel, true, aComponent );
RefreshItem( aComponent );
OnModify();

View File

@ -38,7 +38,7 @@
#include <wx/imaglist.h>
#include <wx/treectrl.h>
#include <tool/tool_manager.h>
#include <tools/sch_actions.h>
#include <tools/ee_actions.h>
#include <netlist_object.h>
#include <sch_sheet_path.h>
@ -257,7 +257,7 @@ void HIERARCHY_NAVIG_DLG::onSelectSheetPath( wxTreeEvent& event )
void SCH_EDIT_FRAME::DisplayCurrentSheet()
{
m_toolManager->RunAction( ACTIONS::cancelInteractive, true );
m_toolManager->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolManager->RunAction( EE_ACTIONS::clearSelection, true );
SCH_SCREEN* screen = g_CurrentSheet->LastScreen();
@ -286,6 +286,6 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet()
UpdateTitle();
GetToolManager()->RunAction( SCH_ACTIONS::highlightNetSelection, true );
GetToolManager()->RunAction( EE_ACTIONS::highlightNetSelection, true );
HardRedraw(); // Ensure any item has its view updated, especially the worksheet items
}

View File

@ -34,7 +34,7 @@
#include <eeschema_id.h>
#include <general.h>
#include <hotkeys.h>
#include <ee_hotkeys.h>
#include <lib_edit_frame.h>
#include <viewlib_frame.h>
#include <lib_draw_item.h>

View File

@ -49,7 +49,7 @@
#include <widgets/lib_tree.h>
#include <symbol_lib_table.h>
#include <kicad_device_context.h>
#include <hotkeys.h>
#include <ee_hotkeys.h>
#include <eeschema_config.h>
#include <dialogs/dialog_lib_edit_text.h>
@ -65,15 +65,15 @@
#include <tool/context_menu.h>
#include <tool/common_tools.h>
#include <tool/zoom_tool.h>
#include <tools/sch_actions.h>
#include <tools/sch_selection_tool.h>
#include <tools/picker_tool.h>
#include <tools/inspection_tool.h>
#include <tools/ee_actions.h>
#include <tools/ee_selection_tool.h>
#include <tools/ee_picker_tool.h>
#include <tools/ee_inspection_tool.h>
#include <tools/lib_pin_tool.h>
#include <tools/lib_edit_tool.h>
#include <tools/lib_move_tool.h>
#include <tools/lib_drawing_tools.h>
#include <tools/point_editor.h>
#include <tools/ee_point_editor.h>
#include <sch_view.h>
#include <sch_painter.h>
@ -317,18 +317,18 @@ void LIB_EDIT_FRAME::setupTools()
m_toolManager = new TOOL_MANAGER;
m_toolManager->SetEnvironment( GetScreen(), GetCanvas()->GetView(),
GetCanvas()->GetViewControls(), this );
m_actions = new SCH_ACTIONS();
m_actions = new EE_ACTIONS();
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions );
// Register tools
m_toolManager->RegisterTool( new COMMON_TOOLS );
m_toolManager->RegisterTool( new ZOOM_TOOL );
m_toolManager->RegisterTool( new SCH_SELECTION_TOOL );
m_toolManager->RegisterTool( new PICKER_TOOL );
m_toolManager->RegisterTool( new INSPECTION_TOOL );
m_toolManager->RegisterTool( new EE_SELECTION_TOOL );
m_toolManager->RegisterTool( new EE_PICKER_TOOL );
m_toolManager->RegisterTool( new EE_INSPECTION_TOOL );
m_toolManager->RegisterTool( new LIB_PIN_TOOL );
m_toolManager->RegisterTool( new LIB_DRAWING_TOOLS );
m_toolManager->RegisterTool( new POINT_EDITOR );
m_toolManager->RegisterTool( new EE_POINT_EDITOR );
m_toolManager->RegisterTool( new LIB_MOVE_TOOL );
m_toolManager->RegisterTool( new LIB_EDIT_TOOL );
m_toolManager->InitTools();
@ -520,21 +520,21 @@ void LIB_EDIT_FRAME::OnUpdatePaste( wxUpdateUIEvent& event )
void LIB_EDIT_FRAME::OnUpdateUndo( wxUpdateUIEvent& event )
{
SCH_SELECTION_TOOL* selTool = m_toolManager->GetTool<SCH_SELECTION_TOOL>();
EE_SELECTION_TOOL* selTool = m_toolManager->GetTool<EE_SELECTION_TOOL>();
event.Enable( GetCurPart() && GetScreen()
&& GetScreen()->GetUndoCommandCount() != 0
&& SCH_CONDITIONS::Idle( selTool->GetSelection() ) );
&& EE_CONDITIONS::Idle( selTool->GetSelection() ) );
}
void LIB_EDIT_FRAME::OnUpdateRedo( wxUpdateUIEvent& event )
{
SCH_SELECTION_TOOL* selTool = m_toolManager->GetTool<SCH_SELECTION_TOOL>();
EE_SELECTION_TOOL* selTool = m_toolManager->GetTool<EE_SELECTION_TOOL>();
event.Enable( GetCurPart() && GetScreen()
&& GetScreen()->GetRedoCommandCount() != 0
&& SCH_CONDITIONS::Idle( selTool->GetSelection() ) );
&& EE_CONDITIONS::Idle( selTool->GetSelection() ) );
}
@ -598,7 +598,7 @@ void LIB_EDIT_FRAME::OnSelectUnit( wxCommandEvent& event )
return;
m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, GetGalCanvas()->GetDefaultCursor() );
m_toolManager->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolManager->RunAction( EE_ACTIONS::clearSelection, true );
m_unit = i + 1;
@ -648,7 +648,7 @@ void LIB_EDIT_FRAME::OnViewEntryDoc( wxCommandEvent& event )
void LIB_EDIT_FRAME::OnSelectBodyStyle( wxCommandEvent& event )
{
m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, GetGalCanvas()->GetDefaultCursor() );
m_toolManager->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolManager->RunAction( EE_ACTIONS::clearSelection, true );
m_convert = event.GetId() == ID_DE_MORGAN_NORMAL_BUTT ? 1 : 2;
@ -715,7 +715,7 @@ void LIB_EDIT_FRAME::SetCurPart( LIB_PART* aPart )
if( !aPart && !m_my_part )
return;
m_toolManager->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolManager->RunAction( EE_ACTIONS::clearSelection, true );
GetScreen()->SetCurItem( nullptr );
if( m_my_part != aPart )
@ -751,7 +751,7 @@ void LIB_EDIT_FRAME::OnEditComponentProperties( wxCommandEvent& event )
wxArrayString oldAliases = GetCurPart()->GetAliasNames( false );
m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, GetGalCanvas()->GetDefaultCursor() );
m_toolManager->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolManager->RunAction( EE_ACTIONS::clearSelection, true );
DIALOG_EDIT_COMPONENT_IN_LIBRARY dlg( this, GetCurPart() );
@ -835,7 +835,7 @@ void LIB_EDIT_FRAME::OnOpenPinTable( wxCommandEvent& aEvent )
{
LIB_PART* part = GetCurPart();
m_toolManager->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolManager->RunAction( EE_ACTIONS::clearSelection, true );
SaveCopyInUndoList( part );
@ -880,7 +880,7 @@ void LIB_EDIT_FRAME::OnAddPartToSchematic( wxCommandEvent& event )
component->AutoplaceFields( /* aScreen */ NULL, /* aManual */ false );
schframe->Raise();
schframe->GetToolManager()->RunAction( SCH_ACTIONS::placeSymbol, true, component );
schframe->GetToolManager()->RunAction( EE_ACTIONS::placeSymbol, true, component );
}
}

View File

@ -31,7 +31,7 @@
#include <widgets/lib_tree.h>
#include <symbol_tree_pane.h>
#include <tool/tool_manager.h>
#include <tools/sch_actions.h>
#include <tools/ee_actions.h>
void LIB_EDIT_FRAME::SaveCopyInUndoList( EDA_ITEM* ItemToCopy, UNDO_REDO_T undoType )
{
@ -58,7 +58,7 @@ void LIB_EDIT_FRAME::GetComponentFromRedoList( wxCommandEvent& event )
if( GetScreen()->GetRedoCommandCount() <= 0 )
return;
m_toolManager->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolManager->RunAction( EE_ACTIONS::clearSelection, true );
// Load the last redo entry
PICKED_ITEMS_LIST* redoCommand = GetScreen()->PopCommandFromRedoList();
@ -107,7 +107,7 @@ void LIB_EDIT_FRAME::GetComponentFromUndoList( wxCommandEvent& event )
if( GetScreen()->GetUndoCommandCount() <= 0 )
return;
m_toolManager->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolManager->RunAction( EE_ACTIONS::clearSelection, true );
// Load the last undo entry
PICKED_ITEMS_LIST* undoCommand = GetScreen()->PopCommandFromUndoList();
@ -153,7 +153,7 @@ void LIB_EDIT_FRAME::GetComponentFromUndoList( wxCommandEvent& event )
void LIB_EDIT_FRAME::RollbackPartFromUndo()
{
m_toolManager->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolManager->RunAction( EE_ACTIONS::clearSelection, true );
// Load the last undo entry
PICKED_ITEMS_LIST* undoCommand = GetScreen()->PopCommandFromUndoList();

View File

@ -34,7 +34,7 @@
#include "eeschema_id.h"
#include "general.h"
#include "help_common_strings.h"
#include "hotkeys.h"
#include "ee_hotkeys.h"
#include "lib_edit_frame.h"

View File

@ -39,15 +39,15 @@
#include <view/view.h>
#include <dialogs/dialog_display_info_HTML_base.h>
#include <tool/tool_manager.h>
#include <tools/sch_selection_tool.h>
#include <tools/ee_selection_tool.h>
void LIB_EDIT_FRAME::LoadOneSymbol()
{
SCH_SELECTION_TOOL* selTool = m_toolManager->GetTool<SCH_SELECTION_TOOL>();
LIB_PART* part = GetCurPart();
EE_SELECTION_TOOL* selTool = m_toolManager->GetTool<EE_SELECTION_TOOL>();
LIB_PART* part = GetCurPart();
// Exit if no library entry is selected or a command is in progress.
if( !part || !SCH_CONDITIONS::Idle( selTool->GetSelection() ) )
if( !part || !EE_CONDITIONS::Idle( selTool->GetSelection() ) )
return;
PROJECT& prj = Prj();

View File

@ -24,7 +24,7 @@
*/
#include <fctsys.h>
#include <hotkeys.h>
#include <ee_hotkeys.h>
#include <eeschema_id.h>
#include <general.h>

View File

@ -36,7 +36,7 @@
#include "eeschema_id.h"
#include "general.h"
#include "help_common_strings.h"
#include "hotkeys.h"
#include "ee_hotkeys.h"
#include "sch_edit_frame.h"
// helper functions that build specific submenus:

View File

@ -39,7 +39,7 @@
#include <dialog_configure_paths.h>
#include <tool/tool_manager.h>
#include <tool/tool_dispatcher.h>
#include <tools/sch_actions.h>
#include <tools/ee_actions.h>
#include "dialogs/panel_sym_lib_table.h"

View File

@ -94,7 +94,7 @@ SEARCH_RESULT SCH_COLLECTOR::Inspect( EDA_ITEM* aItem, void* aTestData )
if( aItem->Type() == LIB_PIN_T )
{
// Special selection rules apply to pins of different units when edited in
// synchronized pins mode. Leave it to SCH_SELECTION_TOOL::isSelectable() to
// synchronized pins mode. Leave it to EE_SELECTION_TOOL::isSelectable() to
// decide what to do with them.
}
else if( m_Unit || m_Convert )

View File

@ -38,8 +38,8 @@
#include <functional>
#include <sch_sheet.h>
#include <pgm_base.h>
#include <tools/sch_actions.h>
#include <tools/sch_selection_tool.h>
#include <tools/ee_actions.h>
#include <tools/ee_selection_tool.h>
using namespace std::placeholders;
@ -285,10 +285,10 @@ void SCH_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )
{
m_abortRequest = true;
SCH_SELECTION_TOOL* selTool = GetParent()->GetToolManager()->GetTool<SCH_SELECTION_TOOL>();
EE_SELECTION_TOOL* selTool = GetParent()->GetToolManager()->GetTool<EE_SELECTION_TOOL>();
if( SCH_CONDITIONS::Idle( selTool->GetSelection() ) )
GetParent()->GetToolManager()->RunAction( SCH_ACTIONS::selectionActivate, true );
if( EE_CONDITIONS::Idle( selTool->GetSelection() ) )
GetParent()->GetToolManager()->RunAction( EE_ACTIONS::selectionActivate, true );
else
GetParent()->GetToolManager()->RunAction( ACTIONS::cancelInteractive, true );

View File

@ -46,7 +46,7 @@
#include <reporter.h>
#include <lib_edit_frame.h>
#include <viewlib_frame.h>
#include <hotkeys.h>
#include <ee_hotkeys.h>
#include <eeschema_config.h>
#include <sch_sheet.h>
#include <sim/sim_plot_frame.h>
@ -58,15 +58,15 @@
#include <tool/tool_dispatcher.h>
#include <tool/common_tools.h>
#include <tool/zoom_tool.h>
#include <tools/sch_actions.h>
#include <tools/sch_selection_tool.h>
#include <tools/picker_tool.h>
#include <tools/point_editor.h>
#include <tools/ee_actions.h>
#include <tools/ee_selection_tool.h>
#include <tools/ee_picker_tool.h>
#include <tools/ee_point_editor.h>
#include <tools/sch_drawing_tools.h>
#include <tools/sch_wire_bus_tool.h>
#include <tools/sch_move_tool.h>
#include <tools/sch_edit_tool.h>
#include <tools/inspection_tool.h>
#include <tools/ee_inspection_tool.h>
#include <tools/sch_editor_control.h>
#include <build_version.h>
#include <wildcards_and_files_ext.h>
@ -422,21 +422,21 @@ void SCH_EDIT_FRAME::setupTools()
m_toolManager = new TOOL_MANAGER;
m_toolManager->SetEnvironment( GetScreen(), GetCanvas()->GetView(),
GetCanvas()->GetViewControls(), this );
m_actions = new SCH_ACTIONS();
m_actions = new EE_ACTIONS();
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions );
// Register tools
m_toolManager->RegisterTool( new COMMON_TOOLS );
m_toolManager->RegisterTool( new ZOOM_TOOL );
m_toolManager->RegisterTool( new SCH_SELECTION_TOOL );
m_toolManager->RegisterTool( new PICKER_TOOL );
m_toolManager->RegisterTool( new EE_SELECTION_TOOL );
m_toolManager->RegisterTool( new EE_PICKER_TOOL );
m_toolManager->RegisterTool( new SCH_DRAWING_TOOLS );
m_toolManager->RegisterTool( new SCH_WIRE_BUS_TOOL );
m_toolManager->RegisterTool( new SCH_MOVE_TOOL );
m_toolManager->RegisterTool( new SCH_EDIT_TOOL );
m_toolManager->RegisterTool( new INSPECTION_TOOL );
m_toolManager->RegisterTool( new EE_INSPECTION_TOOL );
m_toolManager->RegisterTool( new SCH_EDITOR_CONTROL );
m_toolManager->RegisterTool( new POINT_EDITOR );
m_toolManager->RegisterTool( new EE_POINT_EDITOR );
m_toolManager->InitTools();
// Run the selection tool, it is supposed to be always active

View File

@ -35,7 +35,7 @@
#include <sch_view.h>
#include <sch_painter.h>
#include <general.h>
#include <hotkeys.h>
#include <ee_hotkeys.h>
#include <eeschema_id.h>
#include <help_common_strings.h>

View File

@ -28,7 +28,7 @@
#include "eeschema_id.h"
#include "general.h"
#include "help_common_strings.h"
#include "hotkeys.h"
#include "ee_hotkeys.h"
#include "viewlib_frame.h"
#include <symbol_lib_table.h>

View File

@ -23,18 +23,18 @@
#include <common.h>
#include <eeschema_id.h>
#include <tools/sch_actions.h>
#include <tools/ee_actions.h>
char g_lastBusEntryShape = '/';
OPT<TOOL_EVENT> SCH_ACTIONS::TranslateLegacyId( int aId )
OPT<TOOL_EVENT> EE_ACTIONS::TranslateLegacyId( int aId )
{
switch( aId )
{
case ID_NO_TOOL_SELECTED:
return SCH_ACTIONS::selectionActivate.MakeEvent();
return EE_ACTIONS::selectionActivate.MakeEvent();
case ID_CANCEL_CURRENT_COMMAND:
return ACTIONS::cancelInteractive.MakeEvent();
@ -59,184 +59,184 @@ OPT<TOOL_EVENT> SCH_ACTIONS::TranslateLegacyId( int aId )
return ACTIONS::zoomTool.MakeEvent();
case ID_HIGHLIGHT_BUTT:
return SCH_ACTIONS::highlightNetCursor.MakeEvent();
return EE_ACTIONS::highlightNetCursor.MakeEvent();
case ID_HIGHLIGHT_NET:
return SCH_ACTIONS::highlightNet.MakeEvent();
return EE_ACTIONS::highlightNet.MakeEvent();
case ID_MENU_PLACE_COMPONENT:
case ID_SCH_PLACE_COMPONENT:
return SCH_ACTIONS::placeSymbol.MakeEvent();
return EE_ACTIONS::placeSymbol.MakeEvent();
case ID_MENU_PLACE_POWER_BUTT:
case ID_PLACE_POWER_BUTT:
return SCH_ACTIONS::placePower.MakeEvent();
return EE_ACTIONS::placePower.MakeEvent();
case ID_MENU_WIRE_BUTT:
case ID_WIRE_BUTT:
return SCH_ACTIONS::drawWire.MakeEvent();
return EE_ACTIONS::drawWire.MakeEvent();
case ID_MENU_BUS_BUTT:
case ID_BUS_BUTT:
return SCH_ACTIONS::drawBus.MakeEvent();
return EE_ACTIONS::drawBus.MakeEvent();
case ID_MENU_NOCONN_BUTT:
case ID_NOCONN_BUTT:
return SCH_ACTIONS::placeNoConnect.MakeEvent();
return EE_ACTIONS::placeNoConnect.MakeEvent();
case ID_MENU_JUNCTION_BUTT:
case ID_JUNCTION_BUTT:
return SCH_ACTIONS::placeJunction.MakeEvent();
return EE_ACTIONS::placeJunction.MakeEvent();
case ID_MENU_WIRETOBUS_ENTRY_BUTT:
case ID_WIRETOBUS_ENTRY_BUTT:
return SCH_ACTIONS::placeBusWireEntry.MakeEvent();
return EE_ACTIONS::placeBusWireEntry.MakeEvent();
case ID_MENU_BUSTOBUS_ENTRY_BUTT:
case ID_BUSTOBUS_ENTRY_BUTT:
return SCH_ACTIONS::placeBusBusEntry.MakeEvent();
return EE_ACTIONS::placeBusBusEntry.MakeEvent();
case ID_MENU_LABEL_BUTT:
case ID_LABEL_BUTT:
return SCH_ACTIONS::placeLabel.MakeEvent();
return EE_ACTIONS::placeLabel.MakeEvent();
case ID_MENU_GLABEL_BUTT:
case ID_GLOBALLABEL_BUTT:
return SCH_ACTIONS::placeGlobalLabel.MakeEvent();
return EE_ACTIONS::placeGlobalLabel.MakeEvent();
case ID_MENU_HIERLABEL_BUTT:
case ID_HIERLABEL_BUTT:
return SCH_ACTIONS::placeHierarchicalLabel.MakeEvent();
return EE_ACTIONS::placeHierarchicalLabel.MakeEvent();
case ID_MENU_SHEET_PIN_BUTT:
case ID_SHEET_PIN_BUTT:
return SCH_ACTIONS::placeSheetPin.MakeEvent();
return EE_ACTIONS::placeSheetPin.MakeEvent();
case ID_MENU_IMPORT_HLABEL_BUTT:
case ID_IMPORT_HLABEL_BUTT:
return SCH_ACTIONS::importSheetPin.MakeEvent();
return EE_ACTIONS::importSheetPin.MakeEvent();
case ID_MENU_SHEET_SYMBOL_BUTT:
case ID_SHEET_SYMBOL_BUTT:
return SCH_ACTIONS::drawSheet.MakeEvent();
return EE_ACTIONS::drawSheet.MakeEvent();
case ID_MENU_TEXT_COMMENT_BUTT:
case ID_TEXT_COMMENT_BUTT:
return SCH_ACTIONS::placeSchematicText.MakeEvent();
return EE_ACTIONS::placeSchematicText.MakeEvent();
case ID_MENU_LINE_COMMENT_BUTT:
case ID_LINE_COMMENT_BUTT:
return SCH_ACTIONS::drawLines.MakeEvent();
return EE_ACTIONS::drawLines.MakeEvent();
case ID_MENU_ADD_IMAGE_BUTT:
case ID_ADD_IMAGE_BUTT:
return SCH_ACTIONS::placeImage.MakeEvent();
return EE_ACTIONS::placeImage.MakeEvent();
case ID_SCH_END_LINE_WIRE_OR_BUS:
return SCH_ACTIONS::finishLineWireOrBus.MakeEvent();
return EE_ACTIONS::finishLineWireOrBus.MakeEvent();
case ID_MENU_DELETE_ITEM_BUTT:
case ID_SCHEMATIC_DELETE_ITEM_BUTT:
return SCH_ACTIONS::deleteItemCursor.MakeEvent();
return EE_ACTIONS::deleteItemCursor.MakeEvent();
case ID_SCH_MOVE:
return SCH_ACTIONS::move.MakeEvent();
return EE_ACTIONS::move.MakeEvent();
case ID_SCH_DRAG:
return SCH_ACTIONS::drag.MakeEvent();
return EE_ACTIONS::drag.MakeEvent();
case ID_SCH_DELETE:
return SCH_ACTIONS::doDelete.MakeEvent();
return EE_ACTIONS::doDelete.MakeEvent();
case ID_SIM_PROBE:
return SCH_ACTIONS::simProbe.MakeEvent();
return EE_ACTIONS::simProbe.MakeEvent();
case ID_SIM_TUNE:
return SCH_ACTIONS::simTune.MakeEvent();
return EE_ACTIONS::simTune.MakeEvent();
case ID_SCH_ROTATE_CLOCKWISE:
return SCH_ACTIONS::rotateCW.MakeEvent();
return EE_ACTIONS::rotateCW.MakeEvent();
case ID_SCH_ROTATE_COUNTERCLOCKWISE:
return SCH_ACTIONS::rotateCCW.MakeEvent();
return EE_ACTIONS::rotateCCW.MakeEvent();
case ID_SCH_MIRROR_X:
return SCH_ACTIONS::mirrorX.MakeEvent();
return EE_ACTIONS::mirrorX.MakeEvent();
case ID_SCH_MIRROR_Y:
return SCH_ACTIONS::mirrorY.MakeEvent();
return EE_ACTIONS::mirrorY.MakeEvent();
case ID_SCH_DUPLICATE:
return SCH_ACTIONS::duplicate.MakeEvent();
return EE_ACTIONS::duplicate.MakeEvent();
case ID_REPEAT_BUTT:
return SCH_ACTIONS::repeatDrawItem.MakeEvent();
return EE_ACTIONS::repeatDrawItem.MakeEvent();
case ID_SCH_EDIT_ITEM:
return SCH_ACTIONS::properties.MakeEvent();
return EE_ACTIONS::properties.MakeEvent();
case ID_SCH_EDIT_COMPONENT_REFERENCE:
return SCH_ACTIONS::editReference.MakeEvent();
return EE_ACTIONS::editReference.MakeEvent();
case ID_SCH_EDIT_COMPONENT_VALUE:
return SCH_ACTIONS::editValue.MakeEvent();
return EE_ACTIONS::editValue.MakeEvent();
case ID_SCH_EDIT_COMPONENT_FOOTPRINT:
return SCH_ACTIONS::editFootprint.MakeEvent();
return EE_ACTIONS::editFootprint.MakeEvent();
case wxID_CUT:
return SCH_ACTIONS::cut.MakeEvent();
return EE_ACTIONS::cut.MakeEvent();
case wxID_COPY:
return SCH_ACTIONS::copy.MakeEvent();
return EE_ACTIONS::copy.MakeEvent();
case wxID_PASTE:
return SCH_ACTIONS::paste.MakeEvent();
return EE_ACTIONS::paste.MakeEvent();
case ID_AUTOPLACE_FIELDS:
return SCH_ACTIONS::autoplaceFields.MakeEvent();
return EE_ACTIONS::autoplaceFields.MakeEvent();
case ID_SCH_LEAVE_SHEET:
return SCH_ACTIONS::leaveSheet.MakeEvent();
return EE_ACTIONS::leaveSheet.MakeEvent();
case ID_HOTKEY_SELECT_NODE:
return SCH_ACTIONS::selectNode.MakeEvent();
return EE_ACTIONS::selectNode.MakeEvent();
case ID_HOTKEY_SELECT_CONNECTION:
return SCH_ACTIONS::selectConnection.MakeEvent();
return EE_ACTIONS::selectConnection.MakeEvent();
case ID_SCH_UNFOLD_BUS:
return SCH_ACTIONS::unfoldBus.MakeEvent();
return EE_ACTIONS::unfoldBus.MakeEvent();
case ID_MOUSE_CLICK:
return SCH_ACTIONS::cursorClick.MakeEvent();
return EE_ACTIONS::cursorClick.MakeEvent();
case ID_MOUSE_DOUBLECLICK:
return SCH_ACTIONS::cursorDblClick.MakeEvent();
return EE_ACTIONS::cursorDblClick.MakeEvent();
case ID_LIBEDIT_PIN_BUTT:
return SCH_ACTIONS::placeSymbolPin.MakeEvent();
return EE_ACTIONS::placeSymbolPin.MakeEvent();
case ID_LIBEDIT_BODY_TEXT_BUTT:
return SCH_ACTIONS::placeSymbolText.MakeEvent();
return EE_ACTIONS::placeSymbolText.MakeEvent();
case ID_LIBEDIT_ANCHOR_ITEM_BUTT:
return SCH_ACTIONS::placeSymbolAnchor.MakeEvent();
return EE_ACTIONS::placeSymbolAnchor.MakeEvent();
case ID_LIBEDIT_BODY_ARC_BUTT:
return SCH_ACTIONS::drawSymbolArc.MakeEvent();
return EE_ACTIONS::drawSymbolArc.MakeEvent();
case ID_LIBEDIT_BODY_CIRCLE_BUTT:
return SCH_ACTIONS::drawSymbolCircle.MakeEvent();
return EE_ACTIONS::drawSymbolCircle.MakeEvent();
case ID_LIBEDIT_BODY_LINE_BUTT:
return SCH_ACTIONS::drawSymbolLines.MakeEvent();
return EE_ACTIONS::drawSymbolLines.MakeEvent();
case ID_LIBEDIT_BODY_RECT_BUTT:
return SCH_ACTIONS::drawSymbolRectangle.MakeEvent();
return EE_ACTIONS::drawSymbolRectangle.MakeEvent();
case ID_LIBEDIT_DELETE_ITEM_BUTT:
return SCH_ACTIONS::deleteItemCursor.MakeEvent();
return EE_ACTIONS::deleteItemCursor.MakeEvent();
}
return OPT<TOOL_EVENT>();

View File

@ -21,8 +21,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef SCH_ACTIONS_H
#define SCH_ACTIONS_H
#ifndef EESCHEMA_ACTIONS_H
#define EESCHEMA_ACTIONS_H
#include <tool/tool_action.h>
#include <tool/actions.h>
@ -34,12 +34,12 @@ class TOOL_MANAGER;
extern char g_lastBusEntryShape;
/**
* Class SCH_ACTIONS
* Class EESCHEMA_ACTIONS
*
* Gathers 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 SCH_ACTIONS : public ACTIONS
class EE_ACTIONS : public ACTIONS
{
public:
// Selection Tool

View File

@ -21,13 +21,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <tools/sch_actions.h>
#include <tools/inspection_tool.h>
#include <tools/sch_selection_tool.h>
#include <tools/ee_actions.h>
#include <tools/ee_inspection_tool.h>
#include <tools/ee_selection_tool.h>
#include <view/view_controls.h>
#include <sch_component.h>
#include <sch_marker.h>
#include <hotkeys.h>
#include <ee_hotkeys.h>
#include <confirm.h>
#include <tool/conditional_menu.h>
#include <tool/selection_conditions.h>
@ -38,18 +38,18 @@
#include <eda_doc.h>
TOOL_ACTION SCH_ACTIONS::showDatasheet( "eeschema.InspectionTool.showDatasheet",
TOOL_ACTION EE_ACTIONS::showDatasheet( "eeschema.InspectionTool.showDatasheet",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SHOW_COMPONENT_DATASHEET ),
_( "Show Datasheet" ), _( "Opens the datasheet in a browser" ),
datasheet_xpm );
TOOL_ACTION SCH_ACTIONS::showMarkerInfo( "eeschema.InspectionTool.showMarkerInfo",
TOOL_ACTION EE_ACTIONS::showMarkerInfo( "eeschema.InspectionTool.showMarkerInfo",
AS_GLOBAL, 0,
_( "Show Marker Info" ), _( "Display the marker's info in a dialog" ),
info_xpm );
INSPECTION_TOOL::INSPECTION_TOOL()
EE_INSPECTION_TOOL::EE_INSPECTION_TOOL()
: TOOL_INTERACTIVE( "eeschema.InspectionTool" ),
m_selectionTool( nullptr ),
m_view( nullptr ),
@ -59,10 +59,10 @@ INSPECTION_TOOL::INSPECTION_TOOL()
}
bool INSPECTION_TOOL::Init()
bool EE_INSPECTION_TOOL::Init()
{
m_frame = getEditFrame<SCH_BASE_FRAME>();
m_selectionTool = m_toolMgr->GetTool<SCH_SELECTION_TOOL>();
m_selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
wxASSERT_MSG( m_selectionTool, "eeshema.InteractiveSelection tool is not available" );
@ -73,14 +73,14 @@ bool INSPECTION_TOOL::Init()
//
CONDITIONAL_MENU& selToolMenu = m_selectionTool->GetToolMenu().GetMenu();
selToolMenu.AddItem( SCH_ACTIONS::showDatasheet, SCH_CONDITIONS::SingleSymbol && SCH_CONDITIONS::Idle, 400 );
selToolMenu.AddItem( SCH_ACTIONS::showMarkerInfo, singleMarkerCondition && SCH_CONDITIONS::Idle, 400 );
selToolMenu.AddItem( EE_ACTIONS::showDatasheet, EE_CONDITIONS::SingleSymbol && EE_CONDITIONS::Idle, 400 );
selToolMenu.AddItem( EE_ACTIONS::showMarkerInfo, singleMarkerCondition && EE_CONDITIONS::Idle, 400 );
return true;
}
void INSPECTION_TOOL::Reset( RESET_REASON aReason )
void EE_INSPECTION_TOOL::Reset( RESET_REASON aReason )
{
m_view = static_cast<KIGFX::SCH_VIEW*>( getView() );
m_controls = getViewControls();
@ -88,7 +88,7 @@ void INSPECTION_TOOL::Reset( RESET_REASON aReason )
}
int INSPECTION_TOOL::ShowDatasheet( const TOOL_EVENT& aEvent )
int EE_INSPECTION_TOOL::ShowDatasheet( const TOOL_EVENT& aEvent )
{
SELECTION& selection = m_selectionTool->RequestSelection( SCH_COLLECTOR::ComponentsOnly );
@ -105,7 +105,7 @@ int INSPECTION_TOOL::ShowDatasheet( const TOOL_EVENT& aEvent )
}
int INSPECTION_TOOL::ShowMarkerInfo( const TOOL_EVENT& aEvent )
int EE_INSPECTION_TOOL::ShowMarkerInfo( const TOOL_EVENT& aEvent )
{
SELECTION& selection = m_selectionTool->GetSelection();
@ -121,10 +121,10 @@ int INSPECTION_TOOL::ShowMarkerInfo( const TOOL_EVENT& aEvent )
}
int INSPECTION_TOOL::UpdateMessagePanel( const TOOL_EVENT& aEvent )
int EE_INSPECTION_TOOL::UpdateMessagePanel( const TOOL_EVENT& aEvent )
{
SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool<SCH_SELECTION_TOOL>();
SELECTION& selection = selTool->GetSelection();
EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
SELECTION& selection = selTool->GetSelection();
if( selection.GetSize() == 1 )
{
@ -143,14 +143,14 @@ int INSPECTION_TOOL::UpdateMessagePanel( const TOOL_EVENT& aEvent )
}
void INSPECTION_TOOL::setTransitions()
void EE_INSPECTION_TOOL::setTransitions()
{
Go( &INSPECTION_TOOL::ShowDatasheet, SCH_ACTIONS::showDatasheet.MakeEvent() );
Go( &INSPECTION_TOOL::ShowMarkerInfo, SCH_ACTIONS::showMarkerInfo.MakeEvent() );
Go( &EE_INSPECTION_TOOL::ShowDatasheet, EE_ACTIONS::showDatasheet.MakeEvent() );
Go( &EE_INSPECTION_TOOL::ShowMarkerInfo, EE_ACTIONS::showMarkerInfo.MakeEvent() );
Go( &INSPECTION_TOOL::UpdateMessagePanel, EVENTS::SelectedEvent );
Go( &INSPECTION_TOOL::UpdateMessagePanel, EVENTS::UnselectedEvent );
Go( &INSPECTION_TOOL::UpdateMessagePanel, EVENTS::ClearedEvent );
Go( &EE_INSPECTION_TOOL::UpdateMessagePanel, EVENTS::SelectedEvent );
Go( &EE_INSPECTION_TOOL::UpdateMessagePanel, EVENTS::UnselectedEvent );
Go( &EE_INSPECTION_TOOL::UpdateMessagePanel, EVENTS::ClearedEvent );
}

View File

@ -29,15 +29,15 @@
#include <sch_base_frame.h>
class SCH_SELECTION_TOOL;
class EE_SELECTION_TOOL;
class SCH_EDIT_FRAME;
class INSPECTION_TOOL : public TOOL_INTERACTIVE
class EE_INSPECTION_TOOL : public TOOL_INTERACTIVE
{
public:
INSPECTION_TOOL();
~INSPECTION_TOOL() {}
EE_INSPECTION_TOOL();
~EE_INSPECTION_TOOL() {}
/// @copydoc TOOL_INTERACTIVE::Init()
bool Init() override;
@ -55,7 +55,7 @@ private:
void setTransitions() override;
private:
SCH_SELECTION_TOOL* m_selectionTool;
EE_SELECTION_TOOL* m_selectionTool;
KIGFX::SCH_VIEW* m_view;
KIGFX::VIEW_CONTROLS* m_controls;
SCH_BASE_FRAME* m_frame;

View File

@ -21,23 +21,23 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <picker_tool.h>
#include <sch_actions.h>
#include <ee_picker_tool.h>
#include <ee_actions.h>
#include <view/view_controls.h>
#include <tool/tool_manager.h>
#include <sch_base_frame.h>
TOOL_ACTION SCH_ACTIONS::pickerTool( "eeschema.Picker", AS_GLOBAL, 0, "", "", NULL, AF_ACTIVATE );
TOOL_ACTION EE_ACTIONS::pickerTool( "eeschema.Picker", AS_GLOBAL, 0, "", "", NULL, AF_ACTIVATE );
PICKER_TOOL::PICKER_TOOL()
EE_PICKER_TOOL::EE_PICKER_TOOL()
: TOOL_INTERACTIVE( "eeschema.Picker" )
{
reset();
}
int PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
int EE_PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
{
KIGFX::VIEW_CONTROLS* controls = getViewControls();
int finalize_state = WAIT_CANCEL;
@ -62,7 +62,7 @@ int PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
}
catch( std::exception& e )
{
std::cerr << "PICKER_TOOL click handler error: " << e.what() << std::endl;
std::cerr << "EE_PICKER_TOOL click handler error: " << e.what() << std::endl;
finalize_state = EXCEPTION_CANCEL;
break;
}
@ -87,7 +87,7 @@ int PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
}
catch( std::exception& e )
{
std::cerr << "PICKER_TOOL cancel handler error: " << e.what() << std::endl;
std::cerr << "EE_PICKER_TOOL cancel handler error: " << e.what() << std::endl;
}
}
@ -118,7 +118,7 @@ int PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
}
catch( std::exception& e )
{
std::cerr << "PICKER_TOOL finalize handler error: " << e.what() << std::endl;
std::cerr << "EE_PICKER_TOOL finalize handler error: " << e.what() << std::endl;
}
}
@ -130,13 +130,13 @@ int PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
}
void PICKER_TOOL::setTransitions()
void EE_PICKER_TOOL::setTransitions()
{
Go( &PICKER_TOOL::Main, SCH_ACTIONS::pickerTool.MakeEvent() );
Go( &EE_PICKER_TOOL::Main, EE_ACTIONS::pickerTool.MakeEvent() );
}
void PICKER_TOOL::reset()
void EE_PICKER_TOOL::reset()
{
m_cursorCapture = false;
m_autoPanning = false;
@ -148,7 +148,7 @@ void PICKER_TOOL::reset()
}
void PICKER_TOOL::setControls()
void EE_PICKER_TOOL::setControls()
{
KIGFX::VIEW_CONTROLS* controls = getViewControls();

View File

@ -29,11 +29,11 @@
#include <tool/tool_interactive.h>
class PICKER_TOOL : public TOOL_INTERACTIVE
class EE_PICKER_TOOL : public TOOL_INTERACTIVE
{
public:
PICKER_TOOL();
~PICKER_TOOL() {}
EE_PICKER_TOOL();
~EE_PICKER_TOOL() {}
///> Event handler types.
typedef std::function<bool(const VECTOR2D&)> CLICK_HANDLER;

View File

@ -24,15 +24,15 @@
#include <functional>
using namespace std::placeholders;
#include "point_editor.h"
#include "ee_point_editor.h"
#include <tool/tool_manager.h>
#include <view/view_controls.h>
#include <gal/graphics_abstraction_layer.h>
#include <geometry/seg.h>
#include <confirm.h>
#include <tools/sch_actions.h>
#include <tools/sch_selection_tool.h>
#include <tools/ee_actions.h>
#include <tools/ee_selection_tool.h>
#include <bitmaps.h>
#include <status_popup.h>
#include <sch_edit_frame.h>
@ -47,11 +47,11 @@ using namespace std::placeholders;
// Point editor
TOOL_ACTION SCH_ACTIONS::pointEditorAddCorner( "eeschema.PointEditor.addCorner",
TOOL_ACTION EE_ACTIONS::pointEditorAddCorner( "eeschema.PointEditor.addCorner",
AS_GLOBAL, 0,
_( "Create Corner" ), _( "Create a corner" ), add_corner_xpm );
TOOL_ACTION SCH_ACTIONS::pointEditorRemoveCorner( "eeschema.PointEditor.removeCorner",
TOOL_ACTION EE_ACTIONS::pointEditorRemoveCorner( "eeschema.PointEditor.removeCorner",
AS_GLOBAL, 0,
_( "Remove Corner" ), _( "Remove corner" ), delete_xpm );
@ -197,7 +197,7 @@ private:
};
POINT_EDITOR::POINT_EDITOR() :
EE_POINT_EDITOR::EE_POINT_EDITOR() :
TOOL_INTERACTIVE( "eeschema.PointEditor" ),
m_frame( nullptr ),
m_selectionTool( nullptr ),
@ -206,7 +206,7 @@ POINT_EDITOR::POINT_EDITOR() :
}
void POINT_EDITOR::Reset( RESET_REASON aReason )
void EE_POINT_EDITOR::Reset( RESET_REASON aReason )
{
m_editPoints.reset();
getViewControls()->SetAutoPan( false );
@ -215,25 +215,25 @@ void POINT_EDITOR::Reset( RESET_REASON aReason )
}
bool POINT_EDITOR::Init()
bool EE_POINT_EDITOR::Init()
{
m_frame = getEditFrame<SCH_BASE_FRAME>();
m_isLibEdit = dynamic_cast<LIB_EDIT_FRAME*>( m_frame ) != nullptr;
m_selectionTool = m_toolMgr->GetTool<SCH_SELECTION_TOOL>();
m_selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
wxASSERT_MSG( m_selectionTool, "eeshema.InteractiveSelection tool is not available" );
auto& menu = m_selectionTool->GetToolMenu().GetMenu();
menu.AddItem( SCH_ACTIONS::pointEditorAddCorner,
std::bind( &POINT_EDITOR::addCornerCondition, this, _1 ) );
menu.AddItem( SCH_ACTIONS::pointEditorRemoveCorner,
std::bind( &POINT_EDITOR::removeCornerCondition, this, _1 ) );
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 ) );
return true;
}
void POINT_EDITOR::updateEditedPoint( const TOOL_EVENT& aEvent )
void EE_POINT_EDITOR::updateEditedPoint( const TOOL_EVENT& aEvent )
{
EDIT_POINT* point = m_editedPoint;
@ -251,7 +251,7 @@ void POINT_EDITOR::updateEditedPoint( const TOOL_EVENT& aEvent )
}
int POINT_EDITOR::Main( const TOOL_EVENT& aEvent )
int EE_POINT_EDITOR::Main( const TOOL_EVENT& aEvent )
{
static KICAD_T pointTypes[] = { LIB_ARC_T, LIB_CIRCLE_T, LIB_POLYLINE_T, LIB_RECTANGLE_T,
SCH_SHEET_T, SCH_LINE_LOCATE_GRAPHIC_LINE_T, EOT };
@ -420,7 +420,7 @@ void pinEditedCorner( int editedPointIndex, int minWidth, int minHeight, VECTOR2
}
void POINT_EDITOR::updateItem() const
void EE_POINT_EDITOR::updateItem() const
{
EDA_ITEM* item = m_editPoints->GetParent();
@ -535,7 +535,7 @@ void POINT_EDITOR::updateItem() const
}
void POINT_EDITOR::updatePoints()
void EE_POINT_EDITOR::updatePoints()
{
if( !m_editPoints )
return;
@ -630,7 +630,7 @@ void POINT_EDITOR::updatePoints()
}
void POINT_EDITOR::setEditedPoint( EDIT_POINT* aPoint )
void EE_POINT_EDITOR::setEditedPoint( EDIT_POINT* aPoint )
{
KIGFX::VIEW_CONTROLS* controls = getViewControls();
@ -649,7 +649,7 @@ void POINT_EDITOR::setEditedPoint( EDIT_POINT* aPoint )
}
bool POINT_EDITOR::removeCornerCondition( const SELECTION& )
bool EE_POINT_EDITOR::removeCornerCondition( const SELECTION& )
{
if( !m_editPoints || !m_editedPoint )
return false;
@ -671,7 +671,7 @@ bool POINT_EDITOR::removeCornerCondition( const SELECTION& )
}
bool POINT_EDITOR::addCornerCondition( const SELECTION& )
bool EE_POINT_EDITOR::addCornerCondition( const SELECTION& )
{
if( !m_editPoints || !m_editedPoint )
return false;
@ -688,7 +688,7 @@ bool POINT_EDITOR::addCornerCondition( const SELECTION& )
}
int POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent )
int EE_POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent )
{
if( !m_editPoints )
return 0;
@ -708,7 +708,7 @@ int POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent )
}
int POINT_EDITOR::removeCorner( const TOOL_EVENT& aEvent )
int EE_POINT_EDITOR::removeCorner( const TOOL_EVENT& aEvent )
{
if( !m_editPoints || !m_editedPoint )
return 0;
@ -727,14 +727,14 @@ int POINT_EDITOR::removeCorner( const TOOL_EVENT& aEvent )
}
int POINT_EDITOR::modifiedSelection( const TOOL_EVENT& aEvent )
int EE_POINT_EDITOR::modifiedSelection( const TOOL_EVENT& aEvent )
{
updatePoints();
return 0;
}
void POINT_EDITOR::saveItemsToUndo()
void EE_POINT_EDITOR::saveItemsToUndo()
{
if( m_isLibEdit )
{
@ -762,7 +762,7 @@ void POINT_EDITOR::saveItemsToUndo()
}
void POINT_EDITOR::rollbackFromUndo()
void EE_POINT_EDITOR::rollbackFromUndo()
{
if( m_isLibEdit )
static_cast<LIB_EDIT_FRAME*>( m_frame )->RollbackPartFromUndo();
@ -771,12 +771,12 @@ void POINT_EDITOR::rollbackFromUndo()
}
void POINT_EDITOR::setTransitions()
void EE_POINT_EDITOR::setTransitions()
{
Go( &POINT_EDITOR::addCorner, SCH_ACTIONS::pointEditorAddCorner.MakeEvent() );
Go( &POINT_EDITOR::removeCorner, SCH_ACTIONS::pointEditorRemoveCorner.MakeEvent() );
Go( &POINT_EDITOR::modifiedSelection, EVENTS::SelectedItemsModified );
Go( &POINT_EDITOR::Main, EVENTS::SelectedEvent );
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::Main, EVENTS::SelectedEvent );
}

View File

@ -28,7 +28,7 @@
#include <tool/edit_points.h>
#include <tool/selection.h>
class SCH_SELECTION_TOOL;
class EE_SELECTION_TOOL;
class SCH_BASE_FRAME;
/**
@ -36,10 +36,10 @@ class SCH_BASE_FRAME;
*
* Tool that displays edit points allowing to modify items by dragging the points.
*/
class POINT_EDITOR : public TOOL_INTERACTIVE
class EE_POINT_EDITOR : public TOOL_INTERACTIVE
{
public:
POINT_EDITOR();
EE_POINT_EDITOR();
/// @copydoc TOOL_INTERACTIVE::Reset()
void Reset( RESET_REASON aReason ) override;
@ -94,9 +94,9 @@ private:
void rollbackFromUndo();
private:
SCH_BASE_FRAME* m_frame;
SCH_SELECTION_TOOL* m_selectionTool;
bool m_isLibEdit;
SCH_BASE_FRAME* m_frame;
EE_SELECTION_TOOL* m_selectionTool;
bool m_isLibEdit;
///> Currently edited point, NULL if there is none.
EDIT_POINT* m_editedPoint;

View File

@ -22,10 +22,10 @@
*/
#include <sch_actions.h>
#include <ee_actions.h>
#include <core/typeinfo.h>
#include <sch_item_struct.h>
#include <sch_selection_tool.h>
#include <ee_selection_tool.h>
#include <sch_base_frame.h>
#include <sch_edit_frame.h>
#include <lib_edit_frame.h>
@ -39,63 +39,63 @@
#include <tool/tool_event.h>
#include <tool/tool_manager.h>
#include <tools/sch_wire_bus_tool.h>
#include <sch_actions.h>
#include <ee_actions.h>
#include <sch_collectors.h>
#include <painter.h>
#include <eeschema_id.h>
#include <menus_helpers.h>
#include <hotkeys.h>
#include <ee_hotkeys.h>
// Selection tool actions
TOOL_ACTION SCH_ACTIONS::selectionActivate( "eeschema.InteractiveSelection",
TOOL_ACTION EE_ACTIONS::selectionActivate( "eeschema.InteractiveSelection",
AS_GLOBAL, 0, "", "", NULL, AF_ACTIVATE ); // No description, not shown anywhere
TOOL_ACTION SCH_ACTIONS::selectNode( "eeschema.InteractiveSelection.SelectNode",
TOOL_ACTION EE_ACTIONS::selectNode( "eeschema.InteractiveSelection.SelectNode",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SELECT_NODE ),
_( "Select Node" ), _( "Select a connection item under the cursor" ), nullptr );
TOOL_ACTION SCH_ACTIONS::selectConnection( "eeschema.InteractiveSelection.SelectConnection",
TOOL_ACTION EE_ACTIONS::selectConnection( "eeschema.InteractiveSelection.SelectConnection",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SELECT_CONNECTION ),
_( "Select Connection" ), _( "Select a complete connection" ), nullptr );
TOOL_ACTION SCH_ACTIONS::selectionMenu( "eeschema.InteractiveSelection.SelectionMenu",
TOOL_ACTION EE_ACTIONS::selectionMenu( "eeschema.InteractiveSelection.SelectionMenu",
AS_GLOBAL, 0, "", "" ); // No description, it is not supposed to be shown anywhere
TOOL_ACTION SCH_ACTIONS::addItemToSel( "eeschema.InteractiveSelection.AddItemToSel",
TOOL_ACTION EE_ACTIONS::addItemToSel( "eeschema.InteractiveSelection.AddItemToSel",
AS_GLOBAL, 0, "", "" ); // No description, it is not supposed to be shown anywhere
TOOL_ACTION SCH_ACTIONS::addItemsToSel( "eeschema.InteractiveSelection.AddItemsToSel",
TOOL_ACTION EE_ACTIONS::addItemsToSel( "eeschema.InteractiveSelection.AddItemsToSel",
AS_GLOBAL, 0, "", "" ); // No description, it is not supposed to be shown anywhere
TOOL_ACTION SCH_ACTIONS::removeItemFromSel( "eeschema.InteractiveSelection.RemoveItemFromSel",
TOOL_ACTION EE_ACTIONS::removeItemFromSel( "eeschema.InteractiveSelection.RemoveItemFromSel",
AS_GLOBAL, 0, "", "" ); // No description, it is not supposed to be shown anywhere
TOOL_ACTION SCH_ACTIONS::removeItemsFromSel( "eeschema.InteractiveSelection.RemoveItemsFromSel",
TOOL_ACTION EE_ACTIONS::removeItemsFromSel( "eeschema.InteractiveSelection.RemoveItemsFromSel",
AS_GLOBAL, 0, "", "" ); // No description, it is not supposed to be shown anywhere
TOOL_ACTION SCH_ACTIONS::clearSelection( "eeschema.InteractiveSelection.ClearSelection",
TOOL_ACTION EE_ACTIONS::clearSelection( "eeschema.InteractiveSelection.ClearSelection",
AS_GLOBAL, 0, "", "" ); // No description, it is not supposed to be shown anywhere
SELECTION_CONDITION SCH_CONDITIONS::Empty = [] (const SELECTION& aSelection )
SELECTION_CONDITION EE_CONDITIONS::Empty = [] (const SELECTION& aSelection )
{
return aSelection.Empty();
};
SELECTION_CONDITION SCH_CONDITIONS::Idle = [] (const SELECTION& aSelection )
SELECTION_CONDITION EE_CONDITIONS::Idle = [] (const SELECTION& aSelection )
{
return ( !aSelection.Front() || aSelection.Front()->GetEditFlags() == 0 );
};
SELECTION_CONDITION SCH_CONDITIONS::IdleSelection = [] (const SELECTION& aSelection )
SELECTION_CONDITION EE_CONDITIONS::IdleSelection = [] (const SELECTION& aSelection )
{
return ( aSelection.Front() && aSelection.Front()->GetEditFlags() == 0 );
};
SELECTION_CONDITION SCH_CONDITIONS::SingleSymbol = [] (const SELECTION& aSel )
SELECTION_CONDITION EE_CONDITIONS::SingleSymbol = [] (const SELECTION& aSel )
{
if( aSel.GetSize() == 1 )
{
@ -112,7 +112,7 @@ SELECTION_CONDITION SCH_CONDITIONS::SingleSymbol = [] (const SELECTION& aSel )
};
SELECTION_CONDITION SCH_CONDITIONS::SingleDeMorganSymbol = [] ( const SELECTION& aSel )
SELECTION_CONDITION EE_CONDITIONS::SingleDeMorganSymbol = [] ( const SELECTION& aSel )
{
if( aSel.GetSize() == 1 )
{
@ -129,7 +129,7 @@ SELECTION_CONDITION SCH_CONDITIONS::SingleDeMorganSymbol = [] ( const SELECTION&
};
SELECTION_CONDITION SCH_CONDITIONS::SingleMultiUnitSymbol = [] ( const SELECTION& aSel )
SELECTION_CONDITION EE_CONDITIONS::SingleMultiUnitSymbol = [] ( const SELECTION& aSel )
{
if( aSel.GetSize() == 1 )
{
@ -146,7 +146,7 @@ SELECTION_CONDITION SCH_CONDITIONS::SingleMultiUnitSymbol = [] ( const SELECTION
};
SCH_SELECTION_TOOL::SCH_SELECTION_TOOL() :
EE_SELECTION_TOOL::EE_SELECTION_TOOL() :
TOOL_INTERACTIVE( "eeschema.InteractiveSelection" ),
m_frame( nullptr ),
m_additive( false ),
@ -161,13 +161,13 @@ SCH_SELECTION_TOOL::SCH_SELECTION_TOOL() :
}
SCH_SELECTION_TOOL::~SCH_SELECTION_TOOL()
EE_SELECTION_TOOL::~EE_SELECTION_TOOL()
{
getView()->Remove( &m_selection );
}
bool SCH_SELECTION_TOOL::Init()
bool EE_SELECTION_TOOL::Init()
{
m_frame = getEditFrame<SCH_BASE_FRAME>();
@ -182,14 +182,14 @@ bool SCH_SELECTION_TOOL::Init()
static KICAD_T wireOrBusTypes[] = { SCH_LINE_LOCATE_WIRE_T, SCH_LINE_LOCATE_BUS_T, EOT };
auto wireSelection = SCH_CONDITIONS::MoreThan( 0 )
&& SCH_CONDITIONS::OnlyType( SCH_LINE_LOCATE_WIRE_T );
auto wireSelection = EE_CONDITIONS::MoreThan( 0 )
&& EE_CONDITIONS::OnlyType( SCH_LINE_LOCATE_WIRE_T );
auto busSelection = SCH_CONDITIONS::MoreThan( 0 )
&& SCH_CONDITIONS::OnlyType( SCH_LINE_LOCATE_BUS_T );
auto busSelection = EE_CONDITIONS::MoreThan( 0 )
&& EE_CONDITIONS::OnlyType( SCH_LINE_LOCATE_BUS_T );
auto wireOrBusSelection = SCH_CONDITIONS::MoreThan( 0 )
&& SCH_CONDITIONS::OnlyTypes( wireOrBusTypes );
auto wireOrBusSelection = EE_CONDITIONS::MoreThan( 0 )
&& EE_CONDITIONS::OnlyTypes( wireOrBusTypes );
auto sheetSelection = SELECTION_CONDITIONS::Count( 1 )
&& SELECTION_CONDITIONS::OnlyType( SCH_SHEET_T );
@ -204,29 +204,29 @@ bool SCH_SELECTION_TOOL::Init()
auto& menu = m_menu.GetMenu();
menu.AddItem( SCH_ACTIONS::enterSheet, sheetSelection && SCH_CONDITIONS::Idle, 1 );
menu.AddItem( SCH_ACTIONS::explicitCrossProbe, sheetSelection && SCH_CONDITIONS::Idle, 1 );
menu.AddItem( SCH_ACTIONS::leaveSheet, belowRootSheetCondition, 1 );
menu.AddItem( EE_ACTIONS::enterSheet, sheetSelection && EE_CONDITIONS::Idle, 1 );
menu.AddItem( EE_ACTIONS::explicitCrossProbe, sheetSelection && EE_CONDITIONS::Idle, 1 );
menu.AddItem( EE_ACTIONS::leaveSheet, belowRootSheetCondition, 1 );
menu.AddSeparator( SCH_CONDITIONS::Empty, 100 );
menu.AddItem( SCH_ACTIONS::startWire, !libEdit && SCH_CONDITIONS::Empty, 100 );
menu.AddItem( SCH_ACTIONS::startBus, !libEdit && SCH_CONDITIONS::Empty, 100 );
menu.AddSeparator( EE_CONDITIONS::Empty, 100 );
menu.AddItem( EE_ACTIONS::startWire, !libEdit && EE_CONDITIONS::Empty, 100 );
menu.AddItem( EE_ACTIONS::startBus, !libEdit && EE_CONDITIONS::Empty, 100 );
menu.AddSeparator( SCH_WIRE_BUS_TOOL::IsDrawingWire, 100 );
menu.AddItem( SCH_ACTIONS::finishWire, SCH_WIRE_BUS_TOOL::IsDrawingWire, 100 );
menu.AddItem( EE_ACTIONS::finishWire, SCH_WIRE_BUS_TOOL::IsDrawingWire, 100 );
menu.AddSeparator( SCH_WIRE_BUS_TOOL::IsDrawingBus, 100 );
menu.AddItem( SCH_ACTIONS::finishBus, SCH_WIRE_BUS_TOOL::IsDrawingBus, 100 );
menu.AddItem( EE_ACTIONS::finishBus, SCH_WIRE_BUS_TOOL::IsDrawingBus, 100 );
menu.AddSeparator( SCH_CONDITIONS::NotEmpty, 200 );
menu.AddItem( SCH_ACTIONS::selectConnection, wireOrBusSelection && SCH_CONDITIONS::Idle, 200 );
menu.AddItem( SCH_ACTIONS::addJunction, wireOrBusSelection && SCH_CONDITIONS::Idle, 200 );
menu.AddItem( SCH_ACTIONS::addLabel, wireOrBusSelection && SCH_CONDITIONS::Idle, 200 );
menu.AddItem( SCH_ACTIONS::addGlobalLabel, wireOrBusSelection && SCH_CONDITIONS::Idle, 200 );
menu.AddItem( SCH_ACTIONS::addHierLabel, wireOrBusSelection && SCH_CONDITIONS::Idle, 200 );
menu.AddItem( SCH_ACTIONS::breakWire, wireSelection && SCH_CONDITIONS::Idle, 200 );
menu.AddItem( SCH_ACTIONS::breakBus, busSelection && SCH_CONDITIONS::Idle, 200 );
menu.AddItem( SCH_ACTIONS::importSheetPin, sheetSelection && SCH_CONDITIONS::Idle, 200 );
menu.AddSeparator( EE_CONDITIONS::NotEmpty, 200 );
menu.AddItem( EE_ACTIONS::selectConnection, wireOrBusSelection && EE_CONDITIONS::Idle, 200 );
menu.AddItem( EE_ACTIONS::addJunction, wireOrBusSelection && EE_CONDITIONS::Idle, 200 );
menu.AddItem( EE_ACTIONS::addLabel, wireOrBusSelection && EE_CONDITIONS::Idle, 200 );
menu.AddItem( EE_ACTIONS::addGlobalLabel, wireOrBusSelection && EE_CONDITIONS::Idle, 200 );
menu.AddItem( EE_ACTIONS::addHierLabel, wireOrBusSelection && EE_CONDITIONS::Idle, 200 );
menu.AddItem( EE_ACTIONS::breakWire, wireSelection && EE_CONDITIONS::Idle, 200 );
menu.AddItem( EE_ACTIONS::breakBus, busSelection && EE_CONDITIONS::Idle, 200 );
menu.AddItem( EE_ACTIONS::importSheetPin, sheetSelection && EE_CONDITIONS::Idle, 200 );
menu.AddSeparator( SELECTION_CONDITIONS::ShowAlways, 1000 );
m_menu.AddStandardSubMenus( m_frame );
@ -235,7 +235,7 @@ bool SCH_SELECTION_TOOL::Init()
}
void SCH_SELECTION_TOOL::Reset( RESET_REASON aReason )
void EE_SELECTION_TOOL::Reset( RESET_REASON aReason )
{
m_frame = getEditFrame<SCH_BASE_FRAME>();
@ -265,7 +265,7 @@ void SCH_SELECTION_TOOL::Reset( RESET_REASON aReason )
}
int SCH_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
{
// Main loop: keep receiving events
while( OPT_TOOL_EVENT evt = Wait() )
@ -292,7 +292,7 @@ int SCH_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
if( evt->Modifier( MD_CTRL ) && dynamic_cast<SCH_EDIT_FRAME*>( m_frame ) )
{
m_toolMgr->RunAction( SCH_ACTIONS::highlightNet, true );
m_toolMgr->RunAction( EE_ACTIONS::highlightNet, true );
}
else
{
@ -328,9 +328,9 @@ int SCH_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
EDA_ITEM* item = m_selection.Front();
if( item && item->Type() == SCH_SHEET_T )
m_toolMgr->RunAction( SCH_ACTIONS::enterSheet );
m_toolMgr->RunAction( EE_ACTIONS::enterSheet );
else
m_toolMgr->RunAction( SCH_ACTIONS::properties );
m_toolMgr->RunAction( EE_ACTIONS::properties );
}
// drag with LMB? Select multiple objects (or at least draw a selection box) or drag them
@ -372,7 +372,7 @@ int SCH_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
&& evt->GetCommandId().get() <= ID_POPUP_SCH_UNFOLD_BUS_END )
{
wxString* net = new wxString( *evt->Parameter<wxString*>() );
m_toolMgr->RunAction( SCH_ACTIONS::unfoldBus, true, net );
m_toolMgr->RunAction( EE_ACTIONS::unfoldBus, true, net );
}
}
@ -380,7 +380,7 @@ int SCH_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
else if( evt->IsAction( &ACTIONS::cancelInteractive ) || evt->IsCancel() )
{
clearSelection();
m_toolMgr->RunAction( SCH_ACTIONS::clearHighlight, true );
m_toolMgr->RunAction( EE_ACTIONS::clearHighlight, true );
}
else if( evt->Action() == TA_UNDO_REDO_PRE )
@ -401,13 +401,13 @@ int SCH_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
}
SELECTION& SCH_SELECTION_TOOL::GetSelection()
SELECTION& EE_SELECTION_TOOL::GetSelection()
{
return m_selection;
}
EDA_ITEM* SCH_SELECTION_TOOL::SelectPoint( const VECTOR2I& aWhere, const KICAD_T* aFilterList,
EDA_ITEM* EE_SELECTION_TOOL::SelectPoint( const VECTOR2I& aWhere, const KICAD_T* aFilterList,
bool* aSelectionCancelledFlag, bool aCheckLocked )
{
EDA_ITEM* start;
@ -449,7 +449,7 @@ EDA_ITEM* SCH_SELECTION_TOOL::SelectPoint( const VECTOR2I& aWhere, const KICAD_T
{
collector.m_MenuTitle = _( "Clarify Selection" );
// Must call selectionMenu via RunAction() to avoid event-loop contention
m_toolMgr->RunAction( SCH_ACTIONS::selectionMenu, true, &collector );
m_toolMgr->RunAction( EE_ACTIONS::selectionMenu, true, &collector );
if( collector.m_MenuCancelled )
{
@ -475,7 +475,7 @@ EDA_ITEM* SCH_SELECTION_TOOL::SelectPoint( const VECTOR2I& aWhere, const KICAD_T
}
void SCH_SELECTION_TOOL::guessSelectionCandidates( SCH_COLLECTOR& collector,
void EE_SELECTION_TOOL::guessSelectionCandidates( SCH_COLLECTOR& collector,
const VECTOR2I& aWhere )
{
// There are certain parent/child and enclosure combinations that can be handled
@ -498,7 +498,7 @@ void SCH_SELECTION_TOOL::guessSelectionCandidates( SCH_COLLECTOR& collector,
}
SELECTION& SCH_SELECTION_TOOL::RequestSelection( const KICAD_T aFilterList[] )
SELECTION& EE_SELECTION_TOOL::RequestSelection( const KICAD_T aFilterList[] )
{
// Filter an existing selection
if( !m_selection.Empty() )
@ -527,7 +527,7 @@ SELECTION& SCH_SELECTION_TOOL::RequestSelection( const KICAD_T aFilterList[] )
}
bool SCH_SELECTION_TOOL::selectMultiple()
bool EE_SELECTION_TOOL::selectMultiple()
{
bool cancelled = false; // Was the tool cancelled while it was running?
m_multiple = true; // Multiple selection mode is active
@ -642,7 +642,7 @@ static KICAD_T nodeTypes[] =
};
EDA_ITEM* SCH_SELECTION_TOOL::GetNode( VECTOR2I aPosition )
EDA_ITEM* EE_SELECTION_TOOL::GetNode( VECTOR2I aPosition )
{
SCH_COLLECTOR collector;
@ -652,7 +652,7 @@ EDA_ITEM* SCH_SELECTION_TOOL::GetNode( VECTOR2I aPosition )
}
int SCH_SELECTION_TOOL::SelectNode( const TOOL_EVENT& aEvent )
int EE_SELECTION_TOOL::SelectNode( const TOOL_EVENT& aEvent )
{
VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !aEvent.Modifier( MD_ALT ) );
@ -662,7 +662,7 @@ int SCH_SELECTION_TOOL::SelectNode( const TOOL_EVENT& aEvent )
}
int SCH_SELECTION_TOOL::SelectConnection( const TOOL_EVENT& aEvent )
int EE_SELECTION_TOOL::SelectConnection( const TOOL_EVENT& aEvent )
{
static KICAD_T wiresAndBusses[] = { SCH_LINE_LOCATE_WIRE_T, SCH_LINE_LOCATE_BUS_T, EOT };
@ -690,14 +690,14 @@ int SCH_SELECTION_TOOL::SelectConnection( const TOOL_EVENT& aEvent )
}
int SCH_SELECTION_TOOL::AddItemToSel( const TOOL_EVENT& aEvent )
int EE_SELECTION_TOOL::AddItemToSel( const TOOL_EVENT& aEvent )
{
AddItemToSel( aEvent.Parameter<EDA_ITEM*>() );
return 0;
}
void SCH_SELECTION_TOOL::AddItemToSel( EDA_ITEM* aItem, bool aQuietMode )
void EE_SELECTION_TOOL::AddItemToSel( EDA_ITEM* aItem, bool aQuietMode )
{
if( aItem )
{
@ -710,14 +710,14 @@ void SCH_SELECTION_TOOL::AddItemToSel( EDA_ITEM* aItem, bool aQuietMode )
}
int SCH_SELECTION_TOOL::AddItemsToSel( const TOOL_EVENT& aEvent )
int EE_SELECTION_TOOL::AddItemsToSel( const TOOL_EVENT& aEvent )
{
AddItemsToSel( aEvent.Parameter<EDA_ITEMS*>(), false );
return 0;
}
void SCH_SELECTION_TOOL::AddItemsToSel( EDA_ITEMS* aList, bool aQuietMode )
void EE_SELECTION_TOOL::AddItemsToSel( EDA_ITEMS* aList, bool aQuietMode )
{
if( aList )
{
@ -731,14 +731,14 @@ void SCH_SELECTION_TOOL::AddItemsToSel( EDA_ITEMS* aList, bool aQuietMode )
}
int SCH_SELECTION_TOOL::RemoveItemFromSel( const TOOL_EVENT& aEvent )
int EE_SELECTION_TOOL::RemoveItemFromSel( const TOOL_EVENT& aEvent )
{
RemoveItemFromSel( aEvent.Parameter<EDA_ITEM*>() );
return 0;
}
void SCH_SELECTION_TOOL::RemoveItemFromSel( EDA_ITEM* aItem, bool aQuietMode )
void EE_SELECTION_TOOL::RemoveItemFromSel( EDA_ITEM* aItem, bool aQuietMode )
{
if( aItem )
{
@ -751,14 +751,14 @@ void SCH_SELECTION_TOOL::RemoveItemFromSel( EDA_ITEM* aItem, bool aQuietMode )
}
int SCH_SELECTION_TOOL::RemoveItemsFromSel( const TOOL_EVENT& aEvent )
int EE_SELECTION_TOOL::RemoveItemsFromSel( const TOOL_EVENT& aEvent )
{
RemoveItemsFromSel( aEvent.Parameter<EDA_ITEMS*>(), false );
return 0;
}
void SCH_SELECTION_TOOL::RemoveItemsFromSel( EDA_ITEMS* aList, bool aQuietMode )
void EE_SELECTION_TOOL::RemoveItemsFromSel( EDA_ITEMS* aList, bool aQuietMode )
{
if( aList )
{
@ -772,7 +772,7 @@ void SCH_SELECTION_TOOL::RemoveItemsFromSel( EDA_ITEMS* aList, bool aQuietMode )
}
int SCH_SELECTION_TOOL::ClearSelection( const TOOL_EVENT& aEvent )
int EE_SELECTION_TOOL::ClearSelection( const TOOL_EVENT& aEvent )
{
clearSelection();
@ -780,7 +780,7 @@ int SCH_SELECTION_TOOL::ClearSelection( const TOOL_EVENT& aEvent )
}
int SCH_SELECTION_TOOL::SelectionMenu( const TOOL_EVENT& aEvent )
int EE_SELECTION_TOOL::SelectionMenu( const TOOL_EVENT& aEvent )
{
SCH_COLLECTOR* collector = aEvent.Parameter<SCH_COLLECTOR*>();
@ -791,7 +791,7 @@ int SCH_SELECTION_TOOL::SelectionMenu( const TOOL_EVENT& aEvent )
}
bool SCH_SELECTION_TOOL::doSelectionMenu( SCH_COLLECTOR* aCollector )
bool EE_SELECTION_TOOL::doSelectionMenu( SCH_COLLECTOR* aCollector )
{
EDA_ITEM* current = nullptr;
CONTEXT_MENU menu;
@ -871,7 +871,7 @@ bool SCH_SELECTION_TOOL::doSelectionMenu( SCH_COLLECTOR* aCollector )
}
bool SCH_SELECTION_TOOL::selectable( const EDA_ITEM* aItem, bool checkVisibilityOnly ) const
bool EE_SELECTION_TOOL::selectable( const EDA_ITEM* aItem, bool checkVisibilityOnly ) const
{
// NOTE: in the future this is where eeschema layer/itemtype visibility will be handled
@ -917,7 +917,7 @@ bool SCH_SELECTION_TOOL::selectable( const EDA_ITEM* aItem, bool checkVisibility
}
void SCH_SELECTION_TOOL::clearSelection()
void EE_SELECTION_TOOL::clearSelection()
{
if( m_selection.Empty() )
return;
@ -935,7 +935,7 @@ void SCH_SELECTION_TOOL::clearSelection()
}
void SCH_SELECTION_TOOL::toggleSelection( EDA_ITEM* aItem, bool aForce )
void EE_SELECTION_TOOL::toggleSelection( EDA_ITEM* aItem, bool aForce )
{
if( aItem->IsSelected() )
{
@ -964,19 +964,19 @@ void SCH_SELECTION_TOOL::toggleSelection( EDA_ITEM* aItem, bool aForce )
}
void SCH_SELECTION_TOOL::select( EDA_ITEM* aItem )
void EE_SELECTION_TOOL::select( EDA_ITEM* aItem )
{
highlight( aItem, SELECTED, &m_selection );
}
void SCH_SELECTION_TOOL::unselect( EDA_ITEM* aItem )
void EE_SELECTION_TOOL::unselect( EDA_ITEM* aItem )
{
unhighlight( aItem, SELECTED, &m_selection );
}
void SCH_SELECTION_TOOL::highlight( EDA_ITEM* aItem, int aMode, SELECTION* aGroup )
void EE_SELECTION_TOOL::highlight( EDA_ITEM* aItem, int aMode, SELECTION* aGroup )
{
if( aMode == SELECTED )
aItem->SetSelected();
@ -1031,7 +1031,7 @@ void SCH_SELECTION_TOOL::highlight( EDA_ITEM* aItem, int aMode, SELECTION* aGrou
}
void SCH_SELECTION_TOOL::unhighlight( EDA_ITEM* aItem, int aMode, SELECTION* aGroup )
void EE_SELECTION_TOOL::unhighlight( EDA_ITEM* aItem, int aMode, SELECTION* aGroup )
{
if( aMode == SELECTED )
aItem->ClearSelected();
@ -1086,7 +1086,7 @@ void SCH_SELECTION_TOOL::unhighlight( EDA_ITEM* aItem, int aMode, SELECTION* aGr
}
bool SCH_SELECTION_TOOL::selectionContains( const VECTOR2I& aPoint ) const
bool EE_SELECTION_TOOL::selectionContains( const VECTOR2I& aPoint ) const
{
const unsigned GRIP_MARGIN = 20;
VECTOR2I margin = getView()->ToWorld( VECTOR2I( GRIP_MARGIN, GRIP_MARGIN ), false );
@ -1105,18 +1105,18 @@ bool SCH_SELECTION_TOOL::selectionContains( const VECTOR2I& aPoint ) const
}
void SCH_SELECTION_TOOL::setTransitions()
void EE_SELECTION_TOOL::setTransitions()
{
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::ClearSelection, SCH_ACTIONS::clearSelection.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::ClearSelection, EE_ACTIONS::clearSelection.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::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() );
}

View File

@ -41,7 +41,7 @@ namespace KIGFX
}
class SCH_CONDITIONS : public SELECTION_CONDITIONS
class EE_CONDITIONS : public SELECTION_CONDITIONS
{
public:
static SELECTION_CONDITION Empty;
@ -54,11 +54,11 @@ public:
};
class SCH_SELECTION_TOOL : public TOOL_INTERACTIVE
class EE_SELECTION_TOOL : public TOOL_INTERACTIVE
{
public:
SCH_SELECTION_TOOL();
~SCH_SELECTION_TOOL();
EE_SELECTION_TOOL();
~EE_SELECTION_TOOL();
/// @copydoc TOOL_BASE::Init()
bool Init() override;

View File

@ -23,7 +23,7 @@
#include "lib_drawing_tools.h"
#include "lib_pin_tool.h"
#include <sch_actions.h>
#include <ee_actions.h>
#include <lib_edit_frame.h>
#include <sch_view.h>
#include <class_draw_panel_gal.h>
@ -35,8 +35,8 @@
#include <view/view_controls.h>
#include <view/view.h>
#include <tool/tool_manager.h>
#include <tools/sch_selection_tool.h>
#include <hotkeys.h>
#include <tools/ee_selection_tool.h>
#include <ee_hotkeys.h>
#include <class_libentry.h>
#include <bitmaps.h>
#include <lib_text.h>
@ -47,42 +47,42 @@
#include <lib_rectangle.h>
// Drawing tool actions
TOOL_ACTION SCH_ACTIONS::placeSymbolPin( "libedit.InteractiveDrawing.placeSymbolPin",
TOOL_ACTION EE_ACTIONS::placeSymbolPin( "libedit.InteractiveDrawing.placeSymbolPin",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_LIBEDIT_CREATE_PIN ),
_( "Add Pin" ), _( "Add a pin" ),
pin_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::placeSymbolText( "libedit.InteractiveDrawing.placeSymbolText",
TOOL_ACTION EE_ACTIONS::placeSymbolText( "libedit.InteractiveDrawing.placeSymbolText",
AS_GLOBAL, 0,
_( "Add Text" ), _( "Add a text item" ),
text_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::drawSymbolRectangle( "libedit.InteractiveDrawing.drawSymbolRectangle",
TOOL_ACTION EE_ACTIONS::drawSymbolRectangle( "libedit.InteractiveDrawing.drawSymbolRectangle",
AS_GLOBAL, 0,
_( "Add Rectangle" ), _( "Add a rectangle" ),
add_rectangle_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::drawSymbolCircle( "libedit.InteractiveDrawing.drawSymbolCircle",
TOOL_ACTION EE_ACTIONS::drawSymbolCircle( "libedit.InteractiveDrawing.drawSymbolCircle",
AS_GLOBAL, 0,
_( "Add Circle" ), _( "Add a circle" ),
add_circle_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::drawSymbolArc( "libedit.InteractiveDrawing.drawSymbolArc",
TOOL_ACTION EE_ACTIONS::drawSymbolArc( "libedit.InteractiveDrawing.drawSymbolArc",
AS_GLOBAL, 0,
_( "Add Arc" ), _( "Add an arc" ),
add_circle_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::drawSymbolLines( "libedit.InteractiveDrawing.drawSymbolLines",
TOOL_ACTION EE_ACTIONS::drawSymbolLines( "libedit.InteractiveDrawing.drawSymbolLines",
AS_GLOBAL, 0,
_( "Add Lines" ), _( "Add connected graphic lines" ),
add_circle_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::placeSymbolAnchor( "libedit.InteractiveDrawing.placeSymbolAnchor",
TOOL_ACTION EE_ACTIONS::placeSymbolAnchor( "libedit.InteractiveDrawing.placeSymbolAnchor",
AS_GLOBAL, 0,
_( "Move Symbol Anchor" ), _( "Specify a new location for the symbol anchor" ),
anchor_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::finishDrawing( "libedit.InteractiveDrawing.finishDrawing",
TOOL_ACTION EE_ACTIONS::finishDrawing( "libedit.InteractiveDrawing.finishDrawing",
AS_GLOBAL, 0, _( "Finish Drawing" ), _( "Finish drawing shape" ),
checked_ok_xpm, AF_NONE );
@ -109,7 +109,7 @@ LIB_DRAWING_TOOLS::~LIB_DRAWING_TOOLS()
bool LIB_DRAWING_TOOLS::Init()
{
m_frame = getEditFrame<LIB_EDIT_FRAME>();
m_selectionTool = m_toolMgr->GetTool<SCH_SELECTION_TOOL>();
m_selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
auto isDrawingCondition = [] ( const SELECTION& aSel ) {
LIB_ITEM* item = (LIB_ITEM*) aSel.Front();
@ -121,10 +121,10 @@ bool LIB_DRAWING_TOOLS::Init()
//
// Build the drawing tool menu
//
ctxMenu.AddItem( ACTIONS::cancelInteractive, SCH_CONDITIONS::ShowAlways, 1 );
ctxMenu.AddItem( SCH_ACTIONS::finishDrawing, isDrawingCondition, 2 );
ctxMenu.AddItem( ACTIONS::cancelInteractive, EE_CONDITIONS::ShowAlways, 1 );
ctxMenu.AddItem( EE_ACTIONS::finishDrawing, isDrawingCondition, 2 );
ctxMenu.AddSeparator( SCH_CONDITIONS::ShowAlways, 1000 );
ctxMenu.AddSeparator( EE_CONDITIONS::ShowAlways, 1000 );
m_menu.AddStandardSubMenus( m_frame );
return true;
@ -160,7 +160,7 @@ int LIB_DRAWING_TOOLS::doTwoClickPlace( KICAD_T aType )
VECTOR2I cursorPos = m_controls->GetCursorPosition();
EDA_ITEM* item = nullptr;
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_controls->ShowCursor( true );
Activate();
@ -174,7 +174,7 @@ int LIB_DRAWING_TOOLS::doTwoClickPlace( KICAD_T aType )
{
if( item )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_view->ClearPreview();
delete item;
item = nullptr;
@ -196,7 +196,7 @@ int LIB_DRAWING_TOOLS::doTwoClickPlace( KICAD_T aType )
// First click creates...
if( !item )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_frame->GetCanvas()->SetIgnoreMouseEvents( true );
switch( aType )
@ -277,7 +277,7 @@ int LIB_DRAWING_TOOLS::doTwoClickPlace( KICAD_T aType )
m_menu.ShowContextMenu( m_selectionTool->GetSelection() );
}
else if( item && ( evt->IsAction( &SCH_ACTIONS::refreshPreview ) || evt->IsMotion() ) )
else if( item && ( evt->IsAction( &EE_ACTIONS::refreshPreview ) || evt->IsMotion() ) )
{
static_cast<LIB_ITEM*>( item )->SetPosition( wxPoint( cursorPos.x, -cursorPos.y) );
m_view->ClearPreview();
@ -297,16 +297,16 @@ int LIB_DRAWING_TOOLS::doTwoClickPlace( KICAD_T aType )
int LIB_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
{
if( aEvent.IsAction( &SCH_ACTIONS::drawSymbolArc ) )
if( aEvent.IsAction( &EE_ACTIONS::drawSymbolArc ) )
m_frame->SetToolID( ID_LIBEDIT_BODY_ARC_BUTT, wxCURSOR_PENCIL, _( "Draw Arc" ) );
else if( aEvent.IsAction( &SCH_ACTIONS::drawSymbolCircle ) )
else if( aEvent.IsAction( &EE_ACTIONS::drawSymbolCircle ) )
m_frame->SetToolID( ID_LIBEDIT_BODY_CIRCLE_BUTT, wxCURSOR_PENCIL, _( "Draw Circle" ) );
else if( aEvent.IsAction( &SCH_ACTIONS::drawSymbolLines ) )
else if( aEvent.IsAction( &EE_ACTIONS::drawSymbolLines ) )
m_frame->SetToolID( ID_LIBEDIT_BODY_LINE_BUTT, wxCURSOR_PENCIL, _( "Draw Lines" ) );
else if( aEvent.IsAction( &SCH_ACTIONS::drawSymbolRectangle ) )
else if( aEvent.IsAction( &EE_ACTIONS::drawSymbolRectangle ) )
m_frame->SetToolID( ID_LIBEDIT_BODY_RECT_BUTT, wxCURSOR_PENCIL, _( "Draw Rectangle" ) );
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_controls->ShowCursor( true );
Activate();
@ -321,7 +321,7 @@ int LIB_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
if( TOOL_EVT_UTILS::IsCancelInteractive( evt.get() ) )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_view->ClearPreview();
if( item )
@ -341,7 +341,7 @@ int LIB_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
if( !part )
continue;
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
switch( m_frame->GetToolId() )
{
@ -367,10 +367,10 @@ int LIB_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
else if( item && ( evt->IsClick( BUT_LEFT )
|| evt->IsDblClick( BUT_LEFT )
|| evt->IsAction( &SCH_ACTIONS::finishDrawing ) ) )
|| evt->IsAction( &EE_ACTIONS::finishDrawing ) ) )
{
if( evt->IsDblClick( BUT_LEFT )
|| evt->IsAction( &SCH_ACTIONS::finishDrawing )
|| evt->IsAction( &EE_ACTIONS::finishDrawing )
|| !item->ContinueEdit( wxPoint( cursorPos.x, -cursorPos.y ) ) )
{
item->EndEdit( wxPoint( cursorPos.x, -cursorPos.y ) );
@ -385,7 +385,7 @@ int LIB_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
}
}
else if( item && ( evt->IsAction( &SCH_ACTIONS::refreshPreview )
else if( item && ( evt->IsAction( &EE_ACTIONS::refreshPreview )
|| evt->IsMotion() ) )
{
item->CalcEdit( wxPoint( cursorPos.x, -cursorPos.y) );
@ -395,7 +395,7 @@ int LIB_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
else if( evt->IsDblClick( BUT_LEFT ) && !item )
{
m_toolMgr->RunAction( SCH_ACTIONS::properties, true );
m_toolMgr->RunAction( EE_ACTIONS::properties, true );
}
else if( evt->IsClick( BUT_RIGHT ) )
@ -489,10 +489,10 @@ int LIB_DRAWING_TOOLS::RepeatDrawItem( const TOOL_EVENT& aEvent )
LIB_PIN* pin = pinTool->RepeatPin( sourcePin );
g_lastPinWeakPtr = pin;
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
if( pin )
m_toolMgr->RunAction( SCH_ACTIONS::addItemToSel, true, pin );
m_toolMgr->RunAction( EE_ACTIONS::addItemToSel, true, pin );
}
return 0;
@ -501,12 +501,12 @@ int LIB_DRAWING_TOOLS::RepeatDrawItem( const TOOL_EVENT& aEvent )
void LIB_DRAWING_TOOLS::setTransitions()
{
Go( &LIB_DRAWING_TOOLS::PlacePin, SCH_ACTIONS::placeSymbolPin.MakeEvent() );
Go( &LIB_DRAWING_TOOLS::PlaceText, SCH_ACTIONS::placeSymbolText.MakeEvent() );
Go( &LIB_DRAWING_TOOLS::DrawShape, SCH_ACTIONS::drawSymbolRectangle.MakeEvent() );
Go( &LIB_DRAWING_TOOLS::DrawShape, SCH_ACTIONS::drawSymbolCircle.MakeEvent() );
Go( &LIB_DRAWING_TOOLS::DrawShape, SCH_ACTIONS::drawSymbolArc.MakeEvent() );
Go( &LIB_DRAWING_TOOLS::DrawShape, SCH_ACTIONS::drawSymbolLines.MakeEvent() );
Go( &LIB_DRAWING_TOOLS::PlaceAnchor, SCH_ACTIONS::placeSymbolAnchor.MakeEvent() );
Go( &LIB_DRAWING_TOOLS::RepeatDrawItem, SCH_ACTIONS::repeatDrawItem.MakeEvent() );
Go( &LIB_DRAWING_TOOLS::PlacePin, EE_ACTIONS::placeSymbolPin.MakeEvent() );
Go( &LIB_DRAWING_TOOLS::PlaceText, EE_ACTIONS::placeSymbolText.MakeEvent() );
Go( &LIB_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawSymbolRectangle.MakeEvent() );
Go( &LIB_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawSymbolCircle.MakeEvent() );
Go( &LIB_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawSymbolArc.MakeEvent() );
Go( &LIB_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawSymbolLines.MakeEvent() );
Go( &LIB_DRAWING_TOOLS::PlaceAnchor, EE_ACTIONS::placeSymbolAnchor.MakeEvent() );
Go( &LIB_DRAWING_TOOLS::RepeatDrawItem, EE_ACTIONS::repeatDrawItem.MakeEvent() );
}

View File

@ -31,7 +31,7 @@
class LIB_EDIT_FRAME;
class SCH_SELECTION_TOOL;
class EE_SELECTION_TOOL;
/**
@ -70,7 +70,7 @@ private:
void setTransitions() override;
private:
SCH_SELECTION_TOOL* m_selectionTool;
EE_SELECTION_TOOL* m_selectionTool;
KIGFX::SCH_VIEW* m_view;
KIGFX::VIEW_CONTROLS* m_controls;
LIB_EDIT_FRAME* m_frame;

View File

@ -22,13 +22,13 @@
*/
#include <tool/tool_manager.h>
#include <tools/sch_selection_tool.h>
#include <tools/picker_tool.h>
#include <tools/ee_selection_tool.h>
#include <tools/ee_picker_tool.h>
#include <tools/lib_pin_tool.h>
#include <tools/lib_drawing_tools.h>
#include <tools/lib_move_tool.h>
#include <sch_actions.h>
#include <hotkeys.h>
#include <ee_actions.h>
#include <ee_hotkeys.h>
#include <bitmaps.h>
#include <confirm.h>
#include <base_struct.h>
@ -58,7 +58,7 @@ LIB_EDIT_TOOL::~LIB_EDIT_TOOL()
bool LIB_EDIT_TOOL::Init()
{
m_frame = getEditFrame<LIB_EDIT_FRAME>();
m_selectionTool = m_toolMgr->GetTool<SCH_SELECTION_TOOL>();
m_selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
LIB_DRAWING_TOOLS* drawingTools = m_toolMgr->GetTool<LIB_DRAWING_TOOLS>();
LIB_MOVE_TOOL* moveTool = m_toolMgr->GetTool<LIB_MOVE_TOOL>();
@ -73,18 +73,18 @@ bool LIB_EDIT_TOOL::Init()
CONDITIONAL_MENU& moveMenu = moveTool->GetToolMenu().GetMenu();
moveMenu.AddSeparator( SELECTION_CONDITIONS::NotEmpty );
moveMenu.AddItem( SCH_ACTIONS::rotateCCW, SCH_CONDITIONS::NotEmpty );
moveMenu.AddItem( SCH_ACTIONS::rotateCW, SCH_CONDITIONS::NotEmpty );
moveMenu.AddItem( SCH_ACTIONS::mirrorX, SCH_CONDITIONS::NotEmpty );
moveMenu.AddItem( SCH_ACTIONS::mirrorY, SCH_CONDITIONS::NotEmpty );
moveMenu.AddItem( SCH_ACTIONS::duplicate, SCH_CONDITIONS::NotEmpty );
moveMenu.AddItem( SCH_ACTIONS::doDelete, SCH_CONDITIONS::NotEmpty );
moveMenu.AddItem( EE_ACTIONS::rotateCCW, EE_CONDITIONS::NotEmpty );
moveMenu.AddItem( EE_ACTIONS::rotateCW, EE_CONDITIONS::NotEmpty );
moveMenu.AddItem( EE_ACTIONS::mirrorX, EE_CONDITIONS::NotEmpty );
moveMenu.AddItem( EE_ACTIONS::mirrorY, EE_CONDITIONS::NotEmpty );
moveMenu.AddItem( EE_ACTIONS::duplicate, EE_CONDITIONS::NotEmpty );
moveMenu.AddItem( EE_ACTIONS::doDelete, EE_CONDITIONS::NotEmpty );
moveMenu.AddItem( SCH_ACTIONS::properties, SCH_CONDITIONS::Count( 1 ) );
moveMenu.AddItem( EE_ACTIONS::properties, EE_CONDITIONS::Count( 1 ) );
moveMenu.AddSeparator( SCH_CONDITIONS::IdleSelection );
moveMenu.AddItem( SCH_ACTIONS::cut, SCH_CONDITIONS::IdleSelection );
moveMenu.AddItem( SCH_ACTIONS::copy, SCH_CONDITIONS::IdleSelection );
moveMenu.AddSeparator( EE_CONDITIONS::IdleSelection );
moveMenu.AddItem( EE_ACTIONS::cut, EE_CONDITIONS::IdleSelection );
moveMenu.AddItem( EE_ACTIONS::copy, EE_CONDITIONS::IdleSelection );
}
//
@ -92,32 +92,32 @@ bool LIB_EDIT_TOOL::Init()
//
CONDITIONAL_MENU& drawMenu = drawingTools->GetToolMenu().GetMenu();
drawMenu.AddSeparator( SCH_CONDITIONS::NotEmpty, 200 );
drawMenu.AddItem( SCH_ACTIONS::rotateCCW, SCH_CONDITIONS::IdleSelection, 200 );
drawMenu.AddItem( SCH_ACTIONS::rotateCW, SCH_CONDITIONS::IdleSelection, 200 );
drawMenu.AddItem( SCH_ACTIONS::mirrorX, SCH_CONDITIONS::IdleSelection, 200 );
drawMenu.AddItem( SCH_ACTIONS::mirrorY, SCH_CONDITIONS::IdleSelection, 200 );
drawMenu.AddSeparator( EE_CONDITIONS::NotEmpty, 200 );
drawMenu.AddItem( EE_ACTIONS::rotateCCW, EE_CONDITIONS::IdleSelection, 200 );
drawMenu.AddItem( EE_ACTIONS::rotateCW, EE_CONDITIONS::IdleSelection, 200 );
drawMenu.AddItem( EE_ACTIONS::mirrorX, EE_CONDITIONS::IdleSelection, 200 );
drawMenu.AddItem( EE_ACTIONS::mirrorY, EE_CONDITIONS::IdleSelection, 200 );
drawMenu.AddItem( SCH_ACTIONS::properties, SCH_CONDITIONS::Count( 1 ), 200 );
drawMenu.AddItem( EE_ACTIONS::properties, EE_CONDITIONS::Count( 1 ), 200 );
//
// Add editing actions to the selection tool menu
//
CONDITIONAL_MENU& selToolMenu = m_selectionTool->GetToolMenu().GetMenu();
selToolMenu.AddItem( SCH_ACTIONS::rotateCCW, SCH_CONDITIONS::NotEmpty, 200 );
selToolMenu.AddItem( SCH_ACTIONS::rotateCW, SCH_CONDITIONS::NotEmpty, 200 );
selToolMenu.AddItem( SCH_ACTIONS::mirrorX, SCH_CONDITIONS::NotEmpty, 200 );
selToolMenu.AddItem( SCH_ACTIONS::mirrorY, SCH_CONDITIONS::NotEmpty, 200 );
selToolMenu.AddItem( SCH_ACTIONS::duplicate, SCH_CONDITIONS::NotEmpty, 200 );
selToolMenu.AddItem( SCH_ACTIONS::doDelete, SCH_CONDITIONS::NotEmpty, 200 );
selToolMenu.AddItem( EE_ACTIONS::rotateCCW, EE_CONDITIONS::NotEmpty, 200 );
selToolMenu.AddItem( EE_ACTIONS::rotateCW, EE_CONDITIONS::NotEmpty, 200 );
selToolMenu.AddItem( EE_ACTIONS::mirrorX, EE_CONDITIONS::NotEmpty, 200 );
selToolMenu.AddItem( EE_ACTIONS::mirrorY, EE_CONDITIONS::NotEmpty, 200 );
selToolMenu.AddItem( EE_ACTIONS::duplicate, EE_CONDITIONS::NotEmpty, 200 );
selToolMenu.AddItem( EE_ACTIONS::doDelete, EE_CONDITIONS::NotEmpty, 200 );
selToolMenu.AddItem( SCH_ACTIONS::properties, SCH_CONDITIONS::Count( 1 ), 200 );
selToolMenu.AddItem( EE_ACTIONS::properties, EE_CONDITIONS::Count( 1 ), 200 );
selToolMenu.AddSeparator( SCH_CONDITIONS::Idle, 200 );
selToolMenu.AddItem( SCH_ACTIONS::cut, SCH_CONDITIONS::IdleSelection, 200 );
selToolMenu.AddItem( SCH_ACTIONS::copy, SCH_CONDITIONS::IdleSelection, 200 );
selToolMenu.AddItem( SCH_ACTIONS::paste, SCH_CONDITIONS::Idle, 200 );
selToolMenu.AddSeparator( EE_CONDITIONS::Idle, 200 );
selToolMenu.AddItem( EE_ACTIONS::cut, EE_CONDITIONS::IdleSelection, 200 );
selToolMenu.AddItem( EE_ACTIONS::copy, EE_CONDITIONS::IdleSelection, 200 );
selToolMenu.AddItem( EE_ACTIONS::paste, EE_CONDITIONS::Idle, 200 );
return true;
}
@ -141,7 +141,7 @@ int LIB_EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent )
return 0;
wxPoint rotPoint;
bool ccw = ( aEvent.Matches( SCH_ACTIONS::rotateCCW.MakeEvent() ) );
bool ccw = ( aEvent.Matches( EE_ACTIONS::rotateCCW.MakeEvent() ) );
LIB_ITEM* item = static_cast<LIB_ITEM*>( selection.Front() );
if( !item->IsMoving() )
@ -164,7 +164,7 @@ int LIB_EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent )
if( !item->IsMoving() )
{
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_frame->OnModify();
}
@ -181,7 +181,7 @@ int LIB_EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent )
return 0;
wxPoint mirrorPoint;
bool xAxis = ( aEvent.Matches( SCH_ACTIONS::mirrorX.MakeEvent() ) );
bool xAxis = ( aEvent.Matches( EE_ACTIONS::mirrorX.MakeEvent() ) );
LIB_ITEM* item = static_cast<LIB_ITEM*>( selection.Front() );
if( !item->IsMoving() )
@ -209,7 +209,7 @@ int LIB_EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent )
if( !item->IsMoving() )
{
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_frame->OnModify();
}
@ -262,9 +262,9 @@ int LIB_EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
getView()->Add( newItem );
}
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( SCH_ACTIONS::addItemsToSel, true, &newItems );
m_toolMgr->RunAction( SCH_ACTIONS::move, false );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::addItemsToSel, true, &newItems );
m_toolMgr->RunAction( EE_ACTIONS::move, false );
return 0;
}
@ -279,7 +279,7 @@ int LIB_EDIT_TOOL::DoDelete( const TOOL_EVENT& aEvent )
return 0;
// Don't leave a freed pointer in the selection
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_frame->SaveCopyInUndoList( part );
@ -328,15 +328,15 @@ int LIB_EDIT_TOOL::DoDelete( const TOOL_EVENT& aEvent )
static bool deleteItem( SCH_BASE_FRAME* aFrame, const VECTOR2D& aPosition )
{
SCH_SELECTION_TOOL* selectionTool = aFrame->GetToolManager()->GetTool<SCH_SELECTION_TOOL>();
EE_SELECTION_TOOL* selectionTool = aFrame->GetToolManager()->GetTool<EE_SELECTION_TOOL>();
wxCHECK( selectionTool, false );
aFrame->GetToolManager()->RunAction( SCH_ACTIONS::clearSelection, true );
aFrame->GetToolManager()->RunAction( EE_ACTIONS::clearSelection, true );
EDA_ITEM* item = selectionTool->SelectPoint( aPosition );
if( item )
aFrame->GetToolManager()->RunAction( SCH_ACTIONS::doDelete, true );
aFrame->GetToolManager()->RunAction( EE_ACTIONS::doDelete, true );
return true;
}
@ -346,7 +346,7 @@ int LIB_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent )
{
Activate();
PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>();
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
wxCHECK( picker, 0 );
m_frame->SetToolID( ID_LIBEDIT_DELETE_ITEM_BUTT, wxCURSOR_BULLSEYE, _( "Delete item" ) );
@ -583,9 +583,9 @@ int LIB_EDIT_TOOL::Paste( const TOOL_EVENT& aEvent )
delete newPart;
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( SCH_ACTIONS::addItemsToSel, true, &newItems );
m_toolMgr->RunAction( SCH_ACTIONS::move, false );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::addItemsToSel, true, &newItems );
m_toolMgr->RunAction( EE_ACTIONS::move, false );
return 0;
}
@ -593,17 +593,17 @@ int LIB_EDIT_TOOL::Paste( const TOOL_EVENT& aEvent )
void LIB_EDIT_TOOL::setTransitions()
{
Go( &LIB_EDIT_TOOL::Duplicate, SCH_ACTIONS::duplicate.MakeEvent() );
Go( &LIB_EDIT_TOOL::Rotate, SCH_ACTIONS::rotateCW.MakeEvent() );
Go( &LIB_EDIT_TOOL::Rotate, SCH_ACTIONS::rotateCCW.MakeEvent() );
Go( &LIB_EDIT_TOOL::Mirror, SCH_ACTIONS::mirrorX.MakeEvent() );
Go( &LIB_EDIT_TOOL::Mirror, SCH_ACTIONS::mirrorY.MakeEvent() );
Go( &LIB_EDIT_TOOL::DoDelete, SCH_ACTIONS::doDelete.MakeEvent() );
Go( &LIB_EDIT_TOOL::DeleteItemCursor, SCH_ACTIONS::deleteItemCursor.MakeEvent() );
Go( &LIB_EDIT_TOOL::Duplicate, EE_ACTIONS::duplicate.MakeEvent() );
Go( &LIB_EDIT_TOOL::Rotate, EE_ACTIONS::rotateCW.MakeEvent() );
Go( &LIB_EDIT_TOOL::Rotate, EE_ACTIONS::rotateCCW.MakeEvent() );
Go( &LIB_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorX.MakeEvent() );
Go( &LIB_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorY.MakeEvent() );
Go( &LIB_EDIT_TOOL::DoDelete, EE_ACTIONS::doDelete.MakeEvent() );
Go( &LIB_EDIT_TOOL::DeleteItemCursor, EE_ACTIONS::deleteItemCursor.MakeEvent() );
Go( &LIB_EDIT_TOOL::Properties, SCH_ACTIONS::properties.MakeEvent() );
Go( &LIB_EDIT_TOOL::Properties, EE_ACTIONS::properties.MakeEvent() );
Go( &LIB_EDIT_TOOL::Cut, SCH_ACTIONS::cut.MakeEvent() );
Go( &LIB_EDIT_TOOL::Copy, SCH_ACTIONS::copy.MakeEvent() );
Go( &LIB_EDIT_TOOL::Paste, SCH_ACTIONS::paste.MakeEvent() );
Go( &LIB_EDIT_TOOL::Cut, EE_ACTIONS::cut.MakeEvent() );
Go( &LIB_EDIT_TOOL::Copy, EE_ACTIONS::copy.MakeEvent() );
Go( &LIB_EDIT_TOOL::Paste, EE_ACTIONS::paste.MakeEvent() );
}

View File

@ -30,7 +30,7 @@
class LIB_EDIT_FRAME;
class SCH_SELECTION_TOOL;
class EE_SELECTION_TOOL;
class LIB_EDIT_TOOL : public TOOL_INTERACTIVE
@ -78,11 +78,11 @@ private:
void setTransitions() override;
private:
SCH_SELECTION_TOOL* m_selectionTool;
LIB_EDIT_FRAME* m_frame;
EE_SELECTION_TOOL* m_selectionTool;
LIB_EDIT_FRAME* m_frame;
/// Menu model displayed by the tool.
TOOL_MENU m_menu;
TOOL_MENU m_menu;
};
#endif //KICAD_LIB_EDIT_TOOL_H

View File

@ -22,9 +22,9 @@
*/
#include <tool/tool_manager.h>
#include <tools/sch_selection_tool.h>
#include <sch_actions.h>
#include <hotkeys.h>
#include <tools/ee_selection_tool.h>
#include <ee_actions.h>
#include <ee_hotkeys.h>
#include <view/view.h>
#include <bitmaps.h>
#include <base_struct.h>
@ -54,7 +54,7 @@ LIB_MOVE_TOOL::~LIB_MOVE_TOOL()
bool LIB_MOVE_TOOL::Init()
{
m_frame = getEditFrame<LIB_EDIT_FRAME>();
m_selectionTool = m_toolMgr->GetTool<SCH_SELECTION_TOOL>();
m_selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
wxASSERT_MSG( m_selectionTool, "eeshema.InteractiveSelection tool is not available" );
@ -63,9 +63,9 @@ bool LIB_MOVE_TOOL::Init()
//
CONDITIONAL_MENU& ctxMenu = m_menu.GetMenu();
ctxMenu.AddItem( ACTIONS::cancelInteractive, SCH_CONDITIONS::ShowAlways, 1 );
ctxMenu.AddItem( ACTIONS::cancelInteractive, EE_CONDITIONS::ShowAlways, 1 );
ctxMenu.AddSeparator( SCH_CONDITIONS::ShowAlways, 1000 );
ctxMenu.AddSeparator( EE_CONDITIONS::ShowAlways, 1000 );
m_menu.AddStandardSubMenus( m_frame );
//
@ -73,7 +73,7 @@ bool LIB_MOVE_TOOL::Init()
//
CONDITIONAL_MENU& selToolMenu = m_selectionTool->GetToolMenu().GetMenu();
selToolMenu.AddItem( SCH_ACTIONS::move, SCH_CONDITIONS::Idle, 150 );
selToolMenu.AddItem( EE_ACTIONS::move, EE_CONDITIONS::Idle, 150 );
return true;
}
@ -127,8 +127,8 @@ int LIB_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
{
controls->SetSnapping( !evt->Modifier( MD_ALT ) );
if( evt->IsAction( &SCH_ACTIONS::move ) || evt->IsMotion() || evt->IsDrag( BUT_LEFT )
|| evt->IsAction( &SCH_ACTIONS::refreshPreview ) )
if( evt->IsAction( &EE_ACTIONS::move ) || evt->IsMotion() || evt->IsDrag( BUT_LEFT )
|| evt->IsAction( &EE_ACTIONS::refreshPreview ) )
{
if( !m_moveInProgress ) // Prepare to start moving/dragging
{
@ -220,7 +220,7 @@ int LIB_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
//
else if( TOOL_EVT_UTILS::IsCancelInteractive( evt.get() ) )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
if( m_moveInProgress )
restore_state = true;
@ -237,12 +237,12 @@ int LIB_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
}
else if( evt->Category() == TC_COMMAND )
{
if( evt->IsAction( &SCH_ACTIONS::doDelete ) )
if( evt->IsAction( &EE_ACTIONS::doDelete ) )
{
// Exit on a remove operation; there is no further processing for removed items.
break;
}
else if( evt->IsAction( &SCH_ACTIONS::duplicate ) )
else if( evt->IsAction( &EE_ACTIONS::duplicate ) )
{
if( selection.Front()->IsNew() )
{
@ -300,7 +300,7 @@ int LIB_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
item->ClearFlags( item->GetEditFlags() );
if( unselect )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
if( restore_state )
m_frame->RollbackPartFromUndo();
@ -342,5 +342,5 @@ bool LIB_MOVE_TOOL::updateModificationPoint( SELECTION& aSelection )
void LIB_MOVE_TOOL::setTransitions()
{
Go( &LIB_MOVE_TOOL::Main, SCH_ACTIONS::move.MakeEvent() );
Go( &LIB_MOVE_TOOL::Main, EE_ACTIONS::move.MakeEvent() );
}

View File

@ -30,7 +30,7 @@
class LIB_EDIT_FRAME;
class SCH_SELECTION_TOOL;
class EE_SELECTION_TOOL;
class LIB_MOVE_TOOL : public TOOL_INTERACTIVE
@ -66,7 +66,7 @@ private:
void setTransitions() override;
private:
SCH_SELECTION_TOOL* m_selectionTool;
EE_SELECTION_TOOL* m_selectionTool;
KIGFX::VIEW_CONTROLS* m_controls;
LIB_EDIT_FRAME* m_frame;

View File

@ -22,26 +22,26 @@
*/
#include <tool/tool_manager.h>
#include <tools/sch_selection_tool.h>
#include <tools/ee_selection_tool.h>
#include <lib_edit_frame.h>
#include <eeschema_id.h>
#include <confirm.h>
#include <sch_actions.h>
#include <ee_actions.h>
#include <sch_view.h>
#include <dialogs/dialog_display_info_HTML_base.h>
#include <dialogs/dialog_lib_edit_pin.h>
#include "lib_pin_tool.h"
TOOL_ACTION SCH_ACTIONS::pushPinLength( "libedit.PinEditing.pushPinLength",
TOOL_ACTION EE_ACTIONS::pushPinLength( "libedit.PinEditing.pushPinLength",
AS_GLOBAL, 0, _( "Push Pin Length" ), _( "Copy pin length to other pins in symbol" ),
pin_size_to_xpm );
TOOL_ACTION SCH_ACTIONS::pushPinNameSize( "libedit.PinEditing.pushPinNameSize",
TOOL_ACTION EE_ACTIONS::pushPinNameSize( "libedit.PinEditing.pushPinNameSize",
AS_GLOBAL, 0, _( "Push Pin Name Size" ), _( "Copy pin name size to other pins in symbol" ),
pin_size_to_xpm );
TOOL_ACTION SCH_ACTIONS::pushPinNumSize( "libedit.PinEditing.pushPinNumSize",
TOOL_ACTION EE_ACTIONS::pushPinNumSize( "libedit.PinEditing.pushPinNumSize",
AS_GLOBAL, 0, _( "Push Pin Number Size" ), _( "Copy pin number size to other pins in symbol" ),
pin_size_to_xpm );
@ -102,18 +102,18 @@ LIB_PIN_TOOL::~LIB_PIN_TOOL()
bool LIB_PIN_TOOL::Init()
{
m_frame = getEditFrame<LIB_EDIT_FRAME>();
m_selectionTool = m_toolMgr->GetTool<SCH_SELECTION_TOOL>();
m_selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
wxASSERT_MSG( m_selectionTool, "eeshema.InteractiveSelection tool is not available" );
auto singlePinCondition = SCH_CONDITIONS::Count( 1 ) && SCH_CONDITIONS::OnlyType( LIB_PIN_T );
auto singlePinCondition = EE_CONDITIONS::Count( 1 ) && EE_CONDITIONS::OnlyType( LIB_PIN_T );
CONDITIONAL_MENU& selToolMenu = m_selectionTool->GetToolMenu().GetMenu();
selToolMenu.AddSeparator( singlePinCondition, 400 );
selToolMenu.AddItem( SCH_ACTIONS::pushPinLength, singlePinCondition, 400 );
selToolMenu.AddItem( SCH_ACTIONS::pushPinNameSize, singlePinCondition, 400 );
selToolMenu.AddItem( SCH_ACTIONS::pushPinNumSize, singlePinCondition, 400 );
selToolMenu.AddItem( EE_ACTIONS::pushPinLength, singlePinCondition, 400 );
selToolMenu.AddItem( EE_ACTIONS::pushPinNameSize, singlePinCondition, 400 );
selToolMenu.AddItem( EE_ACTIONS::pushPinNumSize, singlePinCondition, 400 );
return true;
}
@ -330,11 +330,11 @@ int LIB_PIN_TOOL::PushPinProperties( const TOOL_EVENT& aEvent )
if( pin == sourcePin )
continue;
if( aEvent.IsAction( &SCH_ACTIONS::pushPinLength ) )
if( aEvent.IsAction( &EE_ACTIONS::pushPinLength ) )
pin->SetLength( sourcePin->GetLength() );
else if( aEvent.IsAction( &SCH_ACTIONS::pushPinNameSize ) )
else if( aEvent.IsAction( &EE_ACTIONS::pushPinNameSize ) )
pin->SetNameTextSize( sourcePin->GetNameTextSize() );
else if( aEvent.IsAction( &SCH_ACTIONS::pushPinNumSize ) )
else if( aEvent.IsAction( &EE_ACTIONS::pushPinNumSize ) )
pin->SetNumberTextSize( sourcePin->GetNumberTextSize() );
}
@ -383,8 +383,8 @@ LIB_PIN* LIB_PIN_TOOL::RepeatPin( const LIB_PIN* aSourcePin )
void LIB_PIN_TOOL::setTransitions()
{
Go( &LIB_PIN_TOOL::PushPinProperties, SCH_ACTIONS::pushPinLength.MakeEvent() );
Go( &LIB_PIN_TOOL::PushPinProperties, SCH_ACTIONS::pushPinNameSize.MakeEvent() );
Go( &LIB_PIN_TOOL::PushPinProperties, SCH_ACTIONS::pushPinNumSize.MakeEvent() );
Go( &LIB_PIN_TOOL::PushPinProperties, EE_ACTIONS::pushPinLength.MakeEvent() );
Go( &LIB_PIN_TOOL::PushPinProperties, EE_ACTIONS::pushPinNameSize.MakeEvent() );
Go( &LIB_PIN_TOOL::PushPinProperties, EE_ACTIONS::pushPinNumSize.MakeEvent() );
}

View File

@ -30,7 +30,7 @@
class LIB_EDIT_FRAME;
class SCH_SELECTION_TOOL;
class EE_SELECTION_TOOL;
class LIB_PIN_TOOL : public TOOL_INTERACTIVE
@ -59,8 +59,8 @@ private:
void setTransitions() override;
private:
SCH_SELECTION_TOOL* m_selectionTool;
LIB_EDIT_FRAME* m_frame;
EE_SELECTION_TOOL* m_selectionTool;
LIB_EDIT_FRAME* m_frame;
};
#endif //KICAD_LIB_PIN_TOOL_H

View File

@ -22,8 +22,8 @@
*/
#include "sch_drawing_tools.h"
#include "sch_selection_tool.h"
#include <sch_actions.h>
#include "ee_selection_tool.h"
#include <ee_actions.h>
#include <sch_edit_frame.h>
#include <sch_view.h>
@ -36,7 +36,7 @@
#include <view/view_controls.h>
#include <view/view.h>
#include <tool/tool_manager.h>
#include <hotkeys.h>
#include <ee_hotkeys.h>
#include <sch_component.h>
#include <sch_no_connect.h>
#include <sch_junction.h>
@ -48,90 +48,90 @@
// Drawing tool actions
TOOL_ACTION SCH_ACTIONS::placeSymbol( "eeschema.InteractiveDrawing.placeSymbol",
TOOL_ACTION EE_ACTIONS::placeSymbol( "eeschema.InteractiveDrawing.placeSymbol",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ADD_NEW_COMPONENT ),
_( "Add Symbol" ), _( "Add a symbol" ),
add_component_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::placePower( "eeschema.InteractiveDrawing.placePowerPort",
TOOL_ACTION EE_ACTIONS::placePower( "eeschema.InteractiveDrawing.placePowerPort",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ADD_NEW_POWER ),
_( "Add Power" ), _( "Add a power port" ),
add_power_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::placeNoConnect( "eeschema.InteractiveDrawing.placeNoConnect",
TOOL_ACTION EE_ACTIONS::placeNoConnect( "eeschema.InteractiveDrawing.placeNoConnect",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ADD_NOCONN_FLAG ),
_( "Add No Connect Flag" ), _( "Add a no-connection flag" ),
noconn_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::placeJunction( "eeschema.InteractiveDrawing.placeJunction",
TOOL_ACTION EE_ACTIONS::placeJunction( "eeschema.InteractiveDrawing.placeJunction",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ADD_JUNCTION ),
_( "Add Junction" ), _( "Add a junction" ),
add_junction_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::placeBusWireEntry( "eeschema.InteractiveDrawing.placeBusWireEntry",
TOOL_ACTION EE_ACTIONS::placeBusWireEntry( "eeschema.InteractiveDrawing.placeBusWireEntry",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ADD_WIRE_ENTRY ),
_( "Add Wire to Bus Entry" ), _( "Add a wire entry to a bus" ),
add_line2bus_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::placeBusBusEntry( "eeschema.InteractiveDrawing.placeBusBusEntry",
TOOL_ACTION EE_ACTIONS::placeBusBusEntry( "eeschema.InteractiveDrawing.placeBusBusEntry",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ADD_BUS_ENTRY ),
_( "Add Bus to Bus Entry" ), _( "Add a bus entry to a bus" ),
add_bus2bus_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::placeLabel( "eeschema.InteractiveDrawing.placeLabel",
TOOL_ACTION EE_ACTIONS::placeLabel( "eeschema.InteractiveDrawing.placeLabel",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ADD_LABEL ),
_( "Add Label" ), _( "Add a net label" ),
add_line_label_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::placeHierarchicalLabel( "eeschema.InteractiveDrawing.placeHierarchicalLabel",
TOOL_ACTION EE_ACTIONS::placeHierarchicalLabel( "eeschema.InteractiveDrawing.placeHierarchicalLabel",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ADD_HLABEL ),
_( "Add Hierarchical Label" ), _( "Add a hierarchical sheet label" ),
add_hierarchical_label_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::drawSheet( "eeschema.InteractiveDrawing.drawSheet",
TOOL_ACTION EE_ACTIONS::drawSheet( "eeschema.InteractiveDrawing.drawSheet",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ADD_HIER_SHEET ),
_( "Add Sheet" ), _( "Add a hierarchical sheet" ),
add_hierarchical_subsheet_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::placeSheetPin( "eeschema.InteractiveDrawing.placeSheetPin",
TOOL_ACTION EE_ACTIONS::placeSheetPin( "eeschema.InteractiveDrawing.placeSheetPin",
AS_GLOBAL, 0, _( "Add Sheet Pin" ), _( "Add a sheet pin" ),
add_hierar_pin_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::importSheetPin( "eeschema.InteractiveDrawing.importSheetPin",
TOOL_ACTION EE_ACTIONS::importSheetPin( "eeschema.InteractiveDrawing.importSheetPin",
AS_GLOBAL, 0, _( "Import Sheet Pin" ), _( "Import a hierarchical sheet pin" ),
import_hierarchical_label_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::placeGlobalLabel( "eeschema.InteractiveDrawing.placeGlobalLabel",
TOOL_ACTION EE_ACTIONS::placeGlobalLabel( "eeschema.InteractiveDrawing.placeGlobalLabel",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ADD_GLABEL ),
_( "Add Global Label" ), _( "Add a global label" ),
add_glabel_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::placeSchematicText( "eeschema.InteractiveDrawing.placeSchematicText",
TOOL_ACTION EE_ACTIONS::placeSchematicText( "eeschema.InteractiveDrawing.placeSchematicText",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ADD_GRAPHIC_TEXT ),
_( "Add Text" ), _( "Add text" ),
text_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::placeImage( "eeschema.InteractiveDrawing.placeImage",
TOOL_ACTION EE_ACTIONS::placeImage( "eeschema.InteractiveDrawing.placeImage",
AS_GLOBAL, 0, _( "Add Image" ), _( "Add bitmap image" ),
image_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::finishSheet( "eeschema.InteractiveDrawing.finishSheet",
TOOL_ACTION EE_ACTIONS::finishSheet( "eeschema.InteractiveDrawing.finishSheet",
AS_GLOBAL, 0, _( "Finish Sheet" ), _( "Finish drawing sheet" ),
checked_ok_xpm, AF_NONE );
TOOL_ACTION SCH_ACTIONS::addJunction( "eeschema.InteractiveEditing.addJunction",
TOOL_ACTION EE_ACTIONS::addJunction( "eeschema.InteractiveEditing.addJunction",
AS_GLOBAL, 0, _( "Add Junction" ), _( "Add a wire or bus junction" ),
add_junction_xpm, AF_NONE );
TOOL_ACTION SCH_ACTIONS::addLabel( "eeschema.InteractiveEditing.addLabel",
TOOL_ACTION EE_ACTIONS::addLabel( "eeschema.InteractiveEditing.addLabel",
AS_GLOBAL, 0, _( "Add Label" ), _( "Add a label to a wire or bus" ),
add_line_label_xpm, AF_NONE );
TOOL_ACTION SCH_ACTIONS::addGlobalLabel( "eeschema.InteractiveEditing.addGlobalLabel",
TOOL_ACTION EE_ACTIONS::addGlobalLabel( "eeschema.InteractiveEditing.addGlobalLabel",
AS_GLOBAL, 0, _( "Add Global Label" ), _( "Add a global label to a wire or bus" ),
add_glabel_xpm, AF_NONE );
TOOL_ACTION SCH_ACTIONS::addHierLabel( "eeschema.InteractiveEditing.addHierLabel",
TOOL_ACTION EE_ACTIONS::addHierLabel( "eeschema.InteractiveEditing.addHierLabel",
AS_GLOBAL, 0, _( "Add Hierarchical Label" ), _( "Add a hierarchical label to a wire or bus" ),
add_hierarchical_label_xpm, AF_NONE );
@ -155,7 +155,7 @@ SCH_DRAWING_TOOLS::~SCH_DRAWING_TOOLS()
bool SCH_DRAWING_TOOLS::Init()
{
m_frame = getEditFrame<SCH_EDIT_FRAME>();
m_selectionTool = m_toolMgr->GetTool<SCH_SELECTION_TOOL>();
m_selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
auto belowRootSheetCondition = [] ( const SELECTION& aSel ) {
return g_CurrentSheet->Last() != g_RootSheet;
@ -166,10 +166,10 @@ bool SCH_DRAWING_TOOLS::Init()
//
// Build the drawing tool menu
//
ctxMenu.AddItem( ACTIONS::cancelInteractive, SCH_CONDITIONS::ShowAlways, 1 );
ctxMenu.AddItem( SCH_ACTIONS::leaveSheet, belowRootSheetCondition, 2 );
ctxMenu.AddItem( ACTIONS::cancelInteractive, EE_CONDITIONS::ShowAlways, 1 );
ctxMenu.AddItem( EE_ACTIONS::leaveSheet, belowRootSheetCondition, 2 );
ctxMenu.AddSeparator( SCH_CONDITIONS::ShowAlways, 1000 );
ctxMenu.AddSeparator( EE_CONDITIONS::ShowAlways, 1000 );
m_menu.AddStandardSubMenus( m_frame );
return true;
@ -187,7 +187,7 @@ void SCH_DRAWING_TOOLS::Reset( RESET_REASON aReason )
int SCH_DRAWING_TOOLS::AddJunction( const TOOL_EVENT& aEvent )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_frame->GetCanvas()->MoveCursorToCrossHair();
m_frame->AddJunction( m_frame->GetCrossHairPosition() );
@ -198,15 +198,15 @@ int SCH_DRAWING_TOOLS::AddJunction( const TOOL_EVENT& aEvent )
int SCH_DRAWING_TOOLS::AddLabel( const TOOL_EVENT& aEvent )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
int layer = LAYER_NOTES;
if( aEvent.IsAction( &SCH_ACTIONS::addLabel ) )
if( aEvent.IsAction( &EE_ACTIONS::addLabel ) )
layer = LAYER_LOCLABEL;
else if( aEvent.IsAction( &SCH_ACTIONS::addGlobalLabel ) )
else if( aEvent.IsAction( &EE_ACTIONS::addGlobalLabel ) )
layer = LAYER_GLOBLABEL;
else if( aEvent.IsAction( &SCH_ACTIONS::addHierLabel ) )
else if( aEvent.IsAction( &EE_ACTIONS::addHierLabel ) )
layer = LAYER_HIERLABEL;
SCH_ITEM* item = m_frame->CreateNewText( layer );
@ -256,11 +256,11 @@ int SCH_DRAWING_TOOLS::doPlaceComponent( SCH_COMPONENT* aComponent, SCHLIB_FILTE
{
aComponent->SetFlags( IS_NEW | IS_MOVED );
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_selectionTool->AddItemToSel( aComponent );
// Queue up a refresh event so we don't have to wait for the next mouse-moved event
m_toolMgr->RunAction( SCH_ACTIONS::refreshPreview );
m_toolMgr->RunAction( EE_ACTIONS::refreshPreview );
}
// Main loop: keep receiving events
@ -272,7 +272,7 @@ int SCH_DRAWING_TOOLS::doPlaceComponent( SCH_COMPONENT* aComponent, SCHLIB_FILTE
{
if( aComponent )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_view->ClearPreview();
delete aComponent;
aComponent = nullptr;
@ -287,7 +287,7 @@ int SCH_DRAWING_TOOLS::doPlaceComponent( SCH_COMPONENT* aComponent, SCHLIB_FILTE
{
if( !aComponent )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
// Pick the module to be placed
m_frame->GetCanvas()->SetIgnoreMouseEvents( true );
@ -346,11 +346,11 @@ int SCH_DRAWING_TOOLS::doPlaceComponent( SCH_COMPONENT* aComponent, SCHLIB_FILTE
if( aComponent )
{
m_frame->SelectUnit( aComponent, unit );
m_toolMgr->RunAction( SCH_ACTIONS::refreshPreview );
m_toolMgr->RunAction( EE_ACTIONS::refreshPreview );
}
}
}
else if( aComponent && ( evt->IsAction( &SCH_ACTIONS::refreshPreview )
else if( aComponent && ( evt->IsAction( &EE_ACTIONS::refreshPreview )
|| evt->IsMotion() ) )
{
aComponent->SetPosition( (wxPoint)cursorPos );
@ -377,7 +377,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent )
VECTOR2I cursorPos = m_controls->GetCursorPosition();
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_controls->ShowCursor( true );
Activate();
@ -399,7 +399,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent )
{
if( image )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_view->ClearPreview();
delete image;
image = nullptr;
@ -414,7 +414,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent )
{
if( !image )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_frame->GetCanvas()->SetIgnoreMouseEvents( true );
@ -470,7 +470,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent )
m_menu.ShowContextMenu( m_selectionTool->GetSelection() );
}
else if( image && ( evt->IsAction( &SCH_ACTIONS::refreshPreview )
else if( image && ( evt->IsAction( &EE_ACTIONS::refreshPreview )
|| evt->IsMotion() ) )
{
image->SetPosition( (wxPoint)cursorPos );
@ -520,7 +520,7 @@ int SCH_DRAWING_TOOLS::PlaceBusBusEntry( const TOOL_EVENT& aEvent )
int SCH_DRAWING_TOOLS::doSingleClickPlace( KICAD_T aType )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_controls->ShowCursor( true );
m_controls->SetSnapping( true );
@ -633,7 +633,7 @@ int SCH_DRAWING_TOOLS::doTwoClickPlace( KICAD_T aType )
VECTOR2I cursorPos = m_controls->GetCursorPosition();
EDA_ITEM* item = nullptr;
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_controls->ShowCursor( true );
Activate();
@ -647,7 +647,7 @@ int SCH_DRAWING_TOOLS::doTwoClickPlace( KICAD_T aType )
{
if( item )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_view->ClearPreview();
delete item;
item = nullptr;
@ -663,7 +663,7 @@ int SCH_DRAWING_TOOLS::doTwoClickPlace( KICAD_T aType )
// First click creates...
if( !item )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_frame->GetCanvas()->SetIgnoreMouseEvents( true );
switch( aType )
@ -742,7 +742,7 @@ int SCH_DRAWING_TOOLS::doTwoClickPlace( KICAD_T aType )
else
item = nullptr;
}
else if( item && ( evt->IsAction( &SCH_ACTIONS::refreshPreview )
else if( item && ( evt->IsAction( &EE_ACTIONS::refreshPreview )
|| evt->IsMotion() ) )
{
static_cast<SCH_ITEM*>( item )->SetPosition( (wxPoint)cursorPos );
@ -764,7 +764,7 @@ int SCH_DRAWING_TOOLS::doTwoClickPlace( KICAD_T aType )
int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent )
{
m_frame->SetToolID( ID_SHEET_SYMBOL_BUTT, wxCURSOR_PENCIL, _( "Add sheet" ) );
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_controls->ShowCursor( true );
SCH_SHEET* sheet = nullptr;
@ -778,7 +778,7 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent )
if( TOOL_EVT_UTILS::IsCancelInteractive( evt.get() ) )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_view->ClearPreview();
if( sheet )
@ -795,7 +795,7 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent )
else if( evt->IsClick( BUT_LEFT ) && !sheet )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
sheet = new SCH_SHEET( (wxPoint) cursorPos );
sheet->SetFlags( IS_NEW | IS_RESIZED );
@ -810,7 +810,7 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent )
}
else if( sheet && ( evt->IsClick( BUT_LEFT )
|| evt->IsAction( &SCH_ACTIONS::finishSheet ) ) )
|| evt->IsAction( &EE_ACTIONS::finishSheet ) ) )
{
m_view->ClearPreview();
@ -822,7 +822,7 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent )
sheet = nullptr;
}
else if( sheet && ( evt->IsAction( &SCH_ACTIONS::refreshPreview )
else if( sheet && ( evt->IsAction( &EE_ACTIONS::refreshPreview )
|| evt->IsMotion() ) )
{
sizeSheet( sheet, cursorPos );
@ -865,23 +865,23 @@ void SCH_DRAWING_TOOLS::sizeSheet( SCH_SHEET* aSheet, VECTOR2I aPos )
void SCH_DRAWING_TOOLS::setTransitions()
{
Go( &SCH_DRAWING_TOOLS::PlaceSymbol, SCH_ACTIONS::placeSymbol.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlacePower, SCH_ACTIONS::placePower.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlaceNoConnect, SCH_ACTIONS::placeNoConnect.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlaceJunction, SCH_ACTIONS::placeJunction.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlaceBusWireEntry, SCH_ACTIONS::placeBusWireEntry.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlaceBusBusEntry, SCH_ACTIONS::placeBusBusEntry.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlaceLabel, SCH_ACTIONS::placeLabel.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlaceHierarchicalLabel,SCH_ACTIONS::placeHierarchicalLabel.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlaceGlobalLabel, SCH_ACTIONS::placeGlobalLabel.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::DrawSheet, SCH_ACTIONS::drawSheet.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlaceSheetPin, SCH_ACTIONS::placeSheetPin.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::ImportSheetPin, SCH_ACTIONS::importSheetPin.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlaceSchematicText, SCH_ACTIONS::placeSchematicText.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlaceImage, SCH_ACTIONS::placeImage.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlaceSymbol, EE_ACTIONS::placeSymbol.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlacePower, EE_ACTIONS::placePower.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlaceNoConnect, EE_ACTIONS::placeNoConnect.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlaceJunction, EE_ACTIONS::placeJunction.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlaceBusWireEntry, EE_ACTIONS::placeBusWireEntry.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlaceBusBusEntry, EE_ACTIONS::placeBusBusEntry.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlaceLabel, EE_ACTIONS::placeLabel.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlaceHierarchicalLabel,EE_ACTIONS::placeHierarchicalLabel.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlaceGlobalLabel, EE_ACTIONS::placeGlobalLabel.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::DrawSheet, EE_ACTIONS::drawSheet.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlaceSheetPin, EE_ACTIONS::placeSheetPin.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::ImportSheetPin, EE_ACTIONS::importSheetPin.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlaceSchematicText, EE_ACTIONS::placeSchematicText.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::PlaceImage, EE_ACTIONS::placeImage.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::AddJunction, SCH_ACTIONS::addJunction.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::AddLabel, SCH_ACTIONS::addLabel.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::AddLabel, SCH_ACTIONS::addGlobalLabel.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::AddLabel, SCH_ACTIONS::addHierLabel.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::AddJunction, EE_ACTIONS::addJunction.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::AddLabel, EE_ACTIONS::addLabel.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::AddLabel, EE_ACTIONS::addGlobalLabel.MakeEvent() );
Go( &SCH_DRAWING_TOOLS::AddLabel, EE_ACTIONS::addHierLabel.MakeEvent() );
}

View File

@ -35,7 +35,7 @@ class SCH_BUS_WIRE_ENTRY;
class SCH_LABEL;
class SCHLIB_FILTER;
class SCH_EDIT_FRAME;
class SCH_SELECTION_TOOL;
class EE_SELECTION_TOOL;
/**
@ -92,7 +92,7 @@ private:
void setTransitions() override;
private:
SCH_SELECTION_TOOL* m_selectionTool;
EE_SELECTION_TOOL* m_selectionTool;
KIGFX::SCH_VIEW* m_view;
KIGFX::VIEW_CONTROLS* m_controls;
SCH_EDIT_FRAME* m_frame;

View File

@ -23,12 +23,12 @@
#include <tool/tool_manager.h>
#include <tools/sch_edit_tool.h>
#include <tools/sch_selection_tool.h>
#include <tools/ee_selection_tool.h>
#include <tools/sch_wire_bus_tool.h>
#include <tools/picker_tool.h>
#include <tools/ee_picker_tool.h>
#include <tools/sch_move_tool.h>
#include <sch_actions.h>
#include <hotkeys.h>
#include <ee_actions.h>
#include <ee_hotkeys.h>
#include <bitmaps.h>
#include <confirm.h>
#include <eda_doc.h>
@ -49,117 +49,117 @@
#include "sch_drawing_tools.h"
TOOL_ACTION SCH_ACTIONS::duplicate( "eeschema.InteractiveEdit.duplicate",
TOOL_ACTION EE_ACTIONS::duplicate( "eeschema.InteractiveEdit.duplicate",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_DUPLICATE ),
_( "Duplicate" ), _( "Duplicates the selected item(s)" ),
duplicate_xpm );
TOOL_ACTION SCH_ACTIONS::repeatDrawItem( "eeschema.InteractiveEdit.repeatDrawItem",
TOOL_ACTION EE_ACTIONS::repeatDrawItem( "eeschema.InteractiveEdit.repeatDrawItem",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_REPEAT_LAST ),
_( "Repeat Last Item" ), _( "Duplicates the last drawn item" ),
nullptr );
TOOL_ACTION SCH_ACTIONS::rotateCW( "eeschema.InteractiveEdit.rotateCW",
TOOL_ACTION EE_ACTIONS::rotateCW( "eeschema.InteractiveEdit.rotateCW",
AS_GLOBAL, 0,
_( "Rotate Clockwise" ), _( "Rotates selected item(s) clockwise" ),
rotate_cw_xpm );
TOOL_ACTION SCH_ACTIONS::rotateCCW( "eeschema.InteractiveEdit.rotateCCW",
TOOL_ACTION EE_ACTIONS::rotateCCW( "eeschema.InteractiveEdit.rotateCCW",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ROTATE ),
_( "Rotate" ), _( "Rotates selected item(s) counter-clockwise" ),
rotate_ccw_xpm );
TOOL_ACTION SCH_ACTIONS::mirrorX( "eeschema.InteractiveEdit.mirrorX",
TOOL_ACTION EE_ACTIONS::mirrorX( "eeschema.InteractiveEdit.mirrorX",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_MIRROR_X ),
_( "Mirror Around Horizontal Axis" ), _( "Flips selected item(s) from top to bottom" ),
mirror_h_xpm );
TOOL_ACTION SCH_ACTIONS::mirrorY( "eeschema.InteractiveEdit.mirrorY",
TOOL_ACTION EE_ACTIONS::mirrorY( "eeschema.InteractiveEdit.mirrorY",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_MIRROR_Y ),
_( "Mirror Around Vertical Axis" ), _( "Flips selected item(s) from left to right" ),
mirror_v_xpm );
TOOL_ACTION SCH_ACTIONS::properties( "eeschema.InteractiveEdit.properties",
TOOL_ACTION EE_ACTIONS::properties( "eeschema.InteractiveEdit.properties",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_EDIT ),
_( "Properties..." ), _( "Displays item properties dialog" ),
edit_xpm );
TOOL_ACTION SCH_ACTIONS::editReference( "eeschema.InteractiveEdit.editReference",
TOOL_ACTION EE_ACTIONS::editReference( "eeschema.InteractiveEdit.editReference",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_EDIT_COMPONENT_REFERENCE ),
_( "Edit Reference..." ), _( "Displays reference field dialog" ),
edit_comp_ref_xpm );
TOOL_ACTION SCH_ACTIONS::editValue( "eeschema.InteractiveEdit.editValue",
TOOL_ACTION EE_ACTIONS::editValue( "eeschema.InteractiveEdit.editValue",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_EDIT_COMPONENT_VALUE ),
_( "Edit Value..." ), _( "Displays value field dialog" ),
edit_comp_value_xpm );
TOOL_ACTION SCH_ACTIONS::editFootprint( "eeschema.InteractiveEdit.editFootprint",
TOOL_ACTION EE_ACTIONS::editFootprint( "eeschema.InteractiveEdit.editFootprint",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_EDIT_COMPONENT_FOOTPRINT ),
_( "Edit Footprint..." ), _( "Displays footprint field dialog" ),
edit_comp_footprint_xpm );
TOOL_ACTION SCH_ACTIONS::autoplaceFields( "eeschema.InteractiveEdit.autoplaceFields",
TOOL_ACTION EE_ACTIONS::autoplaceFields( "eeschema.InteractiveEdit.autoplaceFields",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_AUTOPLACE_FIELDS ),
_( "Autoplace Fields" ), _( "Runs the automatic placement algorithm on the symbol's fields" ),
autoplace_fields_xpm );
TOOL_ACTION SCH_ACTIONS::convertDeMorgan( "eeschema.InteractiveEdit.convertDeMorgan",
TOOL_ACTION EE_ACTIONS::convertDeMorgan( "eeschema.InteractiveEdit.convertDeMorgan",
AS_GLOBAL, 0,
_( "DeMorgan Conversion" ), _( "Switch between DeMorgan representations" ),
morgan2_xpm );
TOOL_ACTION SCH_ACTIONS::toShapeSlash( "eeschema.InteractiveEdit.toShapeSlash",
TOOL_ACTION EE_ACTIONS::toShapeSlash( "eeschema.InteractiveEdit.toShapeSlash",
AS_GLOBAL, 0,
_( "Set Bus Entry Shape /" ), _( "Change the bus entry shape to /" ),
change_entry_orient_xpm );
TOOL_ACTION SCH_ACTIONS::toShapeBackslash( "eeschema.InteractiveEdit.toShapeBackslash",
TOOL_ACTION EE_ACTIONS::toShapeBackslash( "eeschema.InteractiveEdit.toShapeBackslash",
AS_GLOBAL, 0,
_( "Set Bus Entry Shape \\" ), _( "Change the bus entry shape to \\" ),
change_entry_orient_xpm );
TOOL_ACTION SCH_ACTIONS::toLabel( "eeschema.InteractiveEdit.toLabel",
TOOL_ACTION EE_ACTIONS::toLabel( "eeschema.InteractiveEdit.toLabel",
AS_GLOBAL, 0,
_( "Change to Label" ), _( "Change existing item to a label" ),
add_line_label_xpm );
TOOL_ACTION SCH_ACTIONS::toHLabel( "eeschema.InteractiveEdit.toHLabel",
TOOL_ACTION EE_ACTIONS::toHLabel( "eeschema.InteractiveEdit.toHLabel",
AS_GLOBAL, 0,
_( "Change to Hierarchical Label" ), _( "Change existing item to a hierarchical label" ),
add_hierarchical_label_xpm );
TOOL_ACTION SCH_ACTIONS::toGLabel( "eeschema.InteractiveEdit.toGLabel",
TOOL_ACTION EE_ACTIONS::toGLabel( "eeschema.InteractiveEdit.toGLabel",
AS_GLOBAL, 0,
_( "Change to Global Label" ), _( "Change existing item to a global label" ),
add_glabel_xpm );
TOOL_ACTION SCH_ACTIONS::toText( "eeschema.InteractiveEdit.toText",
TOOL_ACTION EE_ACTIONS::toText( "eeschema.InteractiveEdit.toText",
AS_GLOBAL, 0,
_( "Change to Text" ), _( "Change existing item to a text comment" ),
text_xpm );
TOOL_ACTION SCH_ACTIONS::cleanupSheetPins( "eeschema.InteractiveEdit.cleanupSheetPins",
TOOL_ACTION EE_ACTIONS::cleanupSheetPins( "eeschema.InteractiveEdit.cleanupSheetPins",
AS_GLOBAL, 0,
_( "Cleanup Sheet Pins" ), _( "Delete unreferenced sheet pins" ),
nullptr );
TOOL_ACTION SCH_ACTIONS::doDelete( "eeschema.InteractiveEdit.doDelete",
TOOL_ACTION EE_ACTIONS::doDelete( "eeschema.InteractiveEdit.doDelete",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_DELETE ),
_( "Delete" ), _( "Deletes selected item(s)" ),
delete_xpm );
TOOL_ACTION SCH_ACTIONS::deleteItemCursor( "eeschema.InteractiveEdit.deleteItemCursor",
TOOL_ACTION EE_ACTIONS::deleteItemCursor( "eeschema.InteractiveEdit.deleteItemCursor",
AS_GLOBAL, 0,
_( "DoDelete Items" ), _( "DoDelete clicked items" ),
nullptr, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::breakWire( "eeschema.InteractiveEdit.breakWire",
TOOL_ACTION EE_ACTIONS::breakWire( "eeschema.InteractiveEdit.breakWire",
AS_GLOBAL, 0,
_( "Break Wire" ), _( "Divide a wire into segments which can be dragged independently" ),
break_line_xpm );
TOOL_ACTION SCH_ACTIONS::breakBus( "eeschema.InteractiveEdit.breakBus",
TOOL_ACTION EE_ACTIONS::breakBus( "eeschema.InteractiveEdit.breakBus",
AS_GLOBAL, 0,
_( "Break Bus" ), _( "Divide a bus into segments which can be dragged independently" ),
break_line_xpm );
@ -184,9 +184,9 @@ protected:
private:
void update() override
{
SCH_SELECTION_TOOL* selTool = getToolManager()->GetTool<SCH_SELECTION_TOOL>();
SELECTION& selection = selTool->GetSelection();
SCH_COMPONENT* component = dynamic_cast<SCH_COMPONENT*>( selection.Front() );
EE_SELECTION_TOOL* selTool = getToolManager()->GetTool<EE_SELECTION_TOOL>();
SELECTION& selection = selTool->GetSelection();
SCH_COMPONENT* component = dynamic_cast<SCH_COMPONENT*>( selection.Front() );
if( !component )
{
@ -241,7 +241,7 @@ SCH_EDIT_TOOL::~SCH_EDIT_TOOL()
bool SCH_EDIT_TOOL::Init()
{
m_frame = getEditFrame<SCH_EDIT_FRAME>();
m_selectionTool = m_toolMgr->GetTool<SCH_SELECTION_TOOL>();
m_selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
SCH_DRAWING_TOOLS* drawingTools = m_toolMgr->GetTool<SCH_DRAWING_TOOLS>();
SCH_MOVE_TOOL* moveTool = m_toolMgr->GetTool<SCH_MOVE_TOOL>();
@ -315,36 +315,36 @@ bool SCH_EDIT_TOOL::Init()
};
KICAD_T toLabelTypes[] = { SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_TEXT_T, EOT };
auto toLabelCondition = SCH_CONDITIONS::Count( 1 )
&& SCH_CONDITIONS::OnlyTypes( toLabelTypes );
auto toLabelCondition = EE_CONDITIONS::Count( 1 )
&& EE_CONDITIONS::OnlyTypes( toLabelTypes );
KICAD_T toHLableTypes[] = { SCH_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_TEXT_T, EOT };
auto toHLabelCondition = SCH_CONDITIONS::Count( 1 )
&& SCH_CONDITIONS::OnlyTypes( toHLableTypes);
auto toHLabelCondition = EE_CONDITIONS::Count( 1 )
&& EE_CONDITIONS::OnlyTypes( toHLableTypes);
KICAD_T toGLableTypes[] = { SCH_LABEL_T, SCH_HIER_LABEL_T, SCH_TEXT_T, EOT };
auto toGLabelCondition = SCH_CONDITIONS::Count( 1 )
&& SCH_CONDITIONS::OnlyTypes( toGLableTypes);
auto toGLabelCondition = EE_CONDITIONS::Count( 1 )
&& EE_CONDITIONS::OnlyTypes( toGLableTypes);
KICAD_T toTextTypes[] = { SCH_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, EOT };
auto toTextlCondition = SCH_CONDITIONS::Count( 1 )
&& SCH_CONDITIONS::OnlyTypes( toTextTypes);
auto toTextlCondition = EE_CONDITIONS::Count( 1 )
&& EE_CONDITIONS::OnlyTypes( toTextTypes);
KICAD_T entryTypes[] = { SCH_BUS_WIRE_ENTRY_T, SCH_BUS_BUS_ENTRY_T, EOT };
auto entryCondition = SCH_CONDITIONS::MoreThan( 0 )
&& SCH_CONDITIONS::OnlyTypes( entryTypes );
auto entryCondition = EE_CONDITIONS::MoreThan( 0 )
&& EE_CONDITIONS::OnlyTypes( entryTypes );
auto singleComponentCondition = SCH_CONDITIONS::Count( 1 )
&& SCH_CONDITIONS::OnlyType( SCH_COMPONENT_T );
auto singleComponentCondition = EE_CONDITIONS::Count( 1 )
&& EE_CONDITIONS::OnlyType( SCH_COMPONENT_T );
auto wireSelectionCondition = SCH_CONDITIONS::MoreThan( 0 )
&& SCH_CONDITIONS::OnlyType( SCH_LINE_LOCATE_WIRE_T );
auto wireSelectionCondition = EE_CONDITIONS::MoreThan( 0 )
&& EE_CONDITIONS::OnlyType( SCH_LINE_LOCATE_WIRE_T );
auto busSelectionCondition = SCH_CONDITIONS::MoreThan( 0 )
&& SCH_CONDITIONS::OnlyType( SCH_LINE_LOCATE_BUS_T );
auto busSelectionCondition = EE_CONDITIONS::MoreThan( 0 )
&& EE_CONDITIONS::OnlyType( SCH_LINE_LOCATE_BUS_T );
auto singleSheetCondition = SCH_CONDITIONS::Count( 1 )
&& SCH_CONDITIONS::OnlyType( SCH_SHEET_T );
auto singleSheetCondition = EE_CONDITIONS::Count( 1 )
&& EE_CONDITIONS::OnlyType( SCH_SHEET_T );
//
// Add edit actions to the move tool menu
@ -354,27 +354,27 @@ bool SCH_EDIT_TOOL::Init()
CONDITIONAL_MENU& moveMenu = moveTool->GetToolMenu().GetMenu();
moveMenu.AddSeparator( SELECTION_CONDITIONS::NotEmpty );
moveMenu.AddItem( SCH_ACTIONS::rotateCCW, orientCondition );
moveMenu.AddItem( SCH_ACTIONS::rotateCW, orientCondition );
moveMenu.AddItem( SCH_ACTIONS::mirrorX, orientCondition );
moveMenu.AddItem( SCH_ACTIONS::mirrorY, orientCondition );
moveMenu.AddItem( SCH_ACTIONS::duplicate, duplicateCondition );
moveMenu.AddItem( SCH_ACTIONS::doDelete, SCH_CONDITIONS::NotEmpty );
moveMenu.AddItem( EE_ACTIONS::rotateCCW, orientCondition );
moveMenu.AddItem( EE_ACTIONS::rotateCW, orientCondition );
moveMenu.AddItem( EE_ACTIONS::mirrorX, orientCondition );
moveMenu.AddItem( EE_ACTIONS::mirrorY, orientCondition );
moveMenu.AddItem( EE_ACTIONS::duplicate, duplicateCondition );
moveMenu.AddItem( EE_ACTIONS::doDelete, EE_CONDITIONS::NotEmpty );
moveMenu.AddItem( SCH_ACTIONS::properties, propertiesCondition );
moveMenu.AddItem( SCH_ACTIONS::editReference, singleComponentCondition );
moveMenu.AddItem( SCH_ACTIONS::editValue, singleComponentCondition );
moveMenu.AddItem( SCH_ACTIONS::editFootprint, singleComponentCondition );
moveMenu.AddItem( SCH_ACTIONS::convertDeMorgan, SCH_CONDITIONS::SingleDeMorganSymbol );
moveMenu.AddItem( EE_ACTIONS::properties, propertiesCondition );
moveMenu.AddItem( EE_ACTIONS::editReference, singleComponentCondition );
moveMenu.AddItem( EE_ACTIONS::editValue, singleComponentCondition );
moveMenu.AddItem( EE_ACTIONS::editFootprint, singleComponentCondition );
moveMenu.AddItem( EE_ACTIONS::convertDeMorgan, EE_CONDITIONS::SingleDeMorganSymbol );
std::shared_ptr<SYMBOL_UNIT_MENU> symUnitMenu = std::make_shared<SYMBOL_UNIT_MENU>();
symUnitMenu->SetTool( this );
m_menu.AddSubMenu( symUnitMenu );
moveMenu.AddMenu( symUnitMenu.get(), false, SCH_CONDITIONS::SingleMultiUnitSymbol, 1 );
moveMenu.AddMenu( symUnitMenu.get(), false, EE_CONDITIONS::SingleMultiUnitSymbol, 1 );
moveMenu.AddSeparator( SCH_CONDITIONS::IdleSelection );
moveMenu.AddItem( SCH_ACTIONS::cut, SCH_CONDITIONS::IdleSelection );
moveMenu.AddItem( SCH_ACTIONS::copy, SCH_CONDITIONS::IdleSelection );
moveMenu.AddSeparator( EE_CONDITIONS::IdleSelection );
moveMenu.AddItem( EE_ACTIONS::cut, EE_CONDITIONS::IdleSelection );
moveMenu.AddItem( EE_ACTIONS::copy, EE_CONDITIONS::IdleSelection );
}
//
@ -382,73 +382,73 @@ bool SCH_EDIT_TOOL::Init()
//
CONDITIONAL_MENU& drawMenu = drawingTools->GetToolMenu().GetMenu();
drawMenu.AddSeparator( SCH_CONDITIONS::NotEmpty, 200 );
drawMenu.AddItem( SCH_ACTIONS::rotateCCW, orientCondition, 200 );
drawMenu.AddItem( SCH_ACTIONS::rotateCW, orientCondition, 200 );
drawMenu.AddItem( SCH_ACTIONS::mirrorX, orientCondition, 200 );
drawMenu.AddItem( SCH_ACTIONS::mirrorY, orientCondition, 200 );
drawMenu.AddSeparator( EE_CONDITIONS::NotEmpty, 200 );
drawMenu.AddItem( EE_ACTIONS::rotateCCW, orientCondition, 200 );
drawMenu.AddItem( EE_ACTIONS::rotateCW, orientCondition, 200 );
drawMenu.AddItem( EE_ACTIONS::mirrorX, orientCondition, 200 );
drawMenu.AddItem( EE_ACTIONS::mirrorY, orientCondition, 200 );
drawMenu.AddItem( SCH_ACTIONS::properties, propertiesCondition, 200 );
drawMenu.AddItem( SCH_ACTIONS::editReference, singleComponentCondition, 200 );
drawMenu.AddItem( SCH_ACTIONS::editValue, singleComponentCondition, 200 );
drawMenu.AddItem( SCH_ACTIONS::editFootprint, singleComponentCondition, 200 );
drawMenu.AddItem( SCH_ACTIONS::convertDeMorgan, SCH_CONDITIONS::SingleDeMorganSymbol, 200 );
drawMenu.AddItem( EE_ACTIONS::properties, propertiesCondition, 200 );
drawMenu.AddItem( EE_ACTIONS::editReference, singleComponentCondition, 200 );
drawMenu.AddItem( EE_ACTIONS::editValue, singleComponentCondition, 200 );
drawMenu.AddItem( EE_ACTIONS::editFootprint, singleComponentCondition, 200 );
drawMenu.AddItem( EE_ACTIONS::convertDeMorgan, EE_CONDITIONS::SingleDeMorganSymbol, 200 );
std::shared_ptr<SYMBOL_UNIT_MENU> symUnitMenu2 = std::make_shared<SYMBOL_UNIT_MENU>();
symUnitMenu2->SetTool( drawingTools );
drawingTools->GetToolMenu().AddSubMenu( symUnitMenu2 );
drawMenu.AddMenu( symUnitMenu2.get(), false, SCH_CONDITIONS::SingleMultiUnitSymbol, 1 );
drawMenu.AddMenu( symUnitMenu2.get(), false, EE_CONDITIONS::SingleMultiUnitSymbol, 1 );
drawMenu.AddItem( SCH_ACTIONS::editWithSymbolEditor,
singleComponentCondition && SCH_CONDITIONS::Idle, 200 );
drawMenu.AddItem( EE_ACTIONS::editWithSymbolEditor,
singleComponentCondition && EE_CONDITIONS::Idle, 200 );
drawMenu.AddItem( SCH_ACTIONS::toShapeSlash, entryCondition, 200 );
drawMenu.AddItem( SCH_ACTIONS::toShapeBackslash, entryCondition, 200 );
drawMenu.AddItem( SCH_ACTIONS::toLabel, anyTextTool && SCH_CONDITIONS::Idle, 200 );
drawMenu.AddItem( SCH_ACTIONS::toHLabel, anyTextTool && SCH_CONDITIONS::Idle, 200 );
drawMenu.AddItem( SCH_ACTIONS::toGLabel, anyTextTool && SCH_CONDITIONS::Idle, 200 );
drawMenu.AddItem( SCH_ACTIONS::toText, anyTextTool && SCH_CONDITIONS::Idle, 200 );
drawMenu.AddItem( SCH_ACTIONS::cleanupSheetPins, sheetTool && SCH_CONDITIONS::Idle, 200 );
drawMenu.AddItem( EE_ACTIONS::toShapeSlash, entryCondition, 200 );
drawMenu.AddItem( EE_ACTIONS::toShapeBackslash, entryCondition, 200 );
drawMenu.AddItem( EE_ACTIONS::toLabel, anyTextTool && EE_CONDITIONS::Idle, 200 );
drawMenu.AddItem( EE_ACTIONS::toHLabel, anyTextTool && EE_CONDITIONS::Idle, 200 );
drawMenu.AddItem( EE_ACTIONS::toGLabel, anyTextTool && EE_CONDITIONS::Idle, 200 );
drawMenu.AddItem( EE_ACTIONS::toText, anyTextTool && EE_CONDITIONS::Idle, 200 );
drawMenu.AddItem( EE_ACTIONS::cleanupSheetPins, sheetTool && EE_CONDITIONS::Idle, 200 );
//
// Add editing actions to the selection tool menu
//
CONDITIONAL_MENU& selToolMenu = m_selectionTool->GetToolMenu().GetMenu();
selToolMenu.AddItem( SCH_ACTIONS::rotateCCW, orientCondition, 200 );
selToolMenu.AddItem( SCH_ACTIONS::rotateCW, orientCondition, 200 );
selToolMenu.AddItem( SCH_ACTIONS::mirrorX, orientCondition, 200 );
selToolMenu.AddItem( SCH_ACTIONS::mirrorY, orientCondition, 200 );
selToolMenu.AddItem( SCH_ACTIONS::duplicate, duplicateCondition, 200 );
selToolMenu.AddItem( SCH_ACTIONS::doDelete, SCH_CONDITIONS::NotEmpty, 200 );
selToolMenu.AddItem( EE_ACTIONS::rotateCCW, orientCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::rotateCW, orientCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::mirrorX, orientCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::mirrorY, orientCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::duplicate, duplicateCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::doDelete, EE_CONDITIONS::NotEmpty, 200 );
selToolMenu.AddItem( SCH_ACTIONS::properties, propertiesCondition, 200 );
selToolMenu.AddItem( SCH_ACTIONS::editReference, SCH_CONDITIONS::SingleSymbol, 200 );
selToolMenu.AddItem( SCH_ACTIONS::editValue, SCH_CONDITIONS::SingleSymbol, 200 );
selToolMenu.AddItem( SCH_ACTIONS::editFootprint, SCH_CONDITIONS::SingleSymbol, 200 );
selToolMenu.AddItem( SCH_ACTIONS::autoplaceFields, singleComponentCondition, 200 );
selToolMenu.AddItem( SCH_ACTIONS::convertDeMorgan, SCH_CONDITIONS::SingleSymbol, 200 );
selToolMenu.AddItem( EE_ACTIONS::properties, propertiesCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::editReference, EE_CONDITIONS::SingleSymbol, 200 );
selToolMenu.AddItem( EE_ACTIONS::editValue, EE_CONDITIONS::SingleSymbol, 200 );
selToolMenu.AddItem( EE_ACTIONS::editFootprint, EE_CONDITIONS::SingleSymbol, 200 );
selToolMenu.AddItem( EE_ACTIONS::autoplaceFields, singleComponentCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::convertDeMorgan, EE_CONDITIONS::SingleSymbol, 200 );
std::shared_ptr<SYMBOL_UNIT_MENU> symUnitMenu3 = std::make_shared<SYMBOL_UNIT_MENU>();
symUnitMenu3->SetTool( m_selectionTool );
m_selectionTool->GetToolMenu().AddSubMenu( symUnitMenu3 );
selToolMenu.AddMenu( symUnitMenu3.get(), false, SCH_CONDITIONS::SingleMultiUnitSymbol, 1 );
selToolMenu.AddMenu( symUnitMenu3.get(), false, EE_CONDITIONS::SingleMultiUnitSymbol, 1 );
selToolMenu.AddItem( SCH_ACTIONS::editWithSymbolEditor,
singleComponentCondition && SCH_CONDITIONS::Idle, 200 );
selToolMenu.AddItem( EE_ACTIONS::editWithSymbolEditor,
singleComponentCondition && EE_CONDITIONS::Idle, 200 );
selToolMenu.AddItem( SCH_ACTIONS::toShapeSlash, entryCondition, 200 );
selToolMenu.AddItem( SCH_ACTIONS::toShapeBackslash, entryCondition, 200 );
selToolMenu.AddItem( SCH_ACTIONS::toLabel, toLabelCondition, 200 );
selToolMenu.AddItem( SCH_ACTIONS::toHLabel, toHLabelCondition, 200 );
selToolMenu.AddItem( SCH_ACTIONS::toGLabel, toGLabelCondition, 200 );
selToolMenu.AddItem( SCH_ACTIONS::toText, toTextlCondition, 200 );
selToolMenu.AddItem( SCH_ACTIONS::cleanupSheetPins, singleSheetCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::toShapeSlash, entryCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::toShapeBackslash, entryCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::toLabel, toLabelCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::toHLabel, toHLabelCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::toGLabel, toGLabelCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::toText, toTextlCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::cleanupSheetPins, singleSheetCondition, 200 );
selToolMenu.AddSeparator( SCH_CONDITIONS::Idle, 200 );
selToolMenu.AddItem( SCH_ACTIONS::cut, SCH_CONDITIONS::IdleSelection, 200 );
selToolMenu.AddItem( SCH_ACTIONS::copy, SCH_CONDITIONS::IdleSelection, 200 );
selToolMenu.AddItem( SCH_ACTIONS::paste, SCH_CONDITIONS::Idle, 200 );
selToolMenu.AddSeparator( EE_CONDITIONS::Idle, 200 );
selToolMenu.AddItem( EE_ACTIONS::cut, EE_CONDITIONS::IdleSelection, 200 );
selToolMenu.AddItem( EE_ACTIONS::copy, EE_CONDITIONS::IdleSelection, 200 );
selToolMenu.AddItem( EE_ACTIONS::paste, EE_CONDITIONS::Idle, 200 );
return true;
}
@ -472,7 +472,7 @@ int SCH_EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent )
return 0;
wxPoint rotPoint;
bool clockwise = ( aEvent.Matches( SCH_ACTIONS::rotateCW.MakeEvent() ) );
bool clockwise = ( aEvent.Matches( EE_ACTIONS::rotateCW.MakeEvent() ) );
SCH_ITEM* item = static_cast<SCH_ITEM*>( selection.Front() );
bool connections = false;
bool moving = item->IsMoving();
@ -592,7 +592,7 @@ int SCH_EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent )
if( !item->IsMoving() )
{
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
if( connections )
m_frame->TestDanglingEnds();
@ -612,7 +612,7 @@ int SCH_EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent )
return 0;
wxPoint mirrorPoint;
bool xAxis = ( aEvent.Matches( SCH_ACTIONS::mirrorX.MakeEvent() ) );
bool xAxis = ( aEvent.Matches( EE_ACTIONS::mirrorX.MakeEvent() ) );
SCH_ITEM* item = static_cast<SCH_ITEM*>( selection.Front() );
bool connections = false;
bool moving = item->IsMoving();
@ -735,7 +735,7 @@ int SCH_EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent )
if( !item->IsMoving() )
{
if( selection.IsHover() )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
if( connections )
m_frame->TestDanglingEnds();
@ -847,9 +847,9 @@ int SCH_EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
m_frame->SetSheetNumberAndCount();
}
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( SCH_ACTIONS::addItemsToSel, true, &newItems );
m_toolMgr->RunAction( SCH_ACTIONS::move, false );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::addItemsToSel, true, &newItems );
m_toolMgr->RunAction( EE_ACTIONS::move, false );
return 0;
}
@ -862,7 +862,7 @@ int SCH_EDIT_TOOL::RepeatDrawItem( const TOOL_EVENT& aEvent )
if( !sourceItem )
return 0;
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
SCH_ITEM* newItem = (SCH_ITEM*) sourceItem->Clone();
bool performDrag = false;
@ -891,7 +891,7 @@ int SCH_EDIT_TOOL::RepeatDrawItem( const TOOL_EVENT& aEvent )
m_selectionTool->AddItemToSel( newItem );
if( performDrag )
m_toolMgr->RunAction( SCH_ACTIONS::move, true );
m_toolMgr->RunAction( EE_ACTIONS::move, true );
newItem->ClearFlags();
@ -915,7 +915,7 @@ int SCH_EDIT_TOOL::DoDelete( const TOOL_EVENT& aEvent )
return 0;
// Don't leave a freed pointer in the selection
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
for( EDA_ITEM* item : items )
{
@ -970,10 +970,10 @@ int SCH_EDIT_TOOL::DoDelete( const TOOL_EVENT& aEvent )
static bool deleteItem( SCH_BASE_FRAME* aFrame, const VECTOR2D& aPosition )
{
SCH_SELECTION_TOOL* selectionTool = aFrame->GetToolManager()->GetTool<SCH_SELECTION_TOOL>();
EE_SELECTION_TOOL* selectionTool = aFrame->GetToolManager()->GetTool<EE_SELECTION_TOOL>();
wxCHECK( selectionTool, false );
aFrame->GetToolManager()->RunAction( SCH_ACTIONS::clearSelection, true );
aFrame->GetToolManager()->RunAction( EE_ACTIONS::clearSelection, true );
EDA_ITEM* item = selectionTool->SelectPoint( aPosition );
SCH_ITEM* sch_item = dynamic_cast<SCH_ITEM*>( item );
@ -989,7 +989,7 @@ static bool deleteItem( SCH_BASE_FRAME* aFrame, const VECTOR2D& aPosition )
}
if( item )
aFrame->GetToolManager()->RunAction( SCH_ACTIONS::doDelete, true );
aFrame->GetToolManager()->RunAction( EE_ACTIONS::doDelete, true );
return true;
}
@ -999,7 +999,7 @@ int SCH_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent )
{
Activate();
PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>();
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
wxCHECK( picker, 0 );
m_frame->SetToolID( ID_SCHEMATIC_DELETE_ITEM_BUTT, wxCURSOR_BULLSEYE, _( "Delete item" ) );
@ -1020,11 +1020,11 @@ int SCH_EDIT_TOOL::EditField( const TOOL_EVENT& aEvent )
KICAD_T* filter = Nothing;
if( aEvent.IsAction( &SCH_ACTIONS::editReference ) )
if( aEvent.IsAction( &EE_ACTIONS::editReference ) )
filter = CmpOrReference;
else if( aEvent.IsAction( &SCH_ACTIONS::editValue ) )
else if( aEvent.IsAction( &EE_ACTIONS::editValue ) )
filter = CmpOrValue;
else if( aEvent.IsAction( &SCH_ACTIONS::editFootprint ) )
else if( aEvent.IsAction( &EE_ACTIONS::editFootprint ) )
filter = CmpOrFootprint;
SELECTION& selection = m_selectionTool->RequestSelection( filter );
@ -1038,11 +1038,11 @@ int SCH_EDIT_TOOL::EditField( const TOOL_EVENT& aEvent )
{
SCH_COMPONENT* component = (SCH_COMPONENT*) item;
if( aEvent.IsAction( &SCH_ACTIONS::editReference ) )
if( aEvent.IsAction( &EE_ACTIONS::editReference ) )
m_frame->EditComponentFieldText( component->GetField( REFERENCE ) );
else if( aEvent.IsAction( &SCH_ACTIONS::editValue ) )
else if( aEvent.IsAction( &EE_ACTIONS::editValue ) )
m_frame->EditComponentFieldText( component->GetField( VALUE ) );
else if( aEvent.IsAction( &SCH_ACTIONS::editFootprint ) )
else if( aEvent.IsAction( &EE_ACTIONS::editFootprint ) )
m_frame->EditComponentFieldText( component->GetField( FOOTPRINT ) );
}
else if( item->Type() == SCH_FIELD_T )
@ -1085,7 +1085,7 @@ int SCH_EDIT_TOOL::ConvertDeMorgan( const TOOL_EVENT& aEvent )
SCH_COMPONENT* component = (SCH_COMPONENT*) selection.Front();
if( component->IsNew() )
m_toolMgr->RunAction( SCH_ACTIONS::refreshPreview );
m_toolMgr->RunAction( EE_ACTIONS::refreshPreview );
else
m_frame->SaveCopyInUndoList( component, UR_CHANGED );
@ -1187,9 +1187,9 @@ int SCH_EDIT_TOOL::ChangeShape( const TOOL_EVENT& aEvent )
SELECTION& selection = m_selectionTool->GetSelection();
char shape;
if( aEvent.IsAction( &SCH_ACTIONS::toShapeSlash ) )
if( aEvent.IsAction( &EE_ACTIONS::toShapeSlash ) )
shape = '/';
else if( aEvent.IsAction( &SCH_ACTIONS::toShapeBackslash ) )
else if( aEvent.IsAction( &EE_ACTIONS::toShapeBackslash ) )
shape = '\\';
else
return 0;
@ -1223,13 +1223,13 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent )
SELECTION& selection = m_selectionTool->RequestSelection( allTextTypes );
KICAD_T convertTo;
if( aEvent.IsAction( &SCH_ACTIONS::toLabel ) )
if( aEvent.IsAction( &EE_ACTIONS::toLabel ) )
convertTo = SCH_LABEL_T;
else if( aEvent.IsAction( &SCH_ACTIONS::toHLabel ) )
else if( aEvent.IsAction( &EE_ACTIONS::toHLabel ) )
convertTo = SCH_HIER_LABEL_T;
else if( aEvent.IsAction( &SCH_ACTIONS::toGLabel ) )
else if( aEvent.IsAction( &EE_ACTIONS::toGLabel ) )
convertTo = SCH_GLOBAL_LABEL_T;
else if( aEvent.IsAction( &SCH_ACTIONS::toText ) )
else if( aEvent.IsAction( &EE_ACTIONS::toText ) )
convertTo = SCH_TEXT_T;
else
return 0;
@ -1314,31 +1314,31 @@ void SCH_EDIT_TOOL::saveCopyInUndoList( EDA_ITEM* aItem, UNDO_REDO_T aType, bool
void SCH_EDIT_TOOL::setTransitions()
{
Go( &SCH_EDIT_TOOL::Duplicate, SCH_ACTIONS::duplicate.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::mirrorX.MakeEvent() );
Go( &SCH_EDIT_TOOL::Mirror, SCH_ACTIONS::mirrorY.MakeEvent() );
Go( &SCH_EDIT_TOOL::DoDelete, SCH_ACTIONS::doDelete.MakeEvent() );
Go( &SCH_EDIT_TOOL::DeleteItemCursor, SCH_ACTIONS::deleteItemCursor.MakeEvent() );
Go( &SCH_EDIT_TOOL::Duplicate, EE_ACTIONS::duplicate.MakeEvent() );
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::mirrorX.MakeEvent() );
Go( &SCH_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorY.MakeEvent() );
Go( &SCH_EDIT_TOOL::DoDelete, EE_ACTIONS::doDelete.MakeEvent() );
Go( &SCH_EDIT_TOOL::DeleteItemCursor, EE_ACTIONS::deleteItemCursor.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::ConvertDeMorgan, SCH_ACTIONS::convertDeMorgan.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::ConvertDeMorgan, EE_ACTIONS::convertDeMorgan.MakeEvent() );
Go( &SCH_EDIT_TOOL::ChangeShape, SCH_ACTIONS::toShapeSlash.MakeEvent() );
Go( &SCH_EDIT_TOOL::ChangeShape, SCH_ACTIONS::toShapeBackslash.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::toText.MakeEvent() );
Go( &SCH_EDIT_TOOL::ChangeShape, EE_ACTIONS::toShapeSlash.MakeEvent() );
Go( &SCH_EDIT_TOOL::ChangeShape, EE_ACTIONS::toShapeBackslash.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::toText.MakeEvent() );
Go( &SCH_EDIT_TOOL::BreakWire, SCH_ACTIONS::breakWire.MakeEvent() );
Go( &SCH_EDIT_TOOL::BreakWire, SCH_ACTIONS::breakBus.MakeEvent() );
Go( &SCH_EDIT_TOOL::BreakWire, EE_ACTIONS::breakWire.MakeEvent() );
Go( &SCH_EDIT_TOOL::BreakWire, EE_ACTIONS::breakBus.MakeEvent() );
Go( &SCH_EDIT_TOOL::CleanupSheetPins, SCH_ACTIONS::cleanupSheetPins.MakeEvent() );
Go( &SCH_EDIT_TOOL::CleanupSheetPins, EE_ACTIONS::cleanupSheetPins.MakeEvent() );
}

View File

@ -30,7 +30,7 @@
class SCH_EDIT_FRAME;
class SCH_SELECTION_TOOL;
class EE_SELECTION_TOOL;
class SCH_EDIT_TOOL : public TOOL_INTERACTIVE
@ -88,11 +88,11 @@ private:
void setTransitions() override;
private:
SCH_SELECTION_TOOL* m_selectionTool;
SCH_EDIT_FRAME* m_frame;
EE_SELECTION_TOOL* m_selectionTool;
SCH_EDIT_FRAME* m_frame;
/// Menu model displayed by the tool.
TOOL_MENU m_menu;
TOOL_MENU m_menu;
};
#endif //KICAD_SCH_EDIT_TOOL_H

View File

@ -34,13 +34,13 @@
#include <eeschema_id.h>
#include <netlist_object.h>
#include <tool/tool_manager.h>
#include <tools/sch_actions.h>
#include <tools/picker_tool.h>
#include <tools/ee_actions.h>
#include <tools/ee_picker_tool.h>
#include <tools/sch_editor_control.h>
#include <tools/sch_selection_tool.h>
#include <tools/ee_selection_tool.h>
#include <tools/sch_drawing_tools.h>
#include <project.h>
#include <hotkeys.h>
#include <ee_hotkeys.h>
#include <advanced_config.h>
#include <simulation_cursors.h>
#include <sim/sim_plot_frame.h>
@ -50,58 +50,58 @@
#include <lib_edit_frame.h>
#include "sch_wire_bus_tool.h"
TOOL_ACTION SCH_ACTIONS::refreshPreview( "eeschema.EditorControl.refreshPreview",
TOOL_ACTION EE_ACTIONS::refreshPreview( "eeschema.EditorControl.refreshPreview",
AS_GLOBAL, 0, "", "" );
TOOL_ACTION SCH_ACTIONS::simProbe( "eeschema.Simulation.probe",
TOOL_ACTION EE_ACTIONS::simProbe( "eeschema.Simulation.probe",
AS_GLOBAL, 0,
_( "Add a simulator probe" ), "" );
TOOL_ACTION SCH_ACTIONS::simTune( "eeschema.Simulation.tune",
TOOL_ACTION EE_ACTIONS::simTune( "eeschema.Simulation.tune",
AS_GLOBAL, 0,
_( "Select a value to be tuned" ), "" );
TOOL_ACTION SCH_ACTIONS::highlightNet( "eeschema.EditorControl.highlightNet",
TOOL_ACTION EE_ACTIONS::highlightNet( "eeschema.EditorControl.highlightNet",
AS_GLOBAL, 0, "", "" );
TOOL_ACTION SCH_ACTIONS::clearHighlight( "eeschema.EditorControl.clearHighlight",
TOOL_ACTION EE_ACTIONS::clearHighlight( "eeschema.EditorControl.clearHighlight",
AS_GLOBAL, 0, "", "" );
TOOL_ACTION SCH_ACTIONS::highlightNetSelection( "eeschema.EditorControl.highlightNetSelection",
TOOL_ACTION EE_ACTIONS::highlightNetSelection( "eeschema.EditorControl.highlightNetSelection",
AS_GLOBAL, 0, "", "" );
TOOL_ACTION SCH_ACTIONS::highlightNetCursor( "eeschema.EditorControl.highlightNetCursor",
TOOL_ACTION EE_ACTIONS::highlightNetCursor( "eeschema.EditorControl.highlightNetCursor",
AS_GLOBAL, 0,
_( "Highlight Net" ), _( "Highlight wires and pins of a net" ), NULL, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::cut( "eeschema.EditorControl.cut",
TOOL_ACTION EE_ACTIONS::cut( "eeschema.EditorControl.cut",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_EDIT_CUT ),
_( "Cut" ), _( "Cut selected item(s) to clipboard" ), cut_xpm );
TOOL_ACTION SCH_ACTIONS::copy( "eeschema.EditorControl.copy",
TOOL_ACTION EE_ACTIONS::copy( "eeschema.EditorControl.copy",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_EDIT_COPY ),
_( "Copy" ), _( "Copy selected item(s) to clipboard" ), copy_xpm );
TOOL_ACTION SCH_ACTIONS::paste( "eeschema.EditorControl.paste",
TOOL_ACTION EE_ACTIONS::paste( "eeschema.EditorControl.paste",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_EDIT_PASTE ),
_( "Paste" ), _( "Paste clipboard into schematic" ), paste_xpm );
TOOL_ACTION SCH_ACTIONS::editWithSymbolEditor( "eeschema.EditorControl.editWithSymbolEditor",
TOOL_ACTION EE_ACTIONS::editWithSymbolEditor( "eeschema.EditorControl.editWithSymbolEditor",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_EDIT_COMPONENT_WITH_LIBEDIT ),
_( "Edit with Symbol Editor" ), _( "Open the symbol editor to edit the symbol" ),
libedit_xpm );
TOOL_ACTION SCH_ACTIONS::enterSheet( "eeschema.EditorControl.enterSheet",
TOOL_ACTION EE_ACTIONS::enterSheet( "eeschema.EditorControl.enterSheet",
AS_GLOBAL, 0,
_( "Enter Sheet" ), _( "Display the selected sheet's contents in the Eeschema window" ),
enter_sheet_xpm );
TOOL_ACTION SCH_ACTIONS::leaveSheet( "eeschema.EditorControl.leaveSheet",
TOOL_ACTION EE_ACTIONS::leaveSheet( "eeschema.EditorControl.leaveSheet",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_LEAVE_SHEET ),
_( "Leave Sheet" ), _( "Display the parent sheet in the Eeschema window" ),
leave_sheet_xpm );
TOOL_ACTION SCH_ACTIONS::explicitCrossProbe( "eeschema.EditorControl.explicitCrossProbe",
TOOL_ACTION EE_ACTIONS::explicitCrossProbe( "eeschema.EditorControl.explicitCrossProbe",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SELECT_ITEMS_ON_PCB ),
_( "Highlight on PCB" ), _( "Highlight corresponding items in PCBNew" ),
select_same_sheet_xpm );
@ -169,9 +169,9 @@ void SCH_EDITOR_CONTROL::doCrossProbeSchToPcb( const TOOL_EVENT& aEvent, bool aF
return;
}
SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool<SCH_SELECTION_TOOL>();
SCH_ITEM* item = nullptr;
SCH_COMPONENT* component = nullptr;
EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
SCH_ITEM* item = nullptr;
SCH_COMPONENT* component = nullptr;
if( aForce )
{
@ -230,7 +230,7 @@ void SCH_EDITOR_CONTROL::doCrossProbeSchToPcb( const TOOL_EVENT& aEvent, bool aF
static bool probeSimulation( SCH_EDIT_FRAME* aFrame, const VECTOR2D& aPosition )
{
constexpr KICAD_T wiresAndComponents[] = { SCH_LINE_T, SCH_COMPONENT_T, SCH_SHEET_PIN_T, EOT };
SCH_SELECTION_TOOL* selTool = aFrame->GetToolManager()->GetTool<SCH_SELECTION_TOOL>();
EE_SELECTION_TOOL* selTool = aFrame->GetToolManager()->GetTool<EE_SELECTION_TOOL>();
EDA_ITEM* item = selTool->SelectPoint( aPosition, wiresAndComponents );
@ -260,7 +260,7 @@ int SCH_EDITOR_CONTROL::SimProbe( const TOOL_EVENT& aEvent )
{
Activate();
PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>();
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
assert( picker );
m_frame->SetToolID( ID_SIM_PROBE, wxCURSOR_DEFAULT, _( "Add a simulator probe" ) );
@ -277,8 +277,8 @@ int SCH_EDITOR_CONTROL::SimProbe( const TOOL_EVENT& aEvent )
static bool tuneSimulation( SCH_EDIT_FRAME* aFrame, const VECTOR2D& aPosition )
{
constexpr KICAD_T fieldsAndComponents[] = { SCH_COMPONENT_T, SCH_FIELD_T, EOT };
SCH_SELECTION_TOOL* selTool = aFrame->GetToolManager()->GetTool<SCH_SELECTION_TOOL>();
EDA_ITEM* item = selTool->SelectPoint( aPosition, fieldsAndComponents );
EE_SELECTION_TOOL* selTool = aFrame->GetToolManager()->GetTool<EE_SELECTION_TOOL>();
EDA_ITEM* item = selTool->SelectPoint( aPosition, fieldsAndComponents );
if( !item )
return false;
@ -304,7 +304,7 @@ int SCH_EDITOR_CONTROL::SimTune( const TOOL_EVENT& aEvent )
{
Activate();
PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>();
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
assert( picker );
m_frame->SetToolID( ID_SIM_TUNE, wxCURSOR_DEFAULT, _( "Select a value to be tuned" ) );
@ -326,10 +326,10 @@ static VECTOR2D CLEAR;
// TODO(JE) Probably use netcode rather than connection name here eventually
static bool highlightNet( TOOL_MANAGER* aToolMgr, const VECTOR2D& aPosition )
{
SCH_EDIT_FRAME* editFrame = static_cast<SCH_EDIT_FRAME*>( aToolMgr->GetEditFrame() );
SCH_SELECTION_TOOL* selTool = aToolMgr->GetTool<SCH_SELECTION_TOOL>();
wxString netName;
bool retVal = true;
SCH_EDIT_FRAME* editFrame = static_cast<SCH_EDIT_FRAME*>( aToolMgr->GetEditFrame() );
EE_SELECTION_TOOL* selTool = aToolMgr->GetTool<EE_SELECTION_TOOL>();
wxString netName;
bool retVal = true;
if( aPosition != CLEAR )
{
@ -361,7 +361,7 @@ static bool highlightNet( TOOL_MANAGER* aToolMgr, const VECTOR2D& aPosition )
editFrame->SetSelectedNetName( netName );
aToolMgr->RunAction( SCH_ACTIONS::highlightNetSelection, true );
aToolMgr->RunAction( EE_ACTIONS::highlightNetSelection, true );
return retVal;
}
@ -471,7 +471,7 @@ int SCH_EDITOR_CONTROL::HighlightNetCursor( const TOOL_EVENT& aEvent )
Activate();
PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>();
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
assert( picker );
m_frame->SetToolID( ID_HIGHLIGHT_BUTT, wxCURSOR_HAND, _( "Highlight specific net" ) );
@ -485,8 +485,8 @@ int SCH_EDITOR_CONTROL::HighlightNetCursor( const TOOL_EVENT& aEvent )
bool SCH_EDITOR_CONTROL::doCopy()
{
SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool<SCH_SELECTION_TOOL>();
SELECTION& selection = selTool->GetSelection();
EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
SELECTION& selection = selTool->GetSelection();
if( !selection.GetSize() )
return false;
@ -503,7 +503,7 @@ bool SCH_EDITOR_CONTROL::doCopy()
int SCH_EDITOR_CONTROL::Cut( const TOOL_EVENT& aEvent )
{
if( doCopy() )
m_toolMgr->RunAction( SCH_ACTIONS::doDelete, true );
m_toolMgr->RunAction( EE_ACTIONS::doDelete, true );
return 0;
}
@ -519,14 +519,14 @@ int SCH_EDITOR_CONTROL::Copy( const TOOL_EVENT& aEvent )
int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
{
SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool<SCH_SELECTION_TOOL>();
EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
DLIST<SCH_ITEM>& dlist = m_frame->GetScreen()->GetDrawList();
SCH_ITEM* last = dlist.GetLast();
DLIST<SCH_ITEM>& dlist = m_frame->GetScreen()->GetDrawList();
SCH_ITEM* last = dlist.GetLast();
std::string text = m_toolMgr->GetClipboard();
STRING_LINE_READER reader( text, "Clipboard" );
SCH_LEGACY_PLUGIN plugin;
std::string text = m_toolMgr->GetClipboard();
STRING_LINE_READER reader( text, "Clipboard" );
SCH_LEGACY_PLUGIN plugin;
try
{
@ -645,8 +645,8 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
// Now clear the previous selection, select the pasted items, and fire up the "move"
// tool.
//
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( SCH_ACTIONS::addItemsToSel, true, &loadedItems );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::addItemsToSel, true, &loadedItems );
SELECTION& selection = selTool->GetSelection();
@ -655,7 +655,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
SCH_ITEM* item = (SCH_ITEM*) selection.GetTopLeftItem();
selection.SetReferencePoint( item->GetPosition() );
m_toolMgr->RunAction( SCH_ACTIONS::move, false );
m_toolMgr->RunAction( EE_ACTIONS::move, false );
}
return 0;
@ -664,10 +664,9 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
int SCH_EDITOR_CONTROL::EditWithSymbolEditor( const TOOL_EVENT& aEvent )
{
SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool<SCH_SELECTION_TOOL>();
SELECTION& selection = selTool->RequestSelection( SCH_COLLECTOR::ComponentsOnly );
SCH_COMPONENT* comp = nullptr;
wxString msg;
EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
SELECTION& selection = selTool->RequestSelection( SCH_COLLECTOR::ComponentsOnly );
SCH_COMPONENT* comp = nullptr;
if( selection.GetSize() >= 1 )
comp = (SCH_COMPONENT*) selection.Front();
@ -692,8 +691,8 @@ int SCH_EDITOR_CONTROL::EditWithSymbolEditor( const TOOL_EVENT& aEvent )
int SCH_EDITOR_CONTROL::EnterSheet( const TOOL_EVENT& aEvent )
{
SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool<SCH_SELECTION_TOOL>();
const SELECTION& selection = selTool->RequestSelection( SCH_COLLECTOR::SheetsOnly );
EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
const SELECTION& selection = selTool->RequestSelection( SCH_COLLECTOR::SheetsOnly );
if( selection.GetSize() == 1 )
{
@ -720,32 +719,32 @@ int SCH_EDITOR_CONTROL::LeaveSheet( const TOOL_EVENT& aEvent )
void SCH_EDITOR_CONTROL::setTransitions()
{
/*
Go( &SCH_EDITOR_CONTROL::ToggleLockSelected, SCH_ACTIONS::toggleLock.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::LockSelected, SCH_ACTIONS::lock.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::UnlockSelected, SCH_ACTIONS::unlock.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ToggleLockSelected, EE_ACTIONS::toggleLock.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::LockSelected, EE_ACTIONS::lock.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::UnlockSelected, EE_ACTIONS::unlock.MakeEvent() );
*/
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::explicitCrossProbe.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ExplicitCrossProbeToPcb, EE_ACTIONS::explicitCrossProbe.MakeEvent() );
#ifdef KICAD_SPICE
Go( &SCH_EDITOR_CONTROL::SimProbe, SCH_ACTIONS::simProbe.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::SimTune, SCH_ACTIONS::simTune.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::SimProbe, EE_ACTIONS::simProbe.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::SimTune, EE_ACTIONS::simTune.MakeEvent() );
#endif /* KICAD_SPICE */
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::highlightNetCursor.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::HighlightNetSelection, SCH_ACTIONS::highlightNetSelection.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::highlightNetCursor.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::HighlightNetSelection, EE_ACTIONS::highlightNetSelection.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::Cut, SCH_ACTIONS::cut.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::Copy, SCH_ACTIONS::copy.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::Paste, SCH_ACTIONS::paste.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::Cut, EE_ACTIONS::cut.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::Copy, EE_ACTIONS::copy.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::Paste, EE_ACTIONS::paste.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::EditWithSymbolEditor, SCH_ACTIONS::editWithSymbolEditor.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::EditWithSymbolEditor, EE_ACTIONS::editWithSymbolEditor.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::EnterSheet, SCH_ACTIONS::enterSheet.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::LeaveSheet, SCH_ACTIONS::leaveSheet.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::EnterSheet, EE_ACTIONS::enterSheet.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::LeaveSheet, EE_ACTIONS::leaveSheet.MakeEvent() );
}

View File

@ -22,10 +22,10 @@
*/
#include <tool/tool_manager.h>
#include <tools/sch_selection_tool.h>
#include <tools/ee_selection_tool.h>
#include <tools/sch_wire_bus_tool.h>
#include <sch_actions.h>
#include <hotkeys.h>
#include <ee_actions.h>
#include <ee_hotkeys.h>
#include <bitmaps.h>
#include <base_struct.h>
#include <sch_item_struct.h>
@ -38,11 +38,11 @@
#include "sch_move_tool.h"
TOOL_ACTION SCH_ACTIONS::move( "eeschema.InteractiveEdit.move",
TOOL_ACTION EE_ACTIONS::move( "eeschema.InteractiveEdit.move",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_MOVE ),
_( "Move" ), _( "Moves the selected item(s)" ), move_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::drag( "eeschema.InteractiveEdit.drag",
TOOL_ACTION EE_ACTIONS::drag( "eeschema.InteractiveEdit.drag",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_DRAG ),
_( "Drag" ), _( "Drags the selected item(s)" ), move_xpm, AF_ACTIVATE );
@ -71,7 +71,7 @@ SCH_MOVE_TOOL::~SCH_MOVE_TOOL()
bool SCH_MOVE_TOOL::Init()
{
m_frame = getEditFrame<SCH_EDIT_FRAME>();
m_selectionTool = m_toolMgr->GetTool<SCH_SELECTION_TOOL>();
m_selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
wxASSERT_MSG( m_selectionTool, "eeshema.InteractiveSelection tool is not available" );
@ -90,9 +90,9 @@ bool SCH_MOVE_TOOL::Init()
//
CONDITIONAL_MENU& ctxMenu = m_menu.GetMenu();
ctxMenu.AddItem( ACTIONS::cancelInteractive, SCH_CONDITIONS::ShowAlways, 1 );
ctxMenu.AddItem( ACTIONS::cancelInteractive, EE_CONDITIONS::ShowAlways, 1 );
ctxMenu.AddSeparator( SCH_CONDITIONS::ShowAlways, 1000 );
ctxMenu.AddSeparator( EE_CONDITIONS::ShowAlways, 1000 );
m_menu.AddStandardSubMenus( m_frame );
//
@ -100,8 +100,8 @@ bool SCH_MOVE_TOOL::Init()
//
CONDITIONAL_MENU& selToolMenu = m_selectionTool->GetToolMenu().GetMenu();
selToolMenu.AddItem( SCH_ACTIONS::move, moveCondition, 150 );
selToolMenu.AddItem( SCH_ACTIONS::drag, moveCondition, 150 );
selToolMenu.AddItem( EE_ACTIONS::move, moveCondition, 150 );
selToolMenu.AddItem( EE_ACTIONS::drag, moveCondition, 150 );
return true;
}
@ -157,7 +157,7 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
if( selection.Empty() )
return 0;
if( aEvent.IsAction( &SCH_ACTIONS::move ) )
if( aEvent.IsAction( &EE_ACTIONS::move ) )
m_frame->SetToolID( ID_SCH_MOVE, wxCURSOR_DEFAULT, _( "Move Items" ) );
else
m_frame->SetToolID( ID_SCH_DRAG, wxCURSOR_DEFAULT, _( "Drag Items" ) );
@ -181,7 +181,7 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
m_moveInProgress = false;
// And give it a kick so it doesn't have to wait for the first mouse movement to
// refresh.
m_toolMgr->RunAction( SCH_ACTIONS::refreshPreview );
m_toolMgr->RunAction( EE_ACTIONS::refreshPreview );
return 0;
}
else if( selection.Front()->IsNew() )
@ -195,9 +195,9 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
{
controls->SetSnapping( !evt->Modifier( MD_ALT ) );
if( evt->IsAction( &SCH_ACTIONS::move ) || evt->IsAction( &SCH_ACTIONS::drag )
if( evt->IsAction( &EE_ACTIONS::move ) || evt->IsAction( &EE_ACTIONS::drag )
|| evt->IsMotion() || evt->IsDrag( BUT_LEFT )
|| evt->IsAction( &SCH_ACTIONS::refreshPreview ) )
|| evt->IsAction( &EE_ACTIONS::refreshPreview ) )
{
if( !m_moveInProgress ) // Prepare to start moving/dragging
{
@ -349,7 +349,7 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
//
else if( TOOL_EVT_UTILS::IsCancelInteractive( evt.get() ) )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
if( m_moveInProgress )
restore_state = true;
@ -366,12 +366,12 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
}
else if( evt->Category() == TC_COMMAND )
{
if( evt->IsAction( &SCH_ACTIONS::doDelete ) )
if( evt->IsAction( &EE_ACTIONS::doDelete ) )
{
// Exit on a remove operation; there is no further processing for removed items.
break;
}
else if( evt->IsAction( &SCH_ACTIONS::duplicate ) )
else if( evt->IsAction( &EE_ACTIONS::duplicate ) )
{
if( selection.Front()->IsNew() )
{
@ -397,7 +397,7 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
if( component )
{
m_frame->SelectUnit( component, unit );
m_toolMgr->RunAction( SCH_ACTIONS::refreshPreview );
m_toolMgr->RunAction( EE_ACTIONS::refreshPreview );
}
}
}
@ -436,7 +436,7 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
item->ClearFlags( item->GetEditFlags() );
if( unselect )
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
else
m_selectionTool->RemoveItemsFromSel( &dragAdditions, QUIET_MODE );
@ -692,6 +692,6 @@ void SCH_MOVE_TOOL::saveCopyInUndoList( SCH_ITEM* aItem, UNDO_REDO_T aType, bool
void SCH_MOVE_TOOL::setTransitions()
{
Go( &SCH_MOVE_TOOL::Main, SCH_ACTIONS::move.MakeEvent() );
Go( &SCH_MOVE_TOOL::Main, SCH_ACTIONS::drag.MakeEvent() );
Go( &SCH_MOVE_TOOL::Main, EE_ACTIONS::move.MakeEvent() );
Go( &SCH_MOVE_TOOL::Main, EE_ACTIONS::drag.MakeEvent() );
}

View File

@ -30,7 +30,7 @@
class SCH_EDIT_FRAME;
class SCH_SELECTION_TOOL;
class EE_SELECTION_TOOL;
class SCH_MOVE_TOOL : public TOOL_INTERACTIVE
@ -82,7 +82,7 @@ private:
void setTransitions() override;
private:
SCH_SELECTION_TOOL* m_selectionTool;
EE_SELECTION_TOOL* m_selectionTool;
KIGFX::VIEW_CONTROLS* m_controls;
SCH_EDIT_FRAME* m_frame;

View File

@ -23,8 +23,8 @@
#include <connection_graph.h>
#include <sch_wire_bus_tool.h>
#include <sch_selection_tool.h>
#include <sch_actions.h>
#include <ee_selection_tool.h>
#include <ee_actions.h>
#include <sch_edit_frame.h>
#include <sch_view.h>
#include <class_draw_panel_gal.h>
@ -35,7 +35,7 @@
#include <view/view_controls.h>
#include <view/view.h>
#include <tool/tool_manager.h>
#include <hotkeys.h>
#include <ee_hotkeys.h>
#include <sch_junction.h>
#include <sch_line.h>
#include <sch_bus_entry.h>
@ -43,54 +43,54 @@
#include <sch_sheet.h>
#include <advanced_config.h>
TOOL_ACTION SCH_ACTIONS::startWire( "eeschema.WireBusDrawing.startWire",
TOOL_ACTION EE_ACTIONS::startWire( "eeschema.WireBusDrawing.startWire",
AS_GLOBAL, 0,
_( "Start Wire" ), _( "Start drawing a wire" ),
add_line_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::drawWire( "eeschema.WireBusDrawing.drawWires",
TOOL_ACTION EE_ACTIONS::drawWire( "eeschema.WireBusDrawing.drawWires",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_BEGIN_WIRE ),
_( "Add Wire" ), _( "Add a wire" ),
add_line_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::startBus( "eeschema.WireBusDrawing.startBus",
TOOL_ACTION EE_ACTIONS::startBus( "eeschema.WireBusDrawing.startBus",
AS_GLOBAL, 0,
_( "Start Bus" ), _( "Start drawing a bus" ),
add_bus_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::drawBus( "eeschema.WireBusDrawing.drawBusses",
TOOL_ACTION EE_ACTIONS::drawBus( "eeschema.WireBusDrawing.drawBusses",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_BEGIN_BUS ),
_( "Add Bus" ), _( "Add a bus" ),
add_bus_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::unfoldBus( "eeschema.WireBusDrawing.unfoldBus",
TOOL_ACTION EE_ACTIONS::unfoldBus( "eeschema.WireBusDrawing.unfoldBus",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_UNFOLD_BUS ),
_( "Unfold from Bus" ), _( "Break a wire out of a bus" ),
nullptr, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::startLines( "eeschema.WireBusDrawing.startLines",
TOOL_ACTION EE_ACTIONS::startLines( "eeschema.WireBusDrawing.startLines",
AS_GLOBAL, 0, _( "Begin Lines" ), _( "Start drawing connected graphic lines" ),
add_line_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::drawLines( "eeschema.WireBusDrawing.drawLines",
TOOL_ACTION EE_ACTIONS::drawLines( "eeschema.WireBusDrawing.drawLines",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ADD_GRAPHIC_POLYLINE ),
_( "Add Lines" ), _( "Add connected graphic lines" ),
add_graphical_segments_xpm, AF_ACTIVATE );
TOOL_ACTION SCH_ACTIONS::finishLineWireOrBus( "eeschema.WireBusDrawing.finishLineWireOrBus",
TOOL_ACTION EE_ACTIONS::finishLineWireOrBus( "eeschema.WireBusDrawing.finishLineWireOrBus",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_END_CURR_LINEWIREBUS ),
_( "Finish Wire or Bus" ), _( "Complete drawing at current segment" ),
checked_ok_xpm, AF_NONE );
TOOL_ACTION SCH_ACTIONS::finishWire( "eeschema.WireBusDrawing.finishWire",
TOOL_ACTION EE_ACTIONS::finishWire( "eeschema.WireBusDrawing.finishWire",
AS_GLOBAL, 0, _( "Finish Wire" ), _( "Complete wire with current segment" ),
checked_ok_xpm, AF_NONE );
TOOL_ACTION SCH_ACTIONS::finishBus( "eeschema.WireBusDrawing.finishBus",
TOOL_ACTION EE_ACTIONS::finishBus( "eeschema.WireBusDrawing.finishBus",
AS_GLOBAL, 0, _( "Finish Bus" ), _( "Complete bus with current segment" ),
checked_ok_xpm, AF_NONE );
TOOL_ACTION SCH_ACTIONS::finishLine( "eeschema.WireBusDrawing.finishLine",
TOOL_ACTION EE_ACTIONS::finishLine( "eeschema.WireBusDrawing.finishLine",
AS_GLOBAL, 0, _( "Finish Lines" ), _( "Complete connected lines with current segment" ),
checked_ok_xpm, AF_NONE );
@ -120,11 +120,11 @@ protected:
private:
void update() override
{
SCH_EDIT_FRAME* frame = (SCH_EDIT_FRAME*) getToolManager()->GetEditFrame();
SCH_SELECTION_TOOL* selTool = getToolManager()->GetTool<SCH_SELECTION_TOOL>();
KICAD_T busType[] = { SCH_LINE_LOCATE_BUS_T, EOT };
SELECTION& selection = selTool->RequestSelection( busType );
SCH_LINE* bus = (SCH_LINE*) selection.Front();
SCH_EDIT_FRAME* frame = (SCH_EDIT_FRAME*) getToolManager()->GetEditFrame();
EE_SELECTION_TOOL* selTool = getToolManager()->GetTool<EE_SELECTION_TOOL>();
KICAD_T busType[] = { SCH_LINE_LOCATE_BUS_T, EOT };
SELECTION& selection = selTool->RequestSelection( busType );
SCH_LINE* bus = (SCH_LINE*) selection.Front();
// TODO(JE) remove once real-time is enabled
if( !ADVANCED_CFG::GetCfg().m_realTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime )
@ -206,7 +206,7 @@ SCH_WIRE_BUS_TOOL::~SCH_WIRE_BUS_TOOL()
bool SCH_WIRE_BUS_TOOL::Init()
{
m_frame = getEditFrame<SCH_EDIT_FRAME>();
m_selectionTool = m_toolMgr->GetTool<SCH_SELECTION_TOOL>();
m_selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
auto activeTool = [ this ] ( const SELECTION& aSel ) {
return ( m_frame->GetToolId() != ID_NO_TOOL_SELECTED );
@ -224,41 +224,41 @@ bool SCH_WIRE_BUS_TOOL::Init()
return g_CurrentSheet->Last() != g_RootSheet;
};
auto busSelection = SCH_CONDITIONS::MoreThan( 0 )
&& SCH_CONDITIONS::OnlyType( SCH_LINE_LOCATE_BUS_T );
auto busSelection = EE_CONDITIONS::MoreThan( 0 )
&& EE_CONDITIONS::OnlyType( SCH_LINE_LOCATE_BUS_T );
auto& ctxMenu = m_menu.GetMenu();
//
// Build the tool menu
//
ctxMenu.AddItem( ACTIONS::cancelInteractive, SCH_CONDITIONS::ShowAlways, 1 );
ctxMenu.AddItem( SCH_ACTIONS::leaveSheet, belowRootSheetCondition, 2 );
ctxMenu.AddItem( ACTIONS::cancelInteractive, EE_CONDITIONS::ShowAlways, 1 );
ctxMenu.AddItem( EE_ACTIONS::leaveSheet, belowRootSheetCondition, 2 );
ctxMenu.AddSeparator( SCH_CONDITIONS::ShowAlways, 10 );
ctxMenu.AddItem( SCH_ACTIONS::startWire, wireOrBusTool && SCH_CONDITIONS::Idle, 10 );
ctxMenu.AddItem( SCH_ACTIONS::startBus, wireOrBusTool && SCH_CONDITIONS::Idle, 10 );
ctxMenu.AddItem( SCH_ACTIONS::startLines, lineTool && SCH_CONDITIONS::Idle, 10 );
ctxMenu.AddItem( SCH_ACTIONS::finishWire, IsDrawingWire, 10 );
ctxMenu.AddItem( SCH_ACTIONS::finishBus, IsDrawingBus, 10 );
ctxMenu.AddItem( SCH_ACTIONS::finishLine, IsDrawingLine, 10 );
ctxMenu.AddSeparator( EE_CONDITIONS::ShowAlways, 10 );
ctxMenu.AddItem( EE_ACTIONS::startWire, wireOrBusTool && EE_CONDITIONS::Idle, 10 );
ctxMenu.AddItem( EE_ACTIONS::startBus, wireOrBusTool && EE_CONDITIONS::Idle, 10 );
ctxMenu.AddItem( EE_ACTIONS::startLines, lineTool && EE_CONDITIONS::Idle, 10 );
ctxMenu.AddItem( EE_ACTIONS::finishWire, IsDrawingWire, 10 );
ctxMenu.AddItem( EE_ACTIONS::finishBus, IsDrawingBus, 10 );
ctxMenu.AddItem( EE_ACTIONS::finishLine, IsDrawingLine, 10 );
std::shared_ptr<BUS_UNFOLD_MENU> busUnfoldMenu = std::make_shared<BUS_UNFOLD_MENU>();
busUnfoldMenu->SetTool( this );
m_menu.AddSubMenu( busUnfoldMenu );
ctxMenu.AddMenu( busUnfoldMenu.get(), false, SCH_CONDITIONS::Idle, 10 );
ctxMenu.AddMenu( busUnfoldMenu.get(), false, EE_CONDITIONS::Idle, 10 );
ctxMenu.AddSeparator( wireOrBusTool && SCH_CONDITIONS::Idle, 100 );
ctxMenu.AddItem( SCH_ACTIONS::addJunction, wireOrBusTool && SCH_CONDITIONS::Idle, 100 );
ctxMenu.AddItem( SCH_ACTIONS::addLabel, wireOrBusTool && SCH_CONDITIONS::Idle, 100 );
ctxMenu.AddItem( SCH_ACTIONS::addGlobalLabel, wireOrBusTool && SCH_CONDITIONS::Idle, 100 );
ctxMenu.AddItem( SCH_ACTIONS::addHierLabel, wireOrBusTool && SCH_CONDITIONS::Idle, 100 );
ctxMenu.AddItem( SCH_ACTIONS::breakWire, wireOrBusTool && SCH_CONDITIONS::Idle, 100 );
ctxMenu.AddItem( SCH_ACTIONS::breakBus, wireOrBusTool && SCH_CONDITIONS::Idle, 100 );
ctxMenu.AddSeparator( wireOrBusTool && EE_CONDITIONS::Idle, 100 );
ctxMenu.AddItem( EE_ACTIONS::addJunction, wireOrBusTool && EE_CONDITIONS::Idle, 100 );
ctxMenu.AddItem( EE_ACTIONS::addLabel, wireOrBusTool && EE_CONDITIONS::Idle, 100 );
ctxMenu.AddItem( EE_ACTIONS::addGlobalLabel, wireOrBusTool && EE_CONDITIONS::Idle, 100 );
ctxMenu.AddItem( EE_ACTIONS::addHierLabel, wireOrBusTool && EE_CONDITIONS::Idle, 100 );
ctxMenu.AddItem( EE_ACTIONS::breakWire, wireOrBusTool && EE_CONDITIONS::Idle, 100 );
ctxMenu.AddItem( EE_ACTIONS::breakBus, wireOrBusTool && EE_CONDITIONS::Idle, 100 );
ctxMenu.AddSeparator( wireOrBusTool && SCH_CONDITIONS::Idle, 200 );
ctxMenu.AddItem( SCH_ACTIONS::selectNode, wireOrBusTool && SCH_CONDITIONS::Idle, 200 );
ctxMenu.AddItem( SCH_ACTIONS::selectConnection, wireOrBusTool && SCH_CONDITIONS::Idle, 200 );
ctxMenu.AddSeparator( wireOrBusTool && EE_CONDITIONS::Idle, 200 );
ctxMenu.AddItem( EE_ACTIONS::selectNode, wireOrBusTool && EE_CONDITIONS::Idle, 200 );
ctxMenu.AddItem( EE_ACTIONS::selectConnection, wireOrBusTool && EE_CONDITIONS::Idle, 200 );
ctxMenu.AddSeparator( activeTool, 1000 );
m_menu.AddStandardSubMenus( m_frame );
@ -271,7 +271,7 @@ bool SCH_WIRE_BUS_TOOL::Init()
std::shared_ptr<BUS_UNFOLD_MENU> selBusUnfoldMenu = std::make_shared<BUS_UNFOLD_MENU>();
selBusUnfoldMenu->SetTool( m_selectionTool );
m_selectionTool->GetToolMenu().AddSubMenu( selBusUnfoldMenu );
selToolMenu.AddMenu( selBusUnfoldMenu.get(), false, busSelection && SCH_CONDITIONS::Idle, 100 );
selToolMenu.AddMenu( selBusUnfoldMenu.get(), false, busSelection && EE_CONDITIONS::Idle, 100 );
return true;
}
@ -327,7 +327,7 @@ bool SCH_WIRE_BUS_TOOL::IsDrawingLineWireOrBus( const SELECTION& aSelection )
*/
int SCH_WIRE_BUS_TOOL::StartWire( const TOOL_EVENT& aEvent )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
Activate();
@ -347,7 +347,7 @@ int SCH_WIRE_BUS_TOOL::DrawWires( const TOOL_EVENT& aEvent )
else
{
m_frame->SetToolID( ID_WIRE_BUTT, wxCURSOR_PENCIL, _( "Add wire" ) );
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
return doDrawSegments( LAYER_WIRE, nullptr );
}
@ -359,7 +359,7 @@ int SCH_WIRE_BUS_TOOL::DrawWires( const TOOL_EVENT& aEvent )
*/
int SCH_WIRE_BUS_TOOL::StartBus( const TOOL_EVENT& aEvent )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
Activate();
@ -379,7 +379,7 @@ int SCH_WIRE_BUS_TOOL::DrawBusses( const TOOL_EVENT& aEvent )
else
{
m_frame->SetToolID( ID_BUS_BUTT, wxCURSOR_PENCIL, _( "Add bus" ) );
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
return doDrawSegments( LAYER_BUS, nullptr );
}
@ -392,7 +392,7 @@ int SCH_WIRE_BUS_TOOL::UnfoldBus( const TOOL_EVENT& aEvent )
wxString net;
SCH_LINE* segment = nullptr;
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
Activate();
@ -472,7 +472,7 @@ SCH_LINE* SCH_WIRE_BUS_TOOL::doUnfoldBus( const wxString& aNet )
*/
int SCH_WIRE_BUS_TOOL::StartLine( const TOOL_EVENT& aEvent)
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
m_frame->GetCanvas()->MoveCursorToCrossHair();
SCH_LINE* segment = startSegments( LAYER_NOTES, m_frame->GetCrossHairPosition() );
@ -490,7 +490,7 @@ int SCH_WIRE_BUS_TOOL::DrawLines( const TOOL_EVENT& aEvent)
else
{
m_frame->SetToolID( ID_LINE_COMMENT_BUTT, wxCURSOR_PENCIL, _( "Add lines" ) );
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
return doDrawSegments( LAYER_NOTES, nullptr );
}
@ -611,7 +611,7 @@ int SCH_WIRE_BUS_TOOL::doDrawSegments( int aType, SCH_LINE* aSegment )
{
if( aSegment || m_busUnfold.in_progress )
{
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
aSegment = nullptr;
s_wires.DeleteAll();
@ -633,9 +633,9 @@ int SCH_WIRE_BUS_TOOL::doDrawSegments( int aType, SCH_LINE* aSegment )
continue;
}
if( ( evt->IsAction( &SCH_ACTIONS::drawWire ) && aType == LAYER_WIRE )
|| ( evt->IsAction( &SCH_ACTIONS::drawBus ) && aType == LAYER_BUS )
|| ( evt->IsAction( &SCH_ACTIONS::unfoldBus ) && aType == LAYER_WIRE ) )
if( ( evt->IsAction( &EE_ACTIONS::drawWire ) && aType == LAYER_WIRE )
|| ( evt->IsAction( &EE_ACTIONS::drawBus ) && aType == LAYER_BUS )
|| ( evt->IsAction( &EE_ACTIONS::unfoldBus ) && aType == LAYER_WIRE ) )
{
// Don't reset tool. If we do the next command will think it needs to
// re-select the tool rather than start a wire or bus.
@ -650,10 +650,10 @@ int SCH_WIRE_BUS_TOOL::doDrawSegments( int aType, SCH_LINE* aSegment )
//------------------------------------------------------------------------
// Handle finish:
//
else if( evt->IsAction( &SCH_ACTIONS::finishLineWireOrBus )
|| evt->IsAction( &SCH_ACTIONS::finishWire )
|| evt->IsAction( &SCH_ACTIONS::finishBus )
|| evt->IsAction( &SCH_ACTIONS::finishLine ) )
else if( evt->IsAction( &EE_ACTIONS::finishLineWireOrBus )
|| evt->IsAction( &EE_ACTIONS::finishWire )
|| evt->IsAction( &EE_ACTIONS::finishBus )
|| evt->IsAction( &EE_ACTIONS::finishLine ) )
{
if( aSegment || m_busUnfold.in_progress )
{
@ -910,7 +910,7 @@ void SCH_WIRE_BUS_TOOL::finishSegments()
// Clear selection when done so that a new wire can be started.
// NOTE: this must be done before RemoveBacktracks is called or we might end up with
// freed selected items.
m_toolMgr->RunAction( SCH_ACTIONS::clearSelection, true );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
PICKED_ITEMS_LIST itemList;
@ -1002,13 +1002,13 @@ void SCH_WIRE_BUS_TOOL::finishSegments()
void SCH_WIRE_BUS_TOOL::setTransitions()
{
Go( &SCH_WIRE_BUS_TOOL::DrawWires, SCH_ACTIONS::drawWire.MakeEvent() );
Go( &SCH_WIRE_BUS_TOOL::DrawBusses, SCH_ACTIONS::drawBus.MakeEvent() );
Go( &SCH_WIRE_BUS_TOOL::DrawLines, SCH_ACTIONS::drawLines.MakeEvent() );
Go( &SCH_WIRE_BUS_TOOL::DrawWires, EE_ACTIONS::drawWire.MakeEvent() );
Go( &SCH_WIRE_BUS_TOOL::DrawBusses, EE_ACTIONS::drawBus.MakeEvent() );
Go( &SCH_WIRE_BUS_TOOL::DrawLines, EE_ACTIONS::drawLines.MakeEvent() );
Go( &SCH_WIRE_BUS_TOOL::StartWire, SCH_ACTIONS::startWire.MakeEvent() );
Go( &SCH_WIRE_BUS_TOOL::StartBus, SCH_ACTIONS::startBus.MakeEvent() );
Go( &SCH_WIRE_BUS_TOOL::StartLine, SCH_ACTIONS::startLines.MakeEvent() );
Go( &SCH_WIRE_BUS_TOOL::StartWire, EE_ACTIONS::startWire.MakeEvent() );
Go( &SCH_WIRE_BUS_TOOL::StartBus, EE_ACTIONS::startBus.MakeEvent() );
Go( &SCH_WIRE_BUS_TOOL::StartLine, EE_ACTIONS::startLines.MakeEvent() );
Go( &SCH_WIRE_BUS_TOOL::UnfoldBus, SCH_ACTIONS::unfoldBus.MakeEvent() );
Go( &SCH_WIRE_BUS_TOOL::UnfoldBus, EE_ACTIONS::unfoldBus.MakeEvent() );
}

View File

@ -33,7 +33,7 @@
class SCH_BUS_WIRE_ENTRY;
class SCH_LABEL;
class SCH_EDIT_FRAME;
class SCH_SELECTION_TOOL;
class EE_SELECTION_TOOL;
/// Collection of data related to the bus unfolding tool
@ -107,7 +107,7 @@ private:
void setTransitions() override;
private:
SCH_SELECTION_TOOL* m_selectionTool;
EE_SELECTION_TOOL* m_selectionTool;
KIGFX::SCH_VIEW* m_view;
KIGFX::VIEW_CONTROLS* m_controls;
SCH_EDIT_FRAME* m_frame;

View File

@ -37,7 +37,7 @@
#include <viewlib_frame.h>
#include <symbol_lib_table.h>
#include <sch_legacy_plugin.h>
#include <hotkeys.h>
#include <ee_hotkeys.h>
#include <dialog_helpers.h>
#include <class_libentry.h>
#include <class_library.h>
@ -46,7 +46,7 @@
#include <confirm.h>
#include <tool/tool_manager.h>
#include <tool/tool_dispatcher.h>
#include <tools/sch_actions.h>
#include <tools/ee_actions.h>
#include <tool/common_tools.h>
#include <tool/zoom_tool.h>
@ -227,7 +227,7 @@ void LIB_VIEW_FRAME::setupTools()
m_toolManager = new TOOL_MANAGER;
m_toolManager->SetEnvironment( GetScreen(), GetCanvas()->GetView(),
GetCanvas()->GetViewControls(), this );
m_actions = new SCH_ACTIONS();
m_actions = new EE_ACTIONS();
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions );
// Register tools
@ -822,7 +822,7 @@ void LIB_VIEW_FRAME::OnAddPartToSchematic( wxCommandEvent& aEvent )
if( IsModal() )
{
// if we're modal then we just need to return the symbol selection; the caller is
// already in a SCH_ACTIONS::placeSymbol coroutine.
// already in a EE_ACTIONS::placeSymbol coroutine.
if( m_cmpList->GetSelection() >= 0 )
DismissModal( true, m_libraryName + ':' + m_cmpList->GetStringSelection() );
else
@ -853,6 +853,6 @@ void LIB_VIEW_FRAME::OnAddPartToSchematic( wxCommandEvent& aEvent )
component->AutoplaceFields( /* aScreen */ NULL, /* aManual */ false );
schframe->Raise();
schframe->GetToolManager()->RunAction( SCH_ACTIONS::placeSymbol, true, component );
schframe->GetToolManager()->RunAction( EE_ACTIONS::placeSymbol, true, component );
}
}

View File

@ -1022,11 +1022,11 @@ void FOOTPRINT_EDIT_FRAME::setupTools()
m_toolManager->RegisterTool( new EDIT_TOOL );
m_toolManager->RegisterTool( new PAD_TOOL );
m_toolManager->RegisterTool( new DRAWING_TOOL );
m_toolManager->RegisterTool( new POINT_EDITOR );
m_toolManager->RegisterTool( new EE_POINT_EDITOR );
m_toolManager->RegisterTool( new PCBNEW_CONTROL );
m_toolManager->RegisterTool( new MODULE_EDITOR_TOOLS );
m_toolManager->RegisterTool( new ALIGN_DISTRIBUTE_TOOL );
m_toolManager->RegisterTool( new PICKER_TOOL );
m_toolManager->RegisterTool( new EE_PICKER_TOOL );
m_toolManager->RegisterTool( new POSITION_RELATIVE_TOOL );
m_toolManager->GetTool<PAD_TOOL>()->SetEditModules( true );

View File

@ -572,13 +572,13 @@ void PCB_EDIT_FRAME::setupTools()
m_toolManager->RegisterTool( new COMMON_TOOLS );
m_toolManager->RegisterTool( new SELECTION_TOOL );
m_toolManager->RegisterTool( new ZOOM_TOOL );
m_toolManager->RegisterTool( new PICKER_TOOL );
m_toolManager->RegisterTool( new EE_PICKER_TOOL );
m_toolManager->RegisterTool( new ROUTER_TOOL );
m_toolManager->RegisterTool( new LENGTH_TUNER_TOOL );
m_toolManager->RegisterTool( new EDIT_TOOL );
m_toolManager->RegisterTool( new PAD_TOOL );
m_toolManager->RegisterTool( new DRAWING_TOOL );
m_toolManager->RegisterTool( new POINT_EDITOR );
m_toolManager->RegisterTool( new EE_POINT_EDITOR );
m_toolManager->RegisterTool( new PCBNEW_CONTROL );
m_toolManager->RegisterTool( new PCB_EDITOR_CONTROL );
m_toolManager->RegisterTool( new ALIGN_DISTRIBUTE_TOOL );

View File

@ -1462,7 +1462,7 @@ int EDIT_TOOL::editFootprintInFpEditor( const TOOL_EVENT& aEvent )
bool EDIT_TOOL::pickCopyReferencePoint( VECTOR2I& aP )
{
STATUS_TEXT_POPUP statusPopup( frame() );
PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>();
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
bool picking = true;
bool retVal = true;

View File

@ -906,7 +906,7 @@ int PCB_EDITOR_CONTROL::DrillOrigin( const TOOL_EVENT& aEvent )
{
Activate();
PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>();
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
assert( picker );
m_frame->SetToolID( ID_PCB_PLACE_OFFSET_COORD_BUTT, wxCURSOR_HAND, _( "Adjust zero" ) );
@ -1087,7 +1087,7 @@ int PCB_EDITOR_CONTROL::HighlightNetCursor( const TOOL_EVENT& aEvent )
Activate();
PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>();
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
assert( picker );
m_frame->SetToolID( ID_PCB_HIGHLIGHT_BUTT, wxCURSOR_HAND, _( "Highlight net" ) );
@ -1153,7 +1153,7 @@ int PCB_EDITOR_CONTROL::ShowLocalRatsnest( const TOOL_EVENT& aEvent )
{
Activate();
auto picker = m_toolMgr->GetTool<PICKER_TOOL>();
auto picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
auto board = getModel<BOARD>();
wxASSERT( picker );
wxASSERT( board );
@ -1164,7 +1164,7 @@ int PCB_EDITOR_CONTROL::ShowLocalRatsnest( const TOOL_EVENT& aEvent )
picker->SetFinalizeHandler( [ board ]( int aCondition ){
auto vis = board->IsElementVisible( LAYER_RATSNEST );
if( aCondition != PICKER_TOOL::END_ACTIVATE )
if( aCondition != EE_PICKER_TOOL::END_ACTIVATE )
{
for( auto mod : board->Modules() )
for( auto pad : mod->Pads() )

View File

@ -604,7 +604,7 @@ int PCBNEW_CONTROL::GridSetOrigin( const TOOL_EVENT& aEvent )
{
Activate();
PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>();
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
wxCHECK( picker, 0 );
// TODO it will not check the toolbar button in module editor, as it uses a different ID..
@ -693,7 +693,7 @@ int PCBNEW_CONTROL::DeleteItemCursor( const TOOL_EVENT& aEvent )
{
Activate();
PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>();
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
wxCHECK( picker, 0 );
m_frame->SetToolID( m_editModules ? ID_MODEDIT_DELETE_TOOL : ID_PCB_DELETE_ITEM_BUTT,

View File

@ -33,14 +33,14 @@
TOOL_ACTION PCB_ACTIONS::pickerTool( "pcbnew.Picker", AS_GLOBAL, 0, "", "", NULL, AF_ACTIVATE );
PICKER_TOOL::PICKER_TOOL()
EE_PICKER_TOOL::EE_PICKER_TOOL()
: PCB_TOOL( "pcbnew.Picker" )
{
reset();
}
int PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
int EE_PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
{
KIGFX::VIEW_CONTROLS* controls = getViewControls();
GRID_HELPER grid( frame() );
@ -70,7 +70,7 @@ int PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
}
catch( std::exception& e )
{
std::cerr << "PICKER_TOOL click handler error: " << e.what() << std::endl;
std::cerr << "EE_PICKER_TOOL click handler error: " << e.what() << std::endl;
finalize_state = EXCEPTION_CANCEL;
break;
}
@ -95,7 +95,7 @@ int PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
}
catch( std::exception& e )
{
std::cerr << "PICKER_TOOL cancel handler error: " << e.what() << std::endl;
std::cerr << "EE_PICKER_TOOL cancel handler error: " << e.what() << std::endl;
}
}
@ -123,7 +123,7 @@ int PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
}
catch( std::exception& e )
{
std::cerr << "PICKER_TOOL finalize handler error: " << e.what() << std::endl;
std::cerr << "EE_PICKER_TOOL finalize handler error: " << e.what() << std::endl;
}
}
@ -135,13 +135,13 @@ int PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
}
void PICKER_TOOL::setTransitions()
void EE_PICKER_TOOL::setTransitions()
{
Go( &PICKER_TOOL::Main, PCB_ACTIONS::pickerTool.MakeEvent() );
Go( &EE_PICKER_TOOL::Main, PCB_ACTIONS::pickerTool.MakeEvent() );
}
void PICKER_TOOL::reset()
void EE_PICKER_TOOL::reset()
{
m_cursorCapture = false;
m_autoPanning = false;
@ -154,7 +154,7 @@ void PICKER_TOOL::reset()
}
void PICKER_TOOL::setControls()
void EE_PICKER_TOOL::setControls()
{
KIGFX::VIEW_CONTROLS* controls = getViewControls();

View File

@ -31,11 +31,11 @@
/**
* @brief Generic tool for picking a point.
*/
class PICKER_TOOL : public PCB_TOOL
class EE_PICKER_TOOL : public PCB_TOOL
{
public:
PICKER_TOOL();
~PICKER_TOOL() {}
EE_PICKER_TOOL();
~EE_PICKER_TOOL() {}
///> Event handler types.
typedef std::function<bool(const VECTOR2D&)> CLICK_HANDLER;

View File

@ -238,7 +238,7 @@ private:
};
POINT_EDITOR::POINT_EDITOR() :
EE_POINT_EDITOR::EE_POINT_EDITOR() :
PCB_TOOL( "pcbnew.PointEditor" ),
m_selectionTool( NULL ),
m_editedPoint( NULL ),
@ -249,7 +249,7 @@ POINT_EDITOR::POINT_EDITOR() :
}
void POINT_EDITOR::Reset( RESET_REASON aReason )
void EE_POINT_EDITOR::Reset( RESET_REASON aReason )
{
m_refill = false;
m_editPoints.reset();
@ -262,7 +262,7 @@ void POINT_EDITOR::Reset( RESET_REASON aReason )
}
bool POINT_EDITOR::Init()
bool EE_POINT_EDITOR::Init()
{
// Find the selection tool, so they can cooperate
m_selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>();
@ -270,15 +270,15 @@ bool POINT_EDITOR::Init()
wxASSERT_MSG( m_selectionTool, _( "pcbnew.InteractiveSelection tool is not available" ) );
auto& menu = m_selectionTool->GetToolMenu().GetMenu();
menu.AddItem( PCB_ACTIONS::pointEditorAddCorner, POINT_EDITOR::addCornerCondition );
menu.AddItem( PCB_ACTIONS::pointEditorAddCorner, EE_POINT_EDITOR::addCornerCondition );
menu.AddItem( PCB_ACTIONS::pointEditorRemoveCorner,
std::bind( &POINT_EDITOR::removeCornerCondition, this, _1 ) );
std::bind( &EE_POINT_EDITOR::removeCornerCondition, this, _1 ) );
return true;
}
void POINT_EDITOR::updateEditedPoint( const TOOL_EVENT& aEvent )
void EE_POINT_EDITOR::updateEditedPoint( const TOOL_EVENT& aEvent )
{
EDIT_POINT* point = m_editedPoint;
@ -296,7 +296,7 @@ void POINT_EDITOR::updateEditedPoint( const TOOL_EVENT& aEvent )
}
int POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent )
int EE_POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent )
{
if( !m_selectionTool )
return 0;
@ -438,7 +438,7 @@ int POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent )
}
void POINT_EDITOR::updateItem() const
void EE_POINT_EDITOR::updateItem() const
{
EDA_ITEM* item = m_editPoints->GetParent();
@ -642,7 +642,7 @@ void POINT_EDITOR::updateItem() const
}
void POINT_EDITOR::finishItem()
void EE_POINT_EDITOR::finishItem()
{
auto item = m_editPoints->GetParent();
@ -673,7 +673,7 @@ void POINT_EDITOR::finishItem()
}
bool POINT_EDITOR::validatePolygon( SHAPE_POLY_SET& aModified, const SHAPE_POLY_SET* aOriginal ) const
bool EE_POINT_EDITOR::validatePolygon( SHAPE_POLY_SET& aModified, const SHAPE_POLY_SET* aOriginal ) const
{
if( !aModified.IsSelfIntersecting() )
{
@ -696,7 +696,7 @@ bool POINT_EDITOR::validatePolygon( SHAPE_POLY_SET& aModified, const SHAPE_POLY_
}
void POINT_EDITOR::updatePoints()
void EE_POINT_EDITOR::updatePoints()
{
if( !m_editPoints )
return;
@ -805,7 +805,7 @@ void POINT_EDITOR::updatePoints()
}
void POINT_EDITOR::setEditedPoint( EDIT_POINT* aPoint )
void EE_POINT_EDITOR::setEditedPoint( EDIT_POINT* aPoint )
{
KIGFX::VIEW_CONTROLS* controls = getViewControls();
@ -824,7 +824,7 @@ void POINT_EDITOR::setEditedPoint( EDIT_POINT* aPoint )
}
void POINT_EDITOR::setAltConstraint( bool aEnabled )
void EE_POINT_EDITOR::setAltConstraint( bool aEnabled )
{
if( aEnabled )
{
@ -848,7 +848,7 @@ void POINT_EDITOR::setAltConstraint( bool aEnabled )
}
EDIT_POINT POINT_EDITOR::get45DegConstrainer() const
EDIT_POINT EE_POINT_EDITOR::get45DegConstrainer() const
{
EDA_ITEM* item = m_editPoints->GetParent();
@ -900,17 +900,17 @@ EDIT_POINT POINT_EDITOR::get45DegConstrainer() const
}
void POINT_EDITOR::setTransitions()
void EE_POINT_EDITOR::setTransitions()
{
Go( &POINT_EDITOR::addCorner, PCB_ACTIONS::pointEditorAddCorner.MakeEvent() );
Go( &POINT_EDITOR::removeCorner, PCB_ACTIONS::pointEditorRemoveCorner.MakeEvent() );
Go( &POINT_EDITOR::modifiedSelection, EVENTS::SelectedItemsModified );
Go( &POINT_EDITOR::OnSelectionChange, EVENTS::SelectedEvent );
Go( &POINT_EDITOR::OnSelectionChange, EVENTS::UnselectedEvent );
Go( &EE_POINT_EDITOR::addCorner, PCB_ACTIONS::pointEditorAddCorner.MakeEvent() );
Go( &EE_POINT_EDITOR::removeCorner, PCB_ACTIONS::pointEditorRemoveCorner.MakeEvent() );
Go( &EE_POINT_EDITOR::modifiedSelection, EVENTS::SelectedItemsModified );
Go( &EE_POINT_EDITOR::OnSelectionChange, EVENTS::SelectedEvent );
Go( &EE_POINT_EDITOR::OnSelectionChange, EVENTS::UnselectedEvent );
}
bool POINT_EDITOR::canAddCorner( const EDA_ITEM& aItem )
bool EE_POINT_EDITOR::canAddCorner( const EDA_ITEM& aItem )
{
const auto type = aItem.Type();
@ -922,7 +922,7 @@ bool POINT_EDITOR::canAddCorner( const EDA_ITEM& aItem )
}
bool POINT_EDITOR::addCornerCondition( const SELECTION& aSelection )
bool EE_POINT_EDITOR::addCornerCondition( const SELECTION& aSelection )
{
if( aSelection.Size() != 1 )
return false;
@ -949,7 +949,7 @@ findVertex( SHAPE_POLY_SET& aPolySet, const EDIT_POINT& aPoint )
}
bool POINT_EDITOR::removeCornerCondition( const SELECTION& )
bool EE_POINT_EDITOR::removeCornerCondition( const SELECTION& )
{
if( !m_editPoints || !m_editedPoint )
return false;
@ -990,7 +990,7 @@ bool POINT_EDITOR::removeCornerCondition( const SELECTION& )
}
int POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent )
int EE_POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent )
{
if( !m_editPoints )
return 0;
@ -1115,7 +1115,7 @@ int POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent )
}
int POINT_EDITOR::removeCorner( const TOOL_EVENT& aEvent )
int EE_POINT_EDITOR::removeCorner( const TOOL_EVENT& aEvent )
{
if( !m_editPoints || !m_editedPoint )
return 0;
@ -1202,7 +1202,7 @@ int POINT_EDITOR::removeCorner( const TOOL_EVENT& aEvent )
}
int POINT_EDITOR::modifiedSelection( const TOOL_EVENT& aEvent )
int EE_POINT_EDITOR::modifiedSelection( const TOOL_EVENT& aEvent )
{
m_refill = true; // zone has been modified outside the point editor tool
updatePoints();

View File

@ -40,10 +40,10 @@ class SHAPE_POLY_SET;
*
* Tool that displays edit points allowing to modify items by dragging the points.
*/
class POINT_EDITOR : public PCB_TOOL
class EE_POINT_EDITOR : public PCB_TOOL
{
public:
POINT_EDITOR();
EE_POINT_EDITOR();
/// @copydoc TOOL_INTERACTIVE::Reset()
void Reset( RESET_REASON aReason ) override;

View File

@ -140,7 +140,7 @@ int POSITION_RELATIVE_TOOL::SelectPositionRelativeItem( const TOOL_EVENT& aEvent
{
Activate();
PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>();
EE_PICKER_TOOL* picker = m_toolMgr->GetTool<EE_PICKER_TOOL>();
STATUS_TEXT_POPUP statusPopup( frame() );
bool picking = true;