Refactor COMMON_ACTIONS into a base and derived class

New virtual class ACTIONS is added as a member to EDA_DRAW_FRAME so
that the TOOL_DISPATCHER can have access to the appropriate derived
version of TranslateLegacyId()
This commit is contained in:
Jon Evans 2017-02-21 13:42:08 +01:00 committed by Maciej Suminski
parent 2b2b73ee4b
commit 167f45ca2b
38 changed files with 649 additions and 579 deletions

View File

@ -54,6 +54,7 @@
#include <gal/gal_display_options.h>
#include <tool/tool_manager.h>
#include <tool/tool_dispatcher.h>
#include <tool/actions.h>
/**
* Definition for enabling and disabling scroll bar setting trace output. See the
@ -142,6 +143,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent,
m_canvas = NULL;
m_galCanvas = NULL;
m_galCanvasActive = false;
m_actions = NULL;
m_toolManager = NULL;
m_toolDispatcher = NULL;
m_messagePanel = NULL;
@ -214,6 +216,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent,
EDA_DRAW_FRAME::~EDA_DRAW_FRAME()
{
delete m_actions;
delete m_toolManager;
delete m_toolDispatcher;
delete m_galCanvas;

View File

@ -27,7 +27,7 @@
#include <tool/tool_manager.h>
#include <tool/tool_dispatcher.h>
#include <tools/common_actions.h>
#include <tool/actions.h>
#include <view/view.h>
#include <view/wx_view_controls.h>
@ -114,8 +114,9 @@ struct TOOL_DISPATCHER::BUTTON_STATE
};
TOOL_DISPATCHER::TOOL_DISPATCHER( TOOL_MANAGER* aToolMgr ) :
m_toolMgr( aToolMgr )
TOOL_DISPATCHER::TOOL_DISPATCHER( TOOL_MANAGER* aToolMgr, ACTIONS *aActions ) :
m_toolMgr( aToolMgr ),
m_actions( aActions )
{
m_buttons.push_back( new BUTTON_STATE( BUT_LEFT, wxEVT_LEFT_DOWN,
wxEVT_LEFT_UP, wxEVT_LEFT_DCLICK ) );
@ -341,7 +342,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
void TOOL_DISPATCHER::DispatchWxCommand( wxCommandEvent& aEvent )
{
boost::optional<TOOL_EVENT> evt = COMMON_ACTIONS::TranslateLegacyId( aEvent.GetId() );
boost::optional<TOOL_EVENT> evt = m_actions->TranslateLegacyId( aEvent.GetId() );
if( evt )
m_toolMgr->ProcessEvent( *evt );

View File

@ -89,6 +89,7 @@ protected:
TOOL_MANAGER* m_toolManager;
TOOL_DISPATCHER* m_toolDispatcher;
ACTIONS* m_actions;
/// Tool ID of previously active draw tool bar button.
int m_lastDrawToolId;

67
include/tool/actions.h Normal file
View File

@ -0,0 +1,67 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013-2016 CERN
* Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __ACTIONS_H
#define __ACTIONS_H
#include <tool/tool_action.h>
#include <boost/optional.hpp>
class TOOL_EVENT;
class TOOL_MANAGER;
/**
* Class ACTIONS
*
* Gathers all the actions that are shared by tools. The instance of a subclass of
* ACTIONS is created inside of ACTION_MANAGER object that registers the actions.
*/
class ACTIONS
{
public:
virtual ~ACTIONS() {};
/**
* Function TranslateLegacyId()
* Translates legacy tool ids to the corresponding TOOL_ACTION name.
* @param aId is legacy tool id to be translated.
* @return std::string is name of the corresponding TOOL_ACTION. It may be empty, if there is
* no corresponding TOOL_ACTION.
*/
virtual boost::optional<TOOL_EVENT> TranslateLegacyId( int aId ) = 0;
///> Registers all valid tools for an application with the tool manager
virtual void RegisterAllTools( TOOL_MANAGER* aToolManager ) = 0;
///> Cursor control event types
enum CURSOR_EVENT_TYPE { CURSOR_UP, CURSOR_DOWN, CURSOR_LEFT, CURSOR_RIGHT,
CURSOR_CLICK, CURSOR_DBL_CLICK, CURSOR_FAST_MOVE = 0x8000 };
///> Remove event modifier flags
enum class REMOVE_FLAGS { NORMAL = 0x00, ALT = 0x01 };
};
#endif

View File

@ -31,6 +31,7 @@
class TOOL_MANAGER;
class PCB_BASE_FRAME;
class ACTIONS;
namespace KIGFX
{
@ -54,8 +55,9 @@ public:
* Constructor
*
* @param aToolMgr: tool manager instance the events will be sent to
* @param aActions: ACTIONS subclass instance for ::TranslateLegacyId()
*/
TOOL_DISPATCHER( TOOL_MANAGER* aToolMgr );
TOOL_DISPATCHER( TOOL_MANAGER* aToolMgr, ACTIONS *aActions );
virtual ~TOOL_DISPATCHER();
@ -130,6 +132,9 @@ private:
///> Instance of tool manager that cooperates with the dispatcher.
TOOL_MANAGER* m_toolMgr;
///> Instance of an actions list that handles legacy action translation
ACTIONS* m_actions;
};
#endif

View File

@ -84,6 +84,7 @@ class TITLE_BLOCK;
class MSG_PANEL_ITEM;
class TOOL_MANAGER;
class TOOL_DISPATCHER;
class ACTIONS;
enum id_librarytype {

View File

@ -302,7 +302,7 @@ set( PCBNEW_CLASS_SRCS
tools/pcb_editor_control.cpp
tools/module_editor_tools.cpp
tools/placement_tool.cpp
tools/common_actions.cpp
tools/pcb_actions.cpp
tools/grid_helper.cpp
tools/pad_tool.cpp
tools/picker_tool.cpp

View File

@ -28,7 +28,7 @@
#include <pcb_netlist.h>
#include <dialogs/dialog_update_pcb.h>
#include <tools/common_actions.h>
#include <tools/pcb_actions.h>
#include <tool/tool_manager.h>
#include <pcb_draw_panel_gal.h>
@ -135,7 +135,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
{
if( IsGalCanvasActive() )
{
GetToolManager()->RunAction( COMMON_ACTIONS::crossProbeSchToPcb,
GetToolManager()->RunAction( PCB_ACTIONS::crossProbeSchToPcb,
true,
pad ?
static_cast<BOARD_ITEM*>( pad ) :

View File

@ -37,7 +37,7 @@
#include <class_draw_panel_gal.h>
#include <gal/graphics_abstraction_layer.h>
#include <tools/common_actions.h>
#include <tools/pcb_actions.h>
#include <tool/tool_manager.h>
#include <limits.h>
@ -154,7 +154,7 @@ bool DIALOG_SET_GRID::TransferDataFromWindow()
mgr->RunAction( "common.Control.gridPreset", true,
screen->GetGridCmdId() - ID_POPUP_GRID_LEVEL_1000 );
TOOL_EVENT gridOriginUpdate = COMMON_ACTIONS::gridSetOrigin.MakeEvent();
TOOL_EVENT gridOriginUpdate = PCB_ACTIONS::gridSetOrigin.MakeEvent();
gridOriginUpdate.SetParameter( new VECTOR2D( gridOrigin ) );
mgr->ProcessEvent( gridOriginUpdate );
}

View File

@ -32,7 +32,7 @@
#include <wx_html_report_panel.h>
#include <board_netlist_updater.h>
#include <tool/tool_manager.h>
#include <tools/common_actions.h>
#include <tools/pcb_actions.h>
#include <class_draw_panel_gal.h>
#include <class_drawpanel.h>
#include <class_board.h>
@ -76,7 +76,7 @@ void DIALOG_UPDATE_PCB::PerformUpdate( bool aDryRun )
{
// Clear selection, just in case a selected item has to be removed
toolManager->RunAction( COMMON_ACTIONS::selectionClear, true );
toolManager->RunAction( PCB_ACTIONS::selectionClear, true );
}
m_netlist->SetDeleteExtraFootprints( true );
@ -135,7 +135,7 @@ void DIALOG_UPDATE_PCB::PerformUpdate( bool aDryRun )
{
for( MODULE* footprint : newFootprints )
{
toolManager->RunAction( COMMON_ACTIONS::selectItem, true, footprint );
toolManager->RunAction( PCB_ACTIONS::selectItem, true, footprint );
}
toolManager->InvokeTool( "pcbnew.InteractiveEdit" );

View File

@ -45,7 +45,7 @@
#include <ratsnest_data.h>
#include <tool/tool_manager.h>
#include <tools/common_actions.h>
#include <tools/pcb_actions.h>
#include <pcbnew.h>
#include <drc_stuff.h>
@ -70,7 +70,7 @@ void DRC::ShowDRCDialog( wxWindow* aParent )
if( !m_drcDialog )
{
m_pcbEditorFrame->GetToolManager()->RunAction( COMMON_ACTIONS::selectionClear, true );
m_pcbEditorFrame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true );
m_drcDialog = new DIALOG_DRC_CONTROL( this, m_pcbEditorFrame, aParent );
updatePointers();

View File

@ -58,7 +58,7 @@
#include <dialog_move_exact.h>
#include <tool/tool_manager.h>
#include <tools/common_actions.h>
#include <tools/pcb_actions.h>
// Handles the selection of command events.
void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )

View File

@ -54,7 +54,7 @@
#include <modview_frame.h>
#include <collectors.h>
#include <tool/tool_manager.h>
#include <tools/common_actions.h>
#include <tools/pcb_actions.h>
#include <dialog_edit_module_for_Modedit.h>
#include <dialog_move_exact.h>
@ -436,8 +436,8 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break;
}
m_toolManager->RunAction( COMMON_ACTIONS::selectionClear, true );
pcbframe->GetToolManager()->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolManager->RunAction( PCB_ACTIONS::selectionClear, true );
pcbframe->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true );
BOARD_COMMIT commit( pcbframe );
// Create the "new" module

View File

@ -69,7 +69,7 @@
#include "tools/placement_tool.h"
#include "tools/picker_tool.h"
#include "tools/pad_tool.h"
#include "tools/common_actions.h"
#include "tools/pcb_actions.h"
BEGIN_EVENT_TABLE( FOOTPRINT_EDIT_FRAME, PCB_BASE_FRAME )
@ -808,7 +808,7 @@ void FOOTPRINT_EDIT_FRAME::updateView()
{
static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() )->DisplayBoard( GetBoard() );
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
m_toolManager->RunAction( COMMON_ACTIONS::zoomFitScreen, true );
m_toolManager->RunAction( PCB_ACTIONS::zoomFitScreen, true );
}
@ -945,7 +945,8 @@ void FOOTPRINT_EDIT_FRAME::setupTools()
m_toolManager = new TOOL_MANAGER;
m_toolManager->SetEnvironment( GetBoard(), drawPanel->GetView(),
drawPanel->GetViewControls(), this );
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager );
m_actions = new PCB_ACTIONS();
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions );
drawPanel->SetEventDispatcher( m_toolDispatcher );

View File

@ -56,7 +56,7 @@
#include <tool/tool_manager.h>
#include <tool/tool_dispatcher.h>
#include "tools/pcbnew_control.h"
#include "tools/common_actions.h"
#include "tools/pcb_actions.h"
#include <functional>
using namespace std::placeholders;
@ -196,7 +196,8 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
m_toolManager = new TOOL_MANAGER;
m_toolManager->SetEnvironment( GetBoard(), drawPanel->GetView(),
drawPanel->GetViewControls(), this );
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager );
m_actions = new PCB_ACTIONS();
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions );
drawPanel->SetEventDispatcher( m_toolDispatcher );
m_toolManager->RegisterTool( new PCBNEW_CONTROL );
@ -872,7 +873,7 @@ void FOOTPRINT_VIEWER_FRAME::updateView()
{
static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() )->DisplayBoard( GetBoard() );
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
m_toolManager->RunAction( COMMON_ACTIONS::zoomFitScreen, true );
m_toolManager->RunAction( PCB_ACTIONS::zoomFitScreen, true );
}
}

View File

@ -51,7 +51,7 @@ using namespace std::placeholders;
#include <io_mgr.h>
#include <tool/tool_manager.h>
#include <tools/common_actions.h>
#include <tools/pcb_actions.h>
#include <view/view.h>
@ -117,7 +117,7 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName,
}
// Clear selection, just in case a selected item has to be removed
m_toolManager->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolManager->RunAction( PCB_ACTIONS::selectionClear, true );
netlist.SortByReference();
board->ReplaceNetlist( netlist, aDeleteSinglePadNets, &newFootprints, aReporter );
@ -134,7 +134,7 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName,
{
for( MODULE* footprint : newFootprints )
{
m_toolManager->RunAction( COMMON_ACTIONS::selectItem, true, footprint );
m_toolManager->RunAction( PCB_ACTIONS::selectItem, true, footprint );
}
m_toolManager->InvokeTool( "pcbnew.InteractiveEdit" );
}

View File

@ -70,7 +70,7 @@
#include <tool/tool_manager.h>
#include <tool/tool_dispatcher.h>
#include <tools/common_actions.h>
#include <tools/pcb_actions.h>
#include <wildcards_and_files_ext.h>
@ -566,10 +566,11 @@ void PCB_EDIT_FRAME::setupTools()
m_toolManager = new TOOL_MANAGER;
m_toolManager->SetEnvironment( m_Pcb, GetGalCanvas()->GetView(),
GetGalCanvas()->GetViewControls(), this );
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager );
m_actions = new PCB_ACTIONS();
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions );
// Register tools
registerAllTools( m_toolManager );
m_actions->RegisterAllTools( m_toolManager );
m_toolManager->InitTools();
// Run the selection tool, it is supposed to be always active
@ -883,7 +884,7 @@ void PCB_EDIT_FRAME::SetActiveLayer( LAYER_ID aLayer )
if( IsGalCanvasActive() )
{
m_toolManager->RunAction( COMMON_ACTIONS::layerChanged ); // notify other tools
m_toolManager->RunAction( PCB_ACTIONS::layerChanged ); // notify other tools
GetGalCanvas()->SetFocus(); // otherwise hotkeys are stuck somewhere
GetGalCanvas()->SetHighContrastLayer( aLayer );

View File

@ -33,7 +33,7 @@
#include <tool/context_menu.h>
#include <tool/tool_manager.h>
#include <tools/common_actions.h>
#include <tools/pcb_actions.h>
#include "pns_segment.h"
#include "pns_router.h"
@ -110,9 +110,9 @@ void LENGTH_TUNER_TOOL::Reset( RESET_REASON aReason )
{
TOOL_BASE::Reset( aReason );
Go( &LENGTH_TUNER_TOOL::TuneSingleTrace, COMMON_ACTIONS::routerActivateTuneSingleTrace.MakeEvent() );
Go( &LENGTH_TUNER_TOOL::TuneDiffPair, COMMON_ACTIONS::routerActivateTuneDiffPair.MakeEvent() );
Go( &LENGTH_TUNER_TOOL::TuneDiffPairSkew, COMMON_ACTIONS::routerActivateTuneDiffPairSkew.MakeEvent() );
Go( &LENGTH_TUNER_TOOL::TuneSingleTrace, PCB_ACTIONS::routerActivateTuneSingleTrace.MakeEvent() );
Go( &LENGTH_TUNER_TOOL::TuneDiffPair, PCB_ACTIONS::routerActivateTuneDiffPair.MakeEvent() );
Go( &LENGTH_TUNER_TOOL::TuneDiffPairSkew, PCB_ACTIONS::routerActivateTuneDiffPairSkew.MakeEvent() );
}
@ -239,7 +239,7 @@ void LENGTH_TUNER_TOOL::SetTransitions()
int LENGTH_TUNER_TOOL::mainLoop( PNS::ROUTER_MODE aMode )
{
// Deselect all items
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
Activate();

View File

@ -41,7 +41,7 @@ using namespace std::placeholders;
#include <bitmaps.h>
#include <tool/context_menu.h>
#include <tools/common_actions.h>
#include <tools/pcb_actions.h>
#include <tools/grid_helper.h>
#include <ratsnest_data.h>

View File

@ -46,7 +46,7 @@ using namespace std::placeholders;
#include <tool/context_menu.h>
#include <tool/tool_manager.h>
#include <tool/tool_settings.h>
#include <tools/common_actions.h>
#include <tools/pcb_actions.h>
#include <tools/size_menu.h>
#include <tools/selection_tool.h>
#include <tools/edit_tool.h>
@ -204,7 +204,7 @@ protected:
bds.UseCustomTrackViaSize( useCustomTrackViaSize );
}
return OPT_TOOL_EVENT( COMMON_ACTIONS::trackViaSizeChanged.MakeEvent() );
return OPT_TOOL_EVENT( PCB_ACTIONS::trackViaSizeChanged.MakeEvent() );
}
private:
@ -272,7 +272,7 @@ bool ROUTER_TOOL::Init()
// Track & via dragging menu entry
auto selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>();
CONDITIONAL_MENU& menu = selectionTool->GetToolMenu().GetMenu();
menu.AddItem( COMMON_ACTIONS::routerInlineDrag, SELECTION_CONDITIONS::Count( 1 )
menu.AddItem( PCB_ACTIONS::routerInlineDrag, SELECTION_CONDITIONS::Count( 1 )
&& SELECTION_CONDITIONS::OnlyTypes( { PCB_TRACE_T, PCB_VIA_T, EOT } ) );
m_savedSettings.Load( GetSettings() );
@ -586,7 +586,7 @@ void ROUTER_TOOL::performRouting()
updateEndItem( *evt );
m_router->Move( m_endSnapPoint, m_endItem ); // refresh
}
else if( evt->IsAction( &COMMON_ACTIONS::layerChanged ) )
else if( evt->IsAction( &PCB_ACTIONS::layerChanged ) )
{
m_router->SwitchLayer( m_frame->GetActiveLayer() );
updateEndItem( *evt );
@ -639,11 +639,11 @@ int ROUTER_TOOL::SettingsDialog( const TOOL_EVENT& aEvent )
void ROUTER_TOOL::SetTransitions()
{
Go( &ROUTER_TOOL::RouteSingleTrace, COMMON_ACTIONS::routerActivateSingle.MakeEvent() );
Go( &ROUTER_TOOL::RouteDiffPair, COMMON_ACTIONS::routerActivateDiffPair.MakeEvent() );
Go( &ROUTER_TOOL::DpDimensionsDialog, COMMON_ACTIONS::routerActivateDpDimensionsDialog.MakeEvent() );
Go( &ROUTER_TOOL::SettingsDialog, COMMON_ACTIONS::routerActivateSettingsDialog.MakeEvent() );
Go( &ROUTER_TOOL::InlineDrag, COMMON_ACTIONS::routerInlineDrag.MakeEvent() );
Go( &ROUTER_TOOL::RouteSingleTrace, PCB_ACTIONS::routerActivateSingle.MakeEvent() );
Go( &ROUTER_TOOL::RouteDiffPair, PCB_ACTIONS::routerActivateDiffPair.MakeEvent() );
Go( &ROUTER_TOOL::DpDimensionsDialog, PCB_ACTIONS::routerActivateDpDimensionsDialog.MakeEvent() );
Go( &ROUTER_TOOL::SettingsDialog, PCB_ACTIONS::routerActivateSettingsDialog.MakeEvent() );
Go( &ROUTER_TOOL::InlineDrag, PCB_ACTIONS::routerInlineDrag.MakeEvent() );
Go( &ROUTER_TOOL::onViaCommand, ACT_PlaceThroughVia.MakeEvent() );
Go( &ROUTER_TOOL::onViaCommand, ACT_PlaceBlindVia.MakeEvent() );
@ -654,7 +654,7 @@ void ROUTER_TOOL::SetTransitions()
Go( &ROUTER_TOOL::DpDimensionsDialog, ACT_SetDpDimensions.MakeEvent() );
Go( &ROUTER_TOOL::CustomTrackWidthDialog, ACT_CustomTrackWidth.MakeEvent() );
Go( &ROUTER_TOOL::onTrackViaSizeChanged, COMMON_ACTIONS::trackViaSizeChanged.MakeEvent() );
Go( &ROUTER_TOOL::onTrackViaSizeChanged, PCB_ACTIONS::trackViaSizeChanged.MakeEvent() );
}
@ -678,7 +678,7 @@ int ROUTER_TOOL::mainLoop( PNS::ROUTER_MODE aMode )
BOARD* board = getModel<BOARD>();
// Deselect all items
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
Activate();
@ -721,13 +721,13 @@ int ROUTER_TOOL::mainLoop( PNS::ROUTER_MODE aMode )
}
else if( evt->IsAction( &ACT_PlaceThroughVia ) )
{
m_toolMgr->RunAction( COMMON_ACTIONS::layerToggle, true );
m_toolMgr->RunAction( PCB_ACTIONS::layerToggle, true );
}
else if( evt->IsAction( &COMMON_ACTIONS::remove ) )
else if( evt->IsAction( &PCB_ACTIONS::remove ) )
{
deleteTraces( m_startItem, true );
}
else if( evt->IsAction( &COMMON_ACTIONS::removeAlt ) )
else if( evt->IsAction( &PCB_ACTIONS::removeAlt ) )
{
deleteTraces( m_startItem, false );
}
@ -800,7 +800,7 @@ void ROUTER_TOOL::performDragging()
int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent )
{
// Get the item under the cursor
m_toolMgr->RunAction( COMMON_ACTIONS::selectionCursor, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true );
const auto& selection = m_toolMgr->GetTool<SELECTION_TOOL>()->GetSelection();
if( selection.Size() != 1 )
@ -813,7 +813,7 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent )
Activate();
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
m_router->SyncWorld();
m_startItem = m_router->GetWorld()->FindItemByParent( item );
@ -873,7 +873,7 @@ int ROUTER_TOOL::CustomTrackWidthDialog( const TOOL_EVENT& aEvent )
if( sizeDlg.ShowModal() )
{
bds.UseCustomTrackViaSize( true );
m_toolMgr->RunAction( COMMON_ACTIONS::trackViaSizeChanged );
m_toolMgr->RunAction( PCB_ACTIONS::trackViaSizeChanged );
}
return 0;

