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 .Icon( BITMAPS::layers_manager ) );
78
80 .Name( "gerbview.Inspection.showDCodes" )
81 .Scope( AS_GLOBAL )
82 .FriendlyName( _( "List DCodes..." ) )
83 .Tooltip( _( "List D-codes defined in Gerber files" ) )
85
87 .Name( "gerbview.Inspection.showSource" )
88 .Scope( AS_GLOBAL )
89 .FriendlyName( _( "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 .FriendlyName( _( "Export to PCB Editor..." ) )
97 .Tooltip( _( "Export data as a KiCad PCB file" ) )
99
101 .Name( "gerbview.Control.clearLayer" )
102 .Scope( AS_GLOBAL )
103 .FriendlyName( _( "Clear Current Layer..." ) )
104 .Icon( BITMAPS::delete_sheet ) );
105
107 .Name( "gerbview.Control.clearAllLayers" )
108 .Scope( AS_GLOBAL )
109 .FriendlyName( _( "Clear All Layers" ) )
110 .Icon( BITMAPS::delete_gerber ) );
111
113 .Name( "gerbview.Control.reloadAllLayers" )
114 .Scope( AS_GLOBAL )
115 .FriendlyName( _( "Reload All Layers" ) )
116 .Icon( BITMAPS::reload ) );
117
119 .Name( "gerbview.Control.layerChanged" )
120 .Scope( AS_GLOBAL )
121 .Flags( AF_NOTIFY ) );
122
124 .Name( "gerbview.Control.highlightClear" )
125 .Scope( AS_GLOBAL )
126 .FriendlyName( _( "Clear Highlight" ) )
127 .Icon( BITMAPS::cancel ) );
128
130 .Name( "gerbview.Control.highlightNet" )
131 .Scope( AS_GLOBAL )
132 .FriendlyName( _( "Highlight Net" ) )
133 .Icon( BITMAPS::general_ratsnest ) );
134
136 .Name( "gerbview.Control.highlightComponent" )
137 .Scope( AS_GLOBAL )
138 .FriendlyName( _( "Highlight Component" ) )
139 .Icon( BITMAPS::module ) );
140
142 .Name( "gerbview.Control.highlightAttribute" )
143 .Scope( AS_GLOBAL )
144 .FriendlyName( _( "Highlight Attribute" ) )
145 .Icon( BITMAPS::flag ) );
146
148 .Name( "gerbview.Control.highlightDCode" )
149 .Scope( AS_GLOBAL )
150 .FriendlyName( _( "Highlight DCode" ) )
151 .Icon( BITMAPS::show_dcodenumber ) );
152
154 .Name( "gerbview.Control.layerNext" )
155 .Scope( AS_GLOBAL )
156 .DefaultHotkey( WXK_PAGEDOWN )
157 .LegacyHotkeyName( "Switch to Next Layer" )
158 .FriendlyName( _( "Next Layer" ) ) );
159
161 .Name( "gerbview.Control.layerPrev" )
162 .Scope( AS_GLOBAL )
163 .DefaultHotkey( WXK_PAGEUP )
164 .LegacyHotkeyName( "Switch to Previous Layer" )
165 .FriendlyName( _( "Previous Layer" ) ) );
166
168 .Name( "gerbview.Control.moveLayerUp" )
169 .Scope( AS_GLOBAL )
170 .DefaultHotkey( '+' )
171 .FriendlyName( _( "Move Layer Up" ) )
172 .Icon( BITMAPS::up ) );
173
175 .Name( "gerbview.Control.moveLayerDown" )
176 .Scope( AS_GLOBAL )
177 .DefaultHotkey( '-' )
178 .FriendlyName( _( "Move Layer Down" ) )
179 .Icon( BITMAPS::down ) );
180
182 .Name( "gerbview.Control.linesDisplayOutlines" )
183 .Scope( AS_GLOBAL )
184 .DefaultHotkey( 'L' )
185 .LegacyHotkeyName( "Gbr Lines Display Mode" )
186 .FriendlyName( _( "Sketch Lines" ) )
187 .Tooltip( _( "Show lines in outline mode" ) )
188 .Icon( BITMAPS::showtrack ) );
189
191 .Name( "gerbview.Control.flashedDisplayOutlines" )
192 .Scope( AS_GLOBAL )
193 .DefaultHotkey( 'F' )
194 .LegacyHotkeyName( "Gbr Flashed Display Mode" )
195 .FriendlyName( _( "Sketch Flashed Items" ) )
196 .Tooltip( _( "Show flashed items in outline mode" ) )
197 .Icon( BITMAPS::pad_sketch ) );
198
200 .Name( "gerbview.Control.polygonsDisplayOutlines" )
201 .Scope( AS_GLOBAL )
202 .DefaultHotkey( 'P' )
203 .LegacyHotkeyName( "Gbr Polygons Display Mode" )
204 .FriendlyName( _( "Sketch Polygons" ) )
205 .Tooltip( _( "Show polygons in outline mode" ) )
206 .Icon( BITMAPS::opt_show_polygon ) );
207
209 .Name( "gerbview.Control.negativeObjectDisplay" )
210 .Scope( AS_GLOBAL )
211 .LegacyHotkeyName( "Gbr Negative Obj Display Mode" )
212 .FriendlyName( _( "Ghost Negative Objects" ) )
213 .Tooltip( _( "Show negative objects in ghost color" ) )
215
217 .Name( "gerbview.Control.dcodeDisplay" )
218 .Scope( AS_GLOBAL )
219 .DefaultHotkey( 'D' )
220 .LegacyHotkeyName( "DCodes Display Mode" )
221 .FriendlyName( _( "Show DCodes" ) )
222 .Tooltip( _( "Show dcode numbers" ) )
223 .Icon( BITMAPS::show_dcodenumber ) );
224
226 .Name( "gerbview.Control.toggleForceOpacityMode" )
227 .Scope( AS_GLOBAL )
228 .FriendlyName( _( "Show with Forced Opacity Mode" ) )
229 .Tooltip( _( "Show layers using opacity color forced mode" ) )
230 .Icon( BITMAPS::gbr_select_mode1 ) );
231
233 .Name( "gerbview.Control.toggleXORMode" )
234 .Scope( AS_GLOBAL )
235 .FriendlyName( _( "Show in XOR Mode" ) )
236 .Tooltip( _( "Show layers in exclusive-or compare mode" ) )
237 .Icon( BITMAPS::gbr_select_mode2 ) );
238
240 .Name( "gerbview.Control.flipGerberView" )
241 .Scope( AS_GLOBAL )
242 .FriendlyName( _( "Flip Gerber View" ) )
243 .Tooltip( _( "Show as mirror image" ) )
244 .Icon( BITMAPS::flip_board ) );
245
246
247// GERBVIEW_SELECTION_TOOL
248//
250 .Name( "gerbview.InteractiveSelection" )
251 .Scope( AS_GLOBAL )
252 .Flags( AF_ACTIVATE ) );
253
255 .Name( "gerbview.InteractiveSelection.SelectItem" )
256 .Scope( AS_GLOBAL ) );
257
259 .Name( "gerbview.InteractiveSelection.UnselectItem" )
260 .Scope( AS_GLOBAL ) );
261
263 .Name( "gerbview.InteractiveSelection.Clear" )
264 .Scope( AS_GLOBAL ) );
265
266
267// Drag and drop
268//
270 .Name( "gerbview.Control.loadZipFile" )
271 .Scope( AS_GLOBAL ) );
272
274 .Name( "gerbview.Control.loadGerbFiles" )
275 .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 clearAllLayers
static TOOL_ACTION layerNext
static TOOL_ACTION flipGerberView
static TOOL_ACTION openAutodetected
static TOOL_ACTION reloadAllLayers
static TOOL_ACTION toggleForceOpacityMode
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