KiCad PCB EDA Suite
pcb_actions.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2013-2016 CERN
5  * Copyright (C) 2016-2019 KiCad Developers, see AUTHORS.txt for contributors.
6  * @author Maciej Suminski <maciej.suminski@cern.ch>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 #include "pcb_actions.h"
27 #include <pcbnew_id.h>
28 #include <tool/tool_manager.h>
29 #include <tools/pcb_actions.h>
30 
31 
33 {
34  switch( aId )
35  {
36  case ID_PCB_MODULE_BUTT:
38 
39  case ID_TRACK_BUTT:
41 
42  case ID_DIFF_PAIR_BUTT:
44 
47 
50 
53 
56 
59 
60  case ID_PCB_ZONES_BUTT:
62 
65 
68 
72 
76 
77  case ID_PCB_CIRCLE_BUTT:
80 
81  case ID_PCB_ARC_BUTT:
84 
88 
91 
92  case ID_PCB_TARGET_BUTT:
94 
97 
100 
103 
107 
108  case ID_POPUP_GRID_NEXT:
109  return ACTIONS::gridNext.MakeEvent();
110 
111  case ID_POPUP_GRID_PREV:
112  return ACTIONS::gridPrev.MakeEvent();
113 
114  case ID_ZOOM_REDRAW:
118 
119  case ID_ZOOM_IN: // toolbar button "Zoom In"
120  case ID_VIEWER_ZOOM_IN:
122 
123  case ID_ZOOM_OUT: // toolbar button "Zoom In"
124  case ID_VIEWER_ZOOM_OUT:
126 
127  case ID_ZOOM_PAGE: // toolbar button "Fit on Screen"
128  case ID_VIEWER_ZOOM_PAGE:
130 
133 
136 
139 
142 
145 
148 
151 
154 
157 
160 
163 
164  case ID_DEC_LAYER_ALPHA:
166 
167  case ID_INC_LAYER_ALPHA:
169 
170  case ID_FIND_ITEMS:
171  return PCB_ACTIONS::find.MakeEvent();
172 
175 
176  case ID_NO_TOOL_SELECTED:
178 
179  case ID_ZOOM_SELECTION:
180  return ACTIONS::zoomTool.MakeEvent();
181 
185 
188 
192 
195 
196  case ID_APPEND_FILE:
198 
201 
204 
207 
210 
213 
216 
217  case ID_EDIT_CUT:
218  return ACTIONS::cut.MakeEvent();
219 
220  case ID_EDIT_COPY:
221  return ACTIONS::copy.MakeEvent();
222 
223  case ID_EDIT_PASTE:
224  return PCB_ACTIONS::paste.MakeEvent();
225 
228 
231 
234 
237 
238  }
239 
240  return OPT<TOOL_EVENT>();
241 }
static TOOL_ACTION drawLine
Definition: pcb_actions.h:137
static TOOL_ACTION placeModule
Definition: pcb_actions.h:149
static TOOL_ACTION placeImportedGraphics
Definition: pcb_actions.h:150
static TOOL_ACTION zoomInCenter
Definition: actions.h:60
static TOOL_ACTION autoplaceOffboardComponents
Definition: pcb_actions.h:334
static TOOL_ACTION drillOrigin
Definition: pcb_actions.h:315
static TOOL_ACTION zoneFillAll
Definition: pcb_actions.h:251
static TOOL_ACTION drawArc
Definition: pcb_actions.h:140
static TOOL_ACTION microwaveCreateStubArc
Definition: pcb_actions.h:293
static TOOL_ACTION ratsnestLineMode
Definition: pcb_actions.h:212
static TOOL_ACTION autoplaceSelectedComponents
Definition: pcb_actions.h:335
static TOOL_ACTION layerAlphaDec
Definition: pcb_actions.h:236
static TOOL_ACTION zoomTool
Definition: actions.h:65
static TOOL_ACTION zoneDisplayOutlines
Definition: pcb_actions.h:219
static TOOL_ACTION drawZoneKeepout
Definition: pcb_actions.h:145
static TOOL_ACTION layerAlphaInc
Definition: pcb_actions.h:235
Definition: id.h:235
static TOOL_ACTION zoneDisplayDisable
Definition: pcb_actions.h:218
static TOOL_ACTION zoomFitScreen
Definition: actions.h:63
static TOOL_ACTION microwaveCreateLine
Definition: pcb_actions.h:297
static TOOL_ACTION placePad
Activation of the drawing tool (placing a PAD)
Definition: pcb_actions.h:261
ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY
static TOOL_ACTION routerActivateSingle
Activation of the Push and Shove router.
Definition: pcb_actions.h:165
static TOOL_ACTION highlightNetCursor
Definition: pcb_actions.h:313
static TOOL_ACTION setAnchor
Definition: pcb_actions.h:151
static TOOL_ACTION deleteItemCursor
Definition: pcb_actions.h:310
static TOOL_ACTION routerActivateTuneSingleTrace
Activation of the Push and Shove router (tune single line mode)
Definition: pcb_actions.h:171
static TOOL_ACTION placeText
Definition: pcb_actions.h:141
static TOOL_ACTION showLocalRatsnest
Definition: pcb_actions.h:322
static TOOL_ACTION zoomOutCenter
Definition: actions.h:61
static TOOL_ACTION drawGraphicPolygon
Definition: pcb_actions.h:138
static TOOL_ACTION highContrastMode
Definition: pcb_actions.h:220
static TOOL_ACTION copy
Definition: actions.h:53
static TOOL_ACTION appendBoard
Definition: pcb_actions.h:317
static TOOL_ACTION routerActivateTuneDiffPairSkew
Activation of the Push and Shove router (skew tuning mode)
Definition: pcb_actions.h:177
static TOOL_ACTION drawDimension
Definition: pcb_actions.h:142
static TOOL_ACTION gridPrev
Definition: actions.h:94
static TOOL_ACTION find
Find an item.
Definition: pcb_actions.h:327
static TOOL_ACTION cut
Definition: actions.h:52
static TOOL_ACTION microwaveCreateGap
Definition: pcb_actions.h:289
static TOOL_ACTION routerActivateTuneDiffPair
Activation of the Push and Shove router (diff pair tuning mode)
Definition: pcb_actions.h:174
static TOOL_ACTION drawVia
Definition: pcb_actions.h:144
PCB_EDIT_FRAME::OnSelectOptionToolbar ID_PCB_MEASUREMENT_TOOL
static TOOL_ACTION placeTarget
Definition: pcb_actions.h:148
static TOOL_ACTION zoneUnfillAll
Definition: pcb_actions.h:253
static TOOL_ACTION selectionTool
Definition: pcb_actions.h:305
static TOOL_ACTION moduleEdgeOutlines
Display module edges as outlines.
Definition: pcb_actions.h:273
static TOOL_ACTION microwaveCreateStub
Definition: pcb_actions.h:291
static TOOL_ACTION padDisplayMode
Definition: pcb_actions.h:214
static TOOL_ACTION drawCircle
Definition: pcb_actions.h:139
static TOOL_ACTION viaDisplayMode
Definition: pcb_actions.h:215
ID_MODEDIT_MEASUREMENT_TOOL
static TOOL_ACTION moduleTextOutlines
Display module texts as outlines.
Definition: pcb_actions.h:276
static TOOL_ACTION microwaveCreateFunctionShape
Definition: pcb_actions.h:295
static TOOL_ACTION routerActivateSettingsDialog
Activation of the Push and Shove settings dialogs.
Definition: pcb_actions.h:180
static TOOL_ACTION zoomRedraw
Definition: actions.h:57
TOOL_EVENT MakeEvent() const
Function MakeEvent() Returns the event associated with the action (i.e.
Definition: tool_action.h:95
static TOOL_ACTION graphicDisplayMode
Definition: pcb_actions.h:216
static TOOL_ACTION gridNext
Definition: actions.h:93
boost::optional< T > OPT
Definition: optional.h:7
static TOOL_ACTION findMove
Find an item and start moving.
Definition: pcb_actions.h:330
static TOOL_ACTION gridSetOrigin
Definition: actions.h:95
virtual OPT< TOOL_EVENT > TranslateLegacyId(int aId) override
Definition: pcb_actions.cpp:32
static TOOL_ACTION routerActivateDiffPair
Activation of the Push and Shove router (differential pair mode)
Definition: pcb_actions.h:168
static TOOL_ACTION paste
Definition: actions.h:54
static TOOL_ACTION drawZone
Definition: pcb_actions.h:143
static TOOL_ACTION measureTool
Definition: pcb_actions.h:308
static TOOL_ACTION trackDisplayMode
Definition: pcb_actions.h:213
static TOOL_ACTION zoneDisplayEnable
Definition: pcb_actions.h:217
static TOOL_ACTION routerActivateDpDimensionsDialog
Definition: pcb_actions.h:181