KiCad PCB EDA Suite
eeschema/menubar.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2009 Wayne Stambaugh <stambaughw@gmail.com>
6  * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
32 #include <kiface_i.h>
33 #include <menus_helpers.h>
34 #include <pgm_base.h>
35 
36 #include "eeschema_id.h"
37 #include "general.h"
38 #include "help_common_strings.h"
39 #include "hotkeys.h"
40 #include "sch_edit_frame.h"
41 
42 // helper functions that build specific submenus:
43 
44 // Build the place submenu
45 static void preparePlaceMenu( wxMenu* aParentMenu );
46 
47 // Build the files menu. Because some commands are available only if
48 // Eeschemat is run outside a project (run alone), aIsOutsideProject is false
49 // when Eeschema is run from Kicad manager, and true is run as stand alone app.
50 static void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject );
51 
52 // Build the inspect menu
53 static void prepareInspectMenu( wxMenu* aParentMenu );
54 
55 // Build the tools menu
56 static void prepareToolsMenu( wxMenu* aParentMenu );
57 
58 // Build the help menu
59 static void prepareHelpMenu( wxMenu* aParentMenu );
60 
61 // Build the edit menu
62 static void prepareEditMenu( wxMenu* aParentMenu );
63 
64 // Build the view menu
65 static void prepareViewMenu( wxMenu* aParentMenu );
66 
67 // Build the preferences menu
68 static void preparePreferencesMenu( SCH_EDIT_FRAME* aFrame, wxMenu* aParentMenu );
69 
70 
72 {
73  // wxWidgets handles the Mac Application menu behind the scenes, but that means
74  // we always have to start from scratch with a new wxMenuBar.
75  wxMenuBar* oldMenuBar = GetMenuBar();
76  wxMenuBar* menuBar = new wxMenuBar();
77  wxString text;
78 
79  // Recreate all menus:
80 
81  // Menu File:
82  wxMenu* fileMenu = new wxMenu;
83  prepareFilesMenu( fileMenu, Kiface().IsSingle() );
84 
85  // Menu Edit:
86  wxMenu* editMenu = new wxMenu;
87  prepareEditMenu( editMenu );
88 
89  // Menu View:
90  wxMenu* viewMenu = new wxMenu;
91  prepareViewMenu( viewMenu );
92 
93  // Menu place:
94  wxMenu* placeMenu = new wxMenu;
95  preparePlaceMenu( placeMenu );
96 
97  // Menu Inspect:
98  wxMenu* inspectMenu = new wxMenu;
99  prepareInspectMenu( inspectMenu );
100 
101  // Menu Tools:
102  wxMenu* toolsMenu = new wxMenu;
103  prepareToolsMenu( toolsMenu );
104 
105  // Menu Preferences:
106  wxMenu* preferencesMenu = new wxMenu;
107  preparePreferencesMenu( this, preferencesMenu );
108 
109  // Help Menu:
110  wxMenu* helpMenu = new wxMenu;
111  prepareHelpMenu( helpMenu );
112 
113  // Create the menubar and append all submenus
114  menuBar->Append( fileMenu, _( "&File" ) );
115  menuBar->Append( editMenu, _( "&Edit" ) );
116  menuBar->Append( viewMenu, _( "&View" ) );
117  menuBar->Append( placeMenu, _( "&Place" ) );
118  menuBar->Append( inspectMenu, _( "&Inspect" ) );
119  menuBar->Append( toolsMenu, _( "&Tools" ) );
120  menuBar->Append( preferencesMenu, _( "P&references" ) );
121  menuBar->Append( helpMenu, _( "&Help" ) );
122 
123  SetMenuBar( menuBar );
124  delete oldMenuBar;
125 }
126 
127 
128 void prepareViewMenu( wxMenu* aParentMenu )
129 {
130  wxString text;
131 
132  AddMenuItem( aParentMenu,
134  _( "Library &Browser" ), HELP_RUN_LIB_VIEWER,
135  KiBitmap( library_browse_xpm ) );
136 
137  AddMenuItem( aParentMenu,
138  ID_HIERARCHY,
139  _( "Show &Hierarchical Navigator" ),
140  _( "Navigate schematic hierarchy" ),
141  KiBitmap( hierarchy_nav_xpm ) );
142 
143  text = AddHotkeyName( _( "&Leave Sheet" ), g_Schematic_Hokeys_Descr, HK_LEAVE_SHEET );
144  AddMenuItem( aParentMenu,
146  _( "Leave Sheet" ),
147  KiBitmap( leave_sheet_xpm ) );
148 
149  aParentMenu->AppendSeparator();
150 
166  text = AddHotkeyName( _( "Zoom &In" ), g_Schematic_Hokeys_Descr,
167  HK_ZOOM_IN, IS_ACCELERATOR ); // add an accelerator, not a shortcut
168  AddMenuItem( aParentMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, KiBitmap( zoom_in_xpm ) );
169 
170  text = AddHotkeyName( _( "Zoom &Out" ), g_Schematic_Hokeys_Descr,
171  HK_ZOOM_OUT, IS_ACCELERATOR ); // add accelerator, not a shortcut
172  AddMenuItem( aParentMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, KiBitmap( zoom_out_xpm ) );
173 
174  text = AddHotkeyName( _( "&Zoom to Fit" ), g_Schematic_Hokeys_Descr, HK_ZOOM_AUTO );
175 
176  AddMenuItem( aParentMenu, ID_ZOOM_PAGE, text,
177  HELP_ZOOM_FIT, KiBitmap( zoom_fit_in_page_xpm ) );
178 
179  text = AddHotkeyName( _( "Zoom to Selection" ), g_Eeschema_Hokeys_Descr, HK_ZOOM_SELECTION );
180 
181  AddMenuItem( aParentMenu, ID_MENU_ZOOM_SELECTION, text, KiBitmap( zoom_area_xpm ) );
182 
183  text = AddHotkeyName( _( "&Redraw" ), g_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
184 
185  AddMenuItem( aParentMenu, ID_ZOOM_REDRAW, text,
186  HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );
187 
188  aParentMenu->AppendSeparator();
189 
190  AddMenuItem( aParentMenu, ID_TB_OPTIONS_SHOW_GRID,
191  _( "Show &Grid" ), wxEmptyString,
192  KiBitmap( grid_xpm ), wxITEM_CHECK );
193 
194  // Units submenu
195  wxMenu* unitsSubMenu = new wxMenu;
197  _( "&Imperial" ), _( "Use imperial units" ),
198  KiBitmap( unit_inch_xpm ), wxITEM_RADIO );
199 
201  _( "&Metric" ), _( "Use metric units" ),
202  KiBitmap( unit_mm_xpm ), wxITEM_RADIO );
203 
204  AddMenuItem( aParentMenu, unitsSubMenu,
205  -1, _( "&Units" ),
206  _( "Select which units are displayed" ),
207  KiBitmap( unit_mm_xpm ) );
208 
209 
210 #ifndef __APPLE__
212  _( "Full &Window Crosshair" ),
213  _( "Change cursor shape" ),
214  KiBitmap( cursor_shape_xpm ), wxITEM_CHECK );
215 #else
217  _( "Full &Window Crosshair" ),
218  _( "Change cursor shape (not supported in Legacy graphics)" ),
219  KiBitmap( cursor_shape_xpm ), wxITEM_CHECK );
220 #endif
221 
222  aParentMenu->AppendSeparator();
223 
225  _( "Show Hidden &Pins" ),
226  wxEmptyString,
227  KiBitmap( hidden_pin_xpm ), wxITEM_CHECK );
228 
229 #ifdef __APPLE__
230  aParentMenu->AppendSeparator();
231 #endif
232 }
233 
234 
235 void preparePlaceMenu( wxMenu* aParentMenu )
236 {
237  wxString text;
238 
239  text = AddHotkeyName( _( "&Symbol" ), g_Schematic_Hokeys_Descr,
240  HK_ADD_NEW_COMPONENT, IS_ACCELERATOR ); // add an accelerator, not a shortcut
241  AddMenuItem( aParentMenu, ID_MENU_PLACE_COMPONENT, text,
243  KiBitmap( add_component_xpm ) );
244 
245  text = AddHotkeyName( _( "&Power Port" ), g_Schematic_Hokeys_Descr,
246  HK_ADD_NEW_POWER, IS_ACCELERATOR ); // add an accelerator, not a shortcut
247  AddMenuItem( aParentMenu, ID_MENU_PLACE_POWER_BUTT, text,
249  KiBitmap( add_power_xpm ) );
250 
251  text = AddHotkeyName( _( "&Wire" ), g_Schematic_Hokeys_Descr,
252  HK_BEGIN_WIRE, IS_ACCELERATOR ); // add an accelerator, not a shortcut
253  AddMenuItem( aParentMenu, ID_MENU_WIRE_BUTT, text,
255  KiBitmap( add_line_xpm ) );
256 
257  text = AddHotkeyName( _( "&Bus" ), g_Schematic_Hokeys_Descr,
258  HK_BEGIN_BUS, IS_ACCELERATOR ); // add an accelerator, not a shortcut
259  AddMenuItem( aParentMenu, ID_MENU_BUS_BUTT, text,
261  KiBitmap( add_bus_xpm ) );
262 
263  text = AddHotkeyName( _( "Wire to Bus &Entry" ), g_Schematic_Hokeys_Descr,
264  HK_ADD_WIRE_ENTRY, IS_ACCELERATOR ); // add an accelerator, not a shortcut
265  AddMenuItem( aParentMenu, ID_MENU_WIRETOBUS_ENTRY_BUTT, text,
267  KiBitmap( add_line2bus_xpm ) );
268 
269  text = AddHotkeyName( _( "Bus &to Bus Entry" ), g_Schematic_Hokeys_Descr,
270  HK_ADD_BUS_ENTRY, IS_ACCELERATOR ); // add an accelerator, not a shortcut
271  AddMenuItem( aParentMenu, ID_MENU_BUSTOBUS_ENTRY_BUTT, text,
273  KiBitmap( add_bus2bus_xpm ) );
274 
275  text = AddHotkeyName( _( "&No Connect Flag" ), g_Schematic_Hokeys_Descr,
276  HK_ADD_NOCONN_FLAG, IS_ACCELERATOR ); // add an accelerator, not a shortcut
277  AddMenuItem( aParentMenu, ID_MENU_NOCONN_BUTT, text, HELP_PLACE_NC_FLAG, KiBitmap( noconn_xpm ) );
278 
279  text = AddHotkeyName( _( "&Junction" ), g_Schematic_Hokeys_Descr,
280  HK_ADD_JUNCTION, IS_ACCELERATOR ); // add an accelerator, not a shortcut
281  AddMenuItem( aParentMenu, ID_MENU_JUNCTION_BUTT, text,
283  KiBitmap( add_junction_xpm ) );
284 
285  text = AddHotkeyName( _( "&Label" ), g_Schematic_Hokeys_Descr,
286  HK_ADD_LABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
287  AddMenuItem( aParentMenu, ID_MENU_LABEL_BUTT, text,
289  KiBitmap( add_line_label_xpm ) );
290 
291  text = AddHotkeyName( _( "Gl&obal Label" ), g_Schematic_Hokeys_Descr,
292  HK_ADD_GLABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
293  AddMenuItem( aParentMenu, ID_MENU_GLABEL_BUTT, text,
295  KiBitmap( add_glabel_xpm ) );
296 
297  aParentMenu->AppendSeparator();
298 
299  text = AddHotkeyName( _( "&Hierarchical Label" ), g_Schematic_Hokeys_Descr,
300  HK_ADD_HLABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
301  AddMenuItem( aParentMenu, ID_MENU_HIERLABEL_BUTT,
302  text, HELP_PLACE_HIER_LABEL,
303  KiBitmap( add_hierarchical_label_xpm ) );
304 
305 
306  text = AddHotkeyName( _( "Hierar&chical Sheet" ), g_Schematic_Hokeys_Descr,
307  HK_ADD_HIER_SHEET, IS_ACCELERATOR ); // add an accelerator, not a shortcut
308  AddMenuItem( aParentMenu, ID_MENU_SHEET_SYMBOL_BUTT, text,
310  KiBitmap( add_hierarchical_subsheet_xpm ) );
311 
312  AddMenuItem( aParentMenu,
314  _( "I&mport Hierarchical Label" ),
316  KiBitmap( import_hierarchical_label_xpm ) );
317 
318  AddMenuItem( aParentMenu,
320  _( "Hierarchical Pi&n to Sheet" ),
322  KiBitmap( add_hierar_pin_xpm ) );
323 
324  aParentMenu->AppendSeparator();
325 
326  text = AddHotkeyName( _( "Graphic Pol&yline" ), g_Schematic_Hokeys_Descr,
327  HK_ADD_GRAPHIC_POLYLINE, IS_ACCELERATOR ); // add an accelerator, not a shortcut
328  AddMenuItem( aParentMenu, ID_MENU_LINE_COMMENT_BUTT, text,
330  KiBitmap( add_dashed_line_xpm ) );
331 
332  text = AddHotkeyName( _( "&Graphic Text" ), g_Schematic_Hokeys_Descr,
333  HK_ADD_GRAPHIC_TEXT, IS_ACCELERATOR ); // add an accelerator, not a shortcut
334  AddMenuItem( aParentMenu, ID_MENU_TEXT_COMMENT_BUTT, text,
336  KiBitmap( text_xpm ) );
337 
338  // Add graphic image
339  AddMenuItem( aParentMenu, ID_MENU_ADD_IMAGE_BUTT, _( "&Image" ),
341  KiBitmap( image_xpm ) );
342 }
343 
344 
345 void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject )
346 {
347  wxString text;
348 
349  // @todo: static probably not OK in multiple open projects.
350  // Open Recent submenu
351  static wxMenu* openRecentMenu;
352 
353  // Add this menu to list menu managed by m_fileHistory
354  // (the file history will be updated when adding/removing files in history
355  if( openRecentMenu )
356  Kiface().GetFileHistory().RemoveMenu( openRecentMenu );
357 
358  openRecentMenu = new wxMenu();
359 
360  Kiface().GetFileHistory().UseMenu( openRecentMenu );
361  Kiface().GetFileHistory().AddFilesToMenu( openRecentMenu );
362 
363  if( aIsOutsideProject ) // not when under a project mgr
364  {
365  text = AddHotkeyName( _( "&New..." ), g_Schematic_Hokeys_Descr, HK_NEW );
366  AddMenuItem( aParentMenu, ID_NEW_PROJECT, text,
367  _( "Clear current schematic hierarchy and start new schematic root sheet" ),
368  KiBitmap( new_document_xpm ) );
369 
370  text = AddHotkeyName( _( "&Open..." ), g_Schematic_Hokeys_Descr, HK_OPEN );
371  AddMenuItem( aParentMenu, ID_LOAD_PROJECT, text,
372  _( "Open existing schematic" ),
373  KiBitmap( open_document_xpm ) );
374 
375  AddMenuItem( aParentMenu, openRecentMenu,
376  -1, _( "Open &Recent" ),
377  _( "Open recently opened schematic" ),
378  KiBitmap( recent_xpm ) );
379 
380  aParentMenu->AppendSeparator();
381  }
382 
383  text = AddHotkeyName( _( "&Save" ), g_Schematic_Hokeys_Descr, HK_SAVE );
384  AddMenuItem( aParentMenu,
385  ID_SAVE_PROJECT, text,
386  _( "Save all sheets in schematic" ),
387  KiBitmap( save_xpm ) );
388 
389  AddMenuItem( aParentMenu,
391  _( "Save &Current Sheet" ),
392  _( "Save only current schematic sheet" ),
393  KiBitmap( save_xpm ) );
394 
395  if( aIsOutsideProject ) // not when under a project mgr
396  {
397  text = AddHotkeyName( _( "Save C&urrent Sheet As..." ),
399  AddMenuItem( aParentMenu,
401  _( "Save current schematic sheet with new name" ),
402  KiBitmap( save_as_xpm ) );
403  }
404 
405  aParentMenu->AppendSeparator();
406 
407  AddMenuItem( aParentMenu, ID_APPEND_PROJECT,
408  _( "App&end Schematic Sheet..." ),
409  _( "Import schematic sheet content from another project to current sheet" ),
410  KiBitmap( add_document_xpm ) );
411 
412  AddMenuItem( aParentMenu, ID_IMPORT_NON_KICAD_SCH,
413  _( "&Import Non KiCad Schematic File..." ),
414  _( "Import schematic file from other applications" ),
415  KiBitmap( import_document_xpm ) ); // TODO needs a different icon
416 
417  aParentMenu->AppendSeparator();
418 
419  // Import submenu
420  wxMenu* submenuImport = new wxMenu();
421 
422  AddMenuItem( submenuImport, ID_BACKANNO_ITEMS,
423  _( "&Footprint Association File..." ),
425  KiBitmap( import_footprint_names_xpm ) );
426 
427  AddMenuItem( aParentMenu, submenuImport,
429  _( "&Import" ),
430  _( "Import files" ),
431  KiBitmap( import_xpm ) );
432 
433 
434  // Export submenu
435  wxMenu* submenuExport = new wxMenu();
436 
438  _( "Drawing to C&lipboard" ),
439  _( "Export drawings to clipboard" ),
440  KiBitmap( copy_xpm ) );
441 
442  AddMenuItem( aParentMenu, submenuExport,
444  _( "E&xport" ),
445  _( "Export files" ),
446  KiBitmap( export_xpm ) );
447 
448  aParentMenu->AppendSeparator();
449 
450  // Edit page layout:
451  AddMenuItem( aParentMenu, ID_SHEET_SET,
452  _( "Page S&ettings..." ),
453  _( "Settings for sheet size and frame references" ),
454  KiBitmap( sheetset_xpm ) );
455 
456  text = AddHotkeyName( _( "&Print..." ), g_Schematic_Hokeys_Descr, HK_PRINT );
457  AddMenuItem( aParentMenu, wxID_PRINT, text,
458  _( "Print schematic sheet" ),
459  KiBitmap( print_button_xpm ) );
460 
461  AddMenuItem( aParentMenu, ID_GEN_PLOT_SCHEMATIC, _( "P&lot..." ),
462  _( "Plot schematic sheet in PostScript, PDF, SVG, DXF or HPGL format" ),
463  KiBitmap( plot_xpm ) );
464 
465  aParentMenu->AppendSeparator();
466 
467  // Quit
468  AddMenuItem( aParentMenu, wxID_EXIT, _( "&Exit" ), _( "Close Eeschema" ),
469  KiBitmap( exit_xpm ) );
470 }
471 
472 
473 void prepareEditMenu( wxMenu* aParentMenu )
474 {
475  wxString text;
476 
477  // Undo
478  text = AddHotkeyName( _( "&Undo" ), g_Schematic_Hokeys_Descr, HK_UNDO );
479 
480  AddMenuItem( aParentMenu, wxID_UNDO, text, HELP_UNDO, KiBitmap( undo_xpm ) );
481 
482  // Redo
483  text = AddHotkeyName( _( "&Redo" ), g_Schematic_Hokeys_Descr, HK_REDO );
484 
485  AddMenuItem( aParentMenu, wxID_REDO, text, HELP_REDO, KiBitmap( redo_xpm ) );
486 
487  aParentMenu->AppendSeparator();
488 
489  text = AddHotkeyName( _( "&Cut" ), g_Schematic_Hokeys_Descr, HK_EDIT_CUT );
490  AddMenuItem( aParentMenu, wxID_CUT, text,
491  _( "Cuts the selected item(s) to the Clipboard" ),
492  KiBitmap( cut_xpm ) );
493 
494  text = AddHotkeyName( _( "&Copy" ), g_Schematic_Hokeys_Descr, HK_EDIT_COPY );
495  AddMenuItem( aParentMenu, wxID_COPY, text,
496  _( "Copies the selected item(s) to the Clipboard" ),
497  KiBitmap( copy_xpm ) );
498 
499  text = AddHotkeyName( _( "&Paste" ), g_Schematic_Hokeys_Descr, HK_EDIT_PASTE );
500  AddMenuItem( aParentMenu, wxID_PASTE, text,
501  _( "Pastes item(s) from the Clipboard" ),
502  KiBitmap( paste_xpm ) );
503 
504  // Delete
505  aParentMenu->AppendSeparator();
507  _( "&Delete" ), HELP_DELETE_ITEMS,
508  KiBitmap( delete_xpm ) );
509 
510  // Find
511  aParentMenu->AppendSeparator();
512  text = AddHotkeyName( _( "&Find..." ), g_Schematic_Hokeys_Descr, HK_FIND_ITEM );
513  AddMenuItem( aParentMenu, ID_FIND_ITEMS, text, HELP_FIND, KiBitmap( find_xpm ) );
514 
515  // Find/Replace
516  text = AddHotkeyName( _( "Find and Re&place..." ), g_Schematic_Hokeys_Descr,
517  HK_FIND_REPLACE );
518  AddMenuItem( aParentMenu, wxID_REPLACE, text, HELP_REPLACE,
519  KiBitmap( find_replace_xpm ) );
520 
521  aParentMenu->AppendSeparator();
522 
523  // Update field values
524  AddMenuItem( aParentMenu, ID_UPDATE_FIELDS,
525  _( "Update Field Values..." ),
526  _( "Sets symbol fields to original library values" ),
527  KiBitmap( update_fields_xpm ) );
528 }
529 
530 
531 void prepareInspectMenu( wxMenu* aParentMenu )
532 {
533  AddMenuItem( aParentMenu, ID_GET_ERC,
534  _( "Electrical Rules &Checker" ),
535  _( "Perform electrical rules check" ),
536  KiBitmap( erc_xpm ) );
537 }
538 
539 
540 void prepareToolsMenu( wxMenu* aParentMenu )
541 {
542  wxString text;
543 
544  text = AddHotkeyName( _( "Update PCB from Schematic..." ), g_Schematic_Hokeys_Descr,
546 
547  AddMenuItem( aParentMenu,
549  text, _( "Updates PCB design with current schematic (forward annotation)." ),
550  KiBitmap( import_brd_file_xpm ) );
551 
552  // Run Pcbnew
553  AddMenuItem( aParentMenu,
554  ID_RUN_PCB,
555  _( "&Open PCB Editor" ),
556  _( "Run Pcbnew" ),
557  KiBitmap( pcbnew_xpm ) );
558 
559  aParentMenu->AppendSeparator();
560 
561  AddMenuItem( aParentMenu,
563  _( "Symbol Library &Editor" ), HELP_RUN_LIB_EDITOR,
564  KiBitmap( libedit_xpm ) );
565 
566  AddMenuItem( aParentMenu,
568  _( "&Rescue Symbols..." ),
569  _( "Find old symbols in project and rename/rescue them" ),
570  KiBitmap( rescue_xpm ) );
571 
572  AddMenuItem( aParentMenu,
574  _( "Remap Symbols..." ),
575  _( "Remap legacy library symbols to symbol library table" ),
576  KiBitmap( rescue_xpm ) );
577 
578  aParentMenu->AppendSeparator();
579 
580  AddMenuItem( aParentMenu,
582  _( "Edit Symbol Field&s..." ),
583  KiBitmap( spreadsheet_xpm ) );
584 
585  AddMenuItem( aParentMenu,
587  _( "Edit Symbol Library References..." ),
588  _( "Edit links between schematic symbols and library symbols" ),
589  KiBitmap( edit_cmp_symb_links_xpm ) );
590 
591  aParentMenu->AppendSeparator();
592 
593  AddMenuItem( aParentMenu,
595  _( "&Annotate Schematic..." ), HELP_ANNOTATE,
596  KiBitmap( annotate_xpm ) );
597 
598  AddMenuItem( aParentMenu,
600  _( "Generate &Netlist File..." ),
601  _( "Generate netlist file" ),
602  KiBitmap( netlist_xpm ) );
603 
604  AddMenuItem( aParentMenu,
605  ID_GET_TOOLS,
606  _( "Generate Bill of &Materials..." ),
608  KiBitmap( bom_xpm ) );
609 
610  aParentMenu->AppendSeparator();
611 
612  // Run CvPcb
613  AddMenuItem( aParentMenu,
614  ID_RUN_CVPCB,
615  _( "A&ssign Footprints..." ),
616  _( "Assign PCB footprints to schematic symbols" ),
617  KiBitmap( cvpcb_xpm ) );
618 
619  aParentMenu->AppendSeparator();
620 
621 #ifdef KICAD_SPICE
622  // Simulator
623  AddMenuItem( aParentMenu,
624  ID_SIM_SHOW,
625  _("Simula&tor"), _( "Simulate circuit" ),
626  KiBitmap( simulator_xpm ) );
627 #endif /* KICAD_SPICE */
628 
629 }
630 
631 
632 void prepareHelpMenu( wxMenu* aParentMenu )
633 {
634  AddMenuItem( aParentMenu,
635  wxID_HELP,
636  _( "Eeschema &Manual" ),
637  _( "Open Eeschema Manual" ),
638  KiBitmap( online_help_xpm ) );
639 
640  AddMenuItem( aParentMenu,
641  wxID_INDEX,
642  _( "&Getting Started in KiCad" ),
643  _( "Open \"Getting Started in KiCad\" guide for beginners" ),
644  KiBitmap( help_xpm ) );
645 
646  wxString text = AddHotkeyName( _( "&List Hotkeys..." ), g_Eeschema_Hokeys_Descr, HK_HELP );
647  AddMenuItem( aParentMenu,
649  text,
650  _( "Displays current hotkeys table and corresponding commands" ),
651  KiBitmap( hotkeys_xpm ) );
652 
653  aParentMenu->AppendSeparator();
654  AddMenuItem( aParentMenu, ID_HELP_GET_INVOLVED,
655  _( "Get &Involved" ),
656  _( "Contribute to KiCad (opens a web browser)" ),
657  KiBitmap( info_xpm ) );
658 
659  aParentMenu->AppendSeparator();
660  AddMenuItem( aParentMenu,
661  wxID_ABOUT,
662  _( "&About KiCad" ),
663  _( "About KiCad" ),
664  KiBitmap( about_xpm ) );
665 }
666 
667 
668 static void preparePreferencesMenu( SCH_EDIT_FRAME* aFrame, wxMenu* aParentMenu )
669 {
670  // Path configuration edit dialog.
671  AddMenuItem( aParentMenu,
673  _( "Configure Pa&ths..." ),
674  _( "Edit path configuration environment variables" ),
675  KiBitmap( path_xpm ) );
676 
677  // Library
678  AddMenuItem( aParentMenu,
680  _( "Manage Symbol Libraries..." ),
681  _( "Edit the global and project symbol library lists" ),
682  KiBitmap( library_table_xpm ) );
683 
684  // Options (Preferences on WXMAC)
685 #ifdef __WXMAC__
686  aParentMenu->Append( wxID_PREFERENCES );
687 #else
688  AddMenuItem( aParentMenu,
689  wxID_PREFERENCES,
690  _( "General &Options" ),
691  _( "Edit Eeschema preferences" ),
692  KiBitmap( preference_xpm ) );
693 #endif // __WXMAC__
694 
695  aParentMenu->AppendSeparator();
696 
697  // Icons options submenu
698  aFrame->AddMenuIconsOptions( aParentMenu );
699 
700  aParentMenu->AppendSeparator();
701 
702  // Language submenu
703  Pgm().AddMenuLanguageList( aParentMenu );
704 
705  // Hotkeys submenu
706  wxMenu* HotkeySubmenu = new wxMenu;
708  _( "E&xport Hotkeys..." ),
709  _( "Export current hotkeys into configuration file" ),
710  KiBitmap( hotkeys_export_xpm ) );
711 
712  // Reload hotkey file
714  _( "&Import Hotkeys..." ),
715  _( "Load existing hotkey configuration file" ),
716  KiBitmap( hotkeys_import_xpm ) );
717 
718  AddMenuItem( aParentMenu, HotkeySubmenu, -1,
719  _( "&Hotkeys Options" ),
720  _( "Edit hotkeys configuration and preferences" ),
721  KiBitmap( hotkeys_xpm ) );
722 
723 
724  aParentMenu->AppendSeparator();
725 
726  // Import/export
727  AddMenuItem( aParentMenu,
729  _( "&Save Project File..." ),
730  _( "Save project preferences into a project file" ),
731  KiBitmap( save_setup_xpm ) );
732 
733  AddMenuItem( aParentMenu,
735  _( "Load P&roject File..." ),
736  _( "Load project preferences from a project file" ),
737  KiBitmap( import_setup_xpm ) );
738 }
#define HELP_PLACE_POWERPORT
#define HELP_PLACE_COMPONENTS
#define HELP_PLACE_SHEETPIN
#define HELP_PLACE_NETLABEL
static void prepareInspectMenu(wxMenu *aParentMenu)
static void prepareHelpMenu(wxMenu *aParentMenu)
#define HELP_PLACE_GRAPHICTEXTS
wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
Function AddMenuItem is an inline helper function to create and insert a menu item with an icon into ...
Definition: bitmap.cpp:174
void ReCreateMenuBar() override
Function ReCreateMenuBar Creates recreates the menu bar.
#define HELP_ZOOM_FIT
Definition: id.h:242
#define HELP_PLACE_WIRE2BUS_ENTRY
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:66
#define HELP_PLACE_SHEET
#define HELP_PLACE_JUNCTION
Schematic editor (Eeschema) main window.
Definition: id.h:66
#define HELP_PLACE_GLOBALLABEL
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
#define HELP_ZOOM_OUT
EDA_DRAW_FRAME::OnSelectGrid ID_TB_OPTIONS_SELECT_UNIT_INCH
Definition: draw_frame.cpp:123
#define HELP_PLACE_BUS2BUS_ENTRY
#define HELP_ZOOM_REDRAW
#define HELP_PLACE_GRAPHICLINES
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:78
static void preparePreferencesMenu(SCH_EDIT_FRAME *aFrame, wxMenu *aParentMenu)
strings common to toolbars and menubar
struct EDA_HOTKEY_CONFIG g_Eeschema_Hokeys_Descr[]
wxFileHistory & GetFileHistory()
Definition: kiface_i.h:123
#define HELP_REPLACE
#define HELP_RUN_LIB_VIEWER
static void prepareEditMenu(wxMenu *aParentMenu)
#define HELP_IMPORT_FOOTPRINTS
static void prepareViewMenu(wxMenu *aParentMenu)
#define HELP_PLACE_NC_FLAG
void AddMenuIconsOptions(wxMenu *MasterMenu)
Function AddMenuIconsOptions creates a menu list for icons in menu and icon sizes choice...
#define HELP_REDO
#define HELP_PLACE_BUS
wxString AddHotkeyName(const wxString &aText, EDA_HOTKEY **aList, int aCommandId, HOTKEY_ACTION_TYPE aShortCutType)
Function AddHotkeyName Add the key name from the Command id value ( m_Idcommand member value) ...
#define HELP_PLACE_GRAPHICIMAGES
see class PGM_BASE
#define HELP_ZOOM_IN
static void preparePlaceMenu(wxMenu *aParentMenu)
#define HELP_RUN_LIB_EDITOR
#define HELP_IMPORT_SHEETPIN
#define HELP_UNDO
These strings are used in menus and tools, that do the same command But they are internationalized, and therefore must be created at run time, on the fly.
static void prepareToolsMenu(wxMenu *aParentMenu)
VTBL_ENTRY void AddMenuLanguageList(wxMenu *MasterMenu)
Function AddMenuLanguageList creates a menu list for language choice, and add it as submenu to Master...
Definition: pgm_base.cpp:889
static const char * text_xpm[]
#define HELP_GENERATE_BOM
#define HELP_FIND
#define HELP_PLACE_HIER_LABEL
#define HELP_DELETE_ITEMS
static void prepareFilesMenu(wxMenu *aParentMenu, bool aIsOutsideProject)
#define HELP_ANNOTATE
#define HELP_PLACE_WIRE
struct EDA_HOTKEY_CONFIG g_Schematic_Hokeys_Descr[]