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.

468 lines
18 KiB

* KIWAY Milestone A): Make major modules into DLL/DSOs. ! The initial testing of this commit should be done using a Debug build so that all the wxASSERT()s are enabled. Also, be sure and keep enabled the USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it off is senseless anyways. If you want stable code, go back to a prior version, the one tagged with "stable". * Relocate all functionality out of the wxApp derivative into more finely targeted purposes: a) DLL/DSO specific b) PROJECT specific c) EXE or process specific d) configuration file specific data e) configuration file manipulations functions. All of this functionality was blended into an extremely large wxApp derivative and that was incompatible with the desire to support multiple concurrently loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects. An amazing amount of organization come from simply sorting each bit of functionality into the proper box. * Switch to wxConfigBase from wxConfig everywhere except instantiation. * Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD, PGM_SINGLE_TOP, * Remove "Return" prefix on many function names. * Remove obvious comments from CMakeLists.txt files, and from else() and endif()s. * Fix building boost for use in a DSO on linux. * Remove some of the assumptions in the CMakeLists.txt files that windows had to be the host platform when building windows binaries. * Reduce the number of wxStrings being constructed at program load time via static construction. * Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that these functions are useful even when the wxConfigBase comes from another source, as is the case in the KICAD_MANAGER_FRAME. * Move the setting of the KIPRJMOD environment variable into class PROJECT, so that it can be moved into a project variable soon, and out of FP_LIB_TABLE. * Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all its child wxFrames and wxDialogs now have a Kiway() member function which returns a KIWAY& that that window tree branch is in support of. This is like wxWindows DNA in that child windows get this member with proper value at time of construction. * Anticipate some of the needs for milestones B) and C) and make code adjustments now in an effort to reduce work in those milestones. * No testing has been done for python scripting, since milestone C) has that being largely reworked and re-thought-out.
12 years ago
16 years ago
16 years ago
16 years ago
5 years ago
16 years ago
16 years ago
16 years ago
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
  5. * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
  6. * Copyright (C) 2012 Wayne Stambaugh <stambaughw@gmail.com>
  7. * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2
  12. * of the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, you may find one here:
  21. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  22. * or you may search the http://www.gnu.org website for the version 2 license,
  23. * or you may write to the Free Software Foundation, Inc.,
  24. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  25. */
  26. #include <advanced_config.h>
  27. #include <filehistory.h>
  28. #include <kiface_i.h>
  29. #include <menus_helpers.h>
  30. #include <pcb_edit_frame.h>
  31. #include <pcbnew.h>
  32. #include <pcbnew_id.h>
  33. #include <pgm_base.h>
  34. #include <tool/actions.h>
  35. #include <tool/conditional_menu.h>
  36. #include <tool/selection_conditions.h>
  37. #include <tool/tool_manager.h>
  38. #include <tools/pcb_actions.h>
  39. #include <tools/pcb_selection_tool.h>
  40. #include <widgets/wx_menubar.h>
  41. void PCB_EDIT_FRAME::ReCreateMenuBar()
  42. {
  43. PCB_SELECTION_TOOL* selTool = m_toolManager->GetTool<PCB_SELECTION_TOOL>();
  44. // wxWidgets handles the Mac Application menu behind the scenes, but that means
  45. // we always have to start from scratch with a new wxMenuBar.
  46. wxMenuBar* oldMenuBar = GetMenuBar();
  47. WX_MENUBAR* menuBar = new WX_MENUBAR();
  48. // Recreate all menus:
  49. //-- File menu -----------------------------------------------------------
  50. //
  51. ACTION_MENU* fileMenu = new ACTION_MENU( false, selTool );
  52. static ACTION_MENU* openRecentMenu;
  53. if( Kiface().IsSingle() ) // not when under a project mgr
  54. {
  55. FILE_HISTORY& fileHistory = GetFileHistory();
  56. // Create the menu if it does not exist. Adding a file to/from the history
  57. // will automatically refresh the menu.
  58. if( !openRecentMenu )
  59. {
  60. openRecentMenu = new ACTION_MENU( false );
  61. openRecentMenu->SetTool( selTool );
  62. openRecentMenu->SetTitle( _( "Open Recent" ) );
  63. openRecentMenu->SetIcon( recent_xpm );
  64. fileHistory.UseMenu( openRecentMenu );
  65. fileHistory.AddFilesToMenu();
  66. }
  67. fileMenu->Add( ACTIONS::doNew );
  68. fileMenu->Add( ACTIONS::open );
  69. wxMenuItem* item = fileMenu->Add( openRecentMenu );
  70. // Add the file menu condition here since it needs the item ID for the submenu
  71. ACTION_CONDITIONS cond;
  72. cond.Enable( FILE_HISTORY::FileHistoryNotEmpty( fileHistory ) );
  73. RegisterUIUpdateHandler( item->GetId(), cond );
  74. fileMenu->Add( PCB_ACTIONS::appendBoard );
  75. fileMenu->AppendSeparator();
  76. }
  77. fileMenu->Add( ACTIONS::save );
  78. // Save as menu:
  79. // under a project mgr we do not want to modify the board filename
  80. // to keep consistency with the project mgr which expects files names same as prj name
  81. // for main files
  82. if( Kiface().IsSingle() )
  83. fileMenu->Add( ACTIONS::saveAs );
  84. else
  85. fileMenu->Add( ACTIONS::saveCopyAs );
  86. fileMenu->AppendSeparator();
  87. fileMenu->Add( _( "Resc&ue" ),
  88. _( "Clear board and get last rescue file automatically saved by PCB editor" ),
  89. ID_MENU_RECOVER_BOARD_AUTOSAVE,
  90. rescue_xpm );
  91. // Import submenu
  92. ACTION_MENU* submenuImport = new ACTION_MENU( false );
  93. submenuImport->SetTool( selTool );
  94. submenuImport->SetTitle( _( "Import" ) );
  95. submenuImport->SetIcon( import_xpm );
  96. submenuImport->Add( PCB_ACTIONS::importNetlist );
  97. submenuImport->Add( PCB_ACTIONS::importSpecctraSession );
  98. submenuImport->Add( _( "Graphics..." ), _( "Import 2D drawing file" ),
  99. ID_GEN_IMPORT_GRAPHICS_FILE, import_vector_xpm );
  100. if( Kiface().IsSingle() )
  101. {
  102. submenuImport->Add( _( "Non-KiCad Board File..." ),
  103. _( "Import board file from other applications" ),
  104. ID_IMPORT_NON_KICAD_BOARD, import_brd_file_xpm );
  105. }
  106. fileMenu->AppendSeparator();
  107. fileMenu->Add( submenuImport );
  108. // Export submenu
  109. ACTION_MENU* submenuExport = new ACTION_MENU( false );
  110. submenuExport->SetTool( selTool );
  111. submenuExport->SetTitle( _( "Export" ) );
  112. submenuExport->SetIcon( export_xpm );
  113. submenuExport->Add( PCB_ACTIONS::exportSpecctraDSN );
  114. submenuExport->Add( _( "GenCAD..." ), _( "Export GenCAD board representation" ),
  115. ID_GEN_EXPORT_FILE_GENCADFORMAT, post_gencad_xpm );
  116. submenuExport->Add( _( "VRML..." ), _( "Export VRML 3D board representation" ),
  117. ID_GEN_EXPORT_FILE_VRML, export3d_xpm );
  118. submenuExport->Add( _( "IDFv3..." ), _( "Export IDF 3D board representation" ),
  119. ID_GEN_EXPORT_FILE_IDF3, export_idf_xpm );
  120. submenuExport->Add( _( "STEP..." ), _( "Export STEP 3D board representation" ),
  121. ID_GEN_EXPORT_FILE_STEP, export_step_xpm );
  122. submenuExport->Add( _( "SVG..." ), _( "Export SVG board representation" ),
  123. ID_GEN_PLOT_SVG, export_svg_xpm );
  124. submenuExport->Add( _( "Footprint Association (.cmp) File..." ),
  125. _( "Export footprint association file (*.cmp) for schematic back annotation" ),
  126. ID_PCB_GEN_CMP_FILE, export_cmp_xpm );
  127. submenuExport->Add( _( "Hyperlynx..." ), "",
  128. ID_GEN_EXPORT_FILE_HYPERLYNX, export_step_xpm );
  129. submenuExport->AppendSeparator();
  130. submenuExport->Add( _( "Export Footprints to Library..." ),
  131. _( "Add footprints used on board to an existing footprint library\n"
  132. "(does not remove other footprints from this library)" ),
  133. ID_MENU_EXPORT_FOOTPRINTS_TO_LIBRARY, library_archive_xpm );
  134. submenuExport->Add( _( "Export Footprints to New Library..." ),
  135. _( "Create a new footprint library containing the footprints used on board\n"
  136. "(if the library already exists it will be replaced)" ),
  137. ID_MENU_EXPORT_FOOTPRINTS_TO_NEW_LIBRARY, library_archive_as_xpm );
  138. fileMenu->Add( submenuExport );
  139. // Fabrication Outputs submenu
  140. ACTION_MENU* submenuFabOutputs = new ACTION_MENU( false );
  141. submenuFabOutputs->SetTool( selTool );
  142. submenuFabOutputs->SetTitle( _( "Fabrication Outputs" ) );
  143. submenuFabOutputs->SetIcon( fabrication_xpm );
  144. submenuFabOutputs->Add( PCB_ACTIONS::generateGerbers );
  145. submenuFabOutputs->Add( PCB_ACTIONS::generateDrillFiles );
  146. submenuFabOutputs->Add( PCB_ACTIONS::generatePosFile );
  147. submenuFabOutputs->Add( PCB_ACTIONS::generateReportFile );
  148. submenuFabOutputs->Add( PCB_ACTIONS::generateD356File );
  149. submenuFabOutputs->Add( PCB_ACTIONS::generateBOM );
  150. fileMenu->Add( submenuFabOutputs );
  151. fileMenu->AppendSeparator();
  152. fileMenu->Add( PCB_ACTIONS::boardSetup );
  153. fileMenu->AppendSeparator();
  154. fileMenu->Add( ACTIONS::pageSettings );
  155. fileMenu->Add( ACTIONS::print );
  156. fileMenu->Add( ACTIONS::plot );
  157. fileMenu->AppendSeparator();
  158. fileMenu->AddQuitOrClose( &Kiface(), _( "PCB Editor" ) );
  159. //-- Edit menu -----------------------------------------------------------
  160. //
  161. ACTION_MENU* editMenu = new ACTION_MENU( false, selTool );
  162. editMenu->Add( ACTIONS::undo );
  163. editMenu->Add( ACTIONS::redo );
  164. editMenu->AppendSeparator();
  165. editMenu->Add( ACTIONS::cut );
  166. editMenu->Add( ACTIONS::copy );
  167. editMenu->Add( ACTIONS::paste );
  168. editMenu->Add( ACTIONS::doDelete );
  169. editMenu->AppendSeparator();
  170. editMenu->Add( ACTIONS::selectAll );
  171. editMenu->AppendSeparator();
  172. editMenu->Add( ACTIONS::find );
  173. editMenu->AppendSeparator();
  174. editMenu->Add( PCB_ACTIONS::editTracksAndVias );
  175. editMenu->Add( PCB_ACTIONS::editTextAndGraphics );
  176. editMenu->Add( PCB_ACTIONS::changeFootprints );
  177. editMenu->Add( PCB_ACTIONS::swapLayers );
  178. editMenu->AppendSeparator();
  179. editMenu->Add( PCB_ACTIONS::zoneFillAll );
  180. editMenu->Add( PCB_ACTIONS::zoneUnfillAll );
  181. editMenu->AppendSeparator();
  182. editMenu->Add( ACTIONS::deleteTool );
  183. editMenu->Add( PCB_ACTIONS::globalDeletions );
  184. //----- View menu -----------------------------------------------------------
  185. //
  186. ACTION_MENU* viewMenu = new ACTION_MENU( false, selTool );
  187. viewMenu->Add( PCB_ACTIONS::showLayersManager, ACTION_MENU::CHECK );
  188. viewMenu->Add( ACTIONS::showFootprintBrowser );
  189. viewMenu->Add( ACTIONS::show3DViewer );
  190. viewMenu->AppendSeparator();
  191. viewMenu->Add( ACTIONS::zoomInCenter );
  192. viewMenu->Add( ACTIONS::zoomOutCenter );
  193. viewMenu->Add( ACTIONS::zoomFitScreen );
  194. viewMenu->Add( ACTIONS::zoomFitObjects );
  195. viewMenu->Add( ACTIONS::zoomTool );
  196. viewMenu->Add( ACTIONS::zoomRedraw );
  197. viewMenu->AppendSeparator();
  198. viewMenu->Add( ACTIONS::toggleGrid, ACTION_MENU::CHECK );
  199. viewMenu->Add( ACTIONS::gridProperties );
  200. viewMenu->Add( PCB_ACTIONS::togglePolarCoords, ACTION_MENU::CHECK );
  201. // Units submenu
  202. ACTION_MENU* unitsSubMenu = new ACTION_MENU( false, selTool );
  203. unitsSubMenu->SetTitle( _( "&Units" ) );
  204. unitsSubMenu->SetIcon( unit_mm_xpm );
  205. unitsSubMenu->Add( ACTIONS::inchesUnits, ACTION_MENU::CHECK );
  206. unitsSubMenu->Add( ACTIONS::milsUnits, ACTION_MENU::CHECK );
  207. unitsSubMenu->Add( ACTIONS::millimetersUnits, ACTION_MENU::CHECK );
  208. viewMenu->Add( unitsSubMenu );
  209. viewMenu->Add( ACTIONS::toggleCursorStyle, ACTION_MENU::CHECK );
  210. viewMenu->AppendSeparator();
  211. viewMenu->Add( PCB_ACTIONS::showRatsnest, ACTION_MENU::CHECK );
  212. viewMenu->Add( PCB_ACTIONS::ratsnestLineMode, ACTION_MENU::CHECK );
  213. viewMenu->AppendSeparator();
  214. // Drawing Mode Submenu
  215. ACTION_MENU* drawingModeSubMenu = new ACTION_MENU( false, selTool );
  216. drawingModeSubMenu->SetTitle( _( "&Drawing Mode" ) );
  217. drawingModeSubMenu->SetIcon( add_zone_xpm );
  218. drawingModeSubMenu->Add( PCB_ACTIONS::zoneDisplayEnable, ACTION_MENU::CHECK );
  219. drawingModeSubMenu->Add( PCB_ACTIONS::zoneDisplayDisable, ACTION_MENU::CHECK );
  220. drawingModeSubMenu->Add( PCB_ACTIONS::zoneDisplayOutlines, ACTION_MENU::CHECK );
  221. drawingModeSubMenu->AppendSeparator();
  222. drawingModeSubMenu->Add( PCB_ACTIONS::padDisplayMode, ACTION_MENU::CHECK );
  223. drawingModeSubMenu->Add( PCB_ACTIONS::viaDisplayMode, ACTION_MENU::CHECK );
  224. drawingModeSubMenu->Add( PCB_ACTIONS::trackDisplayMode, ACTION_MENU::CHECK );
  225. drawingModeSubMenu->AppendSeparator();
  226. drawingModeSubMenu->Add( PCB_ACTIONS::graphicsOutlines, ACTION_MENU::CHECK );
  227. drawingModeSubMenu->Add( PCB_ACTIONS::textOutlines, ACTION_MENU::CHECK );
  228. viewMenu->Add( drawingModeSubMenu );
  229. // Contrast Mode Submenu
  230. ACTION_MENU* contrastModeSubMenu = new ACTION_MENU( false, selTool );
  231. contrastModeSubMenu->SetTitle( _( "&Contrast Mode" ) );
  232. contrastModeSubMenu->SetIcon( contrast_mode_xpm );
  233. contrastModeSubMenu->Add( ACTIONS::highContrastMode, ACTION_MENU::CHECK );
  234. contrastModeSubMenu->Add( PCB_ACTIONS::layerAlphaDec );
  235. contrastModeSubMenu->Add( PCB_ACTIONS::layerAlphaInc );
  236. viewMenu->Add( contrastModeSubMenu );
  237. viewMenu->Add( PCB_ACTIONS::flipBoard, ACTION_MENU::CHECK );
  238. #ifdef __APPLE__
  239. viewMenu->AppendSeparator();
  240. #endif
  241. //-- Place Menu ----------------------------------------------------------
  242. //
  243. ACTION_MENU* placeMenu = new ACTION_MENU( false, selTool );
  244. placeMenu->Add( PCB_ACTIONS::placeFootprint );
  245. placeMenu->Add( PCB_ACTIONS::drawVia );
  246. placeMenu->Add( PCB_ACTIONS::drawZone );
  247. placeMenu->Add( PCB_ACTIONS::drawRuleArea );
  248. placeMenu->Add( PCB_ACTIONS::placeText );
  249. placeMenu->Add( PCB_ACTIONS::drawLine );
  250. placeMenu->Add( PCB_ACTIONS::drawArc );
  251. placeMenu->Add( PCB_ACTIONS::drawRectangle );
  252. placeMenu->Add( PCB_ACTIONS::drawCircle );
  253. placeMenu->Add( PCB_ACTIONS::drawPolygon );
  254. placeMenu->AppendSeparator();
  255. placeMenu->Add( PCB_ACTIONS::drawAlignedDimension );
  256. placeMenu->Add( PCB_ACTIONS::drawOrthogonalDimension );
  257. placeMenu->Add( PCB_ACTIONS::drawCenterDimension );
  258. placeMenu->Add( PCB_ACTIONS::drawLeader );
  259. placeMenu->AppendSeparator();
  260. placeMenu->Add( PCB_ACTIONS::placeTarget );
  261. placeMenu->AppendSeparator();
  262. placeMenu->Add( PCB_ACTIONS::drillOrigin );
  263. placeMenu->Add( ACTIONS::gridSetOrigin );
  264. placeMenu->AppendSeparator();
  265. ACTION_MENU* autoplaceSubmenu = new ACTION_MENU( false );
  266. autoplaceSubmenu->SetTitle( _( "Auto-Place Footprints" ) );
  267. autoplaceSubmenu->SetTool( selTool );
  268. autoplaceSubmenu->SetIcon( mode_module_xpm );
  269. autoplaceSubmenu->Add( PCB_ACTIONS::autoplaceOffboardComponents );
  270. autoplaceSubmenu->Add( PCB_ACTIONS::autoplaceSelectedComponents );
  271. placeMenu->Add( autoplaceSubmenu );
  272. //-- Route Menu ----------------------------------------------------------
  273. //
  274. ACTION_MENU* routeMenu = new ACTION_MENU( false, selTool );
  275. routeMenu->Add( PCB_ACTIONS::selectLayerPair );
  276. routeMenu->AppendSeparator();
  277. routeMenu->Add( PCB_ACTIONS::routeSingleTrack );
  278. routeMenu->Add( PCB_ACTIONS::routeDiffPair );
  279. routeMenu->AppendSeparator();
  280. routeMenu->Add( PCB_ACTIONS::routerTuneSingleTrace );
  281. routeMenu->Add( PCB_ACTIONS::routerTuneDiffPair );
  282. routeMenu->Add( PCB_ACTIONS::routerTuneDiffPairSkew );
  283. routeMenu->AppendSeparator();
  284. routeMenu->Add( PCB_ACTIONS::routerSettingsDialog );
  285. //-- Inspect Menu --------------------------------------------------------
  286. //
  287. ACTION_MENU* inspectMenu = new ACTION_MENU( false, selTool );
  288. inspectMenu->Add( PCB_ACTIONS::listNets );
  289. inspectMenu->Add( PCB_ACTIONS::boardStatistics );
  290. inspectMenu->Add( ACTIONS::measureTool );
  291. inspectMenu->AppendSeparator();
  292. inspectMenu->Add( PCB_ACTIONS::runDRC );
  293. inspectMenu->Add( ACTIONS::prevMarker );
  294. inspectMenu->Add( ACTIONS::nextMarker );
  295. inspectMenu->Add( ACTIONS::excludeMarker );
  296. inspectMenu->AppendSeparator();
  297. inspectMenu->Add( PCB_ACTIONS::inspectClearance );
  298. inspectMenu->Add( PCB_ACTIONS::inspectConstraints );
  299. //-- Tools menu ----------------------------------------------------------
  300. //
  301. ACTION_MENU* toolsMenu = new ACTION_MENU( false, selTool );
  302. wxMenuItem* update = toolsMenu->Add( ACTIONS::updatePcbFromSchematic );
  303. update->Enable( !Kiface().IsSingle() );
  304. toolsMenu->Add( PCB_ACTIONS::showEeschema );
  305. toolsMenu->AppendSeparator();
  306. toolsMenu->Add( ACTIONS::showFootprintEditor );
  307. toolsMenu->Add( PCB_ACTIONS::updateFootprints );
  308. toolsMenu->AppendSeparator();
  309. toolsMenu->Add( PCB_ACTIONS::cleanupTracksAndVias );
  310. toolsMenu->Add( PCB_ACTIONS::removeUnusedPads );
  311. toolsMenu->Add( PCB_ACTIONS::cleanupGraphics );
  312. toolsMenu->Add( PCB_ACTIONS::repairBoard );
  313. toolsMenu->AppendSeparator();
  314. toolsMenu->Add( PCB_ACTIONS::boardReannotate );
  315. update = toolsMenu->Add( ACTIONS::updateSchematicFromPcb );
  316. update->Enable( !Kiface().IsSingle() );
  317. #if defined(KICAD_SCRIPTING_WXPYTHON)
  318. toolsMenu->AppendSeparator();
  319. toolsMenu->Add( PCB_ACTIONS::showPythonConsole );
  320. #endif
  321. #if defined(KICAD_SCRIPTING) && defined(KICAD_SCRIPTING_ACTION_MENU)
  322. ACTION_MENU* submenuActionPlugins = new ACTION_MENU( false );
  323. submenuActionPlugins->SetTool( selTool );
  324. submenuActionPlugins->SetTitle( _( "External Plugins" ) );
  325. submenuActionPlugins->SetIcon( puzzle_piece_xpm );
  326. submenuActionPlugins->Add( _( "Refresh Plugins" ),
  327. _( "Reload all python plugins and refresh plugin menus" ),
  328. ID_TOOLBARH_PCB_ACTION_PLUGIN_REFRESH,
  329. reload_xpm );
  330. #ifdef __APPLE__
  331. submenuActionPlugins->Add( _( "Reveal Plugin Folder in Finder" ),
  332. _( "Reveals the plugins folder in a Finder window" ),
  333. ID_TOOLBARH_PCB_ACTION_PLUGIN_SHOW_FOLDER,
  334. directory_open_xpm );
  335. #else
  336. submenuActionPlugins->Add( _( "Open Plugin Directory" ),
  337. _( "Opens the directory in the default system file manager" ),
  338. ID_TOOLBARH_PCB_ACTION_PLUGIN_SHOW_FOLDER,
  339. directory_open_xpm );
  340. #endif
  341. // Populate the Action Plugin sub-menu: Must be done before Add
  342. // Since the object is cloned by Add
  343. submenuActionPlugins->AppendSeparator();
  344. buildActionPluginMenus( submenuActionPlugins );
  345. toolsMenu->AppendSeparator();
  346. toolsMenu->Add( submenuActionPlugins );
  347. #endif
  348. //-- Preferences menu ----------------------------------------------------
  349. //
  350. ACTION_MENU* prefsMenu = new ACTION_MENU( false, selTool );
  351. prefsMenu->Add( ACTIONS::configurePaths );
  352. prefsMenu->Add( ACTIONS::showFootprintLibTable );
  353. prefsMenu->Add( _( "Preferences..." ) + "\tCtrl+,",
  354. _( "Show preferences for all open tools" ),
  355. wxID_PREFERENCES,
  356. preference_xpm );
  357. prefsMenu->AppendSeparator();
  358. AddMenuLanguageList( prefsMenu, selTool );
  359. //--MenuBar -----------------------------------------------------------
  360. //
  361. menuBar->Append( fileMenu, _( "&File" ) );
  362. menuBar->Append( editMenu, _( "&Edit" ) );
  363. menuBar->Append( viewMenu, _( "&View" ) );
  364. menuBar->Append( placeMenu, _( "&Place" ) );
  365. menuBar->Append( routeMenu, _( "Ro&ute" ) );
  366. menuBar->Append( inspectMenu, _( "&Inspect" ) );
  367. menuBar->Append( toolsMenu, _( "&Tools" ) );
  368. menuBar->Append( prefsMenu, _( "P&references" ) );
  369. AddStandardHelpMenu( menuBar );
  370. SetMenuBar( menuBar );
  371. delete oldMenuBar;
  372. }