View File

@ -24,7 +24,7 @@
*/
#include "drawing_tool.h"
#include "common_actions.h"
#include "pcb_actions.h"
#include <wxPcbStruct.h>
#include <class_draw_panel_gal.h>
@ -200,7 +200,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
SELECTION preview;
m_view->Add( &preview );
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
m_controls->ShowCursor( true );
m_controls->SetSnapping( true );
// do not capture or auto-pan until we start placing some text
@ -247,7 +247,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
text->Rotate( text->GetPosition(), rotationAngle );
m_view->Update( &preview );
}
else if( evt->IsAction( &COMMON_ACTIONS::flip ) )
else if( evt->IsAction( &PCB_ACTIONS::flip ) )
{
text->Flip( text->GetPosition() );
m_view->Update( &preview );
@ -372,7 +372,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
SELECTION preview;
m_view->Add( &preview );
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
m_controls->ShowCursor( true );
m_controls->SetSnapping( true );
@ -412,14 +412,14 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
break;
}
else if( evt->IsAction( &COMMON_ACTIONS::incWidth ) && step != SET_ORIGIN )
else if( evt->IsAction( &PCB_ACTIONS::incWidth ) && step != SET_ORIGIN )
{
m_lineWidth += WIDTH_STEP;
dimension->SetWidth( m_lineWidth );
m_view->Update( &preview );
}
else if( evt->IsAction( &COMMON_ACTIONS::decWidth ) && step != SET_ORIGIN )
else if( evt->IsAction( &PCB_ACTIONS::decWidth ) && step != SET_ORIGIN )
{
if( m_lineWidth > WIDTH_STEP )
{
@ -606,7 +606,7 @@ int DRAWING_TOOL::PlaceDXF( const TOOL_EVENT& aEvent )
BOARD_ITEM* firstItem = preview.Front();
m_view->Add( &preview );
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
m_controls->ShowCursor( true );
m_controls->SetSnapping( true );
@ -645,7 +645,7 @@ int DRAWING_TOOL::PlaceDXF( const TOOL_EVENT& aEvent )
m_view->Update( &preview );
}
else if( evt->IsAction( &COMMON_ACTIONS::flip ) )
else if( evt->IsAction( &PCB_ACTIONS::flip ) )
{
for( auto item : preview )
item->Flip( wxPoint( cursorPos.x, cursorPos.y ) );
@ -827,7 +827,7 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic,
SELECTION preview;
m_view->Add( &preview );
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
m_controls->ShowCursor( true );
m_controls->SetSnapping( true );
@ -890,7 +890,7 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic,
aGraphic = NULL;
break;
}
else if( evt->IsAction( &COMMON_ACTIONS::layerChanged ) )
else if( evt->IsAction( &PCB_ACTIONS::layerChanged ) )
{
aGraphic->SetLayer( getDrawingLayer() );
m_view->Update( &preview );
@ -961,7 +961,7 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic,
m_view->Update( &preview );
}
else if( evt->IsAction( &COMMON_ACTIONS::incWidth ) )
else if( evt->IsAction( &PCB_ACTIONS::incWidth ) )
{
m_lineWidth += WIDTH_STEP;
aGraphic->SetWidth( m_lineWidth );
@ -969,7 +969,7 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic,
m_view->Update( &preview );
}
else if( evt->IsAction( &COMMON_ACTIONS::decWidth ) && ( m_lineWidth > WIDTH_STEP ) )
else if( evt->IsAction( &PCB_ACTIONS::decWidth ) && ( m_lineWidth > WIDTH_STEP ) )
{
m_lineWidth -= WIDTH_STEP;
aGraphic->SetWidth( m_lineWidth );
@ -1004,7 +1004,7 @@ bool DRAWING_TOOL::drawArc( DRAWSEGMENT*& aGraphic )
SELECTION preview;
m_view->Add( &preview );
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
m_controls->ShowCursor( true );
m_controls->SetSnapping( true );
@ -1125,21 +1125,21 @@ bool DRAWING_TOOL::drawArc( DRAWSEGMENT*& aGraphic )
m_view->Update( &preview );
}
else if( evt->IsAction( &COMMON_ACTIONS::incWidth ) )
else if( evt->IsAction( &PCB_ACTIONS::incWidth ) )
{
m_lineWidth += WIDTH_STEP;
aGraphic->SetWidth( m_lineWidth );
m_view->Update( &preview );
}
else if( evt->IsAction( &COMMON_ACTIONS::decWidth ) && m_lineWidth > WIDTH_STEP )
else if( evt->IsAction( &PCB_ACTIONS::decWidth ) && m_lineWidth > WIDTH_STEP )
{
m_lineWidth -= WIDTH_STEP;
aGraphic->SetWidth( m_lineWidth );
m_view->Update( &preview );
}
else if( evt->IsAction( &COMMON_ACTIONS::arcPosture ) )
else if( evt->IsAction( &PCB_ACTIONS::arcPosture ) )
{
if( clockwise )
aGraphic->SetAngle( aGraphic->GetAngle() - 3600.0 );
@ -1230,7 +1230,7 @@ bool DRAWING_TOOL::getSourceZoneForAction( ZONE_MODE aMode, ZONE_CONTAINER*& aZo
const SELECTION& selection = selTool->GetSelection();
if( selection.Empty() )
m_toolMgr->RunAction( COMMON_ACTIONS::selectionCursor, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true );
// we want a single zone
if( selection.Size() != 1 )
@ -1269,7 +1269,7 @@ void DRAWING_TOOL::performZoneCutout( ZONE_CONTAINER& aExistingZone, ZONE_CONTAI
selection.Clear();
selection.Add( &aExistingZone );
m_toolMgr->RunAction( COMMON_ACTIONS::zoneFill, true );
m_toolMgr->RunAction( PCB_ACTIONS::zoneFill, true );
}
}
@ -1290,7 +1290,7 @@ int DRAWING_TOOL::drawZone( bool aKeepout, ZONE_MODE aMode )
SELECTION preview;
m_view->Add( &preview );
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
m_controls->ShowCursor( true );
m_controls->SetSnapping( true );
@ -1504,17 +1504,17 @@ void DRAWING_TOOL::make45DegLine( DRAWSEGMENT* aSegment, DRAWSEGMENT* aHelper )
void DRAWING_TOOL::SetTransitions()
{
Go( &DRAWING_TOOL::DrawLine, COMMON_ACTIONS::drawLine.MakeEvent() );
Go( &DRAWING_TOOL::DrawCircle, COMMON_ACTIONS::drawCircle.MakeEvent() );
Go( &DRAWING_TOOL::DrawArc, COMMON_ACTIONS::drawArc.MakeEvent() );
Go( &DRAWING_TOOL::DrawDimension, COMMON_ACTIONS::drawDimension.MakeEvent() );
Go( &DRAWING_TOOL::DrawZone, COMMON_ACTIONS::drawZone.MakeEvent() );
Go( &DRAWING_TOOL::DrawKeepout, COMMON_ACTIONS::drawKeepout.MakeEvent() );
Go( &DRAWING_TOOL::DrawZoneCutout, COMMON_ACTIONS::drawZoneCutout.MakeEvent() );
Go( &DRAWING_TOOL::DrawSimilarZone, COMMON_ACTIONS::drawSimilarZone.MakeEvent() );
Go( &DRAWING_TOOL::PlaceText, COMMON_ACTIONS::placeText.MakeEvent() );
Go( &DRAWING_TOOL::PlaceDXF, COMMON_ACTIONS::placeDXF.MakeEvent() );
Go( &DRAWING_TOOL::SetAnchor, COMMON_ACTIONS::setAnchor.MakeEvent() );
Go( &DRAWING_TOOL::DrawLine, PCB_ACTIONS::drawLine.MakeEvent() );
Go( &DRAWING_TOOL::DrawCircle, PCB_ACTIONS::drawCircle.MakeEvent() );
Go( &DRAWING_TOOL::DrawArc, PCB_ACTIONS::drawArc.MakeEvent() );
Go( &DRAWING_TOOL::DrawDimension, PCB_ACTIONS::drawDimension.MakeEvent() );
Go( &DRAWING_TOOL::DrawZone, PCB_ACTIONS::drawZone.MakeEvent() );
Go( &DRAWING_TOOL::DrawKeepout, PCB_ACTIONS::drawKeepout.MakeEvent() );
Go( &DRAWING_TOOL::DrawZoneCutout, PCB_ACTIONS::drawZoneCutout.MakeEvent() );
Go( &DRAWING_TOOL::DrawSimilarZone, PCB_ACTIONS::drawSimilarZone.MakeEvent() );
Go( &DRAWING_TOOL::PlaceText, PCB_ACTIONS::placeText.MakeEvent() );
Go( &DRAWING_TOOL::PlaceDXF, PCB_ACTIONS::placeDXF.MakeEvent() );
Go( &DRAWING_TOOL::SetAnchor, PCB_ACTIONS::setAnchor.MakeEvent() );
}

View File

@ -47,7 +47,7 @@
#include <functional>
using namespace std::placeholders;
#include "common_actions.h"
#include "pcb_actions.h"
#include "selection_tool.h"
#include "edit_tool.h"
#include "grid_helper.h"
@ -98,24 +98,24 @@ bool EDIT_TOOL::Init()
// Add context menu entries that are displayed when selection tool is active
CONDITIONAL_MENU& menu = m_selectionTool->GetToolMenu().GetMenu();
menu.AddItem( COMMON_ACTIONS::editActivate, SELECTION_CONDITIONS::NotEmpty );
menu.AddItem( COMMON_ACTIONS::rotateCw, SELECTION_CONDITIONS::NotEmpty );
menu.AddItem( COMMON_ACTIONS::rotateCcw, SELECTION_CONDITIONS::NotEmpty );
menu.AddItem( COMMON_ACTIONS::flip, SELECTION_CONDITIONS::NotEmpty );
menu.AddItem( COMMON_ACTIONS::remove, SELECTION_CONDITIONS::NotEmpty );
menu.AddItem( COMMON_ACTIONS::properties, SELECTION_CONDITIONS::Count( 1 )
menu.AddItem( PCB_ACTIONS::editActivate, SELECTION_CONDITIONS::NotEmpty );
menu.AddItem( PCB_ACTIONS::rotateCw, SELECTION_CONDITIONS::NotEmpty );
menu.AddItem( PCB_ACTIONS::rotateCcw, SELECTION_CONDITIONS::NotEmpty );
menu.AddItem( PCB_ACTIONS::flip, SELECTION_CONDITIONS::NotEmpty );
menu.AddItem( PCB_ACTIONS::remove, SELECTION_CONDITIONS::NotEmpty );
menu.AddItem( PCB_ACTIONS::properties, SELECTION_CONDITIONS::Count( 1 )
|| SELECTION_CONDITIONS::OnlyTypes( GENERAL_COLLECTOR::Tracks ) );
menu.AddItem( COMMON_ACTIONS::moveExact, SELECTION_CONDITIONS::NotEmpty );
menu.AddItem( COMMON_ACTIONS::duplicate, SELECTION_CONDITIONS::NotEmpty );
menu.AddItem( COMMON_ACTIONS::createArray, SELECTION_CONDITIONS::NotEmpty );
menu.AddItem( PCB_ACTIONS::moveExact, SELECTION_CONDITIONS::NotEmpty );
menu.AddItem( PCB_ACTIONS::duplicate, SELECTION_CONDITIONS::NotEmpty );
menu.AddItem( PCB_ACTIONS::createArray, SELECTION_CONDITIONS::NotEmpty );
// Mirror only available in modedit
menu.AddItem( COMMON_ACTIONS::mirror, editingModuleCondition && SELECTION_CONDITIONS::NotEmpty );
menu.AddItem( PCB_ACTIONS::mirror, editingModuleCondition && SELECTION_CONDITIONS::NotEmpty );
// Footprint actions
menu.AddItem( COMMON_ACTIONS::editFootprintInFpEditor,
menu.AddItem( PCB_ACTIONS::editFootprintInFpEditor,
singleModuleCondition );
menu.AddItem( COMMON_ACTIONS::exchangeFootprints,
menu.AddItem( PCB_ACTIONS::exchangeFootprints,
singleModuleCondition );
m_offset.x = 0;
@ -138,7 +138,7 @@ bool EDIT_TOOL::invokeInlineRouter()
if( !theRouter->PNSSettings().InlineDragEnabled() )
return false;
m_toolMgr->RunAction( COMMON_ACTIONS::routerInlineDrag, true );
m_toolMgr->RunAction( PCB_ACTIONS::routerInlineDrag, true );
return true;
}
@ -179,7 +179,7 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
// Main loop: keep receiving events
do
{
if( evt->IsAction( &COMMON_ACTIONS::editActivate )
if( evt->IsAction( &PCB_ACTIONS::editActivate )
|| evt->IsMotion() || evt->IsDrag( BUT_LEFT ) )
{
if( selection.Empty() )
@ -249,7 +249,7 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
}
getView()->Update( &selection );
m_toolMgr->RunAction( COMMON_ACTIONS::editModifiedSelection, true );
m_toolMgr->RunAction( PCB_ACTIONS::editModifiedSelection, true );
}
else if( evt->IsCancel() || evt->IsActivate() )
@ -269,19 +269,19 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
{
wxPoint modPoint = getModificationPoint( selection );
if( evt->IsAction( &COMMON_ACTIONS::remove ) )
if( evt->IsAction( &PCB_ACTIONS::remove ) )
{
// exit the loop, as there is no further processing for removed items
break;
}
else if( evt->IsAction( &COMMON_ACTIONS::duplicate ) )
else if( evt->IsAction( &PCB_ACTIONS::duplicate ) )
{
// On duplicate, stop moving this item
// The duplicate tool should then select the new item and start
// a new move procedure
break;
}
else if( evt->IsAction( &COMMON_ACTIONS::moveExact ) )
else if( evt->IsAction( &PCB_ACTIONS::moveExact ) )
{
// Can't do this, because the selection will then contain
// stale pointers and it will all go horribly wrong...
@ -327,7 +327,7 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
m_offset.y = 0;
if( unselect || restore )
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
if( restore )
m_commit->Revert();
@ -369,7 +369,7 @@ int EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
BOARD_ITEM* item = selection.Front();
// Some of properties dialogs alter pointers, so we should deselect them
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
// Store flags, so they can be restored later
STATUS_FLAGS flags = item->GetFlags();
@ -379,12 +379,12 @@ int EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
// Display properties dialog provided by the legacy canvas frame
editFrame->OnEditItemRequest( NULL, item );
m_toolMgr->RunAction( COMMON_ACTIONS::editModifiedSelection, true );
m_toolMgr->RunAction( PCB_ACTIONS::editModifiedSelection, true );
item->SetFlags( flags );
}
if( unselect )
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
return 0;
}
@ -416,10 +416,10 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent )
updateRatsnest( true );
if( unselect )
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
// TODO selectionModified
m_toolMgr->RunAction( COMMON_ACTIONS::editModifiedSelection, true );
m_toolMgr->RunAction( PCB_ACTIONS::editModifiedSelection, true );
editFrame->Refresh();
return 0;
@ -527,10 +527,10 @@ int EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent )
updateRatsnest( true );
if( unselect )
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
// TODO selectionModified
m_toolMgr->RunAction( COMMON_ACTIONS::editModifiedSelection, true );
m_toolMgr->RunAction( PCB_ACTIONS::editModifiedSelection, true );
editFrame->Refresh();
return 0;
@ -561,9 +561,9 @@ int EDIT_TOOL::Flip( const TOOL_EVENT& aEvent )
updateRatsnest( true );
if( unselect )
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( COMMON_ACTIONS::editModifiedSelection, true );
m_toolMgr->RunAction( PCB_ACTIONS::editModifiedSelection, true );
getEditFrame<PCB_BASE_EDIT_FRAME>()->Refresh();
return 0;
@ -577,21 +577,21 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent )
// is this "alternative" remove?
const bool isAlt = aEvent.Parameter<intptr_t>() ==
(int) COMMON_ACTIONS::REMOVE_FLAGS::ALT;
(int) PCB_ACTIONS::REMOVE_FLAGS::ALT;
// in "alternative" mode, deletion is not just a simple list
// of selected items, it is:
// - whole tracks, not just segments
if( isAlt )
{
m_toolMgr->RunAction( COMMON_ACTIONS::selectConnection, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectConnection, true );
}
// Get a copy instead of a reference, as we are going to clear current selection
auto selection = m_selectionTool->GetSelection().GetItems();
// As we are about to remove items, they have to be removed from the selection first
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
for( auto item : selection )
{
@ -641,9 +641,9 @@ int EDIT_TOOL::MoveExact( const TOOL_EVENT& aEvent )
m_commit->Push( _( "Move exact" ) );
if( unselect )
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( COMMON_ACTIONS::editModifiedSelection, true );
m_toolMgr->RunAction( PCB_ACTIONS::editModifiedSelection, true );
}
return 0;
@ -654,7 +654,7 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
{
// Note: original items are no more modified.
bool increment = aEvent.IsAction( &COMMON_ACTIONS::duplicateIncrement );
bool increment = aEvent.IsAction( &PCB_ACTIONS::duplicateIncrement );
// first, check if we have a selection, or try to get one
SELECTION_TOOL* selTool = m_toolMgr->GetTool<SELECTION_TOOL>();
@ -682,7 +682,7 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
// Unselect the item, so we won't pick it up again
// Do this first, so a single-item duplicate will correctly call
// SetCurItem and show the item properties
m_toolMgr->RunAction( COMMON_ACTIONS::unselectItem, true, item );
m_toolMgr->RunAction( PCB_ACTIONS::unselectItem, true, item );
BOARD_ITEM* new_item = NULL;
@ -706,7 +706,7 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
m_commit->Add( new_item );
// Select the new item, so we can pick it up
m_toolMgr->RunAction( COMMON_ACTIONS::selectItem, true, new_item );
m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, new_item );
}
}
@ -718,7 +718,7 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
// If items were duplicated, pick them up
// this works well for "dropping" copies around and pushes the commit
TOOL_EVENT evt = COMMON_ACTIONS::editActivate.MakeEvent();
TOOL_EVENT evt = PCB_ACTIONS::editActivate.MakeEvent();
Main( evt );
}
@ -770,7 +770,7 @@ private:
void prePushAction( BOARD_ITEM* new_item ) override
{
m_parent.GetToolManager()->RunAction( COMMON_ACTIONS::unselectItem,
m_parent.GetToolManager()->RunAction( PCB_ACTIONS::unselectItem,
true, new_item );
}
@ -819,7 +819,7 @@ int EDIT_TOOL::ExchangeFootprints( const TOOL_EVENT& aEvent )
// Footprint exchange could remove modules, so they have to be
// removed from the selection first
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
// invoke the exchange dialog process
{
@ -837,20 +837,20 @@ int EDIT_TOOL::ExchangeFootprints( const TOOL_EVENT& aEvent )
void EDIT_TOOL::SetTransitions()
{
Go( &EDIT_TOOL::Main, COMMON_ACTIONS::editActivate.MakeEvent() );
Go( &EDIT_TOOL::Rotate, COMMON_ACTIONS::rotateCw.MakeEvent() );
Go( &EDIT_TOOL::Rotate, COMMON_ACTIONS::rotateCcw.MakeEvent() );
Go( &EDIT_TOOL::Flip, COMMON_ACTIONS::flip.MakeEvent() );
Go( &EDIT_TOOL::Remove, COMMON_ACTIONS::remove.MakeEvent() );
Go( &EDIT_TOOL::Remove, COMMON_ACTIONS::removeAlt.MakeEvent() );
Go( &EDIT_TOOL::Properties, COMMON_ACTIONS::properties.MakeEvent() );
Go( &EDIT_TOOL::MoveExact, COMMON_ACTIONS::moveExact.MakeEvent() );
Go( &EDIT_TOOL::Duplicate, COMMON_ACTIONS::duplicate.MakeEvent() );
Go( &EDIT_TOOL::Duplicate, COMMON_ACTIONS::duplicateIncrement.MakeEvent() );
Go( &EDIT_TOOL::CreateArray,COMMON_ACTIONS::createArray.MakeEvent() );
Go( &EDIT_TOOL::Mirror, COMMON_ACTIONS::mirror.MakeEvent() );
Go( &EDIT_TOOL::editFootprintInFpEditor, COMMON_ACTIONS::editFootprintInFpEditor.MakeEvent() );
Go( &EDIT_TOOL::ExchangeFootprints, COMMON_ACTIONS::exchangeFootprints.MakeEvent() );
Go( &EDIT_TOOL::Main, PCB_ACTIONS::editActivate.MakeEvent() );
Go( &EDIT_TOOL::Rotate, PCB_ACTIONS::rotateCw.MakeEvent() );
Go( &EDIT_TOOL::Rotate, PCB_ACTIONS::rotateCcw.MakeEvent() );
Go( &EDIT_TOOL::Flip, PCB_ACTIONS::flip.MakeEvent() );
Go( &EDIT_TOOL::Remove, PCB_ACTIONS::remove.MakeEvent() );
Go( &EDIT_TOOL::Remove, PCB_ACTIONS::removeAlt.MakeEvent() );
Go( &EDIT_TOOL::Properties, PCB_ACTIONS::properties.MakeEvent() );
Go( &EDIT_TOOL::MoveExact, PCB_ACTIONS::moveExact.MakeEvent() );
Go( &EDIT_TOOL::Duplicate, PCB_ACTIONS::duplicate.MakeEvent() );
Go( &EDIT_TOOL::Duplicate, PCB_ACTIONS::duplicateIncrement.MakeEvent() );
Go( &EDIT_TOOL::CreateArray,PCB_ACTIONS::createArray.MakeEvent() );
Go( &EDIT_TOOL::Mirror, PCB_ACTIONS::mirror.MakeEvent() );
Go( &EDIT_TOOL::editFootprintInFpEditor, PCB_ACTIONS::editFootprintInFpEditor.MakeEvent() );
Go( &EDIT_TOOL::ExchangeFootprints, PCB_ACTIONS::exchangeFootprints.MakeEvent() );
}
@ -891,7 +891,7 @@ wxPoint EDIT_TOOL::getModificationPoint( const SELECTION& aSelection )
bool EDIT_TOOL::hoverSelection( bool aSanitize )
{
m_toolMgr->RunAction( COMMON_ACTIONS::selectionCursor, true, aSanitize );
m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true, aSanitize );
return !m_selectionTool->GetSelection().Empty();
}
@ -925,7 +925,7 @@ int EDIT_TOOL::editFootprintInFpEditor( const TOOL_EVENT& aEvent )
editor->Raise(); // Iconize( false );
if( unselect )
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
return 0;
}

