KiCad PCB EDA Suite
Loading...
Searching...
No Matches
gerbview_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) 2017 Jon Evans <[email protected]>
5 * Copyright (C) 2017-2022 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#include <bitmaps.h>
22#include <tool/tool_action.h>
23#include <tool/tool_manager.h>
25
26
27// Actions, being statically-defined, require specialized I18N handling. We continue to
28// use the _() macro so that string harvesting by the I18N framework doesn't have to be
29// specialized, but we don't translate on initialization and instead do it in the getters.
30
31#undef _
32#define _(s) s
33
34
35// GERBVIEW_CONTROL
36//
38 .Name( "gerbview.Control.openAutodetected" )
39 .Scope( AS_GLOBAL )
40 .MenuText( _( "Open Autodetected File(s)..." ) )
41 .Tooltip( _( "Open Autodetected file(s) on a new layer." ) )
42 .Icon( BITMAPS::load_gerber ) );
43
45 .Name( "gerbview.Control.openGerber" )
46 .Scope( AS_GLOBAL )
47 .MenuText( _( "Open Gerber Plot File(s)..." ) )
48 .Tooltip( _( "Open Gerber plot file(s) on a new layer." ) )
49 .Icon( BITMAPS::load_gerber ) );
50
52 .Name( "gerbview.Control.openDrillFile" )
53 .Scope( AS_GLOBAL )
54 .MenuText( _( "Open Excellon Drill File(s)..." ) )
55 .Tooltip( _( "Open Excellon drill file(s) on a new layer." ) )
56 .Icon( BITMAPS::load_drill ) );
57
59 .Name( "gerbview.Control.openJobFile" )
60 .Scope( AS_GLOBAL )
61 .MenuText( _( "Open Gerber Job File..." ) )
62 .Tooltip( _( "Open a Gerber job file and its associated gerber plot files" ) )
63 .Icon( BITMAPS::file_gerber_job ) );
64
66 .Name( "gerbview.Control.openZipFile" )
67 .Scope( AS_GLOBAL )
68 .MenuText( _( "Open Zip Archive File..." ) )
69 .Tooltip( _( "Open a zipped archive (Gerber and Drill) file" ) )
70 .Icon( BITMAPS::zip ) );
71
73 .Name( "gerbview.Control.toggleLayerManager" )
74 .Scope( AS_GLOBAL )
75 .MenuText( _( "Show Layers Manager" ) )
76 .Tooltip( _( "Show or hide the layer manager" ) )
77 .Icon( BITMAPS::layers_manager ) );
78
80 .Name( "gerbview.Inspection.showDCodes" )
81 .Scope( AS_GLOBAL )
82 .MenuText( _( "List DCodes..." ) )
83 .Tooltip( _( "List D-codes defined in Gerber files" ) )
85
87 .Name( "gerbview.Inspection.showSource" )
88 .Scope( AS_GLOBAL )
89 .MenuText( _( "Show Source..." ) )
90 .Tooltip( _( "Show source file for the current layer" ) )
91 .Icon( BITMAPS::tools ) );
92
94 .Name( "gerbview.Control.exportToPcbnew" )
95 .Scope( AS_GLOBAL )
96 .MenuText( _( "Export to PCB Editor..." ) )
97 .Tooltip( _( "Export data as a KiCad PCB file" ) )
99
101 .Name( "gerbview.Control.clearLayer" )
102 .Scope( AS_GLOBAL )
103 .MenuText( _( "Clear Current Layer..." ) )
104 .Tooltip( _( "Clear the selected graphic layer" ) )
105 .Icon( BITMAPS::delete_sheet ) );
106
108 .Name( "gerbview.Control.clearAllLayers" )
109 .Scope( AS_GLOBAL )
110 .MenuText( _( "Clear All Layers" ) )
111 .Tooltip( _( "Clear all layers. All data will be deleted" ) )
112 .Icon( BITMAPS::delete_gerber ) );
113
115 .Name( "gerbview.Control.reloadAllLayers" )
116 .Scope( AS_GLOBAL )
117 .MenuText( _( "Reload All Layers" ) )
118 .Tooltip( _( "Reload all layers. All data will be reloaded" ) )
119 .Icon( BITMAPS::reload ) );
120
122 .Name( "gerbview.Control.layerChanged" )
123 .Scope( AS_GLOBAL )
124 .Flags( AF_NOTIFY ) );
125
127 .Name( "gerbview.Control.highlightClear" )
128 .Scope( AS_GLOBAL )
129 .MenuText( _( "Clear Highlight" ) )
130 .Tooltip( _( "Clear Highlight" ) )
131 .Icon( BITMAPS::cancel ) );
132
134 .Name( "gerbview.Control.highlightNet" )
135 .Scope( AS_GLOBAL )
136 .MenuText( _( "Highlight Net" ) )
137 .Tooltip( _( "Highlight Net" ) )
138 .Icon( BITMAPS::general_ratsnest ) );
139
141 .Name( "gerbview.Control.highlightComponent" )
142 .Scope( AS_GLOBAL )
143 .MenuText( _( "Highlight Component" ) )
144 .Tooltip( _( "Highlight Component" ) )
145 .Icon( BITMAPS::module ) );
146
148 .Name( "gerbview.Control.highlightAttribute" )
149 .Scope( AS_GLOBAL )
150 .MenuText( _( "Highlight Attribute" ) )
151 .Tooltip( _( "Highlight Attribute" ) )
152 .Icon( BITMAPS::flag ) );
153
155 .Name( "gerbview.Control.highlightDCode" )
156 .Scope( AS_GLOBAL )
157 .MenuText( _( "Highlight DCode" ) )
158 .Tooltip( _( "Highlight DCode" ) )
159 .Icon( BITMAPS::show_dcodenumber ) );
160
162 .Name( "gerbview.Control.layerNext" )
163 .Scope( AS_GLOBAL )
164 .DefaultHotkey( WXK_PAGEDOWN )
165 .LegacyHotkeyName( "Switch to Next Layer" )
166 .MenuText( _( "Next Layer" ) )
167 .Tooltip( _( "Next Layer" ) ) );
168
170 .Name( "gerbview.Control.layerPrev" )
171 .Scope( AS_GLOBAL )
172 .DefaultHotkey( WXK_PAGEUP )
173 .LegacyHotkeyName( "Switch to Previous Layer" )
174 .MenuText( _( "Previous Layer" ) )
175 .Tooltip( _( "Previous Layer" ) ) );
176
178 .Name( "gerbview.Control.moveLayerUp" )
179 .Scope( AS_GLOBAL )
180 .DefaultHotkey( '+' )
181 .MenuText( _( "Move Layer Up" ) )
182 .Tooltip( _( "Move Current Layer up" ) )
183 .Icon( BITMAPS::up ) );
184
186 .Name( "gerbview.Control.moveLayerDown" )
187 .Scope( AS_GLOBAL )
188 .DefaultHotkey( '-' )
189 .MenuText( _( "Move Layer Down" ) )
190 .Tooltip( _( "Move Current Layer Down" ) )
191 .Icon( BITMAPS::down ) );
192
194 .Name( "gerbview.Control.linesDisplayOutlines" )
195 .Scope( AS_GLOBAL )
196 .DefaultHotkey( 'L' )
197 .LegacyHotkeyName( "Gbr Lines Display Mode" )
198 .MenuText( _( "Sketch Lines" ) )
199 .Tooltip( _( "Show lines in outline mode" ) )
200 .Icon( BITMAPS::showtrack ) );
201
203 .Name( "gerbview.Control.flashedDisplayOutlines" )
204 .Scope( AS_GLOBAL )
205 .DefaultHotkey( 'F' )
206 .LegacyHotkeyName( "Gbr Flashed Display Mode" )
207 .MenuText( _( "Sketch Flashed Items" ) )
208 .Tooltip( _( "Show flashed items in outline mode" ) )
209 .Icon( BITMAPS::pad_sketch ) );
210
212 .Name( "gerbview.Control.polygonsDisplayOutlines" )
213 .Scope( AS_GLOBAL )
214 .DefaultHotkey( 'P' )
215 .LegacyHotkeyName( "Gbr Polygons Display Mode" )
216 .MenuText( _( "Sketch Polygons" ) )
217 .Tooltip( _( "Show polygons in outline mode" ) )
218 .Icon( BITMAPS::opt_show_polygon ) );
219
221 .Name( "gerbview.Control.negativeObjectDisplay" )
222 .Scope( AS_GLOBAL )
223 .DefaultHotkey( 'N' )
224 .LegacyHotkeyName( "Gbr Negative Obj Display Mode" )
225 .MenuText( _( "Ghost Negative Objects" ) )
226 .Tooltip( _( "Show negative objects in ghost color" ) )
228
230 .Name( "gerbview.Control.dcodeDisplay" )
231 .Scope( AS_GLOBAL )
232 .DefaultHotkey( 'D' )
233 .LegacyHotkeyName( "DCodes Display Mode" )
234 .MenuText( _( "Show DCodes" ) )
235 .Tooltip( _( "Show dcode number" ) )
236 .Icon( BITMAPS::show_dcodenumber ) );
237
239 .Name( "gerbview.Control.toggleDiffMode" )
240 .Scope( AS_GLOBAL )
241 .MenuText( _( "Show in Differential Mode" ) )
242 .Tooltip( _( "Show layers in differential compare mode" ) )
243 .Icon( BITMAPS::gbr_select_mode1 ) );
244
246 .Name( "gerbview.Control.toggleXORMode" )
247 .Scope( AS_GLOBAL )
248 .MenuText( _( "Show in XOR Mode" ) )
249 .Tooltip( _( "Show layers in exclusive-or compare mode" ) )
250 .Icon( BITMAPS::gbr_select_mode2 ) );
251
253 .Name( "gerbview.Control.flipGerberView" )
254 .Scope( AS_GLOBAL )
255 .MenuText( _( "Flip Gerber View" ) )
256 .Tooltip( _( "Show as mirror image" ) )
257 .Icon( BITMAPS::flip_board ) );
258
259
260// GERBVIEW_SELECTION_TOOL
261//
263 .Name( "gerbview.InteractiveSelection" )
264 .Scope( AS_GLOBAL )
265 .Flags( AF_ACTIVATE ) );
266
268 .Name( "gerbview.InteractiveSelection.SelectItem" )
269 .Scope( AS_GLOBAL ) );
270
272 .Name( "gerbview.InteractiveSelection.UnselectItem" )
273 .Scope( AS_GLOBAL ) );
274
276 .Name( "gerbview.InteractiveSelection.Clear" )
277 .Scope( AS_GLOBAL ) );
278
279
280// Drag and drop
281//
283 .Name( "gerbview.Control.loadZipFile" )
284 .Scope( AS_GLOBAL ) );
285
287 .Name( "gerbview.Control.loadGerbFiles" )
288 .Scope( AS_GLOBAL ) );
@ gerbview_show_negative_objects
@ gbr_select_mode2
@ general_ratsnest
@ delete_gerber
@ show_dcodenumber
@ delete_sheet
@ file_gerber_job
@ layers_manager
@ gbr_select_mode1
@ opt_show_polygon
@ export_to_pcbnew
static TOOL_ACTION dcodeDisplay
static TOOL_ACTION negativeObjectDisplay
static TOOL_ACTION selectionActivate
Activation of the selection tool.
static TOOL_ACTION flashedDisplayOutlines
static TOOL_ACTION selectItem
Selects an item (specified as the event parameter).
static TOOL_ACTION highlightAttribute
static TOOL_ACTION exportToPcbnew
static TOOL_ACTION unselectItem
Unselects an item (specified as the event parameter).
static TOOL_ACTION showDCodes
static TOOL_ACTION highlightNet
static TOOL_ACTION toggleXORMode
static TOOL_ACTION loadZipFile
static TOOL_ACTION toggleLayerManager
static TOOL_ACTION openGerber
static TOOL_ACTION toggleDiffMode
static TOOL_ACTION clearAllLayers
static TOOL_ACTION layerNext
static TOOL_ACTION flipGerberView
static TOOL_ACTION openAutodetected
static TOOL_ACTION reloadAllLayers
static TOOL_ACTION linesDisplayOutlines
static TOOL_ACTION layerPrev
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION openDrillFile
static TOOL_ACTION polygonsDisplayOutlines
static TOOL_ACTION highlightComponent
static TOOL_ACTION openZipFile
static TOOL_ACTION highlightDCode
static TOOL_ACTION showSource
static TOOL_ACTION moveLayerUp
static TOOL_ACTION moveLayerDown
static TOOL_ACTION layerChanged
static TOOL_ACTION loadGerbFiles
static TOOL_ACTION openJobFile
static TOOL_ACTION clearLayer
static TOOL_ACTION highlightClear
Build up the properties of a TOOL_ACTION in an incremental manner that is static-construction safe.
Definition: tool_action.h:67
Represent a single user action.
Definition: tool_action.h:219
#define _(s)
@ AS_GLOBAL
Global action (toolbar/main menu event, global shortcut)
Definition: tool_action.h:48
@ AF_ACTIVATE
Action activates a tool.
Definition: tool_action.h:55
@ AF_NOTIFY
Action is a notification (it is by default passed to all tools)
Definition: tool_action.h:56