KiCad PCB EDA Suite
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) 2019 CERN
5  * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #include <bitmaps.h>
26 #include <common.h>
27 #include <eda_units.h>
28 #include <frame_type.h>
29 #include <tool/actions.h>
30 #include <tool/tool_action.h>
31 #include <tool/tool_event.h>
32 
33 // Actions, being statically-defined, require specialized I18N handling. We continue to
34 // use the _() macro so that string harvesting by the I18N framework doesn't have to be
35 // specialized, but we don't translate on initialization and instead do it in the getters.
36 
37 #undef _
38 #define _(s) s
39 
40 TOOL_ACTION ACTIONS::doNew( "common.Control.new",
41  AS_GLOBAL,
42  MD_CTRL + 'N', LEGACY_HK_NAME( "New" ),
43  _( "New..." ), _( "Create a new document in the editor" ),
45 
46 TOOL_ACTION ACTIONS::newLibrary( "common.Control.newLibrary",
47  AS_GLOBAL,
48  0, "",
49  _( "New Library..." ), _( "Create a new library folder" ),
51 
52 TOOL_ACTION ACTIONS::addLibrary( "common.Control.addLibrary",
53  AS_GLOBAL,
54  0, "",
55  _( "Add Library..." ), _( "Add an existing library folder" ),
57 
58 TOOL_ACTION ACTIONS::open( "common.Control.open",
59  AS_GLOBAL,
60  MD_CTRL + 'O', LEGACY_HK_NAME( "Open" ),
61  _( "Open..." ), _( "Open existing document" ),
63 
64 TOOL_ACTION ACTIONS::save( "common.Control.save",
65  AS_GLOBAL,
66  MD_CTRL + 'S', LEGACY_HK_NAME( "Save" ),
67  _( "Save" ), _( "Save changes" ),
68  BITMAPS::save );
69 
70 TOOL_ACTION ACTIONS::saveAs( "common.Control.saveAs",
71  AS_GLOBAL,
72  MD_SHIFT + MD_CTRL + 'S', LEGACY_HK_NAME( "Save As" ),
73  _( "Save As..." ), _( "Save current document to another location" ),
75 
76 TOOL_ACTION ACTIONS::saveCopyAs( "common.Control.saveCopyAs",
77  AS_GLOBAL,
78  0, "",
79  _( "Save Copy As..." ), _( "Save a copy of the current document to another location" ),
81 
82 TOOL_ACTION ACTIONS::saveAll( "common.Control.saveAll",
83  AS_GLOBAL,
84  0, "",
85  _( "Save All" ), _( "Save all changes" ),
86  BITMAPS::save );
87 
88 TOOL_ACTION ACTIONS::revert( "common.Control.revert",
89  AS_GLOBAL,
90  0, "",
91  _( "Revert" ), _( "Throw away changes" ) );
92 
93 TOOL_ACTION ACTIONS::pageSettings( "common.Control.pageSettings",
94  AS_GLOBAL,
95  0, "",
96  _( "Page Settings..." ), _( "Settings for paper size and title block info" ),
98 
99 TOOL_ACTION ACTIONS::print( "common.Control.print",
100  AS_GLOBAL,
101  MD_CTRL + 'P', LEGACY_HK_NAME( "Print" ),
102  _( "Print..." ), _( "Print" ),
104 
105 TOOL_ACTION ACTIONS::plot( "common.Control.plot",
106  AS_GLOBAL,
107  0, "",
108  _( "Plot..." ), _( "Plot" ),
109  BITMAPS::plot );
110 
111 TOOL_ACTION ACTIONS::quit( "common.Control.quit",
112  AS_GLOBAL,
113  0, "", // Not currently in use due to wxWidgets crankiness
114  _( "Quit" ), _( "Close the current editor" ),
115  BITMAPS::exit );
116 
117 // Generic Edit Actions
118 TOOL_ACTION ACTIONS::cancelInteractive( "common.Interactive.cancel",
119  AS_GLOBAL,
120  0, "", // ESC key is handled in the dispatcher
121  _( "Cancel" ), _( "Cancel current tool" ),
123 
124 TOOL_ACTION ACTIONS::showContextMenu( "common.Control.showContextMenu",
125  AS_GLOBAL,
126  0, "",
127  _( "Show Context Menu" ), _( "Perform the right-mouse-button action" ),
128  BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_RIGHT_CLICK );
129 
130 TOOL_ACTION ACTIONS::updateMenu( "common.Interactive.updateMenu",
131  AS_GLOBAL );
132 
133 TOOL_ACTION ACTIONS::undo( "common.Interactive.undo",
134  AS_GLOBAL,
135  MD_CTRL + 'Z', LEGACY_HK_NAME( "Undo" ),
136  _( "Undo" ), _( "Undo last edit" ),
137  BITMAPS::undo );
138 
139 TOOL_ACTION ACTIONS::redo( "common.Interactive.redo",
140  AS_GLOBAL,
141 #if defined( __WXMAC__ )
142  MD_SHIFT + MD_CTRL + 'Z',
143 #else
144  MD_CTRL + 'Y',
145 #endif
146  LEGACY_HK_NAME( "Redo" ),
147  _( "Redo" ), _( "Redo last edit" ),
148  BITMAPS::redo );
149 
150 TOOL_ACTION ACTIONS::cut( "common.Interactive.cut",
151  AS_GLOBAL,
152  MD_CTRL + 'X', LEGACY_HK_NAME( "Cut" ),
153  _( "Cut" ), _( "Cut selected item(s) to clipboard" ),
154  BITMAPS::cut );
155 
156 TOOL_ACTION ACTIONS::copy( "common.Interactive.copy",
157  AS_GLOBAL,
158  MD_CTRL + 'C', LEGACY_HK_NAME( "Copy" ),
159  _( "Copy" ), _( "Copy selected item(s) to clipboard" ),
160  BITMAPS::copy );
161 
162 TOOL_ACTION ACTIONS::paste( "common.Interactive.paste",
163  AS_GLOBAL,
164  MD_CTRL + 'V', LEGACY_HK_NAME( "Paste" ),
165  _( "Paste" ), _( "Paste items(s) from clipboard" ),
166  BITMAPS::paste );
167 
168 TOOL_ACTION ACTIONS::selectAll( "common.Interactive.selectAll",
169  AS_GLOBAL,
170  MD_CTRL + 'A', "",
171  _( "Select All" ), _( "Select all items on screen" ) );
172 
173 TOOL_ACTION ACTIONS::pasteSpecial( "common.Interactive.pasteSpecial",
174  AS_GLOBAL, 0, "",
175  _( "Paste Special..." ), _( "Paste item(s) from clipboard with options" ) );
176 
177 TOOL_ACTION ACTIONS::duplicate( "common.Interactive.duplicate",
178  AS_GLOBAL,
179  MD_CTRL + 'D', LEGACY_HK_NAME( "Duplicate" ),
180  _( "Duplicate" ), _( "Duplicates the selected item(s)" ),
182 
183 TOOL_ACTION ACTIONS::doDelete( "common.Interactive.delete",
184  AS_GLOBAL,
185 #if defined( __WXMAC__ )
186  WXK_BACK,
187 #else
188  WXK_DELETE,
189 #endif
190  LEGACY_HK_NAME( "Delete Item" ),
191  _( "Delete" ), _( "Deletes selected item(s)" ),
192  BITMAPS::trash );
193 
194 TOOL_ACTION ACTIONS::deleteTool( "common.Interactive.deleteTool",
195  AS_GLOBAL, 0, "",
196  _( "Interactive Delete Tool" ), _( "Delete clicked items" ),
198 
199 TOOL_ACTION ACTIONS::activatePointEditor( "common.Control.activatePointEditor",
200  AS_GLOBAL );
201 
202 TOOL_ACTION ACTIONS::changeEditMethod( "common.Interactive.changeEditMethod", AS_GLOBAL,
203  MD_CTRL + ' ', "", _( "Change Edit Method" ), _( "Change edit method constraints" ) );
204 
205 TOOL_ACTION ACTIONS::find( "common.Interactive.find",
206  AS_GLOBAL,
207  MD_CTRL + 'F', LEGACY_HK_NAME( "Find" ),
208  _( "Find" ), _( "Find text" ),
209  BITMAPS::find );
210 
211 TOOL_ACTION ACTIONS::findAndReplace( "common.Interactive.findAndReplace",
212  AS_GLOBAL,
213  MD_CTRL + MD_ALT + 'F', LEGACY_HK_NAME( "Find and Replace" ),
214  _( "Find and Replace" ), _( "Find and replace text" ),
216 
217 TOOL_ACTION ACTIONS::findNext( "common.Interactive.findNext",
218  AS_GLOBAL,
219  WXK_F3, LEGACY_HK_NAME( "Find Next" ),
220  _( "Find Next" ), _( "Find next match" ),
221  BITMAPS::find );
222 
223 TOOL_ACTION ACTIONS::findNextMarker( "common.Interactive.findNextMarker",
224  AS_GLOBAL,
225  MD_SHIFT + WXK_F3, LEGACY_HK_NAME( "Find Next Marker" ),
226  _( "Find Next Marker" ), "",
227  BITMAPS::find );
228 
229 TOOL_ACTION ACTIONS::replaceAndFindNext( "common.Interactive.replaceAndFindNext",
230  AS_GLOBAL,
231  0, "",
232  _( "Replace and Find Next" ), _( "Replace current match and find next" ),
234 
235 TOOL_ACTION ACTIONS::replaceAll( "common.Interactive.replaceAll",
236  AS_GLOBAL,
237  0, "",
238  _( "Replace All" ), _( "Replace all matches" ),
240 
241 TOOL_ACTION ACTIONS::updateFind( "common.Control.updateFind",
242  AS_GLOBAL );
243 
244 
245 // Marker Controls
246 TOOL_ACTION ACTIONS::prevMarker( "common.Checker.prevMarker",
247  AS_GLOBAL,
248  0, "",
249  _( "Previous Marker" ), _( "Go to previous marker in Checker window" ) );
250 
251 TOOL_ACTION ACTIONS::nextMarker( "common.Checker.nextMarker",
252  AS_GLOBAL,
253  0, "",
254  _( "Next Marker" ), _( "Go to next marker in Checker window" ) );
255 
256 TOOL_ACTION ACTIONS::excludeMarker( "common.Checker.excludeMarker",
257  AS_GLOBAL,
258  0, "",
259  _( "Exclude Marker" ), _( "Mark current violation in Checker window as an exclusion" ) );
260 
261 // View Controls
262 TOOL_ACTION ACTIONS::zoomRedraw( "common.Control.zoomRedraw",
263  AS_GLOBAL,
264 #if defined( __WXMAC__ )
265  MD_CTRL + 'R',
266 #else
267  WXK_F5,
268 #endif
269  LEGACY_HK_NAME( "Zoom Redraw" ),
270  _( "Refresh" ), _( "Refresh" ),
272 
273 TOOL_ACTION ACTIONS::zoomFitScreen( "common.Control.zoomFitScreen",
274  AS_GLOBAL,
275 #if defined( __WXMAC__ )
276  MD_CTRL + '0',
277 #else
278  WXK_HOME,
279 #endif
280  LEGACY_HK_NAME( "Zoom Auto" ),
281  _( "Zoom to Fit" ), _( "Zoom to Fit" ),
283 
284 TOOL_ACTION ACTIONS::zoomFitObjects( "common.Control.zoomFitObjects",
285  AS_GLOBAL, MD_CTRL + WXK_HOME, "",
286  _( "Zoom to Objects" ), _( "Zoom to Objects" ),
288 
289 TOOL_ACTION ACTIONS::zoomIn( "common.Control.zoomIn",
290  AS_GLOBAL,
291 #if defined( __WXMAC__ )
292  MD_CTRL + '+',
293 #else
294  WXK_F1,
295 #endif
296  LEGACY_HK_NAME( "Zoom In" ),
297  _( "Zoom In at Cursor" ), _( "Zoom In at Cursor" ),
299 
300 TOOL_ACTION ACTIONS::zoomOut( "common.Control.zoomOut",
301  AS_GLOBAL,
302 #if defined( __WXMAC__ )
303  MD_CTRL + '-',
304 #else
305  WXK_F2,
306 #endif
307  LEGACY_HK_NAME( "Zoom Out" ),
308  _( "Zoom Out at Cursor" ), _( "Zoom Out at Cursor" ),
310 
311 TOOL_ACTION ACTIONS::zoomInCenter( "common.Control.zoomInCenter",
312  AS_GLOBAL,
313  0, "",
314  _( "Zoom In" ), _( "Zoom In" ),
316 
317 TOOL_ACTION ACTIONS::zoomOutCenter( "common.Control.zoomOutCenter",
318  AS_GLOBAL,
319  0, "",
320  _( "Zoom Out" ), _( "Zoom Out" ),
322 
323 TOOL_ACTION ACTIONS::zoomCenter( "common.Control.zoomCenter",
324  AS_GLOBAL,
325  WXK_F4, LEGACY_HK_NAME( "Zoom Center" ),
326  _( "Center" ), _( "Center" ),
328 
329 TOOL_ACTION ACTIONS::zoomTool( "common.Control.zoomTool",
330  AS_GLOBAL,
331  MD_CTRL + WXK_F5, LEGACY_HK_NAME( "Zoom to Selection" ),
332  _( "Zoom to Selection" ), _( "Zoom to Selection" ),
334 
335 TOOL_ACTION ACTIONS::zoomPreset( "common.Control.zoomPreset",
336  AS_GLOBAL );
337 
338 TOOL_ACTION ACTIONS::centerContents( "common.Control.centerContents",
339  AS_GLOBAL );
340 
341 // Cursor control
342 TOOL_ACTION ACTIONS::cursorUp( "common.Control.cursorUp",
343  AS_GLOBAL,
344  WXK_UP, "",
345  _( "Cursor Up" ), "",
346  BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_UP );
347 
348 TOOL_ACTION ACTIONS::cursorDown( "common.Control.cursorDown",
349  AS_GLOBAL,
350  WXK_DOWN, "",
351  _( "Cursor Down" ), "" ,
352  BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_DOWN );
353 
354 TOOL_ACTION ACTIONS::cursorLeft( "common.Control.cursorLeft",
355  AS_GLOBAL,
356  WXK_LEFT, "",
357  _( "Cursor Left" ), "" ,
358  BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_LEFT );
359 
360 TOOL_ACTION ACTIONS::cursorRight( "common.Control.cursorRight",
361  AS_GLOBAL,
362  WXK_RIGHT, "",
363  _( "Cursor Right" ), "" ,
364  BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_RIGHT );
365 
366 
367 TOOL_ACTION ACTIONS::cursorUpFast( "common.Control.cursorUpFast",
368  AS_GLOBAL,
369  MD_CTRL + WXK_UP, "",
370  _( "Cursor Up Fast" ), "",
371  BITMAPS::INVALID_BITMAP, AF_NONE, (void*) ( CURSOR_UP | CURSOR_FAST_MOVE ) );
372 
373 TOOL_ACTION ACTIONS::cursorDownFast( "common.Control.cursorDownFast",
374  AS_GLOBAL,
375  MD_CTRL + WXK_DOWN, "",
376  _( "Cursor Down Fast" ), "" ,
377  BITMAPS::INVALID_BITMAP, AF_NONE, (void*) ( CURSOR_DOWN | CURSOR_FAST_MOVE ) );
378 
379 TOOL_ACTION ACTIONS::cursorLeftFast( "common.Control.cursorLeftFast",
380  AS_GLOBAL,
381  MD_CTRL + WXK_LEFT, "",
382  _( "Cursor Left Fast" ), "" ,
383  BITMAPS::INVALID_BITMAP, AF_NONE, (void*) ( CURSOR_LEFT | CURSOR_FAST_MOVE ) );
384 
385 TOOL_ACTION ACTIONS::cursorRightFast( "common.Control.cursorRightFast",
386  AS_GLOBAL,
387  MD_CTRL + WXK_RIGHT, "",
388  _( "Cursor Right Fast" ), "" ,
389  BITMAPS::INVALID_BITMAP, AF_NONE, (void*) ( CURSOR_RIGHT | CURSOR_FAST_MOVE ) );
390 
391 TOOL_ACTION ACTIONS::cursorClick( "common.Control.cursorClick",
392  AS_GLOBAL,
393  WXK_RETURN, LEGACY_HK_NAME( "Mouse Left Click" ),
394  _( "Click" ), _( "Performs left mouse button click" ),
395  BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_CLICK );
396 
397 TOOL_ACTION ACTIONS::cursorDblClick( "common.Control.cursorDblClick",
398  AS_GLOBAL,
399  WXK_END, LEGACY_HK_NAME( "Mouse Left Double Click" ),
400  _( "Double-click" ), _( "Performs left mouse button double-click" ),
401  BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_DBL_CLICK );
402 
403 TOOL_ACTION ACTIONS::refreshPreview( "common.Control.refreshPreview",
404  AS_GLOBAL );
405 
406 TOOL_ACTION ACTIONS::pinLibrary( "common.Control.pinLibrary",
407  AS_GLOBAL, 0, "",
408  _( "Pin Library" ),
409  _( "Keep the library at the top of the list" ) );
410 
411 TOOL_ACTION ACTIONS::unpinLibrary( "common.Control.unpinLibrary",
412  AS_GLOBAL, 0, "",
413  _( "Unpin Library" ),
414  _( "No longer keep the library at the top of the list" ) );
415 
416 TOOL_ACTION ACTIONS::panUp( "common.Control.panUp",
417  AS_GLOBAL,
418  MD_SHIFT + WXK_UP, "",
419  _( "Pan Up" ), "",
420  BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_UP );
421 
422 TOOL_ACTION ACTIONS::panDown( "common.Control.panDown",
423  AS_GLOBAL,
424  MD_SHIFT + WXK_DOWN, "",
425  _( "Pan Down" ), "" ,
426  BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_DOWN );
427 
428 TOOL_ACTION ACTIONS::panLeft( "common.Control.panLeft",
429  AS_GLOBAL,
430  MD_SHIFT + WXK_LEFT, "",
431  _( "Pan Left" ), "" ,
432  BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_LEFT );
433 
434 TOOL_ACTION ACTIONS::panRight( "common.Control.panRight",
435  AS_GLOBAL,
436  MD_SHIFT + WXK_RIGHT, "",
437  _( "Pan Right" ), "" ,
438  BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_RIGHT );
439 
440 // Grid control
441 TOOL_ACTION ACTIONS::gridFast1( "common.Control.gridFast1",
442  AS_GLOBAL,
443  MD_ALT + '1', LEGACY_HK_NAME( "Switch Grid To Fast Grid1" ),
444  _( "Switch to Fast Grid 1" ), "" );
445 
446 TOOL_ACTION ACTIONS::gridFast2( "common.Control.gridFast2",
447  AS_GLOBAL,
448  MD_ALT + '2', LEGACY_HK_NAME( "Switch Grid To Fast Grid2" ),
449  _( "Switch to Fast Grid 2" ), "" );
450 
451 TOOL_ACTION ACTIONS::gridNext( "common.Control.gridNext",
452  AS_GLOBAL,
453  'N', LEGACY_HK_NAME( "Switch Grid To Next" ),
454  _("Switch to Next Grid" ), "" );
455 
456 TOOL_ACTION ACTIONS::gridPrev( "common.Control.gridPrev",
457  AS_GLOBAL, MD_SHIFT + 'N', LEGACY_HK_NAME( "Switch Grid To Previous" ),
458  _( "Switch to Previous Grid" ), "" );
459 
460 TOOL_ACTION ACTIONS::gridSetOrigin( "common.Control.gridSetOrigin",
461  AS_GLOBAL,
462  'S', LEGACY_HK_NAME( "Set Grid Origin" ),
463  _( "Grid Origin" ), _( "Set the grid origin point" ),
465 
466 TOOL_ACTION ACTIONS::gridResetOrigin( "common.Control.gridResetOrigin",
467  AS_GLOBAL,
468  'Z', LEGACY_HK_NAME( "Reset Grid Origin" ),
469  _( "Reset Grid Origin" ), "" );
470 
471 TOOL_ACTION ACTIONS::gridPreset( "common.Control.gridPreset",
472  AS_GLOBAL );
473 
474 TOOL_ACTION ACTIONS::toggleGrid( "common.Control.toggleGrid",
475  AS_GLOBAL, 0, "",
476  _( "Show Grid" ), _( "Display grid dots or lines in the edit window" ),
477  BITMAPS::grid );
478 
479 TOOL_ACTION ACTIONS::gridProperties( "common.Control.gridProperties",
480  AS_GLOBAL, 0, "",
481  _( "Grid Properties..." ), _( "Set grid dimensions" ),
483 
484 TOOL_ACTION ACTIONS::inchesUnits( "common.Control.imperialUnits",
485  AS_GLOBAL, 0, "",
486  _( "Inches" ), _( "Use inches" ),
488 
489 TOOL_ACTION ACTIONS::milsUnits( "common.Control.mils",
490  AS_GLOBAL, 0, "",
491  _( "Mils" ), _( "Use mils" ),
493 
494 TOOL_ACTION ACTIONS::millimetersUnits( "common.Control.metricUnits",
495  AS_GLOBAL, 0, "",
496  _( "Millimeters" ), _( "Use millimeters" ),
498 
499 TOOL_ACTION ACTIONS::updateUnits( "common.Control.updateUnits",
500  AS_GLOBAL );
501 
502 TOOL_ACTION ACTIONS::toggleUnits( "common.Control.toggleUnits",
503  AS_GLOBAL,
504  MD_CTRL + 'U', LEGACY_HK_NAME( "Switch Units" ),
505  _( "Switch units" ), _( "Switch between imperial and metric units" ),
507 
508 TOOL_ACTION ACTIONS::togglePolarCoords( "common.Control.togglePolarCoords",
509  AS_GLOBAL, 0, "",
510  _( "Polar Coordinates" ), _( "Switch between polar and cartesian coordinate systems" ),
512 
513 TOOL_ACTION ACTIONS::resetLocalCoords( "common.Control.resetLocalCoords",
514  AS_GLOBAL,
515  ' ', LEGACY_HK_NAME( "Reset Local Coordinates" ),
516  _( "Reset Local Coordinates" ), "" );
517 
518 TOOL_ACTION ACTIONS::toggleCursor( "common.Control.toggleCursor",
519  AS_GLOBAL,
520  // Don't be tempted to remove "Modern Toolset only". It's in the legacy property name.
521  MD_CTRL + MD_SHIFT + 'X', LEGACY_HK_NAME( "Toggle Cursor Display (Modern Toolset only)" ),
522  _( "Always Show Cursor" ), _( "Display crosshairs even in selection tool" ),
523  BITMAPS::cursor );
524 
525 TOOL_ACTION ACTIONS::toggleCursorStyle( "common.Control.toggleCursorStyle",
526  AS_GLOBAL, 0, "",
527  _( "Full-Window Crosshairs" ), _( "Switch display of full-window crosshairs" ),
529 
530 TOOL_ACTION ACTIONS::highContrastMode( "common.Control.highContrastMode",
531  AS_GLOBAL,
532  0, LEGACY_HK_NAME( "Toggle High Contrast Mode" ),
533  _( "Inactive Layer View Mode" ),
534  _( "Toggle inactive layers between normal and dimmed" ),
536 
537 TOOL_ACTION ACTIONS::highContrastModeCycle( "common.Control.highContrastModeCycle",
538  AS_GLOBAL,
539  'H', "",
540  _( "Inactive Layer View Mode (3-state)" ),
541  _( "Cycle inactive layers between normal, dimmed, and hidden" ),
543 
544 TOOL_ACTION ACTIONS::selectionTool( "common.InteractiveSelection.selectionTool",
545  AS_GLOBAL, 0, "",
546  _( "Select item(s)" ), _( "Select item(s)" ),
548 
549 TOOL_ACTION ACTIONS::measureTool( "common.InteractiveEdit.measureTool",
550  AS_GLOBAL,
551  // Don't be tempted to remove "Modern Toolset only". It's in the legacy property name.
552  MD_CTRL + MD_SHIFT + 'M', LEGACY_HK_NAME( "Measure Distance (Modern Toolset only)" ),
553  _( "Measure Tool" ), _( "Interactively measure distance between points" ),
555 
556 TOOL_ACTION ACTIONS::pickerTool( "common.InteractivePicker.pickerTool",
557  AS_GLOBAL, 0, "",
558  "", "",
560 
561 TOOL_ACTION ACTIONS::show3DViewer( "common.Control.show3DViewer",
562  AS_GLOBAL,
563  MD_ALT + '3', LEGACY_HK_NAME( "3D Viewer" ),
564  _( "3D Viewer" ), _( "Show 3D viewer window" ),
566 
567 TOOL_ACTION ACTIONS::showSymbolBrowser( "common.Control.showSymbolBrowser",
568  AS_GLOBAL, 0, "",
569  _( "Symbol Library Browser" ), _( "Browse symbol libraries" ),
571 
572 TOOL_ACTION ACTIONS::showSymbolEditor( "common.Control.showSymbolEditor",
573  AS_GLOBAL, 0, "",
574  _( "Symbol Editor" ), _( "Create, delete and edit symbols" ),
576 
577 TOOL_ACTION ACTIONS::showFootprintBrowser( "common.Control.showFootprintBrowser",
578  AS_GLOBAL, 0, "",
579  _( "Footprint Library Browser" ), _( "Browse footprint libraries" ),
581 
582 TOOL_ACTION ACTIONS::showFootprintEditor( "common.Control.showFootprintEditor",
583  AS_GLOBAL, 0, "",
584  _( "Footprint Editor" ), _( "Create, delete and edit footprints" ),
586 
587 TOOL_ACTION ACTIONS::updatePcbFromSchematic( "common.Control.updatePcbFromSchematic",
588  AS_GLOBAL,
589  WXK_F8, LEGACY_HK_NAME( "Update PCB from Schematic" ),
590  _( "Update PCB from Schematic..." ), _( "Update PCB with changes made to schematic" ),
592 
593 TOOL_ACTION ACTIONS::updateSchematicFromPcb( "common.Control.updateSchematicFromPCB",
594  AS_GLOBAL, 0, "",
595  _( "Update Schematic from PCB..." ), _( "Update schematic with changes made to PCB" ),
597 
598 TOOL_ACTION ACTIONS::openPreferences( "common.SuiteControl.openPreferences",
599  AS_GLOBAL, MD_CTRL + ',', "",
600  _( "Preferences..." ), _( "Show preferences for all open tools" ),
602 
603 TOOL_ACTION ACTIONS::configurePaths( "common.SuiteControl.configurePaths",
604  AS_GLOBAL, 0, "",
605  _( "Configure Paths..." ), _( "Edit path configuration environment variables" ),
606  BITMAPS::path );
607 
608 TOOL_ACTION ACTIONS::showSymbolLibTable( "common.SuiteControl.showSymbolLibTable",
609  AS_GLOBAL, 0, "",
610  _( "Manage Symbol Libraries..." ),
611  _( "Edit the global and project symbol library lists" ),
613 
614 TOOL_ACTION ACTIONS::showFootprintLibTable( "common.SuiteControl.showFootprintLibTable",
615  AS_GLOBAL, 0, "",
616  _( "Manage Footprint Libraries..." ),
617  _( "Edit the global and project footprint library lists" ),
619 
620 TOOL_ACTION ACTIONS::gettingStarted( "common.SuiteControl.gettingStarted",
621  AS_GLOBAL, 0, "",
622  _( "Getting Started with KiCad" ),
623  _( "Open \"Getting Started in KiCad\" guide for beginners" ),
624  BITMAPS::help );
625 
626 TOOL_ACTION ACTIONS::help( "common.SuiteControl.help",
627  AS_GLOBAL, 0, "",
628  _( "Help" ),
629  _( "Open product documentation in a web browser" ),
631 
632 TOOL_ACTION ACTIONS::listHotKeys( "common.SuiteControl.listHotKeys",
633  AS_GLOBAL,
634  MD_CTRL + WXK_F1, LEGACY_HK_NAME( "List Hotkeys" ),
635  _( "List Hotkeys..." ),
636  _( "Displays current hotkeys table and corresponding commands" ),
638 
639 TOOL_ACTION ACTIONS::getInvolved( "common.SuiteControl.getInvolved",
640  AS_GLOBAL, 0, "",
641  _( "Get Involved" ),
642  _( "Open \"Contribute to KiCad\" in a web browser" ),
643  BITMAPS::info );
644 
645 TOOL_ACTION ACTIONS::donate( "common.SuiteControl.donate",
646  AS_GLOBAL, 0, "",
647  _( "Donate" ),
648  _( "Open \"Donate to KiCad\" in a web browser" ) );
649 
650 TOOL_ACTION ACTIONS::reportBug( "common.SuiteControl.reportBug",
651  AS_GLOBAL, 0, "",
652  _( "Report Bug" ),
653  _( "Report a problem with KiCad" ),
654  BITMAPS::bug );
655 
656 
657 // System-wide selection Events
658 
659 const TOOL_EVENT EVENTS::SelectedEvent( TC_MESSAGE, TA_ACTION, "common.Interactive.selected" );
660 const TOOL_EVENT EVENTS::UnselectedEvent( TC_MESSAGE, TA_ACTION, "common.Interactive.unselected" );
661 const TOOL_EVENT EVENTS::ClearedEvent( TC_MESSAGE, TA_ACTION, "common.Interactive.cleared" );
662 
663 const TOOL_EVENT EVENTS::SelectedItemsModified( TC_MESSAGE, TA_ACTION, "common.Interactive.modified" );
664 const TOOL_EVENT EVENTS::SelectedItemsMoved( TC_MESSAGE, TA_ACTION, "common.Interactive.moved" );
665 const TOOL_EVENT EVENTS::InhibitSelectionEditing( TC_MESSAGE, TA_ACTION, "common.Interactive.inhibit" );
666 const TOOL_EVENT EVENTS::UninhibitSelectionEditing( TC_MESSAGE, TA_ACTION, "common.Interactive.uninhibit" );
667 
668 const TOOL_EVENT EVENTS::DisambiguatePoint( TC_MESSAGE, TA_ACTION, "common.Interactive.disambiguate" );
669 
static TOOL_ACTION listHotKeys
Definition: actions.h:178
static TOOL_ACTION pinLibrary
Definition: actions.h:109
static TOOL_ACTION show3DViewer
Definition: actions.h:158
static const TOOL_EVENT SelectedEvent
Definition: actions.h:199
static TOOL_ACTION zoomPreset
Definition: actions.h:98
static TOOL_ACTION findAndReplace
Definition: actions.h:77
static TOOL_ACTION zoomInCenter
Definition: actions.h:93
static TOOL_ACTION activatePointEditor
Definition: actions.h:168
#define LEGACY_HK_NAME(x)
Definition: actions.h:32
static TOOL_ACTION pageSettings
Definition: actions.h:56
static const TOOL_EVENT UnselectedEvent
Definition: actions.h:200
static TOOL_ACTION doDelete
Definition: actions.h:72
static const TOOL_EVENT DisambiguatePoint
Definition: actions.h:214
static TOOL_ACTION zoomTool
Definition: actions.h:99
static TOOL_ACTION gridResetOrigin
Definition: actions.h:138
static TOOL_ACTION changeEditMethod
Definition: actions.h:169
static TOOL_ACTION replaceAll
Definition: actions.h:81
static TOOL_ACTION cancelInteractive
Definition: actions.h:62
static TOOL_ACTION nextMarker
Definition: actions.h:86
static TOOL_ACTION cursorRight
Definition: actions.h:116
static TOOL_ACTION zoomFitScreen
Definition: actions.h:96
static TOOL_ACTION millimetersUnits
Definition: actions.h:146
static TOOL_ACTION reportBug
Cursor control event types.
Definition: actions.h:181
static TOOL_ACTION showSymbolLibTable
Definition: actions.h:174
static TOOL_ACTION cursorRightFast
Definition: actions.h:121
static TOOL_ACTION gridFast1
Definition: actions.h:133
static TOOL_ACTION unpinLibrary
Definition: actions.h:110
static TOOL_ACTION updatePcbFromSchematic
Definition: actions.h:163
static TOOL_ACTION donate
Definition: actions.h:179
static TOOL_ACTION zoomFitObjects
Definition: actions.h:97
static TOOL_ACTION print
Definition: actions.h:57
static TOOL_ACTION excludeMarker
Definition: actions.h:87
static TOOL_ACTION panLeft
Definition: actions.h:129
static TOOL_ACTION find
Definition: actions.h:76
#define _(s)
Definition: actions.cpp:38
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
Definition: actions.h:204
static TOOL_ACTION zoomOutCenter
Definition: actions.h:94
static TOOL_ACTION saveCopyAs
Definition: actions.h:53
static TOOL_ACTION pickerTool
Definition: actions.h:155
static TOOL_ACTION updateFind
Definition: actions.h:82
static TOOL_ACTION measureTool
Definition: actions.h:154
static TOOL_ACTION copy
Definition: actions.h:67
static TOOL_ACTION centerContents
Definition: actions.h:100
static TOOL_ACTION updateSchematicFromPcb
Definition: actions.h:164
static TOOL_ACTION gridFast2
Definition: actions.h:134
static TOOL_ACTION toggleCursor
Definition: actions.h:101
static TOOL_ACTION gridPreset
Definition: actions.h:139
static TOOL_ACTION showFootprintLibTable
Definition: actions.h:175
static TOOL_ACTION gridPrev
Definition: actions.h:136
static TOOL_ACTION panDown
Definition: actions.h:128
static TOOL_ACTION toggleGrid
Definition: actions.h:140
static TOOL_ACTION open
Definition: actions.h:50
static TOOL_ACTION showFootprintBrowser
Definition: actions.h:161
static TOOL_ACTION inchesUnits
Definition: actions.h:144
Action activates a tool.
Definition: tool_action.h:52
static TOOL_ACTION save
Definition: actions.h:51
static TOOL_ACTION doNew
Definition: actions.h:44
Generic, UI-independent tool event.
Definition: tool_event.h:152
static TOOL_ACTION cursorUpFast
Definition: actions.h:118
static TOOL_ACTION cursorDownFast
Definition: actions.h:119
static TOOL_ACTION cursorLeft
Definition: actions.h:115
static TOOL_ACTION panRight
Definition: actions.h:130
static TOOL_ACTION togglePolarCoords
Definition: actions.h:149
static TOOL_ACTION cut
Definition: actions.h:66
static const TOOL_EVENT UninhibitSelectionEditing
Used to inform tool that it should display the disambiguation menu.
Definition: actions.h:211
static TOOL_ACTION addLibrary
Definition: actions.h:49
static TOOL_ACTION quit
Definition: actions.h:59
static const TOOL_EVENT ClearedEvent
Selected item had a property changed (except movement)
Definition: actions.h:201
static TOOL_ACTION replaceAndFindNext
Definition: actions.h:80
static TOOL_ACTION plot
Definition: actions.h:58
static const TOOL_EVENT SelectedItemsMoved
Used to inform tools that the selection should temporarily be non-editable.
Definition: actions.h:207
static TOOL_ACTION cursorLeftFast
Definition: actions.h:120
static TOOL_ACTION updateMenu
Definition: actions.h:167
static TOOL_ACTION newLibrary
Definition: actions.h:48
static TOOL_ACTION milsUnits
Definition: actions.h:145
static TOOL_ACTION prevMarker
Definition: actions.h:85
static TOOL_ACTION pasteSpecial
Definition: actions.h:69
static TOOL_ACTION findNextMarker
Definition: actions.h:79
static TOOL_ACTION redo
Definition: actions.h:65
static TOOL_ACTION updateUnits
Definition: actions.h:147
static TOOL_ACTION showSymbolEditor
Definition: actions.h:160
static TOOL_ACTION zoomCenter
Definition: actions.h:95
static TOOL_ACTION saveAs
Definition: actions.h:52
static TOOL_ACTION cursorUp
Cursor control with keyboard.
Definition: actions.h:113
static TOOL_ACTION zoomRedraw
Definition: actions.h:90
static TOOL_ACTION cursorDblClick
Definition: actions.h:124
Represent a single user action.
Definition: tool_action.h:67
static TOOL_ACTION resetLocalCoords
Definition: actions.h:150
static TOOL_ACTION help
Definition: actions.h:177
static const TOOL_EVENT InhibitSelectionEditing
Definition: actions.h:210
The common library.
static TOOL_ACTION gridNext
Definition: actions.h:135
static TOOL_ACTION gridProperties
Definition: actions.h:141
static TOOL_ACTION panUp
Definition: actions.h:127
static TOOL_ACTION zoomIn
Definition: actions.h:91
static TOOL_ACTION deleteTool
Definition: actions.h:73
static TOOL_ACTION zoomOut
Definition: actions.h:92
static TOOL_ACTION highContrastModeCycle
Definition: actions.h:104
static TOOL_ACTION undo
Definition: actions.h:64
static TOOL_ACTION toggleCursorStyle
Definition: actions.h:102
static TOOL_ACTION saveAll
Definition: actions.h:54
static TOOL_ACTION gridSetOrigin
Definition: actions.h:137
static TOOL_ACTION showSymbolBrowser
Definition: actions.h:159
static TOOL_ACTION openPreferences
Definition: actions.h:172
static TOOL_ACTION showContextMenu
Definition: actions.h:63
static TOOL_ACTION cursorDown
Definition: actions.h:114
static TOOL_ACTION getInvolved
Definition: actions.h:180
static TOOL_ACTION configurePaths
Definition: actions.h:173
static TOOL_ACTION highContrastMode
Definition: actions.h:103
static TOOL_ACTION toggleUnits
Definition: actions.h:148
static TOOL_ACTION selectAll
Definition: actions.h:70
static TOOL_ACTION findNext
Definition: actions.h:78
static TOOL_ACTION gettingStarted
Definition: actions.h:176
static TOOL_ACTION showFootprintEditor
Definition: actions.h:162
static TOOL_ACTION paste
Definition: actions.h:68
static TOOL_ACTION duplicate
Definition: actions.h:71
static TOOL_ACTION revert
Definition: actions.h:55
static TOOL_ACTION selectionTool
Definition: actions.h:153
static TOOL_ACTION refreshPreview
Definition: actions.h:106
static TOOL_ACTION cursorClick
Definition: actions.h:123