View File

@ -27,7 +27,7 @@
#include <id.h>
#include <draw_frame.h>
#include <class_base_screen.h>
#include <tools/common_actions.h>
#include <tools/pcb_actions.h>
#include <bitmaps.h>
#include <functional>
@ -53,7 +53,7 @@ GRID_MENU::GRID_MENU( EDA_DRAW_FRAME* aParent ) : m_parent( aParent )
OPT_TOOL_EVENT GRID_MENU::eventHandler( const wxMenuEvent& aEvent )
{
OPT_TOOL_EVENT event( COMMON_ACTIONS::gridPreset.MakeEvent() );
OPT_TOOL_EVENT event( PCB_ACTIONS::gridPreset.MakeEvent() );
intptr_t idx = aEvent.GetId() - ID_POPUP_GRID_SELECT - 1;
event->SetParameter( idx );

View File

@ -24,7 +24,7 @@
#include "module_editor_tools.h"
#include "selection_tool.h"
#include "common_actions.h"
#include "pcb_actions.h"
#include <tool/tool_manager.h>
#include <class_draw_panel_gal.h>
@ -104,7 +104,7 @@ int MODULE_EDITOR_TOOLS::PlacePad( const TOOL_EVENT& aEvent )
preview.Add( pad );
m_view->Add( &preview );
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
m_controls->ShowCursor( true );
m_controls->SetSnapping( true );
@ -130,7 +130,7 @@ int MODULE_EDITOR_TOOLS::PlacePad( const TOOL_EVENT& aEvent )
pad->Rotate( pad->GetPosition(), rotationAngle );
m_view->Update( &preview );
}
else if( evt->IsAction( &COMMON_ACTIONS::flip ) )
else if( evt->IsAction( &PCB_ACTIONS::flip ) )
{
pad->Flip( pad->GetPosition() );
m_view->Update( &preview );
@ -210,7 +210,7 @@ int MODULE_EDITOR_TOOLS::EnumeratePads( const TOOL_EVENT& aEvent )
Activate();
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
m_controls->ShowCursor( true );
VECTOR2I oldCursorPos = m_controls->GetCursorPosition();
std::list<D_PAD*> selectedPads;
@ -418,7 +418,7 @@ int MODULE_EDITOR_TOOLS::PasteItems( const TOOL_EVENT& aEvent )
preview.Add( pastedModule );
m_view->Add( &preview );
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
m_controls->ShowCursor( true );
m_controls->SetSnapping( true );
m_controls->SetAutoPan( true );
@ -445,7 +445,7 @@ int MODULE_EDITOR_TOOLS::PasteItems( const TOOL_EVENT& aEvent )
pastedModule->Rotate( pastedModule->GetPosition(), rotationAngle );
m_view->Update( &preview );
}
else if( evt->IsAction( &COMMON_ACTIONS::flip ) )
else if( evt->IsAction( &PCB_ACTIONS::flip ) )
{
pastedModule->Flip( pastedModule->GetPosition() );
m_view->Update( &preview );
@ -575,10 +575,10 @@ int MODULE_EDITOR_TOOLS::ModuleEdgeOutlines( const TOOL_EVENT& aEvent )
void MODULE_EDITOR_TOOLS::SetTransitions()
{
Go( &MODULE_EDITOR_TOOLS::PlacePad, COMMON_ACTIONS::placePad.MakeEvent() );
Go( &MODULE_EDITOR_TOOLS::EnumeratePads, COMMON_ACTIONS::enumeratePads.MakeEvent() );
Go( &MODULE_EDITOR_TOOLS::CopyItems, COMMON_ACTIONS::copyItems.MakeEvent() );
Go( &MODULE_EDITOR_TOOLS::PasteItems, COMMON_ACTIONS::pasteItems.MakeEvent() );
Go( &MODULE_EDITOR_TOOLS::ModuleTextOutlines, COMMON_ACTIONS::moduleTextOutlines.MakeEvent() );
Go( &MODULE_EDITOR_TOOLS::ModuleEdgeOutlines, COMMON_ACTIONS::moduleEdgeOutlines.MakeEvent() );
Go( &MODULE_EDITOR_TOOLS::PlacePad, PCB_ACTIONS::placePad.MakeEvent() );
Go( &MODULE_EDITOR_TOOLS::EnumeratePads, PCB_ACTIONS::enumeratePads.MakeEvent() );
Go( &MODULE_EDITOR_TOOLS::CopyItems, PCB_ACTIONS::copyItems.MakeEvent() );
Go( &MODULE_EDITOR_TOOLS::PasteItems, PCB_ACTIONS::pasteItems.MakeEvent() );
Go( &MODULE_EDITOR_TOOLS::ModuleTextOutlines, PCB_ACTIONS::moduleTextOutlines.MakeEvent() );
Go( &MODULE_EDITOR_TOOLS::ModuleEdgeOutlines, PCB_ACTIONS::moduleEdgeOutlines.MakeEvent() );
}

View File

@ -37,7 +37,7 @@
#include <dialogs/dialog_global_pads_edition.h>
#include "common_actions.h"
#include "pcb_actions.h"
#include "selection_tool.h"
#include "selection_conditions.h"
#include "edit_tool.h"
@ -56,16 +56,16 @@ public:
SetIcon( pad_xpm );
SetTitle( _( "Pads" ) );
Add( COMMON_ACTIONS::copyPadSettings );
Add( COMMON_ACTIONS::applyPadSettings );
Add( COMMON_ACTIONS::pushPadSettings );
Add( PCB_ACTIONS::copyPadSettings );
Add( PCB_ACTIONS::applyPadSettings );
Add( PCB_ACTIONS::pushPadSettings );
// show modedit-specific items
if( m_editingFootprint )
{
AppendSeparator();
Add( COMMON_ACTIONS::enumeratePads );
Add( PCB_ACTIONS::enumeratePads );
}
}
@ -114,9 +114,9 @@ private:
auto enablements = getEnablements( selection );
Enable( getMenuId( COMMON_ACTIONS::applyPadSettings ), enablements.canImport );
Enable( getMenuId( COMMON_ACTIONS::copyPadSettings ), enablements.canExport );
Enable( getMenuId( COMMON_ACTIONS::pushPadSettings ), enablements.canPush );
Enable( getMenuId( PCB_ACTIONS::applyPadSettings ), enablements.canImport );
Enable( getMenuId( PCB_ACTIONS::copyPadSettings ), enablements.canExport );
Enable( getMenuId( PCB_ACTIONS::pushPadSettings ), enablements.canPush );
}
bool m_editingFootprint;
@ -204,7 +204,7 @@ int PAD_TOOL::applyPadSettings( const TOOL_EVENT& aEvent )
commit.Push( _( "Apply Pad Settings" ) );
m_toolMgr->RunAction( COMMON_ACTIONS::editModifiedSelection, true );
m_toolMgr->RunAction( PCB_ACTIONS::editModifiedSelection, true );
frame.Refresh();
return 0;
@ -357,7 +357,7 @@ int PAD_TOOL::pushPadSettings( const TOOL_EVENT& aEvent )
commit.Push( _( "Apply Pad Settings" ) );
m_toolMgr->RunAction( COMMON_ACTIONS::editModifiedSelection, true );
m_toolMgr->RunAction( PCB_ACTIONS::editModifiedSelection, true );
frame.Refresh();
return 0;
@ -366,7 +366,7 @@ int PAD_TOOL::pushPadSettings( const TOOL_EVENT& aEvent )
void PAD_TOOL::SetTransitions()
{
Go( &PAD_TOOL::applyPadSettings, COMMON_ACTIONS::applyPadSettings.MakeEvent() );
Go( &PAD_TOOL::copyPadSettings, COMMON_ACTIONS::copyPadSettings.MakeEvent() );
Go( &PAD_TOOL::pushPadSettings, COMMON_ACTIONS::pushPadSettings.MakeEvent() );
Go( &PAD_TOOL::applyPadSettings, PCB_ACTIONS::applyPadSettings.MakeEvent() );
Go( &PAD_TOOL::copyPadSettings, PCB_ACTIONS::copyPadSettings.MakeEvent() );
Go( &PAD_TOOL::pushPadSettings, PCB_ACTIONS::pushPadSettings.MakeEvent() );
}

View File

@ -23,7 +23,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "common_actions.h"
#include "pcb_actions.h"
#include <tool/action_manager.h>
#include <pcbnew_id.h>
#include <layers_id_colors_and_visibility.h>
@ -31,770 +31,770 @@
#include <wx/defs.h>
#include <hotkeys.h>
// These members are static in class COMMON_ACTIONS: Build them here:
// These members are static in class PCB_ACTIONS: Build them here:
// Selection tool actions
TOOL_ACTION COMMON_ACTIONS::selectionActivate( "pcbnew.InteractiveSelection",
TOOL_ACTION PCB_ACTIONS::selectionActivate( "pcbnew.InteractiveSelection",
AS_GLOBAL, 0,
"", "", NULL, AF_ACTIVATE ); // No description, it is not supposed to be shown anywhere
TOOL_ACTION COMMON_ACTIONS::selectionCursor( "pcbnew.InteractiveSelection.Cursor",
TOOL_ACTION PCB_ACTIONS::selectionCursor( "pcbnew.InteractiveSelection.Cursor",
AS_GLOBAL, 0,
"", "" ); // No description, it is not supposed to be shown anywhere
TOOL_ACTION COMMON_ACTIONS::selectItem( "pcbnew.InteractiveSelection.SelectItem",
TOOL_ACTION PCB_ACTIONS::selectItem( "pcbnew.InteractiveSelection.SelectItem",
AS_GLOBAL, 0,
"", "" ); // No description, it is not supposed to be shown anywhere
TOOL_ACTION COMMON_ACTIONS::unselectItem( "pcbnew.InteractiveSelection.UnselectItem",
TOOL_ACTION PCB_ACTIONS::unselectItem( "pcbnew.InteractiveSelection.UnselectItem",
AS_GLOBAL, 0,
"", "" ); // No description, it is not supposed to be shown anywhere
TOOL_ACTION COMMON_ACTIONS::selectionClear( "pcbnew.InteractiveSelection.Clear",
TOOL_ACTION PCB_ACTIONS::selectionClear( "pcbnew.InteractiveSelection.Clear",
AS_GLOBAL, 0,
"", "" ); // No description, it is not supposed to be shown anywhere
TOOL_ACTION COMMON_ACTIONS::selectConnection( "pcbnew.InteractiveSelection.SelectConnection",
TOOL_ACTION PCB_ACTIONS::selectConnection( "pcbnew.InteractiveSelection.SelectConnection",
AS_GLOBAL, 'U',
_( "Trivial Connection" ), _( "Selects a connection between two junctions." ) );
TOOL_ACTION COMMON_ACTIONS::selectCopper( "pcbnew.InteractiveSelection.SelectCopper",
TOOL_ACTION PCB_ACTIONS::selectCopper( "pcbnew.InteractiveSelection.SelectCopper",
AS_GLOBAL, 'I',
_( "Copper Connection" ), _( "Selects whole copper connection." ) );
TOOL_ACTION COMMON_ACTIONS::selectNet( "pcbnew.InteractiveSelection.SelectNet",
TOOL_ACTION PCB_ACTIONS::selectNet( "pcbnew.InteractiveSelection.SelectNet",
AS_GLOBAL, 0,
_( "Whole Net" ), _( "Selects all tracks & vias belonging to the same net." ) );
TOOL_ACTION COMMON_ACTIONS::selectSameSheet( "pcbnew.InteractiveSelection.SelectSameSheet",
TOOL_ACTION PCB_ACTIONS::selectSameSheet( "pcbnew.InteractiveSelection.SelectSameSheet",
AS_GLOBAL, 'P',
_( "Same Sheet" ), _( "Selects all modules and tracks in the same schematic sheet" ) );
TOOL_ACTION COMMON_ACTIONS::find( "pcbnew.InteractiveSelection.Find",
TOOL_ACTION PCB_ACTIONS::find( "pcbnew.InteractiveSelection.Find",
AS_GLOBAL, 0, //TOOL_ACTION::LegacyHotKey( HK_FIND_ITEM ), // handled by wxWidgets
_( "Find Item" ), _( "Searches the document for an item" ), find_xpm );
TOOL_ACTION COMMON_ACTIONS::findMove( "pcbnew.InteractiveSelection.FindMove",
TOOL_ACTION PCB_ACTIONS::findMove( "pcbnew.InteractiveSelection.FindMove",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_GET_AND_MOVE_FOOTPRINT ) );
// Edit tool actions
TOOL_ACTION COMMON_ACTIONS::editFootprintInFpEditor( "pcbnew.InteractiveEdit.editFootprintInFpEditor",
TOOL_ACTION PCB_ACTIONS::editFootprintInFpEditor( "pcbnew.InteractiveEdit.editFootprintInFpEditor",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_EDIT_MODULE_WITH_MODEDIT ),
_( "Open in Footprint Editor" ),
_( "Opens the selected footprint in the Footprint Editor" ),
module_editor_xpm );
TOOL_ACTION COMMON_ACTIONS::copyPadToSettings( "pcbnew.InteractiveEdit.copyPadToSettings",
TOOL_ACTION PCB_ACTIONS::copyPadToSettings( "pcbnew.InteractiveEdit.copyPadToSettings",
AS_GLOBAL, 0,
_( "Copy Pad Settings to Current Settings" ),
_( "Copies the properties of selected pad to the current template pad settings." ) );
TOOL_ACTION COMMON_ACTIONS::copySettingsToPads( "pcbnew.InteractiveEdit.copySettingsToPads",
TOOL_ACTION PCB_ACTIONS::copySettingsToPads( "pcbnew.InteractiveEdit.copySettingsToPads",
AS_GLOBAL, 0,
_( "Copy Current Settings to Pads" ),
_( "Copies the current template pad settings to the selected pad(s)." ) );
TOOL_ACTION COMMON_ACTIONS::globalEditPads( "pcbnew.InteractiveEdit.globalPadEdit",
TOOL_ACTION PCB_ACTIONS::globalEditPads( "pcbnew.InteractiveEdit.globalPadEdit",
AS_GLOBAL, 0,
_( "Global Pad Edition" ),
_( "Changes pad properties globally." ), push_pad_settings_xpm );
TOOL_ACTION COMMON_ACTIONS::editActivate( "pcbnew.InteractiveEdit",
TOOL_ACTION PCB_ACTIONS::editActivate( "pcbnew.InteractiveEdit",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_MOVE_ITEM ),
_( "Move" ), _( "Moves the selected item(s)" ), move_xpm, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::duplicate( "pcbnew.InteractiveEdit.duplicate",
TOOL_ACTION PCB_ACTIONS::duplicate( "pcbnew.InteractiveEdit.duplicate",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_DUPLICATE_ITEM ),
_( "Duplicate" ), _( "Duplicates the selected item(s)" ), duplicate_module_xpm );
TOOL_ACTION COMMON_ACTIONS::duplicateIncrement( "pcbnew.InteractiveEdit.duplicateIncrementPads",
TOOL_ACTION PCB_ACTIONS::duplicateIncrement( "pcbnew.InteractiveEdit.duplicateIncrementPads",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_DUPLICATE_ITEM_AND_INCREMENT ),
_( "Duplicate" ), _( "Duplicates the selected item(s), incrementing pad numbers" ) );
TOOL_ACTION COMMON_ACTIONS::moveExact( "pcbnew.InteractiveEdit.moveExact",
TOOL_ACTION PCB_ACTIONS::moveExact( "pcbnew.InteractiveEdit.moveExact",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_MOVE_ITEM_EXACT ),
_( "Move Exactly..." ), _( "Moves the selected item(s) by an exact amount" ),
move_module_xpm );
TOOL_ACTION COMMON_ACTIONS::createArray( "pcbnew.InteractiveEdit.createArray",
TOOL_ACTION PCB_ACTIONS::createArray( "pcbnew.InteractiveEdit.createArray",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_CREATE_ARRAY ),
_( "Create Array" ), _( "Create array" ), array_module_xpm, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::rotateCw( "pcbnew.InteractiveEdit.rotateCw",
TOOL_ACTION PCB_ACTIONS::rotateCw( "pcbnew.InteractiveEdit.rotateCw",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ROTATE_ITEM ),
_( "Rotate Clockwise" ), _( "Rotates selected item(s) clockwise" ),
rotate_cw_xpm, AF_NONE, (void*) 1 );
TOOL_ACTION COMMON_ACTIONS::rotateCcw( "pcbnew.InteractiveEdit.rotateCcw",
TOOL_ACTION PCB_ACTIONS::rotateCcw( "pcbnew.InteractiveEdit.rotateCcw",
AS_GLOBAL, MD_SHIFT + 'R',
_( "Rotate Counter-clockwise" ), _( "Rotates selected item(s) counter-clockwise" ),
rotate_ccw_xpm, AF_NONE, (void*) -1 );
TOOL_ACTION COMMON_ACTIONS::flip( "pcbnew.InteractiveEdit.flip",
TOOL_ACTION PCB_ACTIONS::flip( "pcbnew.InteractiveEdit.flip",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_FLIP_ITEM ),
_( "Flip" ), _( "Flips selected item(s)" ), swap_layer_xpm );
TOOL_ACTION COMMON_ACTIONS::mirror( "pcbnew.InteractiveEdit.mirror",
TOOL_ACTION PCB_ACTIONS::mirror( "pcbnew.InteractiveEdit.mirror",
AS_GLOBAL, 0,
_( "Mirror" ), _( "Mirrors selected item" ), mirror_h_xpm );
TOOL_ACTION COMMON_ACTIONS::remove( "pcbnew.InteractiveEdit.remove",
TOOL_ACTION PCB_ACTIONS::remove( "pcbnew.InteractiveEdit.remove",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_BACK_SPACE ),
_( "Remove" ), _( "Deletes selected item(s)" ), delete_xpm,
AF_NONE, (void*) REMOVE_FLAGS::NORMAL );
TOOL_ACTION COMMON_ACTIONS::removeAlt( "pcbnew.InteractiveEdit.removeAlt",
TOOL_ACTION PCB_ACTIONS::removeAlt( "pcbnew.InteractiveEdit.removeAlt",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_DELETE ),
_( "Remove (Alternative)" ), _( "Deletes selected item(s)" ), delete_xpm,
AF_NONE, (void*) REMOVE_FLAGS::ALT );
TOOL_ACTION COMMON_ACTIONS::exchangeFootprints( "pcbnew.InteractiveEdit.ExchangeFootprints",
TOOL_ACTION PCB_ACTIONS::exchangeFootprints( "pcbnew.InteractiveEdit.ExchangeFootprints",
AS_GLOBAL, 0,
_( "Exchange Footprint(s)" ), _( "Change the footprint used for modules" ),
import_module_xpm );
TOOL_ACTION COMMON_ACTIONS::properties( "pcbnew.InteractiveEdit.properties",
TOOL_ACTION PCB_ACTIONS::properties( "pcbnew.InteractiveEdit.properties",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_EDIT_ITEM ),
_( "Properties..." ), _( "Displays item properties dialog" ), editor_xpm );
TOOL_ACTION COMMON_ACTIONS::editModifiedSelection( "pcbnew.InteractiveEdit.ModifiedSelection",
TOOL_ACTION PCB_ACTIONS::editModifiedSelection( "pcbnew.InteractiveEdit.ModifiedSelection",
AS_GLOBAL, 0,
"", "" );
// Drawing tool actions
TOOL_ACTION COMMON_ACTIONS::drawLine( "pcbnew.InteractiveDrawing.line",
TOOL_ACTION PCB_ACTIONS::drawLine( "pcbnew.InteractiveDrawing.line",
AS_GLOBAL, 0,
_( "Draw Line" ), _( "Draw a line" ), NULL, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::drawCircle( "pcbnew.InteractiveDrawing.circle",
TOOL_ACTION PCB_ACTIONS::drawCircle( "pcbnew.InteractiveDrawing.circle",
AS_GLOBAL, 0,
_( "Draw Circle" ), _( "Draw a circle" ), NULL, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::drawArc( "pcbnew.InteractiveDrawing.arc",
TOOL_ACTION PCB_ACTIONS::drawArc( "pcbnew.InteractiveDrawing.arc",
AS_GLOBAL, 0,
_( "Draw Arc" ), _( "Draw an arc" ), NULL, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::placeText( "pcbnew.InteractiveDrawing.text",
TOOL_ACTION PCB_ACTIONS::placeText( "pcbnew.InteractiveDrawing.text",
AS_GLOBAL, 0,
_( "Add Text" ), _( "Add a text" ), NULL, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::drawDimension( "pcbnew.InteractiveDrawing.dimension",
TOOL_ACTION PCB_ACTIONS::drawDimension( "pcbnew.InteractiveDrawing.dimension",
AS_GLOBAL, 0,
_( "Add Dimension" ), _( "Add a dimension" ), NULL, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::drawZone( "pcbnew.InteractiveDrawing.zone",
TOOL_ACTION PCB_ACTIONS::drawZone( "pcbnew.InteractiveDrawing.zone",
AS_GLOBAL, 0,
_( "Add Filled Zone" ), _( "Add a filled zone" ), NULL, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::drawKeepout( "pcbnew.InteractiveDrawing.keepout",
TOOL_ACTION PCB_ACTIONS::drawKeepout( "pcbnew.InteractiveDrawing.keepout",
AS_GLOBAL, 0,
_( "Add Keepout Area" ), _( "Add a keepout area" ), NULL, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::drawZoneCutout( "pcbnew.InteractiveDrawing.zoneCutout",
TOOL_ACTION PCB_ACTIONS::drawZoneCutout( "pcbnew.InteractiveDrawing.zoneCutout",
AS_GLOBAL, 0,
_( "Add a Zone Cutout" ), _( "Add a cutout area of an existing zone" ),
add_zone_cutout_xpm, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::drawSimilarZone( "pcbnew.InteractiveDrawing.similarZone",
TOOL_ACTION PCB_ACTIONS::drawSimilarZone( "pcbnew.InteractiveDrawing.similarZone",
AS_GLOBAL, 0,
_( "Add a Similar Zone" ), _( "Add a zone with the same settings as an existing zone" ),
add_zone_xpm, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::placeDXF( "pcbnew.InteractiveDrawing.placeDXF",
TOOL_ACTION PCB_ACTIONS::placeDXF( "pcbnew.InteractiveDrawing.placeDXF",
AS_GLOBAL, 0,
"Place DXF", "", NULL, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::setAnchor( "pcbnew.InteractiveDrawing.setAnchor",
TOOL_ACTION PCB_ACTIONS::setAnchor( "pcbnew.InteractiveDrawing.setAnchor",
AS_GLOBAL, 0,
_( "Place the Footprint Anchor" ), _( "Place the footprint anchor" ),
NULL, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::incWidth( "pcbnew.InteractiveDrawing.incWidth",
TOOL_ACTION PCB_ACTIONS::incWidth( "pcbnew.InteractiveDrawing.incWidth",
AS_CONTEXT, '+',
_( "Increase Line Width" ), _( "Increase the line width" ) );
TOOL_ACTION COMMON_ACTIONS::decWidth( "pcbnew.InteractiveDrawing.decWidth",
TOOL_ACTION PCB_ACTIONS::decWidth( "pcbnew.InteractiveDrawing.decWidth",
AS_CONTEXT, '-',
_( "Decrease Line Width" ), _( "Decrease the line width" ) );
TOOL_ACTION COMMON_ACTIONS::arcPosture( "pcbnew.InteractiveDrawing.arcPosture",
TOOL_ACTION PCB_ACTIONS::arcPosture( "pcbnew.InteractiveDrawing.arcPosture",
AS_CONTEXT, TOOL_ACTION::LegacyHotKey( HK_SWITCH_TRACK_POSTURE ),
_( "Switch Arc Posture" ), _( "Switch the arc posture" ) );
// View Controls
TOOL_ACTION COMMON_ACTIONS::zoomIn( "common.Control.zoomIn",
TOOL_ACTION PCB_ACTIONS::zoomIn( "common.Control.zoomIn",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ZOOM_IN ),
_( "Zoom In" ), "", zoom_in_xpm );
TOOL_ACTION COMMON_ACTIONS::zoomOut( "common.Control.zoomOut",
TOOL_ACTION PCB_ACTIONS::zoomOut( "common.Control.zoomOut",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ZOOM_OUT ),
_( "Zoom Out" ), "", zoom_out_xpm );
TOOL_ACTION COMMON_ACTIONS::zoomInCenter( "common.Control.zoomInCenter",
TOOL_ACTION PCB_ACTIONS::zoomInCenter( "common.Control.zoomInCenter",
AS_GLOBAL, 0,
"", "" );
TOOL_ACTION COMMON_ACTIONS::zoomOutCenter( "common.Control.zoomOutCenter",
TOOL_ACTION PCB_ACTIONS::zoomOutCenter( "common.Control.zoomOutCenter",
AS_GLOBAL, 0,
"", "" );
TOOL_ACTION COMMON_ACTIONS::zoomCenter( "common.Control.zoomCenter",
TOOL_ACTION PCB_ACTIONS::zoomCenter( "common.Control.zoomCenter",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ZOOM_CENTER ),
_( "Center" ), "", zoom_center_on_screen_xpm );
TOOL_ACTION COMMON_ACTIONS::zoomFitScreen( "common.Control.zoomFitScreen",
TOOL_ACTION PCB_ACTIONS::zoomFitScreen( "common.Control.zoomFitScreen",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ZOOM_AUTO ),
_( "Zoom Auto" ), "", zoom_fit_in_page_xpm );
TOOL_ACTION COMMON_ACTIONS::zoomPreset( "common.Control.zoomPreset",
TOOL_ACTION PCB_ACTIONS::zoomPreset( "common.Control.zoomPreset",
AS_GLOBAL, 0,
"", "" );
// Display modes
TOOL_ACTION COMMON_ACTIONS::trackDisplayMode( "pcbnew.Control.trackDisplayMode",
TOOL_ACTION PCB_ACTIONS::trackDisplayMode( "pcbnew.Control.trackDisplayMode",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_TRACK_DISPLAY_MODE ),
"", "" );
TOOL_ACTION COMMON_ACTIONS::padDisplayMode( "pcbnew.Control.padDisplayMode",
TOOL_ACTION PCB_ACTIONS::padDisplayMode( "pcbnew.Control.padDisplayMode",
AS_GLOBAL, 0,
"", "" );
TOOL_ACTION COMMON_ACTIONS::viaDisplayMode( "pcbnew.Control.viaDisplayMode",
TOOL_ACTION PCB_ACTIONS::viaDisplayMode( "pcbnew.Control.viaDisplayMode",
AS_GLOBAL, 0,
"", "" );
TOOL_ACTION COMMON_ACTIONS::zoneDisplayEnable( "pcbnew.Control.zoneDisplayEnable",
TOOL_ACTION PCB_ACTIONS::zoneDisplayEnable( "pcbnew.Control.zoneDisplayEnable",
AS_GLOBAL, 0,
"", "" );
TOOL_ACTION COMMON_ACTIONS::zoneDisplayDisable( "pcbnew.Control.zoneDisplayDisable",
TOOL_ACTION PCB_ACTIONS::zoneDisplayDisable( "pcbnew.Control.zoneDisplayDisable",
AS_GLOBAL, 0,
"", "" );
TOOL_ACTION COMMON_ACTIONS::zoneDisplayOutlines( "pcbnew.Control.zoneDisplayOutlines",
TOOL_ACTION PCB_ACTIONS::zoneDisplayOutlines( "pcbnew.Control.zoneDisplayOutlines",
AS_GLOBAL, 0,
"", "" );
TOOL_ACTION COMMON_ACTIONS::highContrastMode( "pcbnew.Control.highContrastMode",
TOOL_ACTION PCB_ACTIONS::highContrastMode( "pcbnew.Control.highContrastMode",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_HIGHCONTRAST_MODE ),
"", "" );
TOOL_ACTION COMMON_ACTIONS::highContrastInc( "pcbnew.Control.highContrastInc",
TOOL_ACTION PCB_ACTIONS::highContrastInc( "pcbnew.Control.highContrastInc",
AS_GLOBAL, '>',
"", "" );
TOOL_ACTION COMMON_ACTIONS::highContrastDec( "pcbnew.Control.highContrastDec",
TOOL_ACTION PCB_ACTIONS::highContrastDec( "pcbnew.Control.highContrastDec",
AS_GLOBAL, '<',
"", "" );
// Layer control
TOOL_ACTION COMMON_ACTIONS::layerTop( "pcbnew.Control.layerTop",
TOOL_ACTION PCB_ACTIONS::layerTop( "pcbnew.Control.layerTop",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_LAYER_TO_COMPONENT ),
"", "", NULL, AF_NONE, (void*) F_Cu );
TOOL_ACTION COMMON_ACTIONS::layerInner1( "pcbnew.Control.layerInner1",
TOOL_ACTION PCB_ACTIONS::layerInner1( "pcbnew.Control.layerInner1",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_LAYER_TO_INNER1 ),
"", "", NULL, AF_NONE, (void*) In1_Cu );
TOOL_ACTION COMMON_ACTIONS::layerInner2( "pcbnew.Control.layerInner2",
TOOL_ACTION PCB_ACTIONS::layerInner2( "pcbnew.Control.layerInner2",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_LAYER_TO_INNER2 ),
"", "", NULL, AF_NONE, (void*) In2_Cu );
TOOL_ACTION COMMON_ACTIONS::layerInner3( "pcbnew.Control.layerInner3",
TOOL_ACTION PCB_ACTIONS::layerInner3( "pcbnew.Control.layerInner3",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_LAYER_TO_INNER3 ),
"", "", NULL, AF_NONE, (void*) In3_Cu );
TOOL_ACTION COMMON_ACTIONS::layerInner4( "pcbnew.Control.layerInner4",
TOOL_ACTION PCB_ACTIONS::layerInner4( "pcbnew.Control.layerInner4",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_LAYER_TO_INNER4 ),
"", "", NULL, AF_NONE, (void*) In4_Cu );
TOOL_ACTION COMMON_ACTIONS::layerInner5( "pcbnew.Control.layerInner5",
TOOL_ACTION PCB_ACTIONS::layerInner5( "pcbnew.Control.layerInner5",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_LAYER_TO_INNER5 ),
"", "", NULL, AF_NONE, (void*) In5_Cu );
TOOL_ACTION COMMON_ACTIONS::layerInner6( "pcbnew.Control.layerInner6",
TOOL_ACTION PCB_ACTIONS::layerInner6( "pcbnew.Control.layerInner6",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_LAYER_TO_INNER6 ),
"", "", NULL, AF_NONE, (void*) In6_Cu );
TOOL_ACTION COMMON_ACTIONS::layerBottom( "pcbnew.Control.layerBottom",
TOOL_ACTION PCB_ACTIONS::layerBottom( "pcbnew.Control.layerBottom",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_LAYER_TO_COPPER ),
"", "", NULL, AF_NONE, (void*) B_Cu );
TOOL_ACTION COMMON_ACTIONS::layerNext( "pcbnew.Control.layerNext",
TOOL_ACTION PCB_ACTIONS::layerNext( "pcbnew.Control.layerNext",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_LAYER_TO_NEXT ),
"", "" );
TOOL_ACTION COMMON_ACTIONS::layerPrev( "pcbnew.Control.layerPrev",
TOOL_ACTION PCB_ACTIONS::layerPrev( "pcbnew.Control.layerPrev",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_LAYER_TO_PREVIOUS ),
"", "" );
TOOL_ACTION COMMON_ACTIONS::layerToggle( "pcbnew.Control.layerToggle",
TOOL_ACTION PCB_ACTIONS::layerToggle( "pcbnew.Control.layerToggle",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ADD_THROUGH_VIA ),
"", "" );
TOOL_ACTION COMMON_ACTIONS::layerAlphaInc( "pcbnew.Control.layerAlphaInc",
TOOL_ACTION PCB_ACTIONS::layerAlphaInc( "pcbnew.Control.layerAlphaInc",
AS_GLOBAL, '}',
"", "" );
TOOL_ACTION COMMON_ACTIONS::layerAlphaDec( "pcbnew.Control.layerAlphaDec",
TOOL_ACTION PCB_ACTIONS::layerAlphaDec( "pcbnew.Control.layerAlphaDec",
AS_GLOBAL, '{',
"", "" );
TOOL_ACTION COMMON_ACTIONS::layerChanged( "pcbnew.Control.layerChanged",
TOOL_ACTION PCB_ACTIONS::layerChanged( "pcbnew.Control.layerChanged",
AS_GLOBAL, 0,
"", "", NULL, AF_NOTIFY );
// Grid control
TOOL_ACTION COMMON_ACTIONS::gridFast1( "common.Control.gridFast1",
TOOL_ACTION PCB_ACTIONS::gridFast1( "common.Control.gridFast1",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_GRID_TO_FASTGRID1 ),
"", "" );
TOOL_ACTION COMMON_ACTIONS::gridFast2( "common.Control.gridFast2",
TOOL_ACTION PCB_ACTIONS::gridFast2( "common.Control.gridFast2",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_GRID_TO_FASTGRID2 ),
"", "" );
TOOL_ACTION COMMON_ACTIONS::gridNext( "common.Control.gridNext",
TOOL_ACTION PCB_ACTIONS::gridNext( "common.Control.gridNext",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_GRID_TO_NEXT ),
"", "" );
TOOL_ACTION COMMON_ACTIONS::gridPrev( "common.Control.gridPrev",
TOOL_ACTION PCB_ACTIONS::gridPrev( "common.Control.gridPrev",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_GRID_TO_PREVIOUS ),
"", "" );
TOOL_ACTION COMMON_ACTIONS::gridSetOrigin( "common.Control.gridSetOrigin",
TOOL_ACTION PCB_ACTIONS::gridSetOrigin( "common.Control.gridSetOrigin",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SET_GRID_ORIGIN ),
"", "" );
TOOL_ACTION COMMON_ACTIONS::gridResetOrigin( "common.Control.gridResetOrigin",
TOOL_ACTION PCB_ACTIONS::gridResetOrigin( "common.Control.gridResetOrigin",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_RESET_GRID_ORIGIN ),
"", "" );
TOOL_ACTION COMMON_ACTIONS::gridPreset( "common.Control.gridPreset",
TOOL_ACTION PCB_ACTIONS::gridPreset( "common.Control.gridPreset",
AS_GLOBAL, 0,
"", "" );
// Track & via size control
TOOL_ACTION COMMON_ACTIONS::trackWidthInc( "pcbnew.EditorControl.trackWidthInc",
TOOL_ACTION PCB_ACTIONS::trackWidthInc( "pcbnew.EditorControl.trackWidthInc",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_TRACK_WIDTH_TO_NEXT ),
"", "" );
TOOL_ACTION COMMON_ACTIONS::trackWidthDec( "pcbnew.EditorControl.trackWidthDec",
TOOL_ACTION PCB_ACTIONS::trackWidthDec( "pcbnew.EditorControl.trackWidthDec",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_TRACK_WIDTH_TO_PREVIOUS ),
"", "" );
TOOL_ACTION COMMON_ACTIONS::viaSizeInc( "pcbnew.EditorControl.viaSizeInc",
TOOL_ACTION PCB_ACTIONS::viaSizeInc( "pcbnew.EditorControl.viaSizeInc",
AS_GLOBAL, '\'',
"", "" );
TOOL_ACTION COMMON_ACTIONS::viaSizeDec( "pcbnew.EditorControl.viaSizeDec",
TOOL_ACTION PCB_ACTIONS::viaSizeDec( "pcbnew.EditorControl.viaSizeDec",
AS_GLOBAL, '\\',
"", "" );
TOOL_ACTION COMMON_ACTIONS::trackViaSizeChanged( "pcbnew.EditorControl.trackViaSizeChanged",
TOOL_ACTION PCB_ACTIONS::trackViaSizeChanged( "pcbnew.EditorControl.trackViaSizeChanged",
AS_GLOBAL, 0,
"", "", NULL, AF_NOTIFY );
// Zone actions
TOOL_ACTION COMMON_ACTIONS::zoneFill( "pcbnew.EditorControl.zoneFill",
TOOL_ACTION PCB_ACTIONS::zoneFill( "pcbnew.EditorControl.zoneFill",
AS_GLOBAL, 0,
_( "Fill" ), _( "Fill zone(s)" ), fill_zone_xpm );
TOOL_ACTION COMMON_ACTIONS::zoneFillAll( "pcbnew.EditorControl.zoneFillAll",
TOOL_ACTION PCB_ACTIONS::zoneFillAll( "pcbnew.EditorControl.zoneFillAll",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ZONE_FILL_OR_REFILL ),
_( "Fill All" ), _( "Fill all zones" ) );
TOOL_ACTION COMMON_ACTIONS::zoneUnfill( "pcbnew.EditorControl.zoneUnfill",
TOOL_ACTION PCB_ACTIONS::zoneUnfill( "pcbnew.EditorControl.zoneUnfill",
AS_GLOBAL, 0,
_( "Unfill" ), _( "Unfill zone(s)" ), zone_unfill_xpm );
TOOL_ACTION COMMON_ACTIONS::zoneUnfillAll( "pcbnew.EditorControl.zoneUnfillAll",
TOOL_ACTION PCB_ACTIONS::zoneUnfillAll( "pcbnew.EditorControl.zoneUnfillAll",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ZONE_REMOVE_FILLED ),
_( "Unfill All" ), _( "Unfill all zones" ) );
TOOL_ACTION COMMON_ACTIONS::zoneMerge( "pcbnew.EditorControl.zoneMerge",
TOOL_ACTION PCB_ACTIONS::zoneMerge( "pcbnew.EditorControl.zoneMerge",
AS_GLOBAL, 0,
_( "Merge Zones" ), _( "Merge zones" ) );
TOOL_ACTION COMMON_ACTIONS::zoneDuplicate( "pcbnew.EditorControl.zoneDuplicate",
TOOL_ACTION PCB_ACTIONS::zoneDuplicate( "pcbnew.EditorControl.zoneDuplicate",
AS_GLOBAL, 0,
_( "Duplicate Zone onto Layer" ), _( "Duplicate zone outline onto a different layer" ),
zone_duplicate_xpm );
TOOL_ACTION COMMON_ACTIONS::placeTarget( "pcbnew.EditorControl.placeTarget",
TOOL_ACTION PCB_ACTIONS::placeTarget( "pcbnew.EditorControl.placeTarget",
AS_GLOBAL, 0,
_( "Add Layer Alignment Target" ), _( "Add a layer alignment target" ), NULL, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::placeModule( "pcbnew.EditorControl.placeModule",
TOOL_ACTION PCB_ACTIONS::placeModule( "pcbnew.EditorControl.placeModule",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ADD_MODULE ),
_( "Add Footprint" ), _( "Add a footprint" ), NULL, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::drillOrigin( "pcbnew.EditorControl.drillOrigin",
TOOL_ACTION PCB_ACTIONS::drillOrigin( "pcbnew.EditorControl.drillOrigin",
AS_GLOBAL, 0,
"", "" );
TOOL_ACTION COMMON_ACTIONS::crossProbeSchToPcb( "pcbnew.EditorControl.crossProbSchToPcb",
TOOL_ACTION PCB_ACTIONS::crossProbeSchToPcb( "pcbnew.EditorControl.crossProbSchToPcb",
AS_GLOBAL, 0,
"", "" );
TOOL_ACTION COMMON_ACTIONS::toggleLock( "pcbnew.EditorControl.toggleLock",
TOOL_ACTION PCB_ACTIONS::toggleLock( "pcbnew.EditorControl.toggleLock",
AS_GLOBAL, 'L',
"Toggle Lock", "" );
TOOL_ACTION COMMON_ACTIONS::lock( "pcbnew.EditorControl.lock",
TOOL_ACTION PCB_ACTIONS::lock( "pcbnew.EditorControl.lock",
AS_GLOBAL, 0,
_( "Lock" ), "" );
TOOL_ACTION COMMON_ACTIONS::unlock( "pcbnew.EditorControl.unlock",
TOOL_ACTION PCB_ACTIONS::unlock( "pcbnew.EditorControl.unlock",
AS_GLOBAL, 0,
_( "Unlock" ), "" );
TOOL_ACTION COMMON_ACTIONS::appendBoard( "pcbnew.EditorControl.appendBoard",
TOOL_ACTION PCB_ACTIONS::appendBoard( "pcbnew.EditorControl.appendBoard",
AS_GLOBAL, 0,
"", "" );
TOOL_ACTION COMMON_ACTIONS::highlightNet( "pcbnew.EditorControl.highlightNet",
TOOL_ACTION PCB_ACTIONS::highlightNet( "pcbnew.EditorControl.highlightNet",
AS_GLOBAL, 0,
"", "" );
TOOL_ACTION COMMON_ACTIONS::highlightNetCursor( "pcbnew.EditorControl.highlightNetCursor",
TOOL_ACTION PCB_ACTIONS::highlightNetCursor( "pcbnew.EditorControl.highlightNetCursor",
AS_GLOBAL, 0,
"", "" );
// Module editor tools
TOOL_ACTION COMMON_ACTIONS::placePad( "pcbnew.ModuleEditor.placePad",
TOOL_ACTION PCB_ACTIONS::placePad( "pcbnew.ModuleEditor.placePad",
AS_GLOBAL, 0,
_( "Add Pad" ), _( "Add a pad" ), NULL, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::enumeratePads( "pcbnew.ModuleEditor.enumeratePads",
TOOL_ACTION PCB_ACTIONS::enumeratePads( "pcbnew.ModuleEditor.enumeratePads",
AS_GLOBAL, 0,
_( "Enumerate Pads" ), _( "Enumerate pads" ), pad_enumerate_xpm, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::copyItems( "pcbnew.ModuleEditor.copyItems",
TOOL_ACTION PCB_ACTIONS::copyItems( "pcbnew.ModuleEditor.copyItems",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_COPY_ITEM ),
_( "Copy" ), _( "Copy items" ), NULL, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::pasteItems( "pcbnew.ModuleEditor.pasteItems",
TOOL_ACTION PCB_ACTIONS::pasteItems( "pcbnew.ModuleEditor.pasteItems",
AS_GLOBAL, MD_CTRL + int( 'V' ),
_( "Paste" ), _( "Paste items" ), NULL, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::moduleEdgeOutlines( "pcbnew.ModuleEditor.graphicOutlines",
TOOL_ACTION PCB_ACTIONS::moduleEdgeOutlines( "pcbnew.ModuleEditor.graphicOutlines",
AS_GLOBAL, 0,
"", "" );
TOOL_ACTION COMMON_ACTIONS::moduleTextOutlines( "pcbnew.ModuleEditor.textOutlines",
TOOL_ACTION PCB_ACTIONS::moduleTextOutlines( "pcbnew.ModuleEditor.textOutlines",
AS_GLOBAL, 0,
"", "" );
// Pad tools
TOOL_ACTION COMMON_ACTIONS::copyPadSettings(
TOOL_ACTION PCB_ACTIONS::copyPadSettings(
"pcbnew.PadTool.CopyPadSettings",
AS_GLOBAL, 0,
_( "Copy Pad Settings" ), _( "Copy current pad's settings to the board design settings" ),
copy_pad_settings_xpm );
TOOL_ACTION COMMON_ACTIONS::applyPadSettings(
TOOL_ACTION PCB_ACTIONS::applyPadSettings(
"pcbnew.PadTool.ApplyPadSettings",
AS_GLOBAL, 0,
_( "Apply Pad Settings" ), _( "Copy the board design settings pad properties to the current pad" ),
apply_pad_settings_xpm );
TOOL_ACTION COMMON_ACTIONS::pushPadSettings(
TOOL_ACTION PCB_ACTIONS::pushPadSettings(
"pcbnew.PadTool.PushPadSettings",
AS_GLOBAL, 0,
_( "Push Pad Settings" ), _( "Copy the current pad settings to other pads" ),
push_pad_settings_xpm );
// Cursor control
TOOL_ACTION COMMON_ACTIONS::cursorUp( "pcbnew.Control.cursorUp",
TOOL_ACTION PCB_ACTIONS::cursorUp( "pcbnew.Control.cursorUp",
AS_GLOBAL, WXK_UP, "", "", NULL, AF_NONE, (void*) CURSOR_UP );
TOOL_ACTION COMMON_ACTIONS::cursorDown( "pcbnew.Control.cursorDown",
TOOL_ACTION PCB_ACTIONS::cursorDown( "pcbnew.Control.cursorDown",
AS_GLOBAL, WXK_DOWN, "", "" , NULL, AF_NONE, (void*) CURSOR_DOWN );
TOOL_ACTION COMMON_ACTIONS::cursorLeft( "pcbnew.Control.cursorLeft",
TOOL_ACTION PCB_ACTIONS::cursorLeft( "pcbnew.Control.cursorLeft",
AS_GLOBAL, WXK_LEFT, "", "" , NULL, AF_NONE, (void*) CURSOR_LEFT );
TOOL_ACTION COMMON_ACTIONS::cursorRight( "pcbnew.Control.cursorRight",
TOOL_ACTION PCB_ACTIONS::cursorRight( "pcbnew.Control.cursorRight",
AS_GLOBAL, WXK_RIGHT, "", "" , NULL, AF_NONE, (void*) CURSOR_RIGHT );
TOOL_ACTION COMMON_ACTIONS::cursorUpFast( "pcbnew.Control.cursorUpFast",
TOOL_ACTION PCB_ACTIONS::cursorUpFast( "pcbnew.Control.cursorUpFast",
AS_GLOBAL, MD_CTRL + WXK_UP, "", "", NULL, AF_NONE, (void*) ( CURSOR_UP | CURSOR_FAST_MOVE ) );
TOOL_ACTION COMMON_ACTIONS::cursorDownFast( "pcbnew.Control.cursorDownFast",
TOOL_ACTION PCB_ACTIONS::cursorDownFast( "pcbnew.Control.cursorDownFast",
AS_GLOBAL, MD_CTRL + WXK_DOWN, "", "" , NULL, AF_NONE, (void*) ( CURSOR_DOWN | CURSOR_FAST_MOVE ) );
TOOL_ACTION COMMON_ACTIONS::cursorLeftFast( "pcbnew.Control.cursorLeftFast",
TOOL_ACTION PCB_ACTIONS::cursorLeftFast( "pcbnew.Control.cursorLeftFast",
AS_GLOBAL, MD_CTRL + WXK_LEFT, "", "" , NULL, AF_NONE, (void*) ( CURSOR_LEFT | CURSOR_FAST_MOVE ) );
TOOL_ACTION COMMON_ACTIONS::cursorRightFast( "pcbnew.Control.cursorRightFast",
TOOL_ACTION PCB_ACTIONS::cursorRightFast( "pcbnew.Control.cursorRightFast",
AS_GLOBAL, MD_CTRL + WXK_RIGHT, "", "" , NULL, AF_NONE, (void*) ( CURSOR_RIGHT | CURSOR_FAST_MOVE ) );
TOOL_ACTION COMMON_ACTIONS::cursorClick( "pcbnew.Control.cursorClick",
TOOL_ACTION PCB_ACTIONS::cursorClick( "pcbnew.Control.cursorClick",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_LEFT_CLICK ),
"", "", NULL, AF_NONE, (void*) CURSOR_CLICK );
TOOL_ACTION COMMON_ACTIONS::cursorDblClick( "pcbnew.Control.cursorDblClick",
TOOL_ACTION PCB_ACTIONS::cursorDblClick( "pcbnew.Control.cursorDblClick",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_LEFT_DCLICK ),
"", "", NULL, AF_NONE, (void*) CURSOR_DBL_CLICK );
TOOL_ACTION COMMON_ACTIONS::panUp( "pcbnew.Control.panUp",
TOOL_ACTION PCB_ACTIONS::panUp( "pcbnew.Control.panUp",
AS_GLOBAL, MD_SHIFT + WXK_UP, "", "", NULL, AF_NONE, (void*) CURSOR_UP );
TOOL_ACTION COMMON_ACTIONS::panDown( "pcbnew.Control.panDown",
TOOL_ACTION PCB_ACTIONS::panDown( "pcbnew.Control.panDown",
AS_GLOBAL, MD_SHIFT + WXK_DOWN, "", "" , NULL, AF_NONE, (void*) CURSOR_DOWN );
TOOL_ACTION COMMON_ACTIONS::panLeft( "pcbnew.Control.panLeft",
TOOL_ACTION PCB_ACTIONS::panLeft( "pcbnew.Control.panLeft",
AS_GLOBAL, MD_SHIFT + WXK_LEFT, "", "" , NULL, AF_NONE, (void*) CURSOR_LEFT );
TOOL_ACTION COMMON_ACTIONS::panRight( "pcbnew.Control.panRight",
TOOL_ACTION PCB_ACTIONS::panRight( "pcbnew.Control.panRight",
AS_GLOBAL, MD_SHIFT + WXK_RIGHT, "", "" , NULL, AF_NONE, (void*) CURSOR_RIGHT );
// Miscellaneous
TOOL_ACTION COMMON_ACTIONS::selectionTool( "pcbnew.Control.selectionTool",
TOOL_ACTION PCB_ACTIONS::selectionTool( "pcbnew.Control.selectionTool",
AS_GLOBAL, 0,
"", "", NULL, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::zoomTool( "pcbnew.Control.zoomTool",
TOOL_ACTION PCB_ACTIONS::zoomTool( "pcbnew.Control.zoomTool",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ZOOM_SELECTION ),
_( "Zoom to Selection" ), "", NULL, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::pickerTool( "pcbnew.Picker", AS_GLOBAL, 0, "", "", NULL, AF_ACTIVATE );
TOOL_ACTION PCB_ACTIONS::pickerTool( "pcbnew.Picker", AS_GLOBAL, 0, "", "", NULL, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::resetCoords( "pcbnew.Control.resetCoords",
TOOL_ACTION PCB_ACTIONS::resetCoords( "pcbnew.Control.resetCoords",
AS_GLOBAL, ' ',
"", "" );
TOOL_ACTION COMMON_ACTIONS::switchCursor( "pcbnew.Control.switchCursor",
TOOL_ACTION PCB_ACTIONS::switchCursor( "pcbnew.Control.switchCursor",
AS_GLOBAL, 0,
"", "" );
TOOL_ACTION COMMON_ACTIONS::switchUnits( "pcbnew.Control.switchUnits",
TOOL_ACTION PCB_ACTIONS::switchUnits( "pcbnew.Control.switchUnits",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_UNITS ),
"", "" );
TOOL_ACTION COMMON_ACTIONS::deleteItemCursor( "pcbnew.Control.deleteItemCursor",
TOOL_ACTION PCB_ACTIONS::deleteItemCursor( "pcbnew.Control.deleteItemCursor",
AS_GLOBAL, 0,
"", "" );
TOOL_ACTION COMMON_ACTIONS::showHelp( "pcbnew.Control.showHelp",
TOOL_ACTION PCB_ACTIONS::showHelp( "pcbnew.Control.showHelp",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_HELP ),
"", "" );
TOOL_ACTION COMMON_ACTIONS::toBeDone( "pcbnew.Control.toBeDone",
TOOL_ACTION PCB_ACTIONS::toBeDone( "pcbnew.Control.toBeDone",
AS_GLOBAL, 0, // dialog saying it is not implemented yet
"", "" ); // so users are aware of that
TOOL_ACTION COMMON_ACTIONS::routerActivateSingle( "pcbnew.InteractiveRouter.SingleTrack",
TOOL_ACTION PCB_ACTIONS::routerActivateSingle( "pcbnew.InteractiveRouter.SingleTrack",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ADD_NEW_TRACK ),
_( "Interactive Router (Single Tracks)" ),
_( "Run push & shove router (single tracks)" ), ps_router_xpm, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::routerActivateDiffPair( "pcbnew.InteractiveRouter.DiffPair",
TOOL_ACTION PCB_ACTIONS::routerActivateDiffPair( "pcbnew.InteractiveRouter.DiffPair",
AS_GLOBAL, '6',
_( "Interactive Router (Differential Pairs)" ),
_( "Run push & shove router (differential pairs)" ), ps_diff_pair_xpm, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::routerActivateSettingsDialog( "pcbnew.InteractiveRouter.SettingsDialog",
TOOL_ACTION PCB_ACTIONS::routerActivateSettingsDialog( "pcbnew.InteractiveRouter.SettingsDialog",
AS_GLOBAL, 0,
_( "Interactive Router Settings" ),
_( "Open Interactive Router settings" ), NULL, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::routerActivateDpDimensionsDialog( "pcbnew.InteractiveRouter.DpDimensionsDialog",
TOOL_ACTION PCB_ACTIONS::routerActivateDpDimensionsDialog( "pcbnew.InteractiveRouter.DpDimensionsDialog",
AS_GLOBAL, 0,
_( "Differential Pair Dimension settings" ),
_( "Open Differential Pair Dimension settings" ), ps_diff_pair_gap_xpm, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::routerActivateTuneSingleTrace( "pcbnew.LengthTuner.TuneSingleTrack",
TOOL_ACTION PCB_ACTIONS::routerActivateTuneSingleTrace( "pcbnew.LengthTuner.TuneSingleTrack",
AS_GLOBAL, '7',
_( "Tune length of a single track" ), "", ps_tune_length_xpm, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::routerActivateTuneDiffPair( "pcbnew.LengthTuner.TuneDiffPair",
TOOL_ACTION PCB_ACTIONS::routerActivateTuneDiffPair( "pcbnew.LengthTuner.TuneDiffPair",
AS_GLOBAL, '8',
_( "Tune length of a differential pair" ), "", NULL, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::routerActivateTuneDiffPairSkew( "pcbnew.LengthTuner.TuneDiffPairSkew",
TOOL_ACTION PCB_ACTIONS::routerActivateTuneDiffPairSkew( "pcbnew.LengthTuner.TuneDiffPairSkew",
AS_GLOBAL, '9',
_( "Tune skew of a differential pair" ), "", NULL, AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::routerInlineDrag( "pcbnew.InteractiveRouter.InlineDrag",
TOOL_ACTION PCB_ACTIONS::routerInlineDrag( "pcbnew.InteractiveRouter.InlineDrag",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_DRAG_TRACK_KEEP_SLOPE ),
_( "Drag Track/Via" ), _( "Drags tracks and vias without breaking connections" ),
drag_track_segment_xpm );
// Point editor
TOOL_ACTION COMMON_ACTIONS::pointEditorAddCorner( "pcbnew.PointEditor.addCorner",
TOOL_ACTION PCB_ACTIONS::pointEditorAddCorner( "pcbnew.PointEditor.addCorner",
AS_GLOBAL, 0,
_( "Create Corner" ), _( "Create a corner" ), add_corner_xpm );
TOOL_ACTION COMMON_ACTIONS::pointEditorRemoveCorner( "pcbnew.PointEditor.removeCorner",
TOOL_ACTION PCB_ACTIONS::pointEditorRemoveCorner( "pcbnew.PointEditor.removeCorner",
AS_GLOBAL, 0,
_( "Remove Corner" ), _( "Remove corner" ), delete_xpm );
// Placement tool
TOOL_ACTION COMMON_ACTIONS::alignTop( "pcbnew.Place.alignTop",
TOOL_ACTION PCB_ACTIONS::alignTop( "pcbnew.Place.alignTop",
AS_GLOBAL, 0,
_( "Align to Top" ),
_( "Aligns selected items to the top edge" ), up_xpm );
TOOL_ACTION COMMON_ACTIONS::alignBottom( "pcbnew.Place.alignBottom",
TOOL_ACTION PCB_ACTIONS::alignBottom( "pcbnew.Place.alignBottom",
AS_GLOBAL, 0,
_( "Align to Bottom" ),
_( "Aligns selected items to the bottom edge" ), down_xpm );
TOOL_ACTION COMMON_ACTIONS::alignLeft( "pcbnew.Place.alignLeft",
TOOL_ACTION PCB_ACTIONS::alignLeft( "pcbnew.Place.alignLeft",
AS_GLOBAL, 0,
_( "Align to Left" ),
_( "Aligns selected items to the left edge" ), left_xpm );
TOOL_ACTION COMMON_ACTIONS::alignRight( "pcbnew.Place.alignRight",
TOOL_ACTION PCB_ACTIONS::alignRight( "pcbnew.Place.alignRight",
AS_GLOBAL, 0,
_( "Align to Right" ),
_( "Aligns selected items to the right edge" ), right_xpm );
TOOL_ACTION COMMON_ACTIONS::distributeHorizontally( "pcbnew.Place.distributeHorizontally",
TOOL_ACTION PCB_ACTIONS::distributeHorizontally( "pcbnew.Place.distributeHorizontally",
AS_GLOBAL, 0,
_( "Distribute Horizontally" ),
_( "Distributes selected items along the horizontal axis" ), distribute_horizontal_xpm );
TOOL_ACTION COMMON_ACTIONS::distributeVertically( "pcbnew.Place.distributeVertically",
TOOL_ACTION PCB_ACTIONS::distributeVertically( "pcbnew.Place.distributeVertically",
AS_GLOBAL, 0,
_( "Distribute Vertically" ),
_( "Distributes selected items along the vertical axis" ), distribute_vertical_xpm );
boost::optional<TOOL_EVENT> COMMON_ACTIONS::TranslateLegacyId( int aId )
boost::optional<TOOL_EVENT> PCB_ACTIONS::TranslateLegacyId( int aId )
{
switch( aId )
{
case ID_PCB_MODULE_BUTT:
return COMMON_ACTIONS::placeModule.MakeEvent();
return PCB_ACTIONS::placeModule.MakeEvent();
case ID_TRACK_BUTT:
return COMMON_ACTIONS::routerActivateSingle.MakeEvent();
return PCB_ACTIONS::routerActivateSingle.MakeEvent();
case ID_DIFF_PAIR_BUTT:
return COMMON_ACTIONS::routerActivateDiffPair.MakeEvent();
return PCB_ACTIONS::routerActivateDiffPair.MakeEvent();
case ID_TUNE_SINGLE_TRACK_LEN_BUTT:
return COMMON_ACTIONS::routerActivateTuneSingleTrace.MakeEvent();
return PCB_ACTIONS::routerActivateTuneSingleTrace.MakeEvent();
case ID_TUNE_DIFF_PAIR_LEN_BUTT:
return COMMON_ACTIONS::routerActivateTuneDiffPair.MakeEvent();
return PCB_ACTIONS::routerActivateTuneDiffPair.MakeEvent();
case ID_TUNE_DIFF_PAIR_SKEW_BUTT:
return COMMON_ACTIONS::routerActivateTuneDiffPairSkew.MakeEvent();
return PCB_ACTIONS::routerActivateTuneDiffPairSkew.MakeEvent();
case ID_MENU_INTERACTIVE_ROUTER_SETTINGS:
return COMMON_ACTIONS::routerActivateSettingsDialog.MakeEvent();
return PCB_ACTIONS::routerActivateSettingsDialog.MakeEvent();
case ID_MENU_DIFF_PAIR_DIMENSIONS:
return COMMON_ACTIONS::routerActivateDpDimensionsDialog.MakeEvent();
return PCB_ACTIONS::routerActivateDpDimensionsDialog.MakeEvent();
case ID_PCB_ZONES_BUTT:
return COMMON_ACTIONS::drawZone.MakeEvent();
return PCB_ACTIONS::drawZone.MakeEvent();
case ID_PCB_KEEPOUT_AREA_BUTT:
return COMMON_ACTIONS::drawKeepout.MakeEvent();
return PCB_ACTIONS::drawKeepout.MakeEvent();
case ID_PCB_ADD_LINE_BUTT:
case ID_MODEDIT_LINE_TOOL:
return COMMON_ACTIONS::drawLine.MakeEvent();
return PCB_ACTIONS::drawLine.MakeEvent();
case ID_PCB_CIRCLE_BUTT:
case ID_MODEDIT_CIRCLE_TOOL:
return COMMON_ACTIONS::drawCircle.MakeEvent();
return PCB_ACTIONS::drawCircle.MakeEvent();
case ID_PCB_ARC_BUTT:
case ID_MODEDIT_ARC_TOOL:
return COMMON_ACTIONS::drawArc.MakeEvent();
return PCB_ACTIONS::drawArc.MakeEvent();
case ID_PCB_ADD_TEXT_BUTT:
case ID_MODEDIT_TEXT_TOOL:
return COMMON_ACTIONS::placeText.MakeEvent();
return PCB_ACTIONS::placeText.MakeEvent();
case ID_PCB_DIMENSION_BUTT:
return COMMON_ACTIONS::drawDimension.MakeEvent();
return PCB_ACTIONS::drawDimension.MakeEvent();
case ID_PCB_MIRE_BUTT:
return COMMON_ACTIONS::placeTarget.MakeEvent();
return PCB_ACTIONS::placeTarget.MakeEvent();
case ID_MODEDIT_PAD_TOOL:
return COMMON_ACTIONS::placePad.MakeEvent();
return PCB_ACTIONS::placePad.MakeEvent();
case ID_GEN_IMPORT_DXF_FILE:
return COMMON_ACTIONS::placeDXF.MakeEvent();
return PCB_ACTIONS::placeDXF.MakeEvent();
case ID_MODEDIT_ANCHOR_TOOL:
return COMMON_ACTIONS::setAnchor.MakeEvent();
return PCB_ACTIONS::setAnchor.MakeEvent();
case ID_PCB_PLACE_GRID_COORD_BUTT:
case ID_MODEDIT_PLACE_GRID_COORD:
return COMMON_ACTIONS::gridSetOrigin.MakeEvent();
return PCB_ACTIONS::gridSetOrigin.MakeEvent();
case ID_ZOOM_IN: // toolbar button "Zoom In"
return COMMON_ACTIONS::zoomInCenter.MakeEvent();
return PCB_ACTIONS::zoomInCenter.MakeEvent();
case ID_ZOOM_OUT: // toolbar button "Zoom In"
return COMMON_ACTIONS::zoomOutCenter.MakeEvent();
return PCB_ACTIONS::zoomOutCenter.MakeEvent();
case ID_ZOOM_PAGE: // toolbar button "Fit on Screen"
return COMMON_ACTIONS::zoomFitScreen.MakeEvent();
return PCB_ACTIONS::zoomFitScreen.MakeEvent();
case ID_TB_OPTIONS_SHOW_TRACKS_SKETCH:
return COMMON_ACTIONS::trackDisplayMode.MakeEvent();
return PCB_ACTIONS::trackDisplayMode.MakeEvent();
case ID_TB_OPTIONS_SHOW_PADS_SKETCH:
return COMMON_ACTIONS::padDisplayMode.MakeEvent();
return PCB_ACTIONS::padDisplayMode.MakeEvent();
case ID_TB_OPTIONS_SHOW_VIAS_SKETCH:
return COMMON_ACTIONS::viaDisplayMode.MakeEvent();
return PCB_ACTIONS::viaDisplayMode.MakeEvent();
case ID_TB_OPTIONS_SHOW_ZONES:
return COMMON_ACTIONS::zoneDisplayEnable.MakeEvent();
return PCB_ACTIONS::zoneDisplayEnable.MakeEvent();
case ID_TB_OPTIONS_SHOW_ZONES_DISABLE:
return COMMON_ACTIONS::zoneDisplayDisable.MakeEvent();
return PCB_ACTIONS::zoneDisplayDisable.MakeEvent();
case ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY:
return COMMON_ACTIONS::zoneDisplayOutlines.MakeEvent();
return PCB_ACTIONS::zoneDisplayOutlines.MakeEvent();
case ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH:
return COMMON_ACTIONS::moduleEdgeOutlines.MakeEvent();
return PCB_ACTIONS::moduleEdgeOutlines.MakeEvent();
case ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH:
return COMMON_ACTIONS::moduleTextOutlines.MakeEvent();
return PCB_ACTIONS::moduleTextOutlines.MakeEvent();
case ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE:
return COMMON_ACTIONS::highContrastMode.MakeEvent();
return PCB_ACTIONS::highContrastMode.MakeEvent();
case ID_FIND_ITEMS:
return COMMON_ACTIONS::find.MakeEvent();
return PCB_ACTIONS::find.MakeEvent();
case ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST:
return COMMON_ACTIONS::findMove.MakeEvent();
return PCB_ACTIONS::findMove.MakeEvent();
case ID_NO_TOOL_SELECTED:
return COMMON_ACTIONS::selectionTool.MakeEvent();
return PCB_ACTIONS::selectionTool.MakeEvent();
case ID_ZOOM_SELECTION:
return COMMON_ACTIONS::zoomTool.MakeEvent();
return PCB_ACTIONS::zoomTool.MakeEvent();
case ID_PCB_DELETE_ITEM_BUTT:
case ID_MODEDIT_DELETE_TOOL:
return COMMON_ACTIONS::deleteItemCursor.MakeEvent();
return PCB_ACTIONS::deleteItemCursor.MakeEvent();
case ID_PCB_PLACE_OFFSET_COORD_BUTT:
return COMMON_ACTIONS::drillOrigin.MakeEvent();
return PCB_ACTIONS::drillOrigin.MakeEvent();
case ID_PCB_HIGHLIGHT_BUTT:
return COMMON_ACTIONS::highlightNetCursor.MakeEvent();
return PCB_ACTIONS::highlightNetCursor.MakeEvent();
case ID_APPEND_FILE:
return COMMON_ACTIONS::appendBoard.MakeEvent();
return PCB_ACTIONS::appendBoard.MakeEvent();
case ID_PCB_SHOW_1_RATSNEST_BUTT:
return COMMON_ACTIONS::toBeDone.MakeEvent();
return PCB_ACTIONS::toBeDone.MakeEvent();
}
return boost::optional<TOOL_EVENT>();

View File

@ -23,22 +23,23 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __COMMON_ACTIONS_H
#define __COMMON_ACTIONS_H
#ifndef __PCB_ACTIONS_H
#define __PCB_ACTIONS_H
#include <tool/tool_action.h>
#include <tool/actions.h>
#include <boost/optional.hpp>
class TOOL_EVENT;
class TOOL_MANAGER;
/**
* Class COMMON_ACTIONS
* Class PCB_ACTIONS
*
* Gathers all the actions that are shared by tools. The instance of COMMON_ACTION is created
* Gathers all the actions that are shared by tools. The instance of PCB_ACTIONS is created
* inside of ACTION_MANAGER object that registers the actions.
*/
class COMMON_ACTIONS
class PCB_ACTIONS : public ACTIONS
{
public:
// Selection Tool
@ -355,23 +356,11 @@ public:
static TOOL_ACTION globalEditPads;
/**
* Function TranslateLegacyId()
* Translates legacy tool ids to the corresponding TOOL_ACTION name.
* @param aId is legacy tool id to be translated.
* @return std::string is name of the corresponding TOOL_ACTION. It may be empty, if there is
* no corresponding TOOL_ACTION.
*/
static boost::optional<TOOL_EVENT> TranslateLegacyId( int aId );
///> @copydoc COMMON_ACTIONS::TranslateLegacyId()
virtual boost::optional<TOOL_EVENT> TranslateLegacyId( int aId ) override;
///> Cursor control event types
enum CURSOR_EVENT_TYPE { CURSOR_UP, CURSOR_DOWN, CURSOR_LEFT, CURSOR_RIGHT,
CURSOR_CLICK, CURSOR_DBL_CLICK, CURSOR_FAST_MOVE = 0x8000 };
///> Remove event modifier flags
enum class REMOVE_FLAGS { NORMAL = 0x00, ALT = 0x01 };
///> @copydoc COMMON_ACTIONS::RegisterAllTools()
virtual void RegisterAllTools( TOOL_MANAGER* aToolManager ) override;
};
void registerAllTools( TOOL_MANAGER* aToolManager );
#endif

View File

@ -24,7 +24,7 @@
#include <cstdint>
#include "pcb_editor_control.h"
#include "common_actions.h"
#include "pcb_actions.h"
#include <tool/tool_manager.h>
#include "selection_tool.h"
@ -66,17 +66,17 @@ public:
SetIcon( add_zone_xpm );
SetTitle( _( "Zones" ) );
Add( COMMON_ACTIONS::zoneFill );
Add( COMMON_ACTIONS::zoneFillAll );
Add( COMMON_ACTIONS::zoneUnfill );
Add( COMMON_ACTIONS::zoneUnfillAll );
Add( PCB_ACTIONS::zoneFill );
Add( PCB_ACTIONS::zoneFillAll );
Add( PCB_ACTIONS::zoneUnfill );
Add( PCB_ACTIONS::zoneUnfillAll );
AppendSeparator();
Add( COMMON_ACTIONS::zoneMerge );
Add( COMMON_ACTIONS::zoneDuplicate );
Add( COMMON_ACTIONS::drawZoneCutout );
Add( COMMON_ACTIONS::drawSimilarZone );
Add( PCB_ACTIONS::zoneMerge );
Add( PCB_ACTIONS::zoneDuplicate );
Add( PCB_ACTIONS::drawZoneCutout );
Add( PCB_ACTIONS::drawSimilarZone );
}
protected:
@ -95,15 +95,15 @@ private:
&& SELECTION_CONDITIONS::OnlyType( PCB_ZONE_AREA_T )
)( selTool->GetSelection() );
Enable( getMenuId( COMMON_ACTIONS::zoneDuplicate ), singleZoneActionsEnabled );
Enable( getMenuId( COMMON_ACTIONS::drawZoneCutout ), singleZoneActionsEnabled );
Enable( getMenuId( COMMON_ACTIONS::drawSimilarZone ), singleZoneActionsEnabled );
Enable( getMenuId( PCB_ACTIONS::zoneDuplicate ), singleZoneActionsEnabled );
Enable( getMenuId( PCB_ACTIONS::drawZoneCutout ), singleZoneActionsEnabled );
Enable( getMenuId( PCB_ACTIONS::drawSimilarZone ), singleZoneActionsEnabled );
// enable zone actions that ably to a specific set of zones (as opposed to all of them)
bool nonGlobalActionsEnabled = ( SELECTION_CONDITIONS::MoreThan( 0 ) )( selTool->GetSelection() );
Enable( getMenuId( COMMON_ACTIONS::zoneFill ), nonGlobalActionsEnabled );
Enable( getMenuId( COMMON_ACTIONS::zoneUnfill ), nonGlobalActionsEnabled );
Enable( getMenuId( PCB_ACTIONS::zoneFill ), nonGlobalActionsEnabled );
Enable( getMenuId( PCB_ACTIONS::zoneUnfill ), nonGlobalActionsEnabled );
// lines like this make me really think about a better name for SELECTION_CONDITIONS class
bool mergeEnabled = ( SELECTION_CONDITIONS::MoreThan( 1 ) &&
@ -111,7 +111,7 @@ private:
SELECTION_CONDITIONS::SameNet( true ) &&
SELECTION_CONDITIONS::SameLayer() )( selTool->GetSelection() );
Enable( getMenuId( COMMON_ACTIONS::zoneMerge ), mergeEnabled );
Enable( getMenuId( PCB_ACTIONS::zoneMerge ), mergeEnabled );
}
};
@ -124,9 +124,9 @@ public:
SetIcon( locked_xpm );
SetTitle( _( "Locking" ) );
Add( COMMON_ACTIONS::lock );
Add( COMMON_ACTIONS::unlock );
Add( COMMON_ACTIONS::toggleLock );
Add( PCB_ACTIONS::lock );
Add( PCB_ACTIONS::unlock );
Add( PCB_ACTIONS::toggleLock );
}
CONTEXT_MENU* create() const override
@ -232,7 +232,7 @@ int PCB_EDITOR_CONTROL::TrackWidthInc( const TOOL_EVENT& aEvent )
board->GetDesignSettings().SetTrackWidthIndex( widthIndex );
board->GetDesignSettings().UseCustomTrackViaSize( false );
m_toolMgr->RunAction( COMMON_ACTIONS::trackViaSizeChanged );
m_toolMgr->RunAction( PCB_ACTIONS::trackViaSizeChanged );
return 0;
}
@ -249,7 +249,7 @@ int PCB_EDITOR_CONTROL::TrackWidthDec( const TOOL_EVENT& aEvent )
board->GetDesignSettings().SetTrackWidthIndex( widthIndex );
board->GetDesignSettings().UseCustomTrackViaSize( false );
m_toolMgr->RunAction( COMMON_ACTIONS::trackViaSizeChanged );
m_toolMgr->RunAction( PCB_ACTIONS::trackViaSizeChanged );
return 0;
}
@ -266,7 +266,7 @@ int PCB_EDITOR_CONTROL::ViaSizeInc( const TOOL_EVENT& aEvent )
board->GetDesignSettings().SetViaSizeIndex( sizeIndex );
board->GetDesignSettings().UseCustomTrackViaSize( false );
m_toolMgr->RunAction( COMMON_ACTIONS::trackViaSizeChanged );
m_toolMgr->RunAction( PCB_ACTIONS::trackViaSizeChanged );
return 0;
}
@ -283,7 +283,7 @@ int PCB_EDITOR_CONTROL::ViaSizeDec( const TOOL_EVENT& aEvent )
board->GetDesignSettings().SetViaSizeIndex( sizeIndex );
board->GetDesignSettings().UseCustomTrackViaSize( false );
m_toolMgr->RunAction( COMMON_ACTIONS::trackViaSizeChanged );
m_toolMgr->RunAction( PCB_ACTIONS::trackViaSizeChanged );
return 0;
}
@ -300,7 +300,7 @@ int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent )
KIGFX::VIEW_GROUP preview( view );
view->Add( &preview );
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
controls->ShowCursor( true );
controls->SetSnapping( true );
@ -338,7 +338,7 @@ int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent )
module->Rotate( module->GetPosition(), rotationAngle );
view->Update( &preview );
}
else if( evt->IsAction( &COMMON_ACTIONS::flip ) )
else if( evt->IsAction( &PCB_ACTIONS::flip ) )
{
module->Flip( module->GetPosition() );
view->Update( &preview );
@ -428,7 +428,7 @@ int PCB_EDITOR_CONTROL::modifyLockSelected( MODIFY_MODE aMode )
const SELECTION& selection = selTool->GetSelection();
if( selection.Empty() )
m_toolMgr->RunAction( COMMON_ACTIONS::selectionCursor, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true );
bool modified = false;
@ -482,7 +482,7 @@ int PCB_EDITOR_CONTROL::PlaceTarget( const TOOL_EVENT& aEvent )
preview.Add( target );
view->Add( &preview );
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
controls->SetSnapping( true );
Activate();
@ -496,13 +496,13 @@ int PCB_EDITOR_CONTROL::PlaceTarget( const TOOL_EVENT& aEvent )
if( evt->IsCancel() || evt->IsActivate() )
break;
else if( evt->IsAction( &COMMON_ACTIONS::incWidth ) )
else if( evt->IsAction( &PCB_ACTIONS::incWidth ) )
{
target->SetWidth( target->GetWidth() + WIDTH_STEP );
view->Update( &preview );
}
else if( evt->IsAction( &COMMON_ACTIONS::decWidth ) )
else if( evt->IsAction( &PCB_ACTIONS::decWidth ) )
{
int width = target->GetWidth();
@ -724,14 +724,14 @@ int PCB_EDITOR_CONTROL::ZoneMerge( const TOOL_EVENT& aEvent )
}
}
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
if( mergeZones( commit, toMerge, merged ) )
{
commit.Push( _( "Merge zones" ) );
for( auto item : merged )
m_toolMgr->RunAction( COMMON_ACTIONS::selectItem, true, item );
m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, item );
}
return 0;
@ -818,18 +818,18 @@ int PCB_EDITOR_CONTROL::CrossProbeSchToPcb( const TOOL_EVENT& aEvent )
{
m_probingSchToPcb = true;
getView()->SetCenter( VECTOR2D( item->GetPosition() ) );
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
// If it is a pad and the net highlighting tool is enabled, highlight the net
if( item->Type() == PCB_PAD_T && m_frame->GetToolId() == ID_PCB_HIGHLIGHT_BUTT )
{
int net = static_cast<D_PAD*>( item )->GetNetCode();
m_toolMgr->RunAction( COMMON_ACTIONS::highlightNet, false, net );
m_toolMgr->RunAction( PCB_ACTIONS::highlightNet, false, net );
}
else
// Otherwise simply select the corresponding item
{
m_toolMgr->RunAction( COMMON_ACTIONS::selectItem, true, item );
m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, item );
}
}
@ -947,32 +947,32 @@ int PCB_EDITOR_CONTROL::HighlightNetCursor( const TOOL_EVENT& aEvent )
void PCB_EDITOR_CONTROL::SetTransitions()
{
// Track & via size control
Go( &PCB_EDITOR_CONTROL::TrackWidthInc, COMMON_ACTIONS::trackWidthInc.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::TrackWidthDec, COMMON_ACTIONS::trackWidthDec.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ViaSizeInc, COMMON_ACTIONS::viaSizeInc.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ViaSizeDec, COMMON_ACTIONS::viaSizeDec.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::TrackWidthInc, PCB_ACTIONS::trackWidthInc.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::TrackWidthDec, PCB_ACTIONS::trackWidthDec.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ViaSizeInc, PCB_ACTIONS::viaSizeInc.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ViaSizeDec, PCB_ACTIONS::viaSizeDec.MakeEvent() );
// Zone actions
Go( &PCB_EDITOR_CONTROL::ZoneFill, COMMON_ACTIONS::zoneFill.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ZoneFillAll, COMMON_ACTIONS::zoneFillAll.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ZoneUnfill, COMMON_ACTIONS::zoneUnfill.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ZoneUnfillAll, COMMON_ACTIONS::zoneUnfillAll.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ZoneMerge, COMMON_ACTIONS::zoneMerge.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ZoneDuplicate, COMMON_ACTIONS::zoneDuplicate.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ZoneFill, PCB_ACTIONS::zoneFill.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ZoneFillAll, PCB_ACTIONS::zoneFillAll.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ZoneUnfill, PCB_ACTIONS::zoneUnfill.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ZoneUnfillAll, PCB_ACTIONS::zoneUnfillAll.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ZoneMerge, PCB_ACTIONS::zoneMerge.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ZoneDuplicate, PCB_ACTIONS::zoneDuplicate.MakeEvent() );
// Placing tools
Go( &PCB_EDITOR_CONTROL::PlaceTarget, COMMON_ACTIONS::placeTarget.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::PlaceModule, COMMON_ACTIONS::placeModule.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::PlaceTarget, PCB_ACTIONS::placeTarget.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::PlaceModule, PCB_ACTIONS::placeModule.MakeEvent() );
// Other
Go( &PCB_EDITOR_CONTROL::ToggleLockSelected, COMMON_ACTIONS::toggleLock.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::LockSelected, COMMON_ACTIONS::lock.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::UnlockSelected, COMMON_ACTIONS::unlock.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ToggleLockSelected, PCB_ACTIONS::toggleLock.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::LockSelected, PCB_ACTIONS::lock.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::UnlockSelected, PCB_ACTIONS::unlock.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::CrossProbePcbToSch, SELECTION_TOOL::SelectedEvent );
Go( &PCB_EDITOR_CONTROL::CrossProbeSchToPcb, COMMON_ACTIONS::crossProbeSchToPcb.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::DrillOrigin, COMMON_ACTIONS::drillOrigin.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::HighlightNet, COMMON_ACTIONS::highlightNet.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::HighlightNetCursor, COMMON_ACTIONS::highlightNetCursor.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::CrossProbeSchToPcb, PCB_ACTIONS::crossProbeSchToPcb.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::DrillOrigin, PCB_ACTIONS::drillOrigin.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::HighlightNet, PCB_ACTIONS::highlightNet.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::HighlightNetCursor, PCB_ACTIONS::highlightNetCursor.MakeEvent() );
}

View File

@ -25,7 +25,7 @@
#include <cstdint>
#include "pcbnew_control.h"
#include "common_actions.h"
#include "pcb_actions.h"
#include "selection_tool.h"
#include "picker_tool.h"
#include "grid_helper.h"
@ -95,9 +95,9 @@ int PCBNEW_CONTROL::ZoomInOut( const TOOL_EVENT& aEvent )
KIGFX::VIEW_CONTROLS* ctls = getViewControls();
double zoomScale = 1.0;
if( aEvent.IsAction( &COMMON_ACTIONS::zoomIn ) )
if( aEvent.IsAction( &PCB_ACTIONS::zoomIn ) )
zoomScale = 1.3;
else if( aEvent.IsAction( &COMMON_ACTIONS::zoomOut ) )
else if( aEvent.IsAction( &PCB_ACTIONS::zoomOut ) )
zoomScale = 0.7;
view->SetScale( view->GetScale() * zoomScale, getViewControls()->GetCursorPosition() );
@ -114,9 +114,9 @@ int PCBNEW_CONTROL::ZoomInOutCenter( const TOOL_EVENT& aEvent )
KIGFX::VIEW* view = getView();
double zoomScale = 1.0;
if( aEvent.IsAction( &COMMON_ACTIONS::zoomInCenter ) )
if( aEvent.IsAction( &PCB_ACTIONS::zoomInCenter ) )
zoomScale = 1.3;
else if( aEvent.IsAction( &COMMON_ACTIONS::zoomOutCenter ) )
else if( aEvent.IsAction( &PCB_ACTIONS::zoomOutCenter ) )
zoomScale = 0.7;
view->SetScale( view->GetScale() * zoomScale );
@ -276,11 +276,11 @@ int PCBNEW_CONTROL::ZoneDisplayMode( const TOOL_EVENT& aEvent )
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)m_frame->GetDisplayOptions();
// Apply new display options to the GAL canvas
if( aEvent.IsAction( &COMMON_ACTIONS::zoneDisplayEnable ) )
if( aEvent.IsAction( &PCB_ACTIONS::zoneDisplayEnable ) )
displ_opts->m_DisplayZonesMode = 0;
else if( aEvent.IsAction( &COMMON_ACTIONS::zoneDisplayDisable ) )
else if( aEvent.IsAction( &PCB_ACTIONS::zoneDisplayDisable ) )
displ_opts->m_DisplayZonesMode = 1;
else if( aEvent.IsAction( &COMMON_ACTIONS::zoneDisplayOutlines ) )
else if( aEvent.IsAction( &PCB_ACTIONS::zoneDisplayOutlines ) )
displ_opts->m_DisplayZonesMode = 2;
else
assert( false );
@ -436,8 +436,8 @@ int PCBNEW_CONTROL::LayerAlphaDec( const TOOL_EVENT& aEvent )
int PCBNEW_CONTROL::CursorControl( const TOOL_EVENT& aEvent )
{
long type = aEvent.Parameter<intptr_t>();
bool fastMove = type & COMMON_ACTIONS::CURSOR_FAST_MOVE;
type &= ~COMMON_ACTIONS::CURSOR_FAST_MOVE;
bool fastMove = type & PCB_ACTIONS::CURSOR_FAST_MOVE;
type &= ~PCB_ACTIONS::CURSOR_FAST_MOVE;
bool mirroredX = getView()->IsMirroredX();
GRID_HELPER gridHelper( m_frame );
@ -450,24 +450,24 @@ int PCBNEW_CONTROL::CursorControl( const TOOL_EVENT& aEvent )
switch( type )
{
case COMMON_ACTIONS::CURSOR_UP:
case PCB_ACTIONS::CURSOR_UP:
newCursor -= VECTOR2D( 0, gridSize.y );
break;
case COMMON_ACTIONS::CURSOR_DOWN:
case PCB_ACTIONS::CURSOR_DOWN:
newCursor += VECTOR2D( 0, gridSize.y );
break;
case COMMON_ACTIONS::CURSOR_LEFT:
case PCB_ACTIONS::CURSOR_LEFT:
newCursor -= VECTOR2D( mirroredX ? -gridSize.x : gridSize.x, 0 );
break;
case COMMON_ACTIONS::CURSOR_RIGHT:
case PCB_ACTIONS::CURSOR_RIGHT:
newCursor += VECTOR2D( mirroredX ? -gridSize.x : gridSize.x, 0 );
break;
case COMMON_ACTIONS::CURSOR_CLICK: // fall through
case COMMON_ACTIONS::CURSOR_DBL_CLICK:
case PCB_ACTIONS::CURSOR_CLICK: // fall through
case PCB_ACTIONS::CURSOR_DBL_CLICK:
{
TOOL_ACTIONS action = TA_NONE;
int modifiers = 0;
@ -476,9 +476,9 @@ int PCBNEW_CONTROL::CursorControl( const TOOL_EVENT& aEvent )
modifiers |= wxGetKeyState( WXK_CONTROL ) ? MD_CTRL : 0;
modifiers |= wxGetKeyState( WXK_ALT ) ? MD_ALT : 0;
if( type == COMMON_ACTIONS::CURSOR_CLICK )
if( type == PCB_ACTIONS::CURSOR_CLICK )
action = TA_MOUSE_CLICK;
else if( type == COMMON_ACTIONS::CURSOR_DBL_CLICK )
else if( type == PCB_ACTIONS::CURSOR_DBL_CLICK )
action = TA_MOUSE_DBLCLICK;
else
assert( false );
@ -552,19 +552,19 @@ int PCBNEW_CONTROL::PanControl( const TOOL_EVENT& aEvent )
switch( type )
{
case COMMON_ACTIONS::CURSOR_UP:
case PCB_ACTIONS::CURSOR_UP:
center -= VECTOR2D( 0, gridSize.y );
break;
case COMMON_ACTIONS::CURSOR_DOWN:
case PCB_ACTIONS::CURSOR_DOWN:
center += VECTOR2D( 0, gridSize.y );
break;
case COMMON_ACTIONS::CURSOR_LEFT:
case PCB_ACTIONS::CURSOR_LEFT:
center -= VECTOR2D( mirroredX ? -gridSize.x : gridSize.x, 0 );
break;
case COMMON_ACTIONS::CURSOR_RIGHT:
case PCB_ACTIONS::CURSOR_RIGHT:
center += VECTOR2D( mirroredX ? -gridSize.x : gridSize.x, 0 );
break;
@ -721,8 +721,8 @@ static bool deleteItem( TOOL_MANAGER* aToolMgr, const VECTOR2D& aPosition )
SELECTION_TOOL* selectionTool = aToolMgr->GetTool<SELECTION_TOOL>();
assert( selectionTool );
aToolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
aToolMgr->RunAction( COMMON_ACTIONS::selectionCursor, true );
aToolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
aToolMgr->RunAction( PCB_ACTIONS::selectionCursor, true );
selectionTool->SanitizeSelection();
const SELECTION& selection = selectionTool->GetSelection();
@ -733,9 +733,9 @@ static bool deleteItem( TOOL_MANAGER* aToolMgr, const VECTOR2D& aPosition )
bool canBeRemoved = ( selection.Front()->Type() != PCB_MODULE_T );
if( canBeRemoved || IsOK( aToolMgr->GetEditFrame(), _( "Are you sure you want to delete item?" ) ) )
aToolMgr->RunAction( COMMON_ACTIONS::remove, true );
aToolMgr->RunAction( PCB_ACTIONS::remove, true );
else
aToolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
aToolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
return true;
}
@ -820,7 +820,7 @@ int PCBNEW_CONTROL::AppendBoard( const TOOL_EVENT& aEvent )
return 0;
}
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
// Process the new items
for( TRACK* track = board->m_Track; track; track = track->Next() )
@ -832,7 +832,7 @@ int PCBNEW_CONTROL::AppendBoard( const TOOL_EVENT& aEvent )
}
commit.Added( track );
m_toolMgr->RunAction( COMMON_ACTIONS::selectItem, true, track );
m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, track );
}
module = module ? module->Next() : board->m_Modules;
@ -840,7 +840,7 @@ int PCBNEW_CONTROL::AppendBoard( const TOOL_EVENT& aEvent )
for( ; module; module = module->Next() )
{
commit.Added( module );
m_toolMgr->RunAction( COMMON_ACTIONS::selectItem, true, module );
m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, module );
}
drawing = drawing ? drawing->Next() : board->m_Drawings;
@ -848,7 +848,7 @@ int PCBNEW_CONTROL::AppendBoard( const TOOL_EVENT& aEvent )
for( ; drawing; drawing = drawing->Next() )
{
commit.Added( drawing );
m_toolMgr->RunAction( COMMON_ACTIONS::selectItem, true, drawing );
m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, drawing );
}
for( ZONE_CONTAINER* zone = board->GetArea( zonescount ); zone;
@ -856,7 +856,7 @@ int PCBNEW_CONTROL::AppendBoard( const TOOL_EVENT& aEvent )
{
++zonescount;
commit.Added( zone );
m_toolMgr->RunAction( COMMON_ACTIONS::selectItem, true, zone );
m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, zone );
}
if( commit.Empty() )
@ -915,75 +915,75 @@ int PCBNEW_CONTROL::ToBeDone( const TOOL_EVENT& aEvent )
void PCBNEW_CONTROL::SetTransitions()
{
// View controls
Go( &PCBNEW_CONTROL::ZoomInOut, COMMON_ACTIONS::zoomIn.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoomInOut, COMMON_ACTIONS::zoomOut.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoomInOutCenter, COMMON_ACTIONS::zoomInCenter.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoomInOutCenter, COMMON_ACTIONS::zoomOutCenter.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoomCenter, COMMON_ACTIONS::zoomCenter.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoomFitScreen, COMMON_ACTIONS::zoomFitScreen.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoomPreset, COMMON_ACTIONS::zoomPreset.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoomInOut, PCB_ACTIONS::zoomIn.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoomInOut, PCB_ACTIONS::zoomOut.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoomInOutCenter, PCB_ACTIONS::zoomInCenter.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoomInOutCenter, PCB_ACTIONS::zoomOutCenter.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoomCenter, PCB_ACTIONS::zoomCenter.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoomFitScreen, PCB_ACTIONS::zoomFitScreen.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoomPreset, PCB_ACTIONS::zoomPreset.MakeEvent() );
// Display modes
Go( &PCBNEW_CONTROL::TrackDisplayMode, COMMON_ACTIONS::trackDisplayMode.MakeEvent() );
Go( &PCBNEW_CONTROL::PadDisplayMode, COMMON_ACTIONS::padDisplayMode.MakeEvent() );
Go( &PCBNEW_CONTROL::ViaDisplayMode, COMMON_ACTIONS::viaDisplayMode.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoneDisplayMode, COMMON_ACTIONS::zoneDisplayEnable.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoneDisplayMode, COMMON_ACTIONS::zoneDisplayDisable.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoneDisplayMode, COMMON_ACTIONS::zoneDisplayOutlines.MakeEvent() );
Go( &PCBNEW_CONTROL::HighContrastMode, COMMON_ACTIONS::highContrastMode.MakeEvent() );
Go( &PCBNEW_CONTROL::HighContrastInc, COMMON_ACTIONS::highContrastInc.MakeEvent() );
Go( &PCBNEW_CONTROL::HighContrastDec, COMMON_ACTIONS::highContrastDec.MakeEvent() );
Go( &PCBNEW_CONTROL::TrackDisplayMode, PCB_ACTIONS::trackDisplayMode.MakeEvent() );
Go( &PCBNEW_CONTROL::PadDisplayMode, PCB_ACTIONS::padDisplayMode.MakeEvent() );
Go( &PCBNEW_CONTROL::ViaDisplayMode, PCB_ACTIONS::viaDisplayMode.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayEnable.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayDisable.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayOutlines.MakeEvent() );
Go( &PCBNEW_CONTROL::HighContrastMode, PCB_ACTIONS::highContrastMode.MakeEvent() );
Go( &PCBNEW_CONTROL::HighContrastInc, PCB_ACTIONS::highContrastInc.MakeEvent() );
Go( &PCBNEW_CONTROL::HighContrastDec, PCB_ACTIONS::highContrastDec.MakeEvent() );
// Layer control
Go( &PCBNEW_CONTROL::LayerSwitch, COMMON_ACTIONS::layerTop.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerSwitch, COMMON_ACTIONS::layerInner1.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerSwitch, COMMON_ACTIONS::layerInner2.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerSwitch, COMMON_ACTIONS::layerInner3.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerSwitch, COMMON_ACTIONS::layerInner4.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerSwitch, COMMON_ACTIONS::layerInner5.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerSwitch, COMMON_ACTIONS::layerInner6.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerSwitch, COMMON_ACTIONS::layerBottom.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerNext, COMMON_ACTIONS::layerNext.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerPrev, COMMON_ACTIONS::layerPrev.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerToggle, COMMON_ACTIONS::layerToggle.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerAlphaInc, COMMON_ACTIONS::layerAlphaInc.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerAlphaDec, COMMON_ACTIONS::layerAlphaDec.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerTop.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner1.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner2.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner3.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner4.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner5.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner6.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerBottom.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerNext, PCB_ACTIONS::layerNext.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerPrev, PCB_ACTIONS::layerPrev.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerToggle, PCB_ACTIONS::layerToggle.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerAlphaInc, PCB_ACTIONS::layerAlphaInc.MakeEvent() );
Go( &PCBNEW_CONTROL::LayerAlphaDec, PCB_ACTIONS::layerAlphaDec.MakeEvent() );
// Cursor control
Go( &PCBNEW_CONTROL::CursorControl, COMMON_ACTIONS::cursorUp.MakeEvent() );
Go( &PCBNEW_CONTROL::CursorControl, COMMON_ACTIONS::cursorDown.MakeEvent() );
Go( &PCBNEW_CONTROL::CursorControl, COMMON_ACTIONS::cursorLeft.MakeEvent() );
Go( &PCBNEW_CONTROL::CursorControl, COMMON_ACTIONS::cursorRight.MakeEvent() );
Go( &PCBNEW_CONTROL::CursorControl, COMMON_ACTIONS::cursorUpFast.MakeEvent() );
Go( &PCBNEW_CONTROL::CursorControl, COMMON_ACTIONS::cursorDownFast.MakeEvent() );
Go( &PCBNEW_CONTROL::CursorControl, COMMON_ACTIONS::cursorLeftFast.MakeEvent() );
Go( &PCBNEW_CONTROL::CursorControl, COMMON_ACTIONS::cursorRightFast.MakeEvent() );
Go( &PCBNEW_CONTROL::CursorControl, COMMON_ACTIONS::cursorClick.MakeEvent() );
Go( &PCBNEW_CONTROL::CursorControl, COMMON_ACTIONS::cursorDblClick.MakeEvent() );
Go( &PCBNEW_CONTROL::CursorControl, PCB_ACTIONS::cursorUp.MakeEvent() );
Go( &PCBNEW_CONTROL::CursorControl, PCB_ACTIONS::cursorDown.MakeEvent() );
Go( &PCBNEW_CONTROL::CursorControl, PCB_ACTIONS::cursorLeft.MakeEvent() );
Go( &PCBNEW_CONTROL::CursorControl, PCB_ACTIONS::cursorRight.MakeEvent() );
Go( &PCBNEW_CONTROL::CursorControl, PCB_ACTIONS::cursorUpFast.MakeEvent() );
Go( &PCBNEW_CONTROL::CursorControl, PCB_ACTIONS::cursorDownFast.MakeEvent() );
Go( &PCBNEW_CONTROL::CursorControl, PCB_ACTIONS::cursorLeftFast.MakeEvent() );
Go( &PCBNEW_CONTROL::CursorControl, PCB_ACTIONS::cursorRightFast.MakeEvent() );
Go( &PCBNEW_CONTROL::CursorControl, PCB_ACTIONS::cursorClick.MakeEvent() );
Go( &PCBNEW_CONTROL::CursorControl, PCB_ACTIONS::cursorDblClick.MakeEvent() );
// Pan control
Go( &PCBNEW_CONTROL::PanControl, COMMON_ACTIONS::panUp.MakeEvent() );
Go( &PCBNEW_CONTROL::PanControl, COMMON_ACTIONS::panDown.MakeEvent() );
Go( &PCBNEW_CONTROL::PanControl, COMMON_ACTIONS::panLeft.MakeEvent() );
Go( &PCBNEW_CONTROL::PanControl, COMMON_ACTIONS::panRight.MakeEvent() );
Go( &PCBNEW_CONTROL::PanControl, PCB_ACTIONS::panUp.MakeEvent() );
Go( &PCBNEW_CONTROL::PanControl, PCB_ACTIONS::panDown.MakeEvent() );
Go( &PCBNEW_CONTROL::PanControl, PCB_ACTIONS::panLeft.MakeEvent() );
Go( &PCBNEW_CONTROL::PanControl, PCB_ACTIONS::panRight.MakeEvent() );
// Grid control
Go( &PCBNEW_CONTROL::GridFast1, COMMON_ACTIONS::gridFast1.MakeEvent() );
Go( &PCBNEW_CONTROL::GridFast2, COMMON_ACTIONS::gridFast2.MakeEvent() );
Go( &PCBNEW_CONTROL::GridNext, COMMON_ACTIONS::gridNext.MakeEvent() );
Go( &PCBNEW_CONTROL::GridPrev, COMMON_ACTIONS::gridPrev.MakeEvent() );
Go( &PCBNEW_CONTROL::GridSetOrigin, COMMON_ACTIONS::gridSetOrigin.MakeEvent() );
Go( &PCBNEW_CONTROL::GridResetOrigin, COMMON_ACTIONS::gridResetOrigin.MakeEvent() );
Go( &PCBNEW_CONTROL::GridPreset, COMMON_ACTIONS::gridPreset.MakeEvent() );
Go( &PCBNEW_CONTROL::GridFast1, PCB_ACTIONS::gridFast1.MakeEvent() );
Go( &PCBNEW_CONTROL::GridFast2, PCB_ACTIONS::gridFast2.MakeEvent() );
Go( &PCBNEW_CONTROL::GridNext, PCB_ACTIONS::gridNext.MakeEvent() );
Go( &PCBNEW_CONTROL::GridPrev, PCB_ACTIONS::gridPrev.MakeEvent() );
Go( &PCBNEW_CONTROL::GridSetOrigin, PCB_ACTIONS::gridSetOrigin.MakeEvent() );
Go( &PCBNEW_CONTROL::GridResetOrigin, PCB_ACTIONS::gridResetOrigin.MakeEvent() );
Go( &PCBNEW_CONTROL::GridPreset, PCB_ACTIONS::gridPreset.MakeEvent() );
// Miscellaneous
Go( &PCBNEW_CONTROL::ResetCoords, COMMON_ACTIONS::resetCoords.MakeEvent() );
Go( &PCBNEW_CONTROL::SwitchCursor, COMMON_ACTIONS::switchCursor.MakeEvent() );
Go( &PCBNEW_CONTROL::SwitchUnits, COMMON_ACTIONS::switchUnits.MakeEvent() );
Go( &PCBNEW_CONTROL::DeleteItemCursor, COMMON_ACTIONS::deleteItemCursor.MakeEvent() );
Go( &PCBNEW_CONTROL::AppendBoard, COMMON_ACTIONS::appendBoard.MakeEvent() );
Go( &PCBNEW_CONTROL::ShowHelp, COMMON_ACTIONS::showHelp.MakeEvent() );
Go( &PCBNEW_CONTROL::ToBeDone, COMMON_ACTIONS::toBeDone.MakeEvent() );
Go( &PCBNEW_CONTROL::ResetCoords, PCB_ACTIONS::resetCoords.MakeEvent() );
Go( &PCBNEW_CONTROL::SwitchCursor, PCB_ACTIONS::switchCursor.MakeEvent() );
Go( &PCBNEW_CONTROL::SwitchUnits, PCB_ACTIONS::switchUnits.MakeEvent() );
Go( &PCBNEW_CONTROL::DeleteItemCursor, PCB_ACTIONS::deleteItemCursor.MakeEvent() );
Go( &PCBNEW_CONTROL::AppendBoard, PCB_ACTIONS::appendBoard.MakeEvent() );
Go( &PCBNEW_CONTROL::ShowHelp, PCB_ACTIONS::showHelp.MakeEvent() );
Go( &PCBNEW_CONTROL::ToBeDone, PCB_ACTIONS::toBeDone.MakeEvent() );
}

View File

@ -23,7 +23,7 @@
*/
#include "picker_tool.h"
#include "common_actions.h"
#include "pcb_actions.h"
#include <wxPcbStruct.h>
#include <view/view_controls.h>
@ -88,7 +88,7 @@ int PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
void PICKER_TOOL::SetTransitions()
{
Go( &PICKER_TOOL::Main, COMMON_ACTIONS::pickerTool.MakeEvent() );
Go( &PICKER_TOOL::Main, PCB_ACTIONS::pickerTool.MakeEvent() );
}

View File

@ -23,7 +23,7 @@
*/
#include "placement_tool.h"
#include "common_actions.h"
#include "pcb_actions.h"
#include "selection_tool.h"
#include <tool/tool_manager.h>
@ -63,13 +63,13 @@ bool PLACEMENT_TOOL::Init()
m_placementMenu->SetTitle( _( "Align/distribute" ) );
// Add all align/distribute commands
m_placementMenu->Add( COMMON_ACTIONS::alignTop );
m_placementMenu->Add( COMMON_ACTIONS::alignBottom );
m_placementMenu->Add( COMMON_ACTIONS::alignLeft );
m_placementMenu->Add( COMMON_ACTIONS::alignRight );
m_placementMenu->Add( PCB_ACTIONS::alignTop );
m_placementMenu->Add( PCB_ACTIONS::alignBottom );
m_placementMenu->Add( PCB_ACTIONS::alignLeft );
m_placementMenu->Add( PCB_ACTIONS::alignRight );
m_placementMenu->AppendSeparator();
m_placementMenu->Add( COMMON_ACTIONS::distributeHorizontally );
m_placementMenu->Add( COMMON_ACTIONS::distributeVertically );
m_placementMenu->Add( PCB_ACTIONS::distributeHorizontally );
m_placementMenu->Add( PCB_ACTIONS::distributeVertically );
m_selectionTool->GetToolMenu().GetMenu().AddMenu( m_placementMenu, false,
SELECTION_CONDITIONS::MoreThan( 1 ) );
@ -318,11 +318,11 @@ int PLACEMENT_TOOL::DistributeVertically( const TOOL_EVENT& aEvent )
void PLACEMENT_TOOL::SetTransitions()
{
Go( &PLACEMENT_TOOL::AlignTop, COMMON_ACTIONS::alignTop.MakeEvent() );
Go( &PLACEMENT_TOOL::AlignBottom, COMMON_ACTIONS::alignBottom.MakeEvent() );
Go( &PLACEMENT_TOOL::AlignLeft, COMMON_ACTIONS::alignLeft.MakeEvent() );
Go( &PLACEMENT_TOOL::AlignRight, COMMON_ACTIONS::alignRight.MakeEvent() );
Go( &PLACEMENT_TOOL::AlignTop, PCB_ACTIONS::alignTop.MakeEvent() );
Go( &PLACEMENT_TOOL::AlignBottom, PCB_ACTIONS::alignBottom.MakeEvent() );
Go( &PLACEMENT_TOOL::AlignLeft, PCB_ACTIONS::alignLeft.MakeEvent() );
Go( &PLACEMENT_TOOL::AlignRight, PCB_ACTIONS::alignRight.MakeEvent() );
Go( &PLACEMENT_TOOL::DistributeHorizontally, COMMON_ACTIONS::distributeHorizontally.MakeEvent() );
Go( &PLACEMENT_TOOL::DistributeVertically, COMMON_ACTIONS::distributeVertically.MakeEvent() );
Go( &PLACEMENT_TOOL::DistributeHorizontally, PCB_ACTIONS::distributeHorizontally.MakeEvent() );
Go( &PLACEMENT_TOOL::DistributeVertically, PCB_ACTIONS::distributeVertically.MakeEvent() );
}

View File

@ -31,7 +31,7 @@ using namespace std::placeholders;
#include <geometry/seg.h>
#include <confirm.h>
#include "common_actions.h"
#include "pcb_actions.h"
#include "selection_tool.h"
#include "point_editor.h"
#include <board_commit.h>
@ -213,8 +213,8 @@ bool POINT_EDITOR::Init()
}
auto& menu = m_selectionTool->GetToolMenu().GetMenu();
menu.AddItem( COMMON_ACTIONS::pointEditorAddCorner, POINT_EDITOR::addCornerCondition );
menu.AddItem( COMMON_ACTIONS::pointEditorRemoveCorner,
menu.AddItem( PCB_ACTIONS::pointEditorAddCorner, POINT_EDITOR::addCornerCondition );
menu.AddItem( PCB_ACTIONS::pointEditorRemoveCorner,
std::bind( &POINT_EDITOR::removeCornerCondition, this, _1 ) );
return true;
@ -711,9 +711,9 @@ EDIT_POINT POINT_EDITOR::get45DegConstrainer() const
void POINT_EDITOR::SetTransitions()
{
Go( &POINT_EDITOR::addCorner, COMMON_ACTIONS::pointEditorAddCorner.MakeEvent() );
Go( &POINT_EDITOR::removeCorner, COMMON_ACTIONS::pointEditorRemoveCorner.MakeEvent() );
Go( &POINT_EDITOR::modifiedSelection, COMMON_ACTIONS::editModifiedSelection.MakeEvent() );
Go( &POINT_EDITOR::addCorner, PCB_ACTIONS::pointEditorAddCorner.MakeEvent() );
Go( &POINT_EDITOR::removeCorner, PCB_ACTIONS::pointEditorRemoveCorner.MakeEvent() );
Go( &POINT_EDITOR::modifiedSelection, PCB_ACTIONS::editModifiedSelection.MakeEvent() );
Go( &POINT_EDITOR::OnSelectionChange, SELECTION_TOOL::SelectedEvent );
Go( &POINT_EDITOR::OnSelectionChange, SELECTION_TOOL::UnselectedEvent );
}

View File

@ -51,7 +51,7 @@ using namespace std::placeholders;
#include "selection_tool.h"
#include "selection_area.h"
#include "bright_box.h"
#include "common_actions.h"
#include "pcb_actions.h"
class SELECT_MENU: public CONTEXT_MENU
{
@ -59,10 +59,10 @@ public:
SELECT_MENU()
{
SetTitle( _( "Select..." ) );
Add( COMMON_ACTIONS::selectConnection );
Add( COMMON_ACTIONS::selectCopper );
Add( COMMON_ACTIONS::selectNet );
Add( COMMON_ACTIONS::selectSameSheet );
Add( PCB_ACTIONS::selectConnection );
Add( PCB_ACTIONS::selectCopper );
Add( PCB_ACTIONS::selectNet );
Add( PCB_ACTIONS::selectSameSheet );
}
private:
@ -79,10 +79,10 @@ private:
bool sheetSelEnabled = ( SELECTION_CONDITIONS::OnlyType( PCB_MODULE_T ) )
( selTool->GetSelection() );
Enable( getMenuId( COMMON_ACTIONS::selectNet ), selEnabled );
Enable( getMenuId( COMMON_ACTIONS::selectCopper ), selEnabled );
Enable( getMenuId( COMMON_ACTIONS::selectConnection ), selEnabled );
Enable( getMenuId( COMMON_ACTIONS::selectSameSheet ), sheetSelEnabled );
Enable( getMenuId( PCB_ACTIONS::selectNet ), selEnabled );
Enable( getMenuId( PCB_ACTIONS::selectCopper ), selEnabled );
Enable( getMenuId( PCB_ACTIONS::selectConnection ), selEnabled );
Enable( getMenuId( PCB_ACTIONS::selectSameSheet ), sheetSelEnabled );
}
CONTEXT_MENU* create() const override
{
@ -170,7 +170,7 @@ int SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
{
if( evt->Modifier( MD_CTRL ) && !m_editModules )
{
m_toolMgr->RunAction( COMMON_ACTIONS::highlightNet, true );
m_toolMgr->RunAction( PCB_ACTIONS::highlightNet, true );
}
else
{
@ -200,7 +200,7 @@ int SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
if( m_selection.Empty() )
selectPoint( evt->Position() );
m_toolMgr->RunAction( COMMON_ACTIONS::properties );
m_toolMgr->RunAction( PCB_ACTIONS::properties );
}
// drag with LMB? Select multiple objects (or at least draw a selection box) or drag them
@ -468,17 +468,17 @@ bool SELECTION_TOOL::selectMultiple()
void SELECTION_TOOL::SetTransitions()
{
Go( &SELECTION_TOOL::Main, COMMON_ACTIONS::selectionActivate.MakeEvent() );
Go( &SELECTION_TOOL::CursorSelection, COMMON_ACTIONS::selectionCursor.MakeEvent() );
Go( &SELECTION_TOOL::ClearSelection, COMMON_ACTIONS::selectionClear.MakeEvent() );
Go( &SELECTION_TOOL::SelectItem, COMMON_ACTIONS::selectItem.MakeEvent() );
Go( &SELECTION_TOOL::UnselectItem, COMMON_ACTIONS::unselectItem.MakeEvent() );
Go( &SELECTION_TOOL::find, COMMON_ACTIONS::find.MakeEvent() );
Go( &SELECTION_TOOL::findMove, COMMON_ACTIONS::findMove.MakeEvent() );
Go( &SELECTION_TOOL::selectConnection, COMMON_ACTIONS::selectConnection.MakeEvent() );
Go( &SELECTION_TOOL::selectCopper, COMMON_ACTIONS::selectCopper.MakeEvent() );
Go( &SELECTION_TOOL::selectNet, COMMON_ACTIONS::selectNet.MakeEvent() );
Go( &SELECTION_TOOL::selectSameSheet, COMMON_ACTIONS::selectSameSheet.MakeEvent() );
Go( &SELECTION_TOOL::Main, PCB_ACTIONS::selectionActivate.MakeEvent() );
Go( &SELECTION_TOOL::CursorSelection, PCB_ACTIONS::selectionCursor.MakeEvent() );
Go( &SELECTION_TOOL::ClearSelection, PCB_ACTIONS::selectionClear.MakeEvent() );
Go( &SELECTION_TOOL::SelectItem, PCB_ACTIONS::selectItem.MakeEvent() );
Go( &SELECTION_TOOL::UnselectItem, PCB_ACTIONS::unselectItem.MakeEvent() );
Go( &SELECTION_TOOL::find, PCB_ACTIONS::find.MakeEvent() );
Go( &SELECTION_TOOL::findMove, PCB_ACTIONS::findMove.MakeEvent() );
Go( &SELECTION_TOOL::selectConnection, PCB_ACTIONS::selectConnection.MakeEvent() );
Go( &SELECTION_TOOL::selectCopper, PCB_ACTIONS::selectCopper.MakeEvent() );
Go( &SELECTION_TOOL::selectNet, PCB_ACTIONS::selectNet.MakeEvent() );
Go( &SELECTION_TOOL::selectSameSheet, PCB_ACTIONS::selectSameSheet.MakeEvent() );
}

View File

@ -23,15 +23,15 @@
#include <tools/tool_event_utils.h>
#include <tools/common_actions.h>
#include <tools/pcb_actions.h>
#include <pcb_base_edit_frame.h>
bool TOOL_EVT_UTILS::IsRotateToolEvt( const TOOL_EVENT& aEvt )
{
return aEvt.IsAction( &COMMON_ACTIONS::rotateCw )
|| aEvt.IsAction( &COMMON_ACTIONS::rotateCcw );
return aEvt.IsAction( &PCB_ACTIONS::rotateCw )
|| aEvt.IsAction( &PCB_ACTIONS::rotateCcw );
}

View File

@ -25,7 +25,7 @@
#include <tool/context_menu.h>
#include "common_actions.h"
#include "pcb_actions.h"
#include "zoom_menu.h"
#include "grid_menu.h"
#include "selection_tool.h" // For SELECTION
@ -91,10 +91,10 @@ using S_C = SELECTION_CONDITIONS;
void TOOL_MENU::AddStandardSubMenus( EDA_DRAW_FRAME& aFrame )
{
m_menu.AddItem( COMMON_ACTIONS::zoomCenter, S_C::ShowAlways, 1000 );
m_menu.AddItem( COMMON_ACTIONS::zoomIn, S_C::ShowAlways, 1000 );
m_menu.AddItem( COMMON_ACTIONS::zoomOut, S_C::ShowAlways, 1000 );
m_menu.AddItem( COMMON_ACTIONS::zoomFitScreen, S_C::ShowAlways, 1000 );
m_menu.AddItem( PCB_ACTIONS::zoomCenter, S_C::ShowAlways, 1000 );
m_menu.AddItem( PCB_ACTIONS::zoomIn, S_C::ShowAlways, 1000 );
m_menu.AddItem( PCB_ACTIONS::zoomOut, S_C::ShowAlways, 1000 );
m_menu.AddItem( PCB_ACTIONS::zoomFitScreen, S_C::ShowAlways, 1000 );
m_menu.AddSeparator(SELECTION_CONDITIONS::ShowAlways, 1000 );

View File

@ -37,12 +37,12 @@
#include <tools/pcb_editor_control.h>
#include <tools/placement_tool.h>
#include <tools/pad_tool.h>
#include <tools/common_actions.h>
#include <tools/pcb_actions.h>
#include <router/router_tool.h>
#include <router/length_tuner_tool.h>
void registerAllTools( TOOL_MANAGER* aToolManager )
void PCB_ACTIONS::RegisterAllTools( TOOL_MANAGER* aToolManager )
{
aToolManager->RegisterTool( new SELECTION_TOOL );
aToolManager->RegisterTool( new ZOOM_TOOL );

View File

@ -26,7 +26,7 @@
#include <id.h>
#include <draw_frame.h>
#include <class_base_screen.h>
#include <tools/common_actions.h>
#include <tools/pcb_actions.h>
#include <bitmaps.h>
#include <functional>
@ -54,7 +54,7 @@ ZOOM_MENU::ZOOM_MENU( EDA_DRAW_FRAME* aParent ) : m_parent( aParent )
OPT_TOOL_EVENT ZOOM_MENU::eventHandler( const wxMenuEvent& aEvent )
{
OPT_TOOL_EVENT event( COMMON_ACTIONS::zoomPreset.MakeEvent() );
OPT_TOOL_EVENT event( PCB_ACTIONS::zoomPreset.MakeEvent() );
intptr_t idx = aEvent.GetId() - ID_POPUP_ZOOM_LEVEL_START;
event->SetParameter( idx );

View File

@ -26,7 +26,7 @@
#include "zoom_tool.h"
#include "selection_area.h"
#include "common_actions.h"
#include "pcb_actions.h"
ZOOM_TOOL::ZOOM_TOOL() :
@ -129,5 +129,5 @@ bool ZOOM_TOOL::selectRegion()
void ZOOM_TOOL::SetTransitions()
{
Go( &ZOOM_TOOL::Main, COMMON_ACTIONS::zoomTool.MakeEvent() );
Go( &ZOOM_TOOL::Main, PCB_ACTIONS::zoomTool.MakeEvent() );
}