You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

632 lines
23 KiB

5 years ago
  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) 2019 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. #include <bitmaps.h>
  25. #include <common.h>
  26. #include <frame_type.h>
  27. #include <tool/actions.h>
  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. #undef _
  32. #define _(s) s
  33. TOOL_ACTION ACTIONS::doNew( "common.Control.new",
  34. AS_GLOBAL,
  35. MD_CTRL + 'N', LEGACY_HK_NAME( "New" ),
  36. _( "New..." ), _( "Create a new document in the editor" ),
  37. new_generic_xpm );
  38. TOOL_ACTION ACTIONS::newLibrary( "common.Control.newLibrary",
  39. AS_GLOBAL,
  40. 0, "",
  41. _( "New Library..." ), _( "Create a new library folder" ),
  42. new_generic_xpm );
  43. TOOL_ACTION ACTIONS::addLibrary( "common.Control.addLibrary",
  44. AS_GLOBAL,
  45. 0, "",
  46. _( "Add Library..." ), _( "Add an existing library folder" ),
  47. add_library_xpm );
  48. TOOL_ACTION ACTIONS::open( "common.Control.open",
  49. AS_GLOBAL,
  50. MD_CTRL + 'O', LEGACY_HK_NAME( "Open" ),
  51. _( "Open..." ), _( "Open existing document" ),
  52. directory_xpm );
  53. TOOL_ACTION ACTIONS::save( "common.Control.save",
  54. AS_GLOBAL,
  55. MD_CTRL + 'S', LEGACY_HK_NAME( "Save" ),
  56. _( "Save" ), _( "Save changes" ),
  57. save_xpm );
  58. TOOL_ACTION ACTIONS::saveAs( "common.Control.saveAs",
  59. AS_GLOBAL,
  60. MD_SHIFT + MD_CTRL + 'S', LEGACY_HK_NAME( "Save As" ),
  61. _( "Save As..." ), _( "Save current document to another location" ),
  62. save_as_xpm );
  63. TOOL_ACTION ACTIONS::saveCopyAs( "common.Control.saveCopyAs",
  64. AS_GLOBAL,
  65. 0, "",
  66. _( "Save Copy As..." ), _( "Save a copy of the current document to another location" ),
  67. save_as_xpm );
  68. TOOL_ACTION ACTIONS::saveAll( "common.Control.saveAll",
  69. AS_GLOBAL,
  70. 0, "",
  71. _( "Save All" ), _( "Save all changes" ),
  72. save_xpm );
  73. TOOL_ACTION ACTIONS::revert( "common.Control.revert",
  74. AS_GLOBAL,
  75. 0, "",
  76. _( "Revert" ), _( "Throw away changes" ),
  77. undo_xpm );
  78. TOOL_ACTION ACTIONS::pageSettings( "common.Control.pageSettings",
  79. AS_GLOBAL,
  80. 0, "",
  81. _( "Page Settings..." ), _( "Settings for paper size and title block info" ),
  82. sheetset_xpm );
  83. TOOL_ACTION ACTIONS::print( "common.Control.print",
  84. AS_GLOBAL,
  85. MD_CTRL + 'P', LEGACY_HK_NAME( "Print" ),
  86. _( "Print..." ), _( "Print" ),
  87. print_button_xpm );
  88. TOOL_ACTION ACTIONS::plot( "common.Control.plot",
  89. AS_GLOBAL,
  90. 0, "",
  91. _( "Plot..." ), _( "Plot" ),
  92. plot_xpm );
  93. TOOL_ACTION ACTIONS::quit( "common.Control.quit",
  94. AS_GLOBAL,
  95. 0, "", // Not currently in use due to wxWidgets crankiness
  96. _( "Quit" ), _( "Close the current editor" ),
  97. exit_xpm );
  98. // Generic Edit Actions
  99. TOOL_ACTION ACTIONS::cancelInteractive( "common.Interactive.cancel",
  100. AS_GLOBAL,
  101. 0, "", // ESC key is handled in the dispatcher
  102. _( "Cancel" ), _( "Cancel current tool" ),
  103. cancel_xpm, AF_NONE );
  104. TOOL_ACTION ACTIONS::showContextMenu( "common.Control.showContextMenu",
  105. AS_GLOBAL,
  106. 0, "",
  107. _( "Show Context Menu" ), _( "Perform the right-mouse-button action" ),
  108. nullptr, AF_NONE, (void*) CURSOR_RIGHT_CLICK );
  109. TOOL_ACTION ACTIONS::updateMenu( "common.Interactive.updateMenu",
  110. AS_GLOBAL );
  111. TOOL_ACTION ACTIONS::undo( "common.Interactive.undo",
  112. AS_GLOBAL,
  113. MD_CTRL + 'Z', LEGACY_HK_NAME( "Undo" ),
  114. _( "Undo" ), _( "Undo last edit" ),
  115. undo_xpm );
  116. TOOL_ACTION ACTIONS::redo( "common.Interactive.redo",
  117. AS_GLOBAL,
  118. #if defined( __WXMAC__ )
  119. MD_SHIFT + MD_CTRL + 'Z',
  120. #else
  121. MD_CTRL + 'Y',
  122. #endif
  123. LEGACY_HK_NAME( "Redo" ),
  124. _( "Redo" ), _( "Redo last edit" ),
  125. redo_xpm );
  126. TOOL_ACTION ACTIONS::cut( "common.Interactive.cut",
  127. AS_GLOBAL,
  128. MD_CTRL + 'X', LEGACY_HK_NAME( "Cut" ),
  129. _( "Cut" ), _( "Cut selected item(s) to clipboard" ),
  130. cut_xpm );
  131. TOOL_ACTION ACTIONS::copy( "common.Interactive.copy",
  132. AS_GLOBAL,
  133. MD_CTRL + 'C', LEGACY_HK_NAME( "Copy" ),
  134. _( "Copy" ), _( "Copy selected item(s) to clipboard" ),
  135. copy_xpm );
  136. TOOL_ACTION ACTIONS::paste( "common.Interactive.paste",
  137. AS_GLOBAL,
  138. MD_CTRL + 'V', LEGACY_HK_NAME( "Paste" ),
  139. _( "Paste" ), _( "Paste items(s) from clipboard" ),
  140. paste_xpm );
  141. TOOL_ACTION ACTIONS::selectAll( "common.Interactive.selectAll",
  142. AS_GLOBAL,
  143. MD_CTRL + 'A', "",
  144. _( "Select All" ), _( "Select all items on screen" ) );
  145. TOOL_ACTION ACTIONS::pasteSpecial( "common.Interactive.pasteSpecial",
  146. AS_GLOBAL, 0, "",
  147. _( "Paste Special..." ), _( "Paste item(s) from clipboard with options" ),
  148. paste_xpm );
  149. TOOL_ACTION ACTIONS::duplicate( "common.Interactive.duplicate",
  150. AS_GLOBAL,
  151. MD_CTRL + 'D', LEGACY_HK_NAME( "Duplicate" ),
  152. _( "Duplicate" ), _( "Duplicates the selected item(s)" ),
  153. duplicate_xpm );
  154. TOOL_ACTION ACTIONS::doDelete( "common.Interactive.delete",
  155. AS_GLOBAL,
  156. WXK_DELETE, LEGACY_HK_NAME( "Delete Item" ),
  157. _( "Delete" ), _( "Deletes selected item(s)" ),
  158. delete_xpm );
  159. TOOL_ACTION ACTIONS::deleteTool( "common.Interactive.deleteTool",
  160. AS_GLOBAL, 0, "",
  161. _( "Interactive Delete Tool" ), _( "Delete clicked items" ),
  162. delete_xpm, AF_ACTIVATE );
  163. TOOL_ACTION ACTIONS::activatePointEditor( "common.Control.activatePointEditor",
  164. AS_GLOBAL );
  165. TOOL_ACTION ACTIONS::changeEditMethod( "common.Interactive.changeEditMethod", AS_GLOBAL,
  166. MD_CTRL + ' ', "", _( "Change Edit Method" ), _( "Change edit method constraints" ) );
  167. TOOL_ACTION ACTIONS::find( "common.Interactive.find",
  168. AS_GLOBAL,
  169. MD_CTRL + 'F', LEGACY_HK_NAME( "Find" ),
  170. _( "Find" ), _( "Find text" ),
  171. find_xpm );
  172. TOOL_ACTION ACTIONS::findAndReplace( "common.Interactive.findAndReplace",
  173. AS_GLOBAL,
  174. MD_CTRL + MD_ALT + 'F', LEGACY_HK_NAME( "Find and Replace" ),
  175. _( "Find and Replace" ), _( "Find and replace text" ),
  176. find_replace_xpm );
  177. TOOL_ACTION ACTIONS::findNext( "common.Interactive.findNext",
  178. AS_GLOBAL,
  179. WXK_F3, LEGACY_HK_NAME( "Find Next" ),
  180. _( "Find Next" ), _( "Find next match" ),
  181. find_xpm );
  182. TOOL_ACTION ACTIONS::findNextMarker( "common.Interactive.findNextMarker",
  183. AS_GLOBAL,
  184. MD_SHIFT + WXK_F3, LEGACY_HK_NAME( "Find Next Marker" ),
  185. _( "Find Next Marker" ), "",
  186. find_xpm );
  187. TOOL_ACTION ACTIONS::replaceAndFindNext( "common.Interactive.replaceAndFindNext",
  188. AS_GLOBAL,
  189. 0, "",
  190. _( "Replace and Find Next" ), _( "Replace current match and find next" ),
  191. find_replace_xpm );
  192. TOOL_ACTION ACTIONS::replaceAll( "common.Interactive.replaceAll",
  193. AS_GLOBAL,
  194. 0, "",
  195. _( "Replace All" ), _( "Replace all matches" ),
  196. find_replace_xpm );
  197. TOOL_ACTION ACTIONS::updateFind( "common.Control.updateFind",
  198. AS_GLOBAL );
  199. // View Controls
  200. TOOL_ACTION ACTIONS::zoomRedraw( "common.Control.zoomRedraw",
  201. AS_GLOBAL,
  202. #if defined( __WXMAC__ )
  203. MD_CTRL + 'R',
  204. #else
  205. WXK_F5,
  206. #endif
  207. LEGACY_HK_NAME( "Zoom Redraw" ),
  208. _( "Refresh" ), _( "Refresh" ),
  209. refresh_xpm );
  210. TOOL_ACTION ACTIONS::zoomFitScreen( "common.Control.zoomFitScreen",
  211. AS_GLOBAL,
  212. #if defined( __WXMAC__ )
  213. MD_CTRL + '0',
  214. #else
  215. WXK_HOME,
  216. #endif
  217. LEGACY_HK_NAME( "Zoom Auto" ),
  218. _( "Zoom to Fit" ), _( "Zoom to Fit" ),
  219. zoom_fit_in_page_xpm );
  220. TOOL_ACTION ACTIONS::zoomFitObjects( "common.Control.zoomFitObjects",
  221. AS_GLOBAL, MD_CTRL + WXK_HOME, "",
  222. _( "Zoom to Objects" ), _( "Zoom to Objects" ),
  223. zoom_fit_to_objects_xpm );
  224. TOOL_ACTION ACTIONS::zoomIn( "common.Control.zoomIn",
  225. AS_GLOBAL,
  226. #if defined( __WXMAC__ )
  227. MD_CTRL + '+',
  228. #else
  229. WXK_F1,
  230. #endif
  231. LEGACY_HK_NAME( "Zoom In" ),
  232. _( "Zoom In at Cursor" ), _( "Zoom In at Cursor" ),
  233. zoom_in_xpm );
  234. TOOL_ACTION ACTIONS::zoomOut( "common.Control.zoomOut",
  235. AS_GLOBAL,
  236. #if defined( __WXMAC__ )
  237. MD_CTRL + '-',
  238. #else
  239. WXK_F2,
  240. #endif
  241. LEGACY_HK_NAME( "Zoom Out" ),
  242. _( "Zoom Out at Cursor" ), _( "Zoom Out at Cursor" ),
  243. zoom_out_xpm );
  244. TOOL_ACTION ACTIONS::zoomInCenter( "common.Control.zoomInCenter",
  245. AS_GLOBAL,
  246. 0, "",
  247. _( "Zoom In" ), _( "Zoom In" ),
  248. zoom_in_xpm );
  249. TOOL_ACTION ACTIONS::zoomOutCenter( "common.Control.zoomOutCenter",
  250. AS_GLOBAL,
  251. 0, "",
  252. _( "Zoom Out" ), _( "Zoom Out" ),
  253. zoom_out_xpm );
  254. TOOL_ACTION ACTIONS::zoomCenter( "common.Control.zoomCenter",
  255. AS_GLOBAL,
  256. WXK_F4, LEGACY_HK_NAME( "Zoom Center" ),
  257. _( "Center" ), _( "Center" ),
  258. zoom_center_on_screen_xpm );
  259. TOOL_ACTION ACTIONS::zoomTool( "common.Control.zoomTool",
  260. AS_GLOBAL,
  261. MD_CTRL + WXK_F5, LEGACY_HK_NAME( "Zoom to Selection" ),
  262. _( "Zoom to Selection" ), _( "Zoom to Selection" ),
  263. zoom_area_xpm, AF_ACTIVATE );
  264. TOOL_ACTION ACTIONS::zoomPreset( "common.Control.zoomPreset",
  265. AS_GLOBAL );
  266. TOOL_ACTION ACTIONS::centerContents( "common.Control.centerContents",
  267. AS_GLOBAL );
  268. // Cursor control
  269. TOOL_ACTION ACTIONS::cursorUp( "common.Control.cursorUp",
  270. AS_GLOBAL,
  271. WXK_UP, "",
  272. _( "Cursor Up" ), "",
  273. nullptr, AF_NONE, (void*) CURSOR_UP );
  274. TOOL_ACTION ACTIONS::cursorDown( "common.Control.cursorDown",
  275. AS_GLOBAL,
  276. WXK_DOWN, "",
  277. _( "Cursor Down" ), "" ,
  278. nullptr, AF_NONE, (void*) CURSOR_DOWN );
  279. TOOL_ACTION ACTIONS::cursorLeft( "common.Control.cursorLeft",
  280. AS_GLOBAL,
  281. WXK_LEFT, "",
  282. _( "Cursor Left" ), "" ,
  283. nullptr, AF_NONE, (void*) CURSOR_LEFT );
  284. TOOL_ACTION ACTIONS::cursorRight( "common.Control.cursorRight",
  285. AS_GLOBAL,
  286. WXK_RIGHT, "",
  287. _( "Cursor Right" ), "" ,
  288. nullptr, AF_NONE, (void*) CURSOR_RIGHT );
  289. TOOL_ACTION ACTIONS::cursorUpFast( "common.Control.cursorUpFast",
  290. AS_GLOBAL,
  291. MD_CTRL + WXK_UP, "",
  292. _( "Cursor Up Fast" ), "",
  293. nullptr, AF_NONE, (void*) ( CURSOR_UP | CURSOR_FAST_MOVE ) );
  294. TOOL_ACTION ACTIONS::cursorDownFast( "common.Control.cursorDownFast",
  295. AS_GLOBAL,
  296. MD_CTRL + WXK_DOWN, "",
  297. _( "Cursor Down Fast" ), "" ,
  298. nullptr, AF_NONE, (void*) ( CURSOR_DOWN | CURSOR_FAST_MOVE ) );
  299. TOOL_ACTION ACTIONS::cursorLeftFast( "common.Control.cursorLeftFast",
  300. AS_GLOBAL,
  301. MD_CTRL + WXK_LEFT, "",
  302. _( "Cursor Left Fast" ), "" ,
  303. nullptr, AF_NONE, (void*) ( CURSOR_LEFT | CURSOR_FAST_MOVE ) );
  304. TOOL_ACTION ACTIONS::cursorRightFast( "common.Control.cursorRightFast",
  305. AS_GLOBAL,
  306. MD_CTRL + WXK_RIGHT, "",
  307. _( "Cursor Right Fast" ), "" ,
  308. nullptr, AF_NONE, (void*) ( CURSOR_RIGHT | CURSOR_FAST_MOVE ) );
  309. TOOL_ACTION ACTIONS::cursorClick( "common.Control.cursorClick",
  310. AS_GLOBAL,
  311. WXK_RETURN, LEGACY_HK_NAME( "Mouse Left Click" ),
  312. _( "Click" ), _( "Performs left mouse button click" ),
  313. nullptr, AF_NONE, (void*) CURSOR_CLICK );
  314. TOOL_ACTION ACTIONS::cursorDblClick( "common.Control.cursorDblClick",
  315. AS_GLOBAL,
  316. WXK_END, LEGACY_HK_NAME( "Mouse Left Double Click" ),
  317. _( "Double-click" ), _( "Performs left mouse button double-click" ),
  318. nullptr, AF_NONE, (void*) CURSOR_DBL_CLICK );
  319. TOOL_ACTION ACTIONS::refreshPreview( "common.Control.refreshPreview",
  320. AS_GLOBAL );
  321. TOOL_ACTION ACTIONS::pinLibrary( "common.Control.pinLibrary",
  322. AS_GLOBAL, 0, "",
  323. _( "Pin Library" ), "Keep the library at the top of the list",
  324. flag_xpm );
  325. TOOL_ACTION ACTIONS::unpinLibrary( "common.Control.unpinLibrary",
  326. AS_GLOBAL, 0, "",
  327. _( "Unpin Library" ), "No longer keep the library at the top of the list",
  328. flag_remove_xpm );
  329. TOOL_ACTION ACTIONS::panUp( "common.Control.panUp",
  330. AS_GLOBAL,
  331. MD_SHIFT + WXK_UP, "",
  332. _( "Pan Up" ), "",
  333. nullptr, AF_NONE, (void*) CURSOR_UP );
  334. TOOL_ACTION ACTIONS::panDown( "common.Control.panDown",
  335. AS_GLOBAL,
  336. MD_SHIFT + WXK_DOWN, "",
  337. _( "Pan Down" ), "" ,
  338. nullptr, AF_NONE, (void*) CURSOR_DOWN );
  339. TOOL_ACTION ACTIONS::panLeft( "common.Control.panLeft",
  340. AS_GLOBAL,
  341. MD_SHIFT + WXK_LEFT, "",
  342. _( "Pan Left" ), "" ,
  343. nullptr, AF_NONE, (void*) CURSOR_LEFT );
  344. TOOL_ACTION ACTIONS::panRight( "common.Control.panRight",
  345. AS_GLOBAL,
  346. MD_SHIFT + WXK_RIGHT, "",
  347. _( "Pan Right" ), "" ,
  348. nullptr, AF_NONE, (void*) CURSOR_RIGHT );
  349. // Grid control
  350. TOOL_ACTION ACTIONS::gridFast1( "common.Control.gridFast1",
  351. AS_GLOBAL,
  352. MD_ALT + '1', LEGACY_HK_NAME( "Switch Grid To Fast Grid1" ),
  353. _( "Switch to Fast Grid 1" ), "" );
  354. TOOL_ACTION ACTIONS::gridFast2( "common.Control.gridFast2",
  355. AS_GLOBAL,
  356. MD_ALT + '2', LEGACY_HK_NAME( "Switch Grid To Fast Grid2" ),
  357. _( "Switch to Fast Grid 2" ), "" );
  358. TOOL_ACTION ACTIONS::gridNext( "common.Control.gridNext",
  359. AS_GLOBAL,
  360. 'N', LEGACY_HK_NAME( "Switch Grid To Next" ),
  361. _("Switch to Next Grid" ), "" );
  362. TOOL_ACTION ACTIONS::gridPrev( "common.Control.gridPrev",
  363. AS_GLOBAL, MD_SHIFT + 'N', LEGACY_HK_NAME( "Switch Grid To Previous" ),
  364. _( "Switch to Previous Grid" ), "" );
  365. TOOL_ACTION ACTIONS::gridSetOrigin( "common.Control.gridSetOrigin",
  366. AS_GLOBAL,
  367. 'S', LEGACY_HK_NAME( "Set Grid Origin" ),
  368. _( "Grid Origin" ), _( "Set the grid origin point" ),
  369. grid_select_axis_xpm );
  370. TOOL_ACTION ACTIONS::gridResetOrigin( "common.Control.gridResetOrigin",
  371. AS_GLOBAL,
  372. 'Z', LEGACY_HK_NAME( "Reset Grid Origin" ),
  373. _( "Reset Grid Origin" ), "" );
  374. TOOL_ACTION ACTIONS::gridPreset( "common.Control.gridPreset",
  375. AS_GLOBAL );
  376. TOOL_ACTION ACTIONS::toggleGrid( "common.Control.toggleGrid",
  377. AS_GLOBAL, 0, "",
  378. _( "Show Grid" ), _( "Display grid dots or lines in the edit window" ),
  379. grid_xpm );
  380. TOOL_ACTION ACTIONS::gridProperties( "common.Control.gridProperties",
  381. AS_GLOBAL, 0, "",
  382. _( "Grid Properties..." ), _( "Set grid dimensions" ),
  383. grid_select_xpm );
  384. TOOL_ACTION ACTIONS::inchesUnits( "common.Control.imperialUnits",
  385. AS_GLOBAL, 0, "",
  386. _( "Inches" ), _( "Use inches" ),
  387. unit_inch_xpm, AF_NONE, (void*) EDA_UNITS::INCHES );
  388. TOOL_ACTION ACTIONS::milsUnits( "common.Control.mils",
  389. AS_GLOBAL, 0, "",
  390. _( "Mils" ), _( "Use mils" ),
  391. unit_mil_xpm, AF_NONE, (void*) EDA_UNITS::MILS );
  392. TOOL_ACTION ACTIONS::millimetersUnits( "common.Control.metricUnits",
  393. AS_GLOBAL, 0, "",
  394. _( "Millimeters" ), _( "Use millimeters" ),
  395. unit_mm_xpm, AF_NONE, (void*) EDA_UNITS::MILLIMETRES );
  396. TOOL_ACTION ACTIONS::toggleUnits( "common.Control.toggleUnits",
  397. AS_GLOBAL,
  398. MD_CTRL + 'U', LEGACY_HK_NAME( "Switch Units" ),
  399. _( "Switch units" ), _( "Switch between imperial and metric units" ),
  400. unit_mm_xpm );
  401. TOOL_ACTION ACTIONS::togglePolarCoords( "common.Control.togglePolarCoords",
  402. AS_GLOBAL, 0, "",
  403. _( "Polar Coordinates" ), _( "Switch between polar and cartesian coordinate systems" ),
  404. polar_coord_xpm );
  405. TOOL_ACTION ACTIONS::resetLocalCoords( "common.Control.resetLocalCoords",
  406. AS_GLOBAL,
  407. ' ', LEGACY_HK_NAME( "Reset Local Coordinates" ),
  408. _( "Reset Local Coordinates" ), "" );
  409. TOOL_ACTION ACTIONS::toggleCursor( "common.Control.toggleCursor",
  410. AS_GLOBAL,
  411. // Don't be tempted to remove "Modern Toolset only". It's in the legacy property name.
  412. MD_CTRL + MD_SHIFT + 'X', LEGACY_HK_NAME( "Toggle Cursor Display (Modern Toolset only)" ),
  413. _( "Always Show Cursor" ), _( "Display crosshairs even in selection tool" ),
  414. cursor_xpm );
  415. TOOL_ACTION ACTIONS::toggleCursorStyle( "common.Control.toggleCursorStyle",
  416. AS_GLOBAL, 0, "",
  417. _( "Full-Window Crosshairs" ), _( "Switch display of full-window crosshairs" ),
  418. cursor_shape_xpm );
  419. TOOL_ACTION ACTIONS::highContrastMode( "common.Control.highContrastMode",
  420. AS_GLOBAL,
  421. MD_CTRL + 'H', LEGACY_HK_NAME( "Toggle High Contrast Mode" ),
  422. _( "High Contrast Mode" ), _( "Use high contrast display mode" ),
  423. contrast_mode_xpm );
  424. TOOL_ACTION ACTIONS::highContrastModeCycle( "common.Control.highContrastModeCycle",
  425. AS_GLOBAL, 0, "", _( "High Contrast Mode (3-state)" ),
  426. _( "Toggle inactive layers between normal, dimmed, and hidden" ), contrast_mode_xpm );
  427. TOOL_ACTION ACTIONS::selectionTool( "common.InteractiveSelection.selectionTool",
  428. AS_GLOBAL, 0, "",
  429. _( "Select item(s)" ), "",
  430. cursor_xpm, AF_ACTIVATE );
  431. TOOL_ACTION ACTIONS::measureTool( "common.InteractiveEdit.measureTool",
  432. AS_GLOBAL,
  433. // Don't be tempted to remove "Modern Toolset only". It's in the legacy property name.
  434. MD_CTRL + MD_SHIFT + 'M', LEGACY_HK_NAME( "Measure Distance (Modern Toolset only)" ),
  435. _( "Measure Tool" ), _( "Interactively measure distance between points" ),
  436. measurement_xpm, AF_ACTIVATE );
  437. TOOL_ACTION ACTIONS::pickerTool( "common.InteractivePicker.pickerTool",
  438. AS_GLOBAL, 0, "", "", "", NULL, AF_ACTIVATE );
  439. TOOL_ACTION ACTIONS::show3DViewer( "common.Control.show3DViewer",
  440. AS_GLOBAL,
  441. MD_ALT + '3', LEGACY_HK_NAME( "3D Viewer" ),
  442. _( "3D Viewer" ), _( "Show 3D viewer window" ),
  443. three_d_xpm );
  444. TOOL_ACTION ACTIONS::showSymbolBrowser( "common.Control.showSymbolBrowser",
  445. AS_GLOBAL, 0, "",
  446. _( "Symbol Library Browser" ), _( "Browse symbol libraries" ),
  447. library_browse_xpm, AF_NONE, (void*) FRAME_SCH_VIEWER );
  448. TOOL_ACTION ACTIONS::showSymbolEditor( "common.Control.showSymbolEditor",
  449. AS_GLOBAL, 0, "",
  450. _( "Symbol Editor" ), _( "Create, delete and edit symbols" ),
  451. libedit_xpm, AF_NONE, (void*) FRAME_SCH_LIB_EDITOR );
  452. TOOL_ACTION ACTIONS::showFootprintBrowser( "common.Control.showFootprintBrowser",
  453. AS_GLOBAL, 0, "",
  454. _( "Footprint Library Browser" ), _( "Browse footprint libraries" ),
  455. modview_icon_xpm, AF_NONE, (void*) FRAME_FOOTPRINT_VIEWER );
  456. TOOL_ACTION ACTIONS::showFootprintEditor( "common.Control.showFootprintEditor",
  457. AS_GLOBAL, 0, "",
  458. _( "Footprint Editor" ), _( "Create, delete and edit footprints" ),
  459. module_editor_xpm, AF_NONE, (void*) FRAME_FOOTPRINT_EDITOR );
  460. TOOL_ACTION ACTIONS::updatePcbFromSchematic( "common.Control.updatePcbFromSchematic",
  461. AS_GLOBAL,
  462. WXK_F8, LEGACY_HK_NAME( "Update PCB from Schematic" ),
  463. _( "Update PCB from Schematic..." ), _( "Push changes from schematic to PCB" ),
  464. update_pcb_from_sch_xpm );
  465. TOOL_ACTION ACTIONS::updateSchematicFromPcb( "common.Control.updateSchematicFromPCB", AS_GLOBAL, 0,
  466. LEGACY_HK_NAME( "Update Schematic from PCB" ), _( "Update Schematic from PCB..." ),
  467. _( "Push changes from PCB to Schematic" ), update_sch_from_pcb_xpm );
  468. TOOL_ACTION ACTIONS::acceleratedGraphics( "common.Control.acceleratedGraphics",
  469. AS_GLOBAL, 0, "",
  470. _( "Accelerated Graphics" ), _( "Use hardware-accelerated graphics (recommended)" ),
  471. tools_xpm );
  472. TOOL_ACTION ACTIONS::standardGraphics( "common.Control.standardGraphics",
  473. AS_GLOBAL, 0, "",
  474. _( "Standard Graphics" ), _( "Use software graphics (fall-back)" ),
  475. tools_xpm );
  476. TOOL_ACTION ACTIONS::configurePaths( "common.SuiteControl.configurePaths",
  477. AS_GLOBAL, 0, "",
  478. _( "Configure Paths..." ), _( "Edit path configuration environment variables" ),
  479. path_xpm );
  480. TOOL_ACTION ACTIONS::showSymbolLibTable( "common.SuiteControl.showSymbolLibTable",
  481. AS_GLOBAL, 0, "",
  482. _( "Manage Symbol Libraries..." ),
  483. _( "Edit the global and project symbol library lists" ),
  484. library_table_xpm );
  485. TOOL_ACTION ACTIONS::showFootprintLibTable( "common.SuiteControl.showFootprintLibTable",
  486. AS_GLOBAL, 0, "",
  487. _( "Manage Footprint Libraries..." ),
  488. _( "Edit the global and project footprint library lists" ),
  489. library_table_xpm );
  490. TOOL_ACTION ACTIONS::gettingStarted( "common.SuiteControl.gettingStarted",
  491. AS_GLOBAL, 0, "",
  492. _( "Getting Started with KiCad" ),
  493. _( "Open \"Getting Started in KiCad\" guide for beginners" ),
  494. help_xpm );
  495. TOOL_ACTION ACTIONS::help( "common.SuiteControl.help",
  496. AS_GLOBAL, 0, "",
  497. _( "Help" ),
  498. _( "Open product documentation in a web browser" ),
  499. online_help_xpm );
  500. TOOL_ACTION ACTIONS::listHotKeys( "common.SuiteControl.listHotKeys",
  501. AS_GLOBAL,
  502. MD_CTRL + WXK_F1, LEGACY_HK_NAME( "List Hotkeys" ),
  503. _( "List Hotkeys..." ),
  504. _( "Displays current hotkeys table and corresponding commands" ),
  505. hotkeys_xpm );
  506. TOOL_ACTION ACTIONS::getInvolved( "common.SuiteControl.getInvolved",
  507. AS_GLOBAL, 0, "",
  508. _( "Get Involved" ),
  509. _( "Open \"Contribute to KiCad\" in a web browser" ),
  510. info_xpm );
  511. TOOL_ACTION ACTIONS::reportBug( "common.SuiteControl.reportBug",
  512. AS_GLOBAL, 0, "",
  513. _( "Report Bug" ),
  514. _( "Report a problem with KiCad" ),
  515. drc_xpm );
  516. // System-wide selection Events
  517. const TOOL_EVENT EVENTS::SelectedEvent( TC_MESSAGE, TA_ACTION, "common.Interactive.selected" );
  518. const TOOL_EVENT EVENTS::UnselectedEvent( TC_MESSAGE, TA_ACTION, "common.Interactive.unselected" );
  519. const TOOL_EVENT EVENTS::ClearedEvent( TC_MESSAGE, TA_ACTION, "common.Interactive.cleared" );
  520. const TOOL_EVENT EVENTS::SelectedItemsModified( TC_MESSAGE, TA_ACTION, "common.Interactive.modified" );
  521. const TOOL_EVENT EVENTS::SelectedItemsMoved( TC_MESSAGE, TA_ACTION, "common.Interactive.moved" );