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.

699 lines
26 KiB

  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. #include <bitmaps.h>
  25. #include <common.h>
  26. #include <eda_units.h>
  27. #include <frame_type.h>
  28. #include <tool/actions.h>
  29. #include <tool/tool_action.h>
  30. #include <tool/tool_event.h>
  31. // Actions, being statically-defined, require specialized I18N handling. We continue to
  32. // use the _() macro so that string harvesting by the I18N framework doesn't have to be
  33. // specialized, but we don't translate on initialization and instead do it in the getters.
  34. #undef _
  35. #define _(s) s
  36. TOOL_ACTION ACTIONS::doNew( "common.Control.new",
  37. AS_GLOBAL,
  38. MD_CTRL + 'N', LEGACY_HK_NAME( "New" ),
  39. _( "New..." ), _( "Create a new document in the editor" ),
  40. BITMAPS::new_generic );
  41. TOOL_ACTION ACTIONS::newLibrary( "common.Control.newLibrary",
  42. AS_GLOBAL,
  43. 0, "",
  44. _( "New Library..." ), _( "Create a new library folder" ),
  45. BITMAPS::new_library );
  46. TOOL_ACTION ACTIONS::addLibrary( "common.Control.addLibrary",
  47. AS_GLOBAL,
  48. 0, "",
  49. _( "Add Library..." ), _( "Add an existing library folder" ),
  50. BITMAPS::add_library );
  51. TOOL_ACTION ACTIONS::open( "common.Control.open",
  52. AS_GLOBAL,
  53. MD_CTRL + 'O', LEGACY_HK_NAME( "Open" ),
  54. _( "Open..." ), _( "Open existing document" ),
  55. BITMAPS::directory_open );
  56. TOOL_ACTION ACTIONS::save( "common.Control.save",
  57. AS_GLOBAL,
  58. MD_CTRL + 'S', LEGACY_HK_NAME( "Save" ),
  59. _( "Save" ), _( "Save changes" ),
  60. BITMAPS::save );
  61. TOOL_ACTION ACTIONS::saveAs( "common.Control.saveAs",
  62. AS_GLOBAL,
  63. MD_SHIFT + MD_CTRL + 'S', LEGACY_HK_NAME( "Save As" ),
  64. _( "Save As..." ), _( "Save current document to another location" ),
  65. BITMAPS::save_as );
  66. TOOL_ACTION ACTIONS::saveCopy( "common.Control.saveCopy",
  67. AS_GLOBAL,
  68. 0, "",
  69. _( "Save a Copy..." ), _( "Save a copy of the current document to another location" ),
  70. BITMAPS::save_as );
  71. TOOL_ACTION ACTIONS::saveAll( "common.Control.saveAll",
  72. AS_GLOBAL,
  73. 0, "",
  74. _( "Save All" ), _( "Save all changes" ),
  75. BITMAPS::save );
  76. TOOL_ACTION ACTIONS::revert( "common.Control.revert",
  77. AS_GLOBAL,
  78. 0, "",
  79. _( "Revert" ), _( "Throw away changes" ) );
  80. TOOL_ACTION ACTIONS::pageSettings( "common.Control.pageSettings",
  81. AS_GLOBAL,
  82. 0, "",
  83. _( "Page Settings..." ), _( "Settings for paper size and title block info" ),
  84. BITMAPS::sheetset );
  85. TOOL_ACTION ACTIONS::print( "common.Control.print",
  86. AS_GLOBAL,
  87. MD_CTRL + 'P', LEGACY_HK_NAME( "Print" ),
  88. _( "Print..." ), _( "Print" ),
  89. BITMAPS::print_button );
  90. TOOL_ACTION ACTIONS::plot( "common.Control.plot",
  91. AS_GLOBAL,
  92. 0, "",
  93. _( "Plot..." ), _( "Plot" ),
  94. BITMAPS::plot );
  95. TOOL_ACTION ACTIONS::quit( "common.Control.quit",
  96. AS_GLOBAL,
  97. 0, "", // Not currently in use due to wxWidgets crankiness
  98. _( "Quit" ), _( "Close the current editor" ),
  99. BITMAPS::exit );
  100. // Generic Edit Actions
  101. TOOL_ACTION ACTIONS::cancelInteractive( "common.Interactive.cancel",
  102. AS_GLOBAL,
  103. 0, "", // ESC key is handled in the dispatcher
  104. _( "Cancel" ), _( "Cancel current tool" ),
  105. BITMAPS::cancel, AF_NONE );
  106. TOOL_ACTION ACTIONS::showContextMenu( "common.Control.showContextMenu",
  107. AS_GLOBAL,
  108. 0, "",
  109. _( "Show Context Menu" ), _( "Perform the right-mouse-button action" ),
  110. BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_RIGHT_CLICK );
  111. TOOL_ACTION ACTIONS::updateMenu( "common.Interactive.updateMenu",
  112. AS_GLOBAL );
  113. TOOL_ACTION ACTIONS::undo( "common.Interactive.undo",
  114. AS_GLOBAL,
  115. MD_CTRL + 'Z', LEGACY_HK_NAME( "Undo" ),
  116. _( "Undo" ), _( "Undo last edit" ),
  117. BITMAPS::undo );
  118. TOOL_ACTION ACTIONS::redo( "common.Interactive.redo",
  119. AS_GLOBAL,
  120. #if defined( __WXMAC__ )
  121. MD_SHIFT + MD_CTRL + 'Z',
  122. #else
  123. MD_CTRL + 'Y',
  124. #endif
  125. LEGACY_HK_NAME( "Redo" ),
  126. _( "Redo" ), _( "Redo last edit" ),
  127. BITMAPS::redo );
  128. TOOL_ACTION ACTIONS::cut( "common.Interactive.cut",
  129. AS_GLOBAL,
  130. MD_CTRL + 'X', LEGACY_HK_NAME( "Cut" ),
  131. _( "Cut" ), _( "Cut selected item(s) to clipboard" ),
  132. BITMAPS::cut, AF_NONE, (void*) wxID_CUT );
  133. TOOL_ACTION ACTIONS::copy( "common.Interactive.copy",
  134. AS_GLOBAL,
  135. MD_CTRL + 'C', LEGACY_HK_NAME( "Copy" ),
  136. _( "Copy" ), _( "Copy selected item(s) to clipboard" ),
  137. BITMAPS::copy, AF_NONE, (void*) wxID_COPY );
  138. TOOL_ACTION ACTIONS::paste( "common.Interactive.paste",
  139. AS_GLOBAL,
  140. MD_CTRL + 'V', LEGACY_HK_NAME( "Paste" ),
  141. _( "Paste" ), _( "Paste item(s) from clipboard" ),
  142. BITMAPS::paste, AF_NONE, (void*) wxID_PASTE );
  143. TOOL_ACTION ACTIONS::selectAll( "common.Interactive.selectAll",
  144. AS_GLOBAL,
  145. MD_CTRL + 'A', "",
  146. _( "Select All" ), _( "Select all items on screen" ) );
  147. TOOL_ACTION ACTIONS::pasteSpecial( "common.Interactive.pasteSpecial",
  148. AS_GLOBAL, 0, "",
  149. _( "Paste Special..." ), _( "Paste item(s) from clipboard with annotation options" ),
  150. BITMAPS::paste_special );
  151. TOOL_ACTION ACTIONS::duplicate( "common.Interactive.duplicate",
  152. AS_GLOBAL,
  153. MD_CTRL + 'D', LEGACY_HK_NAME( "Duplicate" ),
  154. _( "Duplicate" ), _( "Duplicates the selected item(s)" ),
  155. BITMAPS::duplicate );
  156. TOOL_ACTION ACTIONS::doDelete( "common.Interactive.delete",
  157. AS_GLOBAL,
  158. #if defined( __WXMAC__ )
  159. WXK_BACK,
  160. #else
  161. WXK_DELETE,
  162. #endif
  163. LEGACY_HK_NAME( "Delete Item" ),
  164. _( "Delete" ), _( "Deletes selected item(s)" ),
  165. BITMAPS::trash );
  166. TOOL_ACTION ACTIONS::deleteTool( "common.Interactive.deleteTool",
  167. AS_GLOBAL, 0, "",
  168. _( "Interactive Delete Tool" ), _( "Delete clicked items" ),
  169. BITMAPS::delete_cursor, AF_ACTIVATE );
  170. TOOL_ACTION ACTIONS::activatePointEditor( "common.Control.activatePointEditor",
  171. AS_GLOBAL );
  172. TOOL_ACTION ACTIONS::cycleArcEditMode( "common.Interactive.cycleArcEditMode", AS_GLOBAL,
  173. MD_CTRL + ' ', "", _( "Cycle arc editing mode" ),
  174. _( "Switch to a different method of editing arcs" ) );
  175. TOOL_ACTION ACTIONS::showSearch( "common.Interactive.search",
  176. AS_GLOBAL,
  177. MD_CTRL + 'G', LEGACY_HK_NAME( "Search" ),
  178. _( "Show Search Panel" ), _( "Show/hide the search panel" ),
  179. BITMAPS::find );
  180. TOOL_ACTION ACTIONS::find( "common.Interactive.find",
  181. AS_GLOBAL,
  182. MD_CTRL + 'F', LEGACY_HK_NAME( "Find" ),
  183. _( "Find" ), _( "Find text" ),
  184. BITMAPS::find );
  185. TOOL_ACTION ACTIONS::findAndReplace( "common.Interactive.findAndReplace",
  186. AS_GLOBAL,
  187. MD_CTRL + MD_ALT + 'F', LEGACY_HK_NAME( "Find and Replace" ),
  188. _( "Find and Replace" ), _( "Find and replace text" ),
  189. BITMAPS::find_replace );
  190. TOOL_ACTION ACTIONS::findNext( "common.Interactive.findNext",
  191. AS_GLOBAL,
  192. WXK_F3, LEGACY_HK_NAME( "Find Next" ),
  193. _( "Find Next" ), _( "Find next match" ),
  194. BITMAPS::find );
  195. TOOL_ACTION ACTIONS::findNextMarker( "common.Interactive.findNextMarker",
  196. AS_GLOBAL,
  197. MD_SHIFT + WXK_F3, LEGACY_HK_NAME( "Find Next Marker" ),
  198. _( "Find Next Marker" ), "",
  199. BITMAPS::find );
  200. TOOL_ACTION ACTIONS::replaceAndFindNext( "common.Interactive.replaceAndFindNext",
  201. AS_GLOBAL,
  202. 0, "",
  203. _( "Replace and Find Next" ), _( "Replace current match and find next" ),
  204. BITMAPS::find_replace );
  205. TOOL_ACTION ACTIONS::replaceAll( "common.Interactive.replaceAll",
  206. AS_GLOBAL,
  207. 0, "",
  208. _( "Replace All" ), _( "Replace all matches" ),
  209. BITMAPS::find_replace );
  210. TOOL_ACTION ACTIONS::updateFind( "common.Control.updateFind",
  211. AS_GLOBAL );
  212. // Marker Controls
  213. TOOL_ACTION ACTIONS::prevMarker( "common.Checker.prevMarker",
  214. AS_GLOBAL,
  215. 0, "",
  216. _( "Previous Marker" ), _( "Go to previous marker in Checker window" ),
  217. BITMAPS::marker_previous );
  218. TOOL_ACTION ACTIONS::nextMarker( "common.Checker.nextMarker",
  219. AS_GLOBAL,
  220. 0, "",
  221. _( "Next Marker" ), _( "Go to next marker in Checker window" ),
  222. BITMAPS::marker_next );
  223. TOOL_ACTION ACTIONS::excludeMarker( "common.Checker.excludeMarker",
  224. AS_GLOBAL,
  225. 0, "",
  226. _( "Exclude Marker" ), _( "Mark current violation in Checker window as an exclusion" ),
  227. BITMAPS::marker_exclude );
  228. // View Controls
  229. TOOL_ACTION ACTIONS::zoomRedraw( "common.Control.zoomRedraw",
  230. AS_GLOBAL,
  231. #if defined( __WXMAC__ )
  232. MD_CTRL + 'R',
  233. #else
  234. WXK_F5,
  235. #endif
  236. LEGACY_HK_NAME( "Zoom Redraw" ),
  237. _( "Refresh" ), _( "Refresh" ),
  238. BITMAPS::refresh );
  239. TOOL_ACTION ACTIONS::zoomFitScreen( "common.Control.zoomFitScreen",
  240. AS_GLOBAL,
  241. #if defined( __WXMAC__ )
  242. MD_CTRL + '0',
  243. #else
  244. WXK_HOME,
  245. #endif
  246. LEGACY_HK_NAME( "Zoom Auto" ),
  247. _( "Zoom to Fit" ), _( "Zoom to Fit" ),
  248. BITMAPS::zoom_fit_in_page );
  249. TOOL_ACTION ACTIONS::zoomFitObjects( "common.Control.zoomFitObjects",
  250. AS_GLOBAL, MD_CTRL + WXK_HOME, "",
  251. _( "Zoom to Objects" ), _( "Zoom to Objects" ),
  252. BITMAPS::zoom_fit_to_objects );
  253. TOOL_ACTION ACTIONS::zoomIn( "common.Control.zoomIn",
  254. AS_GLOBAL,
  255. #if defined( __WXMAC__ )
  256. MD_CTRL + '+',
  257. #else
  258. WXK_F1,
  259. #endif
  260. LEGACY_HK_NAME( "Zoom In" ),
  261. _( "Zoom In at Cursor" ), _( "Zoom In at Cursor" ),
  262. BITMAPS::zoom_in );
  263. TOOL_ACTION ACTIONS::zoomOut( "common.Control.zoomOut",
  264. AS_GLOBAL,
  265. #if defined( __WXMAC__ )
  266. MD_CTRL + '-',
  267. #else
  268. WXK_F2,
  269. #endif
  270. LEGACY_HK_NAME( "Zoom Out" ),
  271. _( "Zoom Out at Cursor" ), _( "Zoom Out at Cursor" ),
  272. BITMAPS::zoom_out );
  273. TOOL_ACTION ACTIONS::zoomInCenter( "common.Control.zoomInCenter",
  274. AS_GLOBAL,
  275. 0, "",
  276. _( "Zoom In" ), _( "Zoom In" ),
  277. BITMAPS::zoom_in );
  278. TOOL_ACTION ACTIONS::zoomOutCenter( "common.Control.zoomOutCenter",
  279. AS_GLOBAL,
  280. 0, "",
  281. _( "Zoom Out" ), _( "Zoom Out" ),
  282. BITMAPS::zoom_out );
  283. TOOL_ACTION ACTIONS::zoomCenter( "common.Control.zoomCenter",
  284. AS_GLOBAL,
  285. WXK_F4, LEGACY_HK_NAME( "Zoom Center" ),
  286. _( "Center on Cursor" ), _( "Center on Cursor" ),
  287. BITMAPS::zoom_center_on_screen );
  288. TOOL_ACTION ACTIONS::zoomTool( "common.Control.zoomTool",
  289. AS_GLOBAL,
  290. MD_CTRL + WXK_F5, LEGACY_HK_NAME( "Zoom to Selection" ),
  291. _( "Zoom to Selection" ), _( "Zoom to Selection" ),
  292. BITMAPS::zoom_area, AF_ACTIVATE );
  293. TOOL_ACTION ACTIONS::zoomPreset( "common.Control.zoomPreset",
  294. AS_GLOBAL );
  295. TOOL_ACTION ACTIONS::centerContents( "common.Control.centerContents",
  296. AS_GLOBAL );
  297. // Cursor control
  298. TOOL_ACTION ACTIONS::cursorUp( "common.Control.cursorUp",
  299. AS_GLOBAL,
  300. WXK_UP, "",
  301. _( "Cursor Up" ), "",
  302. BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_UP );
  303. TOOL_ACTION ACTIONS::cursorDown( "common.Control.cursorDown",
  304. AS_GLOBAL,
  305. WXK_DOWN, "",
  306. _( "Cursor Down" ), "" ,
  307. BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_DOWN );
  308. TOOL_ACTION ACTIONS::cursorLeft( "common.Control.cursorLeft",
  309. AS_GLOBAL,
  310. WXK_LEFT, "",
  311. _( "Cursor Left" ), "" ,
  312. BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_LEFT );
  313. TOOL_ACTION ACTIONS::cursorRight( "common.Control.cursorRight",
  314. AS_GLOBAL,
  315. WXK_RIGHT, "",
  316. _( "Cursor Right" ), "" ,
  317. BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_RIGHT );
  318. TOOL_ACTION ACTIONS::cursorUpFast( "common.Control.cursorUpFast",
  319. AS_GLOBAL,
  320. MD_CTRL + WXK_UP, "",
  321. _( "Cursor Up Fast" ), "",
  322. BITMAPS::INVALID_BITMAP, AF_NONE, (void*) ( CURSOR_UP | CURSOR_FAST_MOVE ) );
  323. TOOL_ACTION ACTIONS::cursorDownFast( "common.Control.cursorDownFast",
  324. AS_GLOBAL,
  325. MD_CTRL + WXK_DOWN, "",
  326. _( "Cursor Down Fast" ), "" ,
  327. BITMAPS::INVALID_BITMAP, AF_NONE, (void*) ( CURSOR_DOWN | CURSOR_FAST_MOVE ) );
  328. TOOL_ACTION ACTIONS::cursorLeftFast( "common.Control.cursorLeftFast",
  329. AS_GLOBAL,
  330. MD_CTRL + WXK_LEFT, "",
  331. _( "Cursor Left Fast" ), "" ,
  332. BITMAPS::INVALID_BITMAP, AF_NONE, (void*) ( CURSOR_LEFT | CURSOR_FAST_MOVE ) );
  333. TOOL_ACTION ACTIONS::cursorRightFast( "common.Control.cursorRightFast",
  334. AS_GLOBAL,
  335. MD_CTRL + WXK_RIGHT, "",
  336. _( "Cursor Right Fast" ), "" ,
  337. BITMAPS::INVALID_BITMAP, AF_NONE, (void*) ( CURSOR_RIGHT | CURSOR_FAST_MOVE ) );
  338. TOOL_ACTION ACTIONS::cursorClick( "common.Control.cursorClick",
  339. AS_GLOBAL,
  340. WXK_RETURN, LEGACY_HK_NAME( "Mouse Left Click" ),
  341. _( "Click" ), _( "Performs left mouse button click" ),
  342. BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_CLICK );
  343. TOOL_ACTION ACTIONS::cursorDblClick( "common.Control.cursorDblClick",
  344. AS_GLOBAL,
  345. WXK_END, LEGACY_HK_NAME( "Mouse Left Double Click" ),
  346. _( "Double-click" ), _( "Performs left mouse button double-click" ),
  347. BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_DBL_CLICK );
  348. TOOL_ACTION ACTIONS::refreshPreview( "common.Control.refreshPreview",
  349. AS_GLOBAL );
  350. TOOL_ACTION ACTIONS::pinLibrary( "common.Control.pinLibrary",
  351. AS_GLOBAL, 0, "",
  352. _( "Pin Library" ),
  353. _( "Keep the library at the top of the list" ) );
  354. TOOL_ACTION ACTIONS::unpinLibrary( "common.Control.unpinLibrary",
  355. AS_GLOBAL, 0, "",
  356. _( "Unpin Library" ),
  357. _( "No longer keep the library at the top of the list" ) );
  358. TOOL_ACTION ACTIONS::panUp( "common.Control.panUp",
  359. AS_GLOBAL,
  360. MD_SHIFT + WXK_UP, "",
  361. _( "Pan Up" ), "",
  362. BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_UP );
  363. TOOL_ACTION ACTIONS::panDown( "common.Control.panDown",
  364. AS_GLOBAL,
  365. MD_SHIFT + WXK_DOWN, "",
  366. _( "Pan Down" ), "" ,
  367. BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_DOWN );
  368. TOOL_ACTION ACTIONS::panLeft( "common.Control.panLeft",
  369. AS_GLOBAL,
  370. MD_SHIFT + WXK_LEFT, "",
  371. _( "Pan Left" ), "" ,
  372. BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_LEFT );
  373. TOOL_ACTION ACTIONS::panRight( "common.Control.panRight",
  374. AS_GLOBAL,
  375. MD_SHIFT + WXK_RIGHT, "",
  376. _( "Pan Right" ), "" ,
  377. BITMAPS::INVALID_BITMAP, AF_NONE, (void*) CURSOR_RIGHT );
  378. // Grid control
  379. TOOL_ACTION ACTIONS::gridFast1( "common.Control.gridFast1",
  380. AS_GLOBAL,
  381. MD_ALT + '1', LEGACY_HK_NAME( "Switch Grid To Fast Grid1" ),
  382. _( "Switch to Fast Grid 1" ), "" );
  383. TOOL_ACTION ACTIONS::gridFast2( "common.Control.gridFast2",
  384. AS_GLOBAL,
  385. MD_ALT + '2', LEGACY_HK_NAME( "Switch Grid To Fast Grid2" ),
  386. _( "Switch to Fast Grid 2" ), "" );
  387. TOOL_ACTION ACTIONS::gridNext( "common.Control.gridNext",
  388. AS_GLOBAL,
  389. 'N', LEGACY_HK_NAME( "Switch Grid To Next" ),
  390. _("Switch to Next Grid" ), "" );
  391. TOOL_ACTION ACTIONS::gridPrev( "common.Control.gridPrev",
  392. AS_GLOBAL, MD_SHIFT + 'N', LEGACY_HK_NAME( "Switch Grid To Previous" ),
  393. _( "Switch to Previous Grid" ), "" );
  394. TOOL_ACTION ACTIONS::gridSetOrigin( "common.Control.gridSetOrigin",
  395. AS_GLOBAL,
  396. 'S', LEGACY_HK_NAME( "Set Grid Origin" ),
  397. _( "Grid Origin" ), _( "Set the grid origin point" ),
  398. BITMAPS::grid_select_axis );
  399. TOOL_ACTION ACTIONS::gridResetOrigin( "common.Control.gridResetOrigin",
  400. AS_GLOBAL,
  401. 'Z', LEGACY_HK_NAME( "Reset Grid Origin" ),
  402. _( "Reset Grid Origin" ), "" );
  403. TOOL_ACTION ACTIONS::gridPreset( "common.Control.gridPreset",
  404. AS_GLOBAL );
  405. TOOL_ACTION ACTIONS::toggleGrid( "common.Control.toggleGrid",
  406. AS_GLOBAL, 0, "",
  407. _( "Show Grid" ), _( "Display background grid in the edit window" ),
  408. BITMAPS::grid );
  409. TOOL_ACTION ACTIONS::gridProperties( "common.Control.gridProperties",
  410. AS_GLOBAL, 0, "",
  411. _( "Grid Properties..." ), _( "Set grid dimensions" ),
  412. BITMAPS::grid_select );
  413. TOOL_ACTION ACTIONS::inchesUnits( "common.Control.imperialUnits",
  414. AS_GLOBAL, 0, "",
  415. _( "Inches" ), _( "Use inches" ),
  416. BITMAPS::unit_inch, AF_NONE, (void*) EDA_UNITS::INCHES );
  417. TOOL_ACTION ACTIONS::milsUnits( "common.Control.mils",
  418. AS_GLOBAL, 0, "",
  419. _( "Mils" ), _( "Use mils" ),
  420. BITMAPS::unit_mil, AF_NONE, (void*) EDA_UNITS::MILS );
  421. TOOL_ACTION ACTIONS::millimetersUnits( "common.Control.metricUnits",
  422. AS_GLOBAL, 0, "",
  423. _( "Millimeters" ), _( "Use millimeters" ),
  424. BITMAPS::unit_mm, AF_NONE, (void*) EDA_UNITS::MILLIMETRES );
  425. TOOL_ACTION ACTIONS::updateUnits( "common.Control.updateUnits",
  426. AS_GLOBAL );
  427. TOOL_ACTION ACTIONS::updatePreferences( "common.Control.updatePreferences",
  428. AS_GLOBAL );
  429. TOOL_ACTION ACTIONS::selectColumns( "common.Control.selectColumns",
  430. AS_GLOBAL, 0, "",
  431. _( "Select Columns" ) );
  432. TOOL_ACTION ACTIONS::toggleUnits( "common.Control.toggleUnits",
  433. AS_GLOBAL,
  434. MD_CTRL + 'U', LEGACY_HK_NAME( "Switch Units" ),
  435. _( "Switch units" ), _( "Switch between imperial and metric units" ),
  436. BITMAPS::unit_mm );
  437. TOOL_ACTION ACTIONS::togglePolarCoords( "common.Control.togglePolarCoords",
  438. AS_GLOBAL, 0, "",
  439. _( "Polar Coordinates" ), _( "Switch between polar and cartesian coordinate systems" ),
  440. BITMAPS::polar_coord );
  441. TOOL_ACTION ACTIONS::resetLocalCoords( "common.Control.resetLocalCoords",
  442. AS_GLOBAL,
  443. ' ', LEGACY_HK_NAME( "Reset Local Coordinates" ),
  444. _( "Reset Local Coordinates" ), "" );
  445. TOOL_ACTION ACTIONS::toggleCursor( "common.Control.toggleCursor",
  446. AS_GLOBAL,
  447. // Don't be tempted to remove "Modern Toolset only". It's in the legacy property name.
  448. MD_CTRL + MD_SHIFT + 'X', LEGACY_HK_NAME( "Toggle Cursor Display (Modern Toolset only)" ),
  449. _( "Always Show Cursor" ), _( "Display crosshairs even in selection tool" ),
  450. BITMAPS::cursor );
  451. TOOL_ACTION ACTIONS::toggleCursorStyle( "common.Control.toggleCursorStyle",
  452. AS_GLOBAL, 0, "",
  453. _( "Full-Window Crosshairs" ), _( "Switch display of full-window crosshairs" ),
  454. BITMAPS::cursor_shape );
  455. TOOL_ACTION ACTIONS::highContrastMode( "common.Control.highContrastMode",
  456. AS_GLOBAL,
  457. 0, LEGACY_HK_NAME( "Toggle High Contrast Mode" ),
  458. _( "Inactive Layer View Mode" ),
  459. _( "Toggle inactive layers between normal and dimmed" ),
  460. BITMAPS::contrast_mode );
  461. TOOL_ACTION ACTIONS::highContrastModeCycle( "common.Control.highContrastModeCycle",
  462. AS_GLOBAL,
  463. 'H', "",
  464. _( "Inactive Layer View Mode (3-state)" ),
  465. _( "Cycle inactive layers between normal, dimmed, and hidden" ),
  466. BITMAPS::contrast_mode );
  467. TOOL_ACTION ACTIONS::toggleBoundingBoxes( "common.Control.toggleBoundingBoxes",
  468. AS_GLOBAL, 0, "",
  469. _( "Draw Bounding Boxes" ), _( "Draw Bounding Boxes" ),
  470. BITMAPS::gerbview_show_negative_objects );
  471. TOOL_ACTION ACTIONS::selectionTool( "common.InteractiveSelection.selectionTool",
  472. AS_GLOBAL, 0, "",
  473. _( "Select item(s)" ), _( "Select item(s)" ),
  474. BITMAPS::cursor, AF_ACTIVATE );
  475. TOOL_ACTION ACTIONS::measureTool( "common.InteractiveEdit.measureTool",
  476. AS_GLOBAL,
  477. // Don't be tempted to remove "Modern Toolset only". It's in the legacy property name.
  478. MD_CTRL + MD_SHIFT + 'M', LEGACY_HK_NAME( "Measure Distance (Modern Toolset only)" ),
  479. _( "Measure Tool" ), _( "Interactively measure distance between points" ),
  480. BITMAPS::measurement, AF_ACTIVATE );
  481. TOOL_ACTION ACTIONS::pickerTool( "common.InteractivePicker.pickerTool",
  482. AS_GLOBAL, 0, "",
  483. "", "",
  484. BITMAPS::INVALID_BITMAP, AF_ACTIVATE );
  485. TOOL_ACTION ACTIONS::pickerSubTool( "common.InteractivePicker.pickerSubTool",
  486. AS_GLOBAL );
  487. TOOL_ACTION ACTIONS::show3DViewer( "common.Control.show3DViewer",
  488. AS_GLOBAL,
  489. MD_ALT + '3', LEGACY_HK_NAME( "3D Viewer" ),
  490. _( "3D Viewer" ), _( "Show 3D viewer window" ),
  491. BITMAPS::three_d );
  492. TOOL_ACTION ACTIONS::showSymbolBrowser( "common.Control.showSymbolBrowser",
  493. AS_GLOBAL, 0, "",
  494. _( "Symbol Library Browser" ), _( "Browse symbol libraries" ),
  495. BITMAPS::library_browser, AF_NONE, (void*) FRAME_SCH_VIEWER );
  496. TOOL_ACTION ACTIONS::showSymbolEditor( "common.Control.showSymbolEditor",
  497. AS_GLOBAL, 0, "",
  498. _( "Symbol Editor" ), _( "Create, delete and edit symbols" ),
  499. BITMAPS::libedit, AF_NONE, (void*) FRAME_SCH_SYMBOL_EDITOR );
  500. TOOL_ACTION ACTIONS::showFootprintBrowser( "common.Control.showFootprintBrowser",
  501. AS_GLOBAL, 0, "",
  502. _( "Footprint Library Browser" ), _( "Browse footprint libraries" ),
  503. BITMAPS::library_browser, AF_NONE, (void*) FRAME_FOOTPRINT_VIEWER );
  504. TOOL_ACTION ACTIONS::showFootprintEditor( "common.Control.showFootprintEditor",
  505. AS_GLOBAL, 0, "",
  506. _( "Footprint Editor" ), _( "Create, delete and edit footprints" ),
  507. BITMAPS::module_editor, AF_NONE, (void*) FRAME_FOOTPRINT_EDITOR );
  508. TOOL_ACTION ACTIONS::updatePcbFromSchematic( "common.Control.updatePcbFromSchematic",
  509. AS_GLOBAL,
  510. WXK_F8, LEGACY_HK_NAME( "Update PCB from Schematic" ),
  511. _( "Update PCB from Schematic..." ), _( "Update PCB with changes made to schematic" ),
  512. BITMAPS::update_pcb_from_sch );
  513. TOOL_ACTION ACTIONS::updateSchematicFromPcb( "common.Control.updateSchematicFromPCB",
  514. AS_GLOBAL, 0, "",
  515. _( "Update Schematic from PCB..." ), _( "Update schematic with changes made to PCB" ),
  516. BITMAPS::update_sch_from_pcb );
  517. TOOL_ACTION ACTIONS::openPreferences( "common.SuiteControl.openPreferences",
  518. AS_GLOBAL, MD_CTRL + ',', "",
  519. _( "Preferences..." ), _( "Show preferences for all open tools" ),
  520. BITMAPS::preference );
  521. TOOL_ACTION ACTIONS::configurePaths( "common.SuiteControl.configurePaths",
  522. AS_GLOBAL, 0, "",
  523. _( "Configure Paths..." ), _( "Edit path configuration environment variables" ),
  524. BITMAPS::path );
  525. TOOL_ACTION ACTIONS::showSymbolLibTable( "common.SuiteControl.showSymbolLibTable",
  526. AS_GLOBAL, 0, "",
  527. _( "Manage Symbol Libraries..." ),
  528. _( "Edit the global and project symbol library lists" ),
  529. BITMAPS::library_table );
  530. TOOL_ACTION ACTIONS::showFootprintLibTable( "common.SuiteControl.showFootprintLibTable",
  531. AS_GLOBAL, 0, "",
  532. _( "Manage Footprint Libraries..." ),
  533. _( "Edit the global and project footprint library lists" ),
  534. BITMAPS::library_table );
  535. TOOL_ACTION ACTIONS::gettingStarted( "common.SuiteControl.gettingStarted",
  536. AS_GLOBAL, 0, "",
  537. _( "Getting Started with KiCad" ),
  538. _( "Open \"Getting Started in KiCad\" guide for beginners" ),
  539. BITMAPS::help );
  540. TOOL_ACTION ACTIONS::help( "common.SuiteControl.help",
  541. AS_GLOBAL, 0, "",
  542. _( "Help" ),
  543. _( "Open product documentation in a web browser" ),
  544. BITMAPS::help_online );
  545. TOOL_ACTION ACTIONS::listHotKeys( "common.SuiteControl.listHotKeys",
  546. AS_GLOBAL,
  547. MD_CTRL + WXK_F1, LEGACY_HK_NAME( "List Hotkeys" ),
  548. _( "List Hotkeys..." ),
  549. _( "Displays current hotkeys table and corresponding commands" ),
  550. BITMAPS::hotkeys );
  551. TOOL_ACTION ACTIONS::getInvolved( "common.SuiteControl.getInvolved",
  552. AS_GLOBAL, 0, "",
  553. _( "Get Involved" ),
  554. _( "Open \"Contribute to KiCad\" in a web browser" ),
  555. BITMAPS::info );
  556. TOOL_ACTION ACTIONS::donate( "common.SuiteControl.donate",
  557. AS_GLOBAL, 0, "",
  558. _( "Donate" ),
  559. _( "Open \"Donate to KiCad\" in a web browser" ) );
  560. TOOL_ACTION ACTIONS::reportBug( "common.SuiteControl.reportBug",
  561. AS_GLOBAL, 0, "",
  562. _( "Report Bug" ),
  563. _( "Report a problem with KiCad" ),
  564. BITMAPS::bug );
  565. TOOL_ACTION ACTIONS::ddAddLibrary( "common.Control.ddaddLibrary",
  566. AS_GLOBAL );
  567. // System-wide selection Events
  568. const TOOL_EVENT EVENTS::PointSelectedEvent( TC_MESSAGE, TA_ACTION, "common.Interactive.pointSelected" );
  569. const TOOL_EVENT EVENTS::SelectedEvent( TC_MESSAGE, TA_ACTION, "common.Interactive.selected" );
  570. const TOOL_EVENT EVENTS::UnselectedEvent( TC_MESSAGE, TA_ACTION, "common.Interactive.unselected" );
  571. const TOOL_EVENT EVENTS::ClearedEvent( TC_MESSAGE, TA_ACTION, "common.Interactive.cleared" );
  572. const TOOL_EVENT EVENTS::ConnectivityChangedEvent( TC_MESSAGE, TA_ACTION, "common.Interactive.connectivityChanged" );
  573. const TOOL_EVENT EVENTS::SelectedItemsModified( TC_MESSAGE, TA_ACTION, "common.Interactive.modified" );
  574. const TOOL_EVENT EVENTS::SelectedItemsMoved( TC_MESSAGE, TA_ACTION, "common.Interactive.moved" );
  575. const TOOL_EVENT EVENTS::InhibitSelectionEditing( TC_MESSAGE, TA_ACTION, "common.Interactive.inhibit" );
  576. const TOOL_EVENT EVENTS::UninhibitSelectionEditing( TC_MESSAGE, TA_ACTION, "common.Interactive.uninhibit" );
  577. const TOOL_EVENT EVENTS::DisambiguatePoint( TC_MESSAGE, TA_ACTION, "common.Interactive.disambiguate" );