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 * Copyright (C) 2023 CERN
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#include <bitmaps.h>
23#include <tool/tool_action.h>
24#include <tool/tool_manager.h>
26
27
28// Actions, being statically-defined, require specialized I18N handling. We continue to
29// use the _() macro so that string harvesting by the I18N framework doesn't have to be
30// specialized, but we don't translate on initialization and instead do it in the getters.
31
32#undef _
33#define _(s) s
34
35
36// GERBVIEW_CONTROL
37//
39 .Name( "gerbview.Control.openAutodetected" )
40 .Scope( AS_GLOBAL )
41 .FriendlyName( _( "Open Autodetected File(s)..." ) )
42 .Tooltip( _( "Open Autodetected file(s) on a new layer." ) )
43 .Icon( BITMAPS::load_gerber ) );
44
46 .Name( "gerbview.Control.openGerber" )
47 .Scope( AS_GLOBAL )
48 .FriendlyName( _( "Open Gerber Plot File(s)..." ) )
49 .Tooltip( _( "Open Gerber plot file(s) on a new layer." ) )
50 .Icon( BITMAPS::load_gerber ) );
51
53 .Name( "gerbview.Control.openDrillFile" )
54 .Scope( AS_GLOBAL )
55 .FriendlyName( _( "Open Excellon Drill File(s)..." ) )
56 .Tooltip( _( "Open Excellon drill file(s) on a new layer." ) )
57 .Icon( BITMAPS::load_drill ) );
58
60 .Name( "gerbview.Control.openJobFile" )
61 .Scope( AS_GLOBAL )
62 .FriendlyName( _( "Open Gerber Job File..." ) )
63 .Tooltip( _( "Open a Gerber job file and its associated gerber plot files" ) )
64 .Icon( BITMAPS::file_gerber_job ) );
65
67 .Name( "gerbview.Control.openZipFile" )
68 .Scope( AS_GLOBAL )
69 .FriendlyName( _( "Open Zip Archive File..." ) )
70 .Tooltip( _( "Open a zipped archive (Gerber and Drill) file" ) )
71 .Icon( BITMAPS::zip ) );
72
74 .Name( "gerbview.Control.toggleLayerManager" )
75 .Scope( AS_GLOBAL )
76 .FriendlyName( _( "Show Layers Manager" ) )
77 .Tooltip( _( "Show or hide the layer manager" ) )
78 .Icon( BITMAPS::layers_manager ) );
79
81 .Name( "gerbview.Inspection.showDCodes" )
82 .Scope( AS_GLOBAL )
83 .FriendlyName( _( "List DCodes..." ) )
84 .Tooltip( _( "List D-codes defined in Gerber files" ) )
86
88 .Name( "gerbview.Inspection.showSource" )
89 .Scope( AS_GLOBAL )
90 .FriendlyName( _( "Show Source..." ) )
91 .Tooltip( _( "Show source file for the current layer" ) )
92 .Icon( BITMAPS::tools ) );
93
95 .Name( "gerbview.Control.exportToPcbnew" )
96 .Scope( AS_GLOBAL )
97 .FriendlyName( _( "Export to PCB Editor..." ) )
98 .Tooltip( _( "Export data as a KiCad PCB file" ) )
100
102 .Name( "gerbview.Control.clearLayer" )
103 .Scope( AS_GLOBAL )
104 .FriendlyName( _( "Clear Current Layer..." ) )
105 .Tooltip( _( "Clear the selected graphic layer" ) )
106 .Icon( BITMAPS::delete_sheet ) );
107
109 .Name( "gerbview.Control.clearAllLayers" )
110 .Scope( AS_GLOBAL )
111 .FriendlyName( _( "Clear All Layers" ) )
112 .Tooltip( _( "Clear all layers. All data will be deleted" ) )
113 .Icon( BITMAPS::delete_gerber ) );
114
116 .Name( "gerbview.Control.reloadAllLayers" )
117 .Scope( AS_GLOBAL )
118 .FriendlyName( _( "Reload All Layers" ) )
119 .Tooltip( _( "Reload all layers. All data will be reloaded" ) )
120 .Icon( BITMAPS::reload ) );
121
123 .Name( "gerbview.Control.layerChanged" )
124 .Scope( AS_GLOBAL )
125 .Flags( AF_NOTIFY ) );
126
128 .Name( "gerbview.Control.highlightClear" )
129 .Scope( AS_GLOBAL )
130 .FriendlyName( _( "Clear Highlight" ) )
131 .Icon( BITMAPS::cancel ) );
132
134 .Name( "gerbview.Control.highlightNet" )
135 .Scope( AS_GLOBAL )
136 .FriendlyName( _( "Highlight Net" ) )
137 .Icon( BITMAPS::general_ratsnest ) );
138
140 .Name( "gerbview.Control.highlightComponent" )
141 .Scope( AS_GLOBAL )
142 .FriendlyName( _( "Highlight Component" ) )
143 .Icon( BITMAPS::module ) );
144
146 .Name( "gerbview.Control.highlightAttribute" )
147 .Scope( AS_GLOBAL )
148 .FriendlyName( _( "Highlight Attribute" ) )
149 .Icon( BITMAPS::flag ) );
150
152 .Name( "gerbview.Control.highlightDCode" )
153 .Scope( AS_GLOBAL )
154 .FriendlyName( _( "Highlight DCode" ) )
155 .Icon( BITMAPS::show_dcodenumber ) );
156
158 .Name( "gerbview.Control.layerNext" )
159 .Scope( AS_GLOBAL )
160 .DefaultHotkey( WXK_PAGEDOWN )
161 .LegacyHotkeyName( "Switch to Next Layer" )
162 .FriendlyName( _( "Next Layer" ) ) );
163
165 .Name( "gerbview.Control.layerPrev" )
166 .Scope( AS_GLOBAL )
167 .DefaultHotkey( WXK_PAGEUP )
168 .LegacyHotkeyName( "Switch to Previous Layer" )
169 .FriendlyName( _( "Previous Layer" ) ) );
170
172 .Name( "gerbview.Control.moveLayerUp" )
173 .Scope( AS_GLOBAL )
174 .DefaultHotkey( '+' )
175 .FriendlyName( _( "Move Layer Up" ) )
176 .Tooltip( _( "Move current layer up" ) )
177 .Icon( BITMAPS::up ) );
178
180 .Name( "gerbview.Control.moveLayerDown" )
181 .Scope( AS_GLOBAL )
182 .DefaultHotkey( '-' )
183 .FriendlyName( _( "Move Layer Down" ) )
184 .Tooltip( _( "Move current layer down" ) )
185 .Icon( BITMAPS::down ) );
186
188 .Name( "gerbview.Control.linesDisplayOutlines" )
189 .Scope( AS_GLOBAL )
190 .DefaultHotkey( 'L' )
191 .LegacyHotkeyName( "Gbr Lines Display Mode" )
192 .FriendlyName( _( "Sketch Lines" ) )
193 .Tooltip( _( "Show lines in outline mode" ) )
194 .Icon( BITMAPS::showtrack ) );
195
197 .Name( "gerbview.Control.flashedDisplayOutlines" )
198 .Scope( AS_GLOBAL )
199 .DefaultHotkey( 'F' )
200 .LegacyHotkeyName( "Gbr Flashed Display Mode" )
201 .FriendlyName( _( "Sketch Flashed Items" ) )
202 .Tooltip( _( "Show flashed items in outline mode" ) )
203 .Icon( BITMAPS::pad_sketch ) );
204
206 .Name( "gerbview.Control.polygonsDisplayOutlines" )
207 .Scope( AS_GLOBAL )
208 .DefaultHotkey( 'P' )
209 .LegacyHotkeyName( "Gbr Polygons Display Mode" )
210 .FriendlyName( _( "Sketch Polygons" ) )
211 .Tooltip( _( "Show polygons in outline mode" ) )
212 .Icon( BITMAPS::opt_show_polygon ) );
213
215 .Name( "gerbview.Control.negativeObjectDisplay" )
216 .Scope( AS_GLOBAL )
217 .LegacyHotkeyName( "Gbr Negative Obj Display Mode" )
218 .FriendlyName( _( "Ghost Negative Objects" ) )
219 .Tooltip( _( "Show negative objects in ghost color" ) )
221
223 .Name( "gerbview.Control.dcodeDisplay" )
224 .Scope( AS_GLOBAL )
225 .DefaultHotkey( 'D' )
226 .LegacyHotkeyName( "DCodes Display Mode" )
227 .FriendlyName( _( "Show DCodes" ) )
228 .Tooltip( _( "Show dcode number" ) )
229 .Icon( BITMAPS::show_dcodenumber ) );
230
232 .Name( "gerbview.Control.toggleDiffMode" )
233 .Scope( AS_GLOBAL )
234 .FriendlyName( _( "Show in Differential Mode" ) )
235 .Tooltip( _( "Show layers in differential compare mode" ) )
236 .Icon( BITMAPS::gbr_select_mode1 ) );
237
239 .Name( "gerbview.Control.toggleXORMode" )
240 .Scope( AS_GLOBAL )
241 .FriendlyName( _( "Show in XOR Mode" ) )
242 .Tooltip( _( "Show layers in exclusive-or compare mode" ) )
243 .Icon( BITMAPS::gbr_select_mode2 ) );
244
246 .Name( "gerbview.Control.flipGerberView" )
247 .Scope( AS_GLOBAL )
248 .FriendlyName( _( "Flip Gerber View" ) )
249 .Tooltip( _( "Show as mirror image" ) )
250 .Icon( BITMAPS::flip_board ) );
251
252
253// GERBVIEW_SELECTION_TOOL
254//
256 .Name( "gerbview.InteractiveSelection" )
257 .Scope( AS_GLOBAL )
258 .Flags( AF_ACTIVATE ) );
259
261 .Name( "gerbview.InteractiveSelection.SelectItem" )
262 .Scope( AS_GLOBAL ) );
263
265 .Name( "gerbview.InteractiveSelection.UnselectItem" )
266 .Scope( AS_GLOBAL ) );
267
269 .Name( "gerbview.InteractiveSelection.Clear" )
270 .Scope( AS_GLOBAL ) );
271
272
273// Drag and drop
274//
276 .Name( "gerbview.Control.loadZipFile" )
277 .Scope( AS_GLOBAL ) );
278
280 .Name( "gerbview.Control.loadGerbFiles" )
281 .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:102
Represent a single user action.
Definition: tool_action.h:269
#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