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.

640 lines
23 KiB

16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
  1. /**
  2. * @file menubar_pcbframe.cpp
  3. * PCBNew editor menu bar
  4. */
  5. #include "fctsys.h"
  6. #include "appl_wxstruct.h"
  7. #include "common.h"
  8. #include "pcbnew.h"
  9. #include "wxPcbStruct.h"
  10. #include "bitmaps.h"
  11. #include "protos.h"
  12. #include "hotkeys.h"
  13. #include "pcbnew_id.h"
  14. #include "macros.h"
  15. #include "help_common_strings.h"
  16. /**
  17. * PCBNew mainframe menubar
  18. */
  19. void PCB_EDIT_FRAME::ReCreateMenuBar()
  20. {
  21. wxString text;
  22. wxMenuItem* item;
  23. wxMenuBar* menuBar = GetMenuBar();
  24. if( ! menuBar )
  25. menuBar = new wxMenuBar();
  26. // Delete all existing menus so they can be rebuilt.
  27. // This allows language changes of the menu text on the fly.
  28. menuBar->Freeze();
  29. while( menuBar->GetMenuCount() )
  30. delete menuBar->Remove(0);
  31. // Recreate all menus:
  32. // Create File Menu
  33. wxMenu* filesMenu = new wxMenu;
  34. // New
  35. item = new wxMenuItem( filesMenu, ID_NEW_BOARD,
  36. _( "&New" ),
  37. _( "Clear current board and initialize a new one" ) );
  38. SET_BITMAP( new_xpm );
  39. filesMenu->Append( item );
  40. // Open
  41. item = new wxMenuItem( filesMenu, ID_LOAD_FILE,
  42. _( "&Open\tCtrl+O" ),
  43. _( "Delete current board and load new board" ) );
  44. SET_BITMAP( open_document_xpm );
  45. filesMenu->Append( item );
  46. // Load Recent submenu
  47. static wxMenu* openRecentMenu;
  48. // Add this menu to list menu managed by m_fileHistory
  49. // (the file history will be updated when adding/removing files in history
  50. if( openRecentMenu )
  51. wxGetApp().m_fileHistory.RemoveMenu( openRecentMenu );
  52. openRecentMenu = new wxMenu();
  53. wxGetApp().m_fileHistory.UseMenu( openRecentMenu );
  54. wxGetApp().m_fileHistory.AddFilesToMenu();
  55. ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu,
  56. -1, _( "Open &Recent" ),
  57. _( "Open a recent opened board" ),
  58. open_project_xpm );
  59. // PCBNew Board
  60. item = new wxMenuItem( filesMenu, ID_APPEND_FILE,
  61. _( "&Append Board" ),
  62. _( "Append another PCBNew board to the current loaded board" ) );
  63. SET_BITMAP( import_xpm );
  64. filesMenu->Append( item );
  65. // Separator
  66. filesMenu->AppendSeparator();
  67. // Save
  68. item = new wxMenuItem( filesMenu, ID_SAVE_BOARD,
  69. _( "&Save\tCtrl+S" ),
  70. _( "Save current board" ) );
  71. SET_BITMAP( save_xpm );
  72. filesMenu->Append( item );
  73. // Save As
  74. item = new wxMenuItem( filesMenu, ID_SAVE_BOARD_AS,
  75. _( "Save as..." ),
  76. _( "Save the current board as.." ) );
  77. SET_BITMAP( save_as_xpm );
  78. filesMenu->Append( item );
  79. filesMenu->AppendSeparator();
  80. // Revert
  81. item = new wxMenuItem( filesMenu, ID_MENU_READ_LAST_SAVED_VERSION_BOARD,
  82. _( "&Revert" ),
  83. _( "Clear board and get previous saved version of board" ) );
  84. SET_BITMAP( jigsaw_xpm );
  85. filesMenu->Append( item );
  86. // Rescue
  87. item = new wxMenuItem( filesMenu, ID_MENU_RECOVER_BOARD, _( "&Rescue" ),
  88. _( "Clear old board and get last rescue file" ) );
  89. SET_BITMAP( hammer_xpm );
  90. filesMenu->Append( item );
  91. filesMenu->AppendSeparator();
  92. /* Fabrication Outputs submenu */
  93. wxMenu* fabricationOutputsMenu = new wxMenu;
  94. item = new wxMenuItem( fabricationOutputsMenu, ID_PCB_GEN_POS_MODULES_FILE,
  95. _( "&Modules Position File" ),
  96. _( "Generate modules position file for pick and place" ) );
  97. SET_BITMAP( post_compo_xpm );
  98. fabricationOutputsMenu->Append( item );
  99. item = new wxMenuItem( fabricationOutputsMenu, ID_PCB_GEN_DRILL_FILE,
  100. _( "&Drill File" ),
  101. _( "Generate excellon2 drill file" ) );
  102. SET_BITMAP( post_drill_xpm );
  103. fabricationOutputsMenu->Append( item );
  104. // Component File
  105. item = new wxMenuItem( fabricationOutputsMenu, ID_PCB_GEN_CMP_FILE,
  106. _( "&Component File" ),
  107. _( "(Re)create components file (*.cmp) for CvPcb" ) );
  108. SET_BITMAP( create_cmp_file_xpm );
  109. fabricationOutputsMenu->Append( item );
  110. // BOM File
  111. item = new wxMenuItem( fabricationOutputsMenu, ID_PCB_GEN_BOM_FILE_FROM_BOARD,
  112. _( "&BOM File" ),
  113. _( "Create a bill of materials from schematic" ) );
  114. SET_BITMAP( tools_xpm );
  115. fabricationOutputsMenu->Append( item );
  116. // Fabrications Outputs submenu append
  117. ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, fabricationOutputsMenu,
  118. -1, _( "Fabrication Outputs" ),
  119. _( "Generate files for fabrication" ),
  120. fabrication_xpm );
  121. /** Import submenu **/
  122. wxMenu* submenuImport = new wxMenu();
  123. // Specctra Session
  124. item = new wxMenuItem( submenuImport, ID_GEN_IMPORT_SPECCTRA_SESSION,
  125. _( "&Specctra Session" ),
  126. _( "Import a routed \"Specctra Session\" (*.ses) file" ) );
  127. SET_BITMAP( import_xpm ); // @todo need better bitmap
  128. submenuImport->Append( item );
  129. ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, submenuImport,
  130. ID_GEN_IMPORT_FILE, _( "Import" ),
  131. _( "Import files" ), import_xpm );
  132. /** Export submenu **/
  133. wxMenu* submenuexport = new wxMenu();
  134. // Specctra DSN
  135. item = new wxMenuItem( submenuexport, ID_GEN_EXPORT_SPECCTRA,
  136. _( "&Specctra DSN" ),
  137. _( "Export the current board to a \"Specctra DSN\" file" ) );
  138. SET_BITMAP( export_xpm );
  139. submenuexport->Append( item );
  140. // GenCAD
  141. item = new wxMenuItem( submenuexport, ID_GEN_EXPORT_FILE_GENCADFORMAT,
  142. _( "&GenCAD" ), _( "Export GenCAD format" ) );
  143. SET_BITMAP( export_xpm );
  144. submenuexport->Append( item );
  145. // Module Report
  146. item = new wxMenuItem( submenuexport, ID_GEN_EXPORT_FILE_MODULE_REPORT,
  147. _( "&Module Report" ),
  148. _( "Create a report of all modules on the current board" ) );
  149. SET_BITMAP( tools_xpm );
  150. submenuexport->Append( item );
  151. // VRML
  152. item = new wxMenuItem( submenuexport, ID_GEN_EXPORT_FILE_VRML,
  153. _( "&VRML" ),
  154. _( "Export a VRML board representation" ) );
  155. SET_BITMAP( show_3d_xpm );
  156. submenuexport->Append( item );
  157. ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, submenuexport,
  158. ID_GEN_EXPORT_FILE, _( "&Export" ),
  159. _( "Export board" ), export_xpm );
  160. filesMenu->AppendSeparator();
  161. // Print
  162. item = new wxMenuItem( filesMenu, wxID_PRINT,
  163. _( "&Print\tCtrl+P" ),
  164. _( "Print board" ) );
  165. SET_BITMAP( print_button );
  166. filesMenu->Append( item );
  167. // Create SVG file
  168. item = new wxMenuItem( filesMenu, ID_GEN_PLOT_SVG,
  169. _( "Print S&VG" ),
  170. _( "Plot board in Scalable Vector Graphics format" ) );
  171. SET_BITMAP( print_button );
  172. filesMenu->Append( item );
  173. // Plot
  174. item = new wxMenuItem( filesMenu, ID_GEN_PLOT,
  175. _( "&Plot" ),
  176. _( "Plot board in HPGL, PostScript or Gerber RS-274X format)" ) );
  177. SET_BITMAP( plot_xpm );
  178. filesMenu->Append( item );
  179. filesMenu->AppendSeparator();
  180. wxMenu* submenuarchive = new wxMenu();
  181. // Archive New Footprints
  182. item = new wxMenuItem( submenuarchive, ID_MENU_ARCHIVE_NEW_MODULES,
  183. _( "Archive New Footprints" ),
  184. _( "Archive new footprints only in a library (keep other footprints in this lib)" ) );
  185. SET_BITMAP( library_update_xpm );
  186. submenuarchive->Append( item );
  187. // Create FootPrint Archive
  188. item = new wxMenuItem( submenuarchive, ID_MENU_ARCHIVE_ALL_MODULES,
  189. _( "Create Footprint Archive" ),
  190. _( "Archive all footprints in a library (old library will be deleted)" ) );
  191. SET_BITMAP( library_xpm );
  192. submenuarchive->Append( item );
  193. ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, submenuarchive,
  194. ID_MENU_ARCHIVE_MODULES,
  195. _( "Archive Footprints" ),
  196. _( "Archive or add footprints in a library file" ),
  197. library_xpm );
  198. /* Quit */
  199. filesMenu->AppendSeparator();
  200. item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ), _( "Quit PCBNew" ) );
  201. SET_BITMAP( exit_xpm );
  202. filesMenu->Append( item );
  203. /** Create Edit menu **/
  204. wxMenu* editMenu = new wxMenu;
  205. // Undo
  206. text = AddHotkeyName( _( "Undo" ), g_Pcbnew_Editor_Hokeys_Descr, HK_UNDO );
  207. item = new wxMenuItem( editMenu, wxID_UNDO, text,
  208. HELP_UNDO, wxITEM_NORMAL );
  209. SET_BITMAP( undo_xpm );
  210. editMenu->Append( item );
  211. // Redo
  212. text = AddHotkeyName( _( "Redo" ), g_Pcbnew_Editor_Hokeys_Descr, HK_REDO );
  213. item = new wxMenuItem( editMenu, wxID_REDO, text,
  214. HELP_REDO, wxITEM_NORMAL );
  215. SET_BITMAP( redo_xpm );
  216. editMenu->Append( item );
  217. // Delete
  218. item = new wxMenuItem( editMenu, ID_PCB_DELETE_ITEM_BUTT,
  219. _( "Delete" ),
  220. _( "Delete items" ) );
  221. SET_BITMAP( delete_body_xpm );
  222. editMenu->Append( item );
  223. editMenu->AppendSeparator();
  224. // Find
  225. text = AddHotkeyName( _( "&Find" ), g_Pcbnew_Editor_Hokeys_Descr, HK_FIND_ITEM );
  226. item = new wxMenuItem( editMenu, ID_FIND_ITEMS,
  227. text, HELP_FIND );
  228. SET_BITMAP( find_xpm );
  229. editMenu->Append( item );
  230. editMenu->AppendSeparator();
  231. // Global Deletions
  232. item = new wxMenuItem( editMenu, ID_PCB_GLOBAL_DELETE,
  233. _( "Global &Deletions" ),
  234. _( "Delete tracks, modules, texts... on board" ) );
  235. SET_BITMAP( general_deletions_xpm );
  236. editMenu->Append( item );
  237. // Cleanup Tracks and Vias
  238. item = new wxMenuItem( editMenu, ID_MENU_PCB_CLEAN,
  239. _( "&Cleanup Tracks and Vias" ),
  240. _( "Clean stubs, vias, delete break points, or connect dangling tracks to pads and vias" ) );
  241. SET_BITMAP( delete_body_xpm );
  242. editMenu->Append( item );
  243. // Swap Layers
  244. item = new wxMenuItem( editMenu, ID_MENU_PCB_SWAP_LAYERS,
  245. _( "&Swap Layers" ),
  246. _( "Swap tracks on copper layers or drawings on other layers" ) );
  247. SET_BITMAP( swap_layer_xpm );
  248. editMenu->Append( item );
  249. // Reset module reference sizes
  250. item = new wxMenuItem( editMenu,
  251. ID_MENU_PCB_RESET_TEXTMODULE_REFERENCE_SIZES,
  252. _( "Reset Module &Reference Sizes" ),
  253. _( "Reset text size and width of all module references to current defaults" ) );
  254. SET_BITMAP( reset_text_xpm );
  255. editMenu->Append( item );
  256. // Reset module value sizes
  257. item = new wxMenuItem( editMenu,
  258. ID_MENU_PCB_RESET_TEXTMODULE_VALUE_SIZES,
  259. _( "Reset Module &Value Sizes" ),
  260. _( "Reset text size and width of all module values to current defaults" ) );
  261. SET_BITMAP( reset_text_xpm );
  262. editMenu->Append( item );
  263. /** Create View menu **/
  264. wxMenu* viewMenu = new wxMenu;
  265. /* Important Note for ZOOM IN and ZOOM OUT commands from menubar:
  266. * we cannot add hotkey info here, because the hotkey HK_ZOOM_IN and HK_ZOOM_OUT
  267. * events(default = WXK_F1 and WXK_F2) are *NOT* equivalent to this menu command:
  268. * zoom in and out from hotkeys are equivalent to the pop up menu zoom
  269. * From here, zooming is made around the screen center
  270. * From hotkeys, zooming is made around the mouse cursor position
  271. * (obviously not possible from the toolbar or menubar command)
  272. *
  273. * in other words HK_ZOOM_IN and HK_ZOOM_OUT *are NOT* accelerators
  274. * for Zoom in and Zoom out sub menus
  275. */
  276. // Zoom In
  277. text = AddHotkeyName( _( "Zoom In" ), g_Pcbnew_Editor_Hokeys_Descr,
  278. HK_ZOOM_IN, false );
  279. item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text,
  280. HELP_ZOOM_IN, wxITEM_NORMAL );
  281. SET_BITMAP( zoom_in_xpm );
  282. viewMenu->Append( item );
  283. // Zoom Out
  284. text = AddHotkeyName( _( "Zoom Out" ), g_Pcbnew_Editor_Hokeys_Descr,
  285. HK_ZOOM_OUT, false );
  286. item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text,
  287. HELP_ZOOM_OUT, wxITEM_NORMAL );
  288. SET_BITMAP( zoom_out_xpm );
  289. viewMenu->Append( item );
  290. // Fit on Screen
  291. text = AddHotkeyName( _( "Fit on Screen" ), g_Pcbnew_Editor_Hokeys_Descr,
  292. HK_ZOOM_AUTO );
  293. item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text,
  294. HELP_ZOOM_FIT, wxITEM_NORMAL );
  295. SET_BITMAP( zoom_fit_in_page_xpm );
  296. viewMenu->Append( item );
  297. viewMenu->AppendSeparator();
  298. // Redraw
  299. text = AddHotkeyName( _( "Redraw" ), g_Pcbnew_Editor_Hokeys_Descr,
  300. HK_ZOOM_REDRAW );
  301. item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text,
  302. HELP_ZOOM_REDRAW,
  303. wxITEM_NORMAL );
  304. SET_BITMAP( zoom_redraw_xpm );
  305. viewMenu->Append( item );
  306. viewMenu->AppendSeparator();
  307. // 3D Display
  308. item = new wxMenuItem( viewMenu, ID_MENU_PCB_SHOW_3D_FRAME,
  309. _( "3D Display" ),
  310. _( "Show board in 3D viewer" ) );
  311. SET_BITMAP( show_3d_xpm );
  312. viewMenu->Append( item );
  313. // List Nets
  314. item = new wxMenuItem( viewMenu, ID_MENU_LIST_NETS,
  315. _( "&List Nets" ),
  316. _( "View a list of nets with names and id's" ) );
  317. SET_BITMAP( tools_xpm );
  318. viewMenu->Append( item );
  319. /** Create Place Menu **/
  320. wxMenu* placeMenu = new wxMenu;
  321. // Module
  322. text = AddHotkeyName( _( "Module" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ADD_MODULE, false );
  323. item = new wxMenuItem( placeMenu, ID_PCB_MODULE_BUTT, text,
  324. _( "Add modules" ), wxITEM_NORMAL );
  325. SET_BITMAP( module_xpm );
  326. placeMenu->Append( item );
  327. // Track
  328. text = AddHotkeyName( _( "Track" ), g_Pcbnew_Editor_Hokeys_Descr,
  329. HK_ADD_NEW_TRACK, false );
  330. item = new wxMenuItem( placeMenu, ID_TRACK_BUTT, text,
  331. _( "Add tracks and vias" ), wxITEM_NORMAL );
  332. SET_BITMAP( add_tracks_xpm );
  333. placeMenu->Append( item );
  334. // Zone
  335. item = new wxMenuItem( placeMenu, ID_PCB_ZONES_BUTT,
  336. _( "Zone" ),
  337. _( "Add filled zones" ));
  338. SET_BITMAP( add_zone_xpm );
  339. placeMenu->Append( item );
  340. // Text
  341. item = new wxMenuItem( placeMenu, ID_PCB_ADD_TEXT_BUTT,
  342. _( "Text" ),
  343. _( "Add text on copper layers or graphic text" ) );
  344. SET_BITMAP( add_text_xpm );
  345. placeMenu->Append( item );
  346. // Graphic Arc
  347. item = new wxMenuItem( placeMenu, ID_PCB_ARC_BUTT,
  348. _( "Arc" ),
  349. _( "Add graphic arc" ) );
  350. SET_BITMAP( add_arc_xpm );
  351. placeMenu->Append( item );
  352. // Graphic Circle
  353. item = new wxMenuItem( placeMenu, ID_PCB_CIRCLE_BUTT,
  354. _( "Circle" ),
  355. _( "Add graphic circle" ));
  356. SET_BITMAP( add_circle_xpm );
  357. placeMenu->Append( item );
  358. // Line or Polygon
  359. item = new wxMenuItem( placeMenu, ID_PCB_ADD_LINE_BUTT,
  360. _( "Line or Polygon" ),
  361. _( "Add graphic line or polygon" ));
  362. SET_BITMAP( add_dashed_line_xpm );
  363. placeMenu->Append( item );
  364. placeMenu->AppendSeparator();
  365. // Dimension
  366. item = new wxMenuItem( placeMenu, ID_PCB_DIMENSION_BUTT,
  367. _( "Dimension" ),
  368. _( "Add dimension" ) );
  369. SET_BITMAP( add_dimension_xpm );
  370. placeMenu->Append( item );
  371. // Layer alignment target
  372. item = new wxMenuItem( placeMenu, ID_PCB_MIRE_BUTT,
  373. _( "Layer alignment target" ),
  374. _( "Add layer alignment target" ));
  375. SET_BITMAP( add_mires_xpm );
  376. placeMenu->Append( item );
  377. placeMenu->AppendSeparator();
  378. // Drill & Place Offset
  379. item = new wxMenuItem( placeMenu, ID_PCB_PLACE_OFFSET_COORD_BUTT,
  380. _( "Drill and Place Offset" ),
  381. _( "Place the origin point for drill and place files" ));
  382. SET_BITMAP( pcb_offset_xpm );
  383. placeMenu->Append( item );
  384. // Grid Origin
  385. item = new wxMenuItem( placeMenu, ID_PCB_PLACE_GRID_COORD_BUTT,
  386. _( "Grid Origin" ),
  387. _( "Set the origin point for the grid" ));
  388. SET_BITMAP( grid_select_axis_xpm );
  389. placeMenu->Append( item );
  390. /** Create Preferences and configuration menu **/
  391. wxMenu* configmenu = new wxMenu;
  392. // Library
  393. item = new wxMenuItem( configmenu, ID_CONFIG_REQ,
  394. _( "&Library" ),
  395. _( "Setting libraries, directories and others..." ) );
  396. SET_BITMAP( library_xpm );
  397. configmenu->Append( item );
  398. // Colors and Visibility are also handled by the layers manager toolbar
  399. item = new wxMenuItem( configmenu, ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER_DIALOG,
  400. m_show_layer_manager_tools ?
  401. _( "Hide &Layers Manager" ) : _("Show &Layers Manager" ),
  402. HELP_SHOW_HIDE_LAYERMANAGER );
  403. SET_BITMAP( layers_manager_xpm );
  404. configmenu->Append( item );
  405. // General
  406. item = new wxMenuItem( configmenu, wxID_PREFERENCES,
  407. #ifdef __WXMAC__
  408. _( "&Preferences..." ),
  409. #else
  410. _( "&General" ),
  411. #endif
  412. _( "Select general options for PCBnew" ) );
  413. SET_BITMAP( preference_xpm );
  414. configmenu->Append( item );
  415. // Display
  416. item = new wxMenuItem( configmenu, ID_PCB_DISPLAY_OPTIONS_SETUP,
  417. _( "&Display" ),
  418. _( "Select how items (pads, tracks texts ... ) are displayed" ) );
  419. SET_BITMAP( display_options_xpm );
  420. configmenu->Append( item );
  421. // Create Dimensions submenu
  422. wxMenu* dimensionsMenu = new wxMenu;
  423. // Grid
  424. item = new wxMenuItem( dimensionsMenu, ID_PCB_USER_GRID_SETUP,
  425. _( "Grid" ),
  426. _( "Adjust user grid dimensions" ) );
  427. SET_BITMAP( grid_xpm );
  428. dimensionsMenu->Append( item );
  429. // Text and Drawings
  430. item = new wxMenuItem( dimensionsMenu, ID_PCB_DRAWINGS_WIDTHS_SETUP,
  431. _( "Texts and Drawings" ),
  432. _( "Adjust dimensions for texts and drawings" ) );
  433. SET_BITMAP( options_text_xpm );
  434. dimensionsMenu->Append( item );
  435. // Pads
  436. item = new wxMenuItem( dimensionsMenu, ID_PCB_PAD_SETUP,
  437. _( "Pads" ),
  438. _( "Adjust default pad characteristics" ) );
  439. SET_BITMAP( pad_xpm );
  440. dimensionsMenu->Append( item );
  441. // Pads Mask Clearance
  442. item = new wxMenuItem( dimensionsMenu, ID_PCB_MASK_CLEARANCE,
  443. _( "Pads Mask Clearance" ),
  444. _( "Adjust the global clearance between pads and the solder resist mask" ) );
  445. SET_BITMAP( pads_mask_layers_xpm );
  446. dimensionsMenu->Append( item );
  447. // Save dimension preferences
  448. dimensionsMenu->AppendSeparator();
  449. item = new wxMenuItem( dimensionsMenu, ID_CONFIG_SAVE,
  450. _( "&Save" ),
  451. _( "Save dimension preferences" ) );
  452. SET_BITMAP( save_xpm );
  453. dimensionsMenu->Append( item );
  454. // Append dimension menu to config menu
  455. ADD_MENUITEM_WITH_HELP_AND_SUBMENU( configmenu, dimensionsMenu,
  456. -1, _( "Di&mensions" ),
  457. _( "Global dimensions preferences" ),
  458. add_dimension_xpm );
  459. // Language submenu
  460. wxGetApp().AddMenuLanguageList( configmenu );
  461. // Hotkey submenu
  462. AddHotkeyConfigMenu( configmenu );
  463. configmenu->AppendSeparator();
  464. // Save Preferences
  465. item = new wxMenuItem( configmenu, ID_CONFIG_SAVE,
  466. _( "&Save Preferences" ),
  467. _( "Save application preferences" ) );
  468. SET_BITMAP( save_setup_xpm );
  469. configmenu->Append( item );
  470. // Read Preferences
  471. item = new wxMenuItem( configmenu, ID_CONFIG_READ,
  472. _( "&Read Preferences" ),
  473. _( "Read application preferences" ) );
  474. SET_BITMAP( read_setup_xpm );
  475. configmenu->Append( item );
  476. /**
  477. * Design Rules menu
  478. */
  479. wxMenu* designRulesMenu = new wxMenu;
  480. // Design Rules
  481. item = new wxMenuItem( designRulesMenu, ID_MENU_PCB_SHOW_DESIGN_RULES_DIALOG,
  482. _( "Design Rules" ),
  483. _( "Open the design rules editor" ) );
  484. SET_BITMAP( hammer_xpm );
  485. designRulesMenu->Append( item );
  486. // Layers Setup
  487. item = new wxMenuItem( configmenu, ID_PCB_LAYERS_SETUP,
  488. _( "&Layers Setup" ),
  489. _( "Enable and set layer properties" ) );
  490. SET_BITMAP( copper_layers_setup_xpm );
  491. designRulesMenu->Append( item );
  492. /**
  493. * Help menu
  494. */
  495. wxMenu* helpMenu = new wxMenu;
  496. AddHelpVersionInfoMenuEntry( helpMenu );
  497. // Contents
  498. item = new wxMenuItem( helpMenu, wxID_HELP,
  499. _( "&Contents" ),
  500. _( "Open the PCBNew handbook" ) );
  501. SET_BITMAP( online_help_xpm );
  502. helpMenu->Append( item );
  503. // About
  504. item = new wxMenuItem( helpMenu, wxID_ABOUT,
  505. _( "&About" ),
  506. _( "About PCBnew printed circuit board designer" ));
  507. SET_BITMAP( info_xpm );
  508. helpMenu->Append( item );
  509. /**
  510. * Append all menus to the menuBar
  511. */
  512. menuBar->Append( filesMenu, _( "&File" ) );
  513. menuBar->Append( editMenu, _( "&Edit" ) );
  514. menuBar->Append( viewMenu, _( "&View" ) );
  515. menuBar->Append( placeMenu, _( "&Place" ) );
  516. menuBar->Append( configmenu, _( "&Preferences" ) );
  517. menuBar->Append( designRulesMenu, _( "&Design Rules" ) );
  518. menuBar->Append( helpMenu, _( "&Help" ) );
  519. menuBar->Thaw();
  520. // Associate the menu bar with the frame, if no previous menubar
  521. if( GetMenuBar() == NULL )
  522. SetMenuBar( menuBar );
  523. else
  524. menuBar->Refresh();
  525. }