2013-09-27 18:52:34 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2016-05-04 12:59:14 +00:00
|
|
|
* Copyright (C) 2013-2016 CERN
|
2016-06-08 11:19:53 +00:00
|
|
|
* Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
|
2013-09-27 18:52:34 +00:00
|
|
|
* @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
|
|
|
|
*/
|
|
|
|
|
2017-02-21 12:42:08 +00:00
|
|
|
#include "pcb_actions.h"
|
2014-02-17 17:21:00 +00:00
|
|
|
#include <pcbnew_id.h>
|
2014-07-09 12:23:13 +00:00
|
|
|
|
|
|
|
|
2017-11-01 11:14:16 +00:00
|
|
|
OPT<TOOL_EVENT> PCB_ACTIONS::TranslateLegacyId( int aId )
|
2014-02-17 17:21:00 +00:00
|
|
|
{
|
|
|
|
switch( aId )
|
|
|
|
{
|
|
|
|
case ID_PCB_MODULE_BUTT:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::placeModule.MakeEvent();
|
2014-02-17 17:21:00 +00:00
|
|
|
|
|
|
|
case ID_TRACK_BUTT:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::routerActivateSingle.MakeEvent();
|
2015-02-18 00:29:54 +00:00
|
|
|
|
|
|
|
case ID_DIFF_PAIR_BUTT:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::routerActivateDiffPair.MakeEvent();
|
2015-02-18 00:29:54 +00:00
|
|
|
|
|
|
|
case ID_TUNE_SINGLE_TRACK_LEN_BUTT:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::routerActivateTuneSingleTrace.MakeEvent();
|
2015-02-18 16:53:46 +00:00
|
|
|
|
2015-02-18 00:29:54 +00:00
|
|
|
case ID_TUNE_DIFF_PAIR_LEN_BUTT:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::routerActivateTuneDiffPair.MakeEvent();
|
2015-02-18 16:53:46 +00:00
|
|
|
|
2015-02-18 00:29:54 +00:00
|
|
|
case ID_TUNE_DIFF_PAIR_SKEW_BUTT:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::routerActivateTuneDiffPairSkew.MakeEvent();
|
2015-02-18 16:53:46 +00:00
|
|
|
|
2015-02-18 00:29:54 +00:00
|
|
|
case ID_MENU_INTERACTIVE_ROUTER_SETTINGS:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::routerActivateSettingsDialog.MakeEvent();
|
2015-02-18 00:29:54 +00:00
|
|
|
|
|
|
|
case ID_MENU_DIFF_PAIR_DIMENSIONS:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::routerActivateDpDimensionsDialog.MakeEvent();
|
2014-02-17 17:21:00 +00:00
|
|
|
|
|
|
|
case ID_PCB_ZONES_BUTT:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::drawZone.MakeEvent();
|
2014-02-17 17:21:00 +00:00
|
|
|
|
2017-04-22 15:46:31 +00:00
|
|
|
case ID_PCB_DRAW_VIA_BUTT:
|
|
|
|
return PCB_ACTIONS::drawVia.MakeEvent();
|
|
|
|
|
2014-02-17 17:21:00 +00:00
|
|
|
case ID_PCB_KEEPOUT_AREA_BUTT:
|
2017-04-07 09:57:02 +00:00
|
|
|
return PCB_ACTIONS::drawZoneKeepout.MakeEvent();
|
2014-02-17 17:21:00 +00:00
|
|
|
|
|
|
|
case ID_PCB_ADD_LINE_BUTT:
|
2014-07-09 12:01:06 +00:00
|
|
|
case ID_MODEDIT_LINE_TOOL:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::drawLine.MakeEvent();
|
2014-02-17 17:21:00 +00:00
|
|
|
|
2017-10-19 21:14:01 +00:00
|
|
|
case ID_PCB_ADD_POLYGON_BUTT:
|
|
|
|
case ID_MODEDIT_POLYGON_TOOL:
|
|
|
|
return PCB_ACTIONS::drawGraphicPolygon.MakeEvent();
|
|
|
|
|
2014-02-17 17:21:00 +00:00
|
|
|
case ID_PCB_CIRCLE_BUTT:
|
2014-07-09 12:01:06 +00:00
|
|
|
case ID_MODEDIT_CIRCLE_TOOL:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::drawCircle.MakeEvent();
|
2014-02-17 17:21:00 +00:00
|
|
|
|
|
|
|
case ID_PCB_ARC_BUTT:
|
2014-07-09 12:01:06 +00:00
|
|
|
case ID_MODEDIT_ARC_TOOL:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::drawArc.MakeEvent();
|
2014-02-17 17:21:00 +00:00
|
|
|
|
|
|
|
case ID_PCB_ADD_TEXT_BUTT:
|
2014-07-09 11:50:27 +00:00
|
|
|
case ID_MODEDIT_TEXT_TOOL:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::placeText.MakeEvent();
|
2014-02-17 17:21:00 +00:00
|
|
|
|
|
|
|
case ID_PCB_DIMENSION_BUTT:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::drawDimension.MakeEvent();
|
2014-02-17 17:21:00 +00:00
|
|
|
|
2017-10-31 15:38:10 +00:00
|
|
|
case ID_PCB_TARGET_BUTT:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::placeTarget.MakeEvent();
|
2014-06-04 15:46:43 +00:00
|
|
|
|
2014-07-09 12:01:06 +00:00
|
|
|
case ID_MODEDIT_PAD_TOOL:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::placePad.MakeEvent();
|
2014-07-09 12:01:06 +00:00
|
|
|
|
2014-07-09 13:02:56 +00:00
|
|
|
case ID_GEN_IMPORT_DXF_FILE:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::placeDXF.MakeEvent();
|
2014-07-09 13:02:56 +00:00
|
|
|
|
2014-07-09 12:01:06 +00:00
|
|
|
case ID_MODEDIT_ANCHOR_TOOL:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::setAnchor.MakeEvent();
|
2014-07-09 12:01:06 +00:00
|
|
|
|
2014-06-04 15:46:43 +00:00
|
|
|
case ID_PCB_PLACE_GRID_COORD_BUTT:
|
2014-07-09 12:01:06 +00:00
|
|
|
case ID_MODEDIT_PLACE_GRID_COORD:
|
2017-02-20 18:10:20 +00:00
|
|
|
return ACTIONS::gridSetOrigin.MakeEvent();
|
2014-07-09 11:50:27 +00:00
|
|
|
|
|
|
|
case ID_ZOOM_IN: // toolbar button "Zoom In"
|
2017-09-26 12:35:21 +00:00
|
|
|
case ID_VIEWER_ZOOM_IN:
|
2017-02-20 18:10:20 +00:00
|
|
|
return ACTIONS::zoomInCenter.MakeEvent();
|
2014-07-09 11:50:27 +00:00
|
|
|
|
|
|
|
case ID_ZOOM_OUT: // toolbar button "Zoom In"
|
2017-09-26 12:35:21 +00:00
|
|
|
case ID_VIEWER_ZOOM_OUT:
|
2017-02-20 18:10:20 +00:00
|
|
|
return ACTIONS::zoomOutCenter.MakeEvent();
|
2014-07-09 11:50:27 +00:00
|
|
|
|
|
|
|
case ID_ZOOM_PAGE: // toolbar button "Fit on Screen"
|
2017-09-26 12:35:21 +00:00
|
|
|
case ID_VIEWER_ZOOM_PAGE:
|
2017-02-20 18:10:20 +00:00
|
|
|
return ACTIONS::zoomFitScreen.MakeEvent();
|
2014-07-09 11:50:27 +00:00
|
|
|
|
2014-07-09 13:02:56 +00:00
|
|
|
case ID_TB_OPTIONS_SHOW_TRACKS_SKETCH:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::trackDisplayMode.MakeEvent();
|
2014-07-09 13:02:56 +00:00
|
|
|
|
|
|
|
case ID_TB_OPTIONS_SHOW_PADS_SKETCH:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::padDisplayMode.MakeEvent();
|
2014-07-09 13:02:56 +00:00
|
|
|
|
|
|
|
case ID_TB_OPTIONS_SHOW_VIAS_SKETCH:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::viaDisplayMode.MakeEvent();
|
2014-07-09 13:02:56 +00:00
|
|
|
|
|
|
|
case ID_TB_OPTIONS_SHOW_ZONES:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::zoneDisplayEnable.MakeEvent();
|
2014-07-09 13:02:56 +00:00
|
|
|
|
|
|
|
case ID_TB_OPTIONS_SHOW_ZONES_DISABLE:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::zoneDisplayDisable.MakeEvent();
|
2014-07-09 13:02:56 +00:00
|
|
|
|
|
|
|
case ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::zoneDisplayOutlines.MakeEvent();
|
2014-07-09 13:02:56 +00:00
|
|
|
|
2018-02-18 14:21:23 +00:00
|
|
|
case ID_TB_OPTIONS_SHOW_GRAPHIC_SKETCH:;
|
|
|
|
return PCB_ACTIONS::graphicDisplayMode.MakeEvent();
|
|
|
|
|
2014-07-09 13:10:32 +00:00
|
|
|
case ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::moduleEdgeOutlines.MakeEvent();
|
2014-07-09 13:10:32 +00:00
|
|
|
|
2018-01-19 18:26:48 +00:00
|
|
|
case ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH:;
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::moduleTextOutlines.MakeEvent();
|
2014-07-09 13:10:32 +00:00
|
|
|
|
2014-07-09 13:02:56 +00:00
|
|
|
case ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::highContrastMode.MakeEvent();
|
2014-07-09 13:02:56 +00:00
|
|
|
|
2018-02-21 16:29:24 +00:00
|
|
|
case ID_DEC_LAYER_ALPHA:
|
|
|
|
return PCB_ACTIONS::layerAlphaDec.MakeEvent();
|
|
|
|
|
|
|
|
case ID_INC_LAYER_ALPHA:
|
|
|
|
return PCB_ACTIONS::layerAlphaInc.MakeEvent();
|
|
|
|
|
2014-10-13 13:25:16 +00:00
|
|
|
case ID_FIND_ITEMS:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::find.MakeEvent();
|
2014-10-13 13:25:16 +00:00
|
|
|
|
2014-10-13 13:22:14 +00:00
|
|
|
case ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::findMove.MakeEvent();
|
2014-10-13 13:22:14 +00:00
|
|
|
|
2014-07-15 09:50:00 +00:00
|
|
|
case ID_NO_TOOL_SELECTED:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::selectionTool.MakeEvent();
|
2014-07-15 09:50:00 +00:00
|
|
|
|
2016-06-08 11:19:53 +00:00
|
|
|
case ID_ZOOM_SELECTION:
|
2017-08-31 02:35:30 +00:00
|
|
|
return ACTIONS::zoomTool.MakeEvent();
|
2016-06-08 11:19:53 +00:00
|
|
|
|
2014-07-09 11:50:27 +00:00
|
|
|
case ID_PCB_DELETE_ITEM_BUTT:
|
2015-06-18 15:51:51 +00:00
|
|
|
case ID_MODEDIT_DELETE_TOOL:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::deleteItemCursor.MakeEvent();
|
2015-06-18 15:51:51 +00:00
|
|
|
|
|
|
|
case ID_PCB_PLACE_OFFSET_COORD_BUTT:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::drillOrigin.MakeEvent();
|
2015-06-18 15:51:51 +00:00
|
|
|
|
2017-03-09 09:09:13 +00:00
|
|
|
case ID_PCB_MEASUREMENT_TOOL:
|
|
|
|
case ID_MODEDIT_MEASUREMENT_TOOL:
|
|
|
|
return PCB_ACTIONS::measureTool.MakeEvent();
|
|
|
|
|
2014-07-09 11:50:27 +00:00
|
|
|
case ID_PCB_HIGHLIGHT_BUTT:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::highlightNetCursor.MakeEvent();
|
2015-06-18 15:51:51 +00:00
|
|
|
|
2015-08-07 16:24:42 +00:00
|
|
|
case ID_APPEND_FILE:
|
2017-02-21 12:42:08 +00:00
|
|
|
return PCB_ACTIONS::appendBoard.MakeEvent();
|
2015-08-07 16:24:42 +00:00
|
|
|
|
2014-07-09 11:50:27 +00:00
|
|
|
case ID_PCB_SHOW_1_RATSNEST_BUTT:
|
2017-03-28 16:30:49 +00:00
|
|
|
return PCB_ACTIONS::showLocalRatsnest.MakeEvent();
|
2017-02-23 06:23:17 +00:00
|
|
|
|
|
|
|
case ID_PCB_MUWAVE_TOOL_GAP_CMD:
|
|
|
|
return PCB_ACTIONS::microwaveCreateGap.MakeEvent();
|
|
|
|
|
|
|
|
case ID_PCB_MUWAVE_TOOL_STUB_CMD:
|
|
|
|
return PCB_ACTIONS::microwaveCreateStub.MakeEvent();
|
|
|
|
|
|
|
|
case ID_PCB_MUWAVE_TOOL_STUB_ARC_CMD:
|
|
|
|
return PCB_ACTIONS::microwaveCreateStubArc.MakeEvent();
|
|
|
|
|
|
|
|
case ID_PCB_MUWAVE_TOOL_FUNCTION_SHAPE_CMD:
|
|
|
|
return PCB_ACTIONS::microwaveCreateFunctionShape.MakeEvent();
|
|
|
|
|
|
|
|
case ID_PCB_MUWAVE_TOOL_SELF_CMD:
|
|
|
|
return PCB_ACTIONS::microwaveCreateLine.MakeEvent();
|
2017-09-29 08:58:05 +00:00
|
|
|
|
|
|
|
case ID_EDIT_CUT:
|
|
|
|
return PCB_ACTIONS::cutToClipboard.MakeEvent();
|
|
|
|
|
|
|
|
case ID_EDIT_COPY:
|
|
|
|
return PCB_ACTIONS::copyToClipboard.MakeEvent();
|
|
|
|
|
|
|
|
case ID_EDIT_PASTE:
|
|
|
|
return PCB_ACTIONS::pasteFromClipboard.MakeEvent();
|
2018-07-24 19:55:51 +00:00
|
|
|
|
|
|
|
case ID_POPUP_PCB_FILL_ALL_ZONES:
|
|
|
|
return PCB_ACTIONS::zoneFillAll.MakeEvent();
|
|
|
|
|
|
|
|
case ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_ALL_ZONES:
|
|
|
|
return PCB_ACTIONS::zoneUnfillAll.MakeEvent();
|
2018-08-24 10:54:45 +00:00
|
|
|
|
|
|
|
case ID_POPUP_PCB_AUTOPLACE_OFF_BOARD_MODULES:
|
|
|
|
return PCB_ACTIONS::autoplaceOffboardComponents.MakeEvent();
|
|
|
|
|
|
|
|
case ID_POPUP_PCB_AUTOPLACE_SELECTED_MODULES:
|
|
|
|
return PCB_ACTIONS::autoplaceSelectedComponents.MakeEvent();
|
|
|
|
|
2014-02-17 17:21:00 +00:00
|
|
|
}
|
|
|
|
|
2017-11-01 11:14:16 +00:00
|
|
|
return OPT<TOOL_EVENT>();
|
2014-02-17 17:21:00 +00:00
|
|
|
}
|