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) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2009 Wayne Stambaugh <stambaughw@gmail.com>
6  * Copyright (C) 1992-2017 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 "schframe.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 tools menu
53 static void prepareToolsMenu( wxMenu* aParentMenu );
54 
55 // Build the help menu
56 static void prepareHelpMenu( wxMenu* aParentMenu );
57 
58 // Build the import/export submenu
59 static void prepareImportExportMenu( 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  // Create and try to get the current menubar
74  wxString text;
75  wxMenuBar* menuBar = GetMenuBar();
76 
77  if( !menuBar )
78  menuBar = new wxMenuBar();
79 
80  // Delete all existing menus so they can be rebuilt.
81  // This allows language changes of the menu text on the fly.
82  menuBar->Freeze();
83 
84  while( menuBar->GetMenuCount() )
85  delete menuBar->Remove( 0 );
86 
87  // Recreate all menus:
88 
89  // Menu File:
90  wxMenu* fileMenu = new wxMenu;
91  prepareFilesMenu( fileMenu, Kiface().IsSingle() );
92 
93  // Menu Edit:
94  wxMenu* editMenu = new wxMenu;
95  prepareEditMenu( editMenu );
96 
97  // Menu View:
98  wxMenu* viewMenu = new wxMenu;
99  prepareViewMenu( viewMenu );
100 
101  // Menu place:
102  wxMenu* placeMenu = new wxMenu;
103  preparePlaceMenu( placeMenu );
104 
105  // Menu Preferences:
106  wxMenu* preferencesMenu = new wxMenu;
107  preparePreferencesMenu( this, preferencesMenu );
108 
109  // Menu Tools:
110  wxMenu* toolsMenu = new wxMenu;
111  prepareToolsMenu( toolsMenu );
112 
113  // Help Menu:
114  wxMenu* helpMenu = new wxMenu;
115  prepareHelpMenu( helpMenu );
116 
117  // Create the menubar and append all submenus
118  menuBar->Append( fileMenu, _( "&File" ) );
119  menuBar->Append( editMenu, _( "&Edit" ) );
120  menuBar->Append( viewMenu, _( "&View" ) );
121  menuBar->Append( placeMenu, _( "&Place" ) );
122  menuBar->Append( preferencesMenu, _( "P&references" ) );
123  menuBar->Append( toolsMenu, _( "&Tools" ) );
124  menuBar->Append( helpMenu, _( "&Help" ) );
125 
126  menuBar->Thaw();
127 
128  // Associate the menu bar with the frame, if no previous menubar
129  if( GetMenuBar() == NULL )
130  SetMenuBar( menuBar );
131  else
132  menuBar->Refresh();
133 }
134 
135 
136 void prepareViewMenu( wxMenu* aParentMenu )
137 {
138  wxString text;
139 
155  text = AddHotkeyName( _( "Zoom &In" ), g_Schematic_Hokeys_Descr,
156  HK_ZOOM_IN, IS_ACCELERATOR ); // add an accelerator, not a shortcut
157  AddMenuItem( aParentMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, KiBitmap( zoom_in_xpm ) );
158 
159  text = AddHotkeyName( _( "Zoom &Out" ), g_Schematic_Hokeys_Descr,
160  HK_ZOOM_OUT, IS_ACCELERATOR ); // add accelerator, not a shortcut
161  AddMenuItem( aParentMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, KiBitmap( zoom_out_xpm ) );
162 
163  text = AddHotkeyName( _( "&Fit on Screen" ), g_Schematic_Hokeys_Descr, HK_ZOOM_AUTO );
164 
165  AddMenuItem( aParentMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, KiBitmap( zoom_fit_in_page_xpm ) );
166 
167  text = AddHotkeyName( _( "&Redraw" ), g_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
168 
169  AddMenuItem( aParentMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );
170 
171  aParentMenu->AppendSeparator();
172 
173  AddMenuItem( aParentMenu,
174  ID_HIERARCHY,
175  _( "Show &Hierarchical Navigator" ),
176  _( "Navigate hierarchical sheets" ),
177  KiBitmap( hierarchy_nav_xpm ) );
178 
179  text = AddHotkeyName( _( "&Leave Sheet" ), g_Schematic_Hokeys_Descr, HK_LEAVE_SHEET );
180 
181  AddMenuItem( aParentMenu,
183  text,
184  _( "Leave Sheet" ),
185  KiBitmap( leave_sheet_xpm ) );
186 }
187 
188 
189 void preparePlaceMenu( wxMenu* aParentMenu )
190 {
191  wxString text;
192 
193  text = AddHotkeyName( _( "&Component" ), g_Schematic_Hokeys_Descr,
194  HK_ADD_NEW_COMPONENT, IS_ACCELERATOR ); // add an accelerator, not a shortcut
195  AddMenuItem( aParentMenu, ID_SCH_PLACE_COMPONENT, text,
197  KiBitmap( add_component_xpm ) );
198 
199  text = AddHotkeyName( _( "&Power Port" ), g_Schematic_Hokeys_Descr,
200  HK_ADD_NEW_POWER, IS_ACCELERATOR ); // add an accelerator, not a shortcut
201  AddMenuItem( aParentMenu, ID_PLACE_POWER_BUTT, text,
203  KiBitmap( add_power_xpm ) );
204 
205  text = AddHotkeyName( _( "&Wire" ), g_Schematic_Hokeys_Descr,
206  HK_BEGIN_WIRE, IS_ACCELERATOR ); // add an accelerator, not a shortcut
207  AddMenuItem( aParentMenu, ID_WIRE_BUTT, text,
209  KiBitmap( add_line_xpm ) );
210 
211  text = AddHotkeyName( _( "&Bus" ), g_Schematic_Hokeys_Descr,
212  HK_BEGIN_BUS, IS_ACCELERATOR ); // add an accelerator, not a shortcut
213  AddMenuItem( aParentMenu, ID_BUS_BUTT, text,
215  KiBitmap( add_bus_xpm ) );
216 
217  text = AddHotkeyName( _( "Wire to Bus &Entry" ), g_Schematic_Hokeys_Descr,
218  HK_ADD_WIRE_ENTRY, IS_ACCELERATOR ); // add an accelerator, not a shortcut
219  AddMenuItem( aParentMenu, ID_WIRETOBUS_ENTRY_BUTT, text,
221  KiBitmap( add_line2bus_xpm ) );
222 
223  text = AddHotkeyName( _( "Bus &to Bus Entry" ), g_Schematic_Hokeys_Descr,
224  HK_ADD_BUS_ENTRY, IS_ACCELERATOR ); // add an accelerator, not a shortcut
225  AddMenuItem( aParentMenu, ID_BUSTOBUS_ENTRY_BUTT, text,
227  KiBitmap( add_bus2bus_xpm ) );
228 
229  text = AddHotkeyName( _( "&No Connect Flag" ), g_Schematic_Hokeys_Descr,
230  HK_ADD_NOCONN_FLAG, IS_ACCELERATOR ); // add an accelerator, not a shortcut
231  AddMenuItem( aParentMenu, ID_NOCONN_BUTT, text, HELP_PLACE_NC_FLAG, KiBitmap( noconn_xpm ) );
232 
233  text = AddHotkeyName( _( "&Junction" ), g_Schematic_Hokeys_Descr,
234  HK_ADD_JUNCTION, IS_ACCELERATOR ); // add an accelerator, not a shortcut
235  AddMenuItem( aParentMenu, ID_JUNCTION_BUTT, text,
237  KiBitmap( add_junction_xpm ) );
238 
239  text = AddHotkeyName( _( "&Label" ), g_Schematic_Hokeys_Descr,
240  HK_ADD_LABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
241  AddMenuItem( aParentMenu, ID_LABEL_BUTT, text,
243  KiBitmap( add_line_label_xpm ) );
244 
245  text = AddHotkeyName( _( "Gl&obal Label" ), g_Schematic_Hokeys_Descr,
246  HK_ADD_GLABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
247  AddMenuItem( aParentMenu, ID_GLABEL_BUTT, text,
249  KiBitmap( add_glabel_xpm ) );
250 
251  aParentMenu->AppendSeparator();
252 
253  text = AddHotkeyName( _( "&Hierarchical Label" ), g_Schematic_Hokeys_Descr,
254  HK_ADD_HLABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
255  AddMenuItem( aParentMenu, ID_HIERLABEL_BUTT,
256  text, HELP_PLACE_HIER_LABEL,
257  KiBitmap( add_hierarchical_label_xpm ) );
258 
259 
260  text = AddHotkeyName( _( "Hierarchical &Sheet" ), g_Schematic_Hokeys_Descr,
261  HK_ADD_HIER_SHEET, IS_ACCELERATOR ); // add an accelerator, not a shortcut
262  AddMenuItem( aParentMenu, ID_SHEET_SYMBOL_BUTT, text,
264  KiBitmap( add_hierarchical_subsheet_xpm ) );
265 
266  AddMenuItem( aParentMenu,
268  _( "I&mport Hierarchical Label" ),
270  KiBitmap( import_hierarchical_label_xpm ) );
271 
272  AddMenuItem( aParentMenu,
274  _( "Hierarchical Pi&n to Sheet" ),
276  KiBitmap( add_hierar_pin_xpm ) );
277 
278  aParentMenu->AppendSeparator();
279 
280  text = AddHotkeyName( _( "Graphic Pol&yline" ), g_Schematic_Hokeys_Descr,
281  HK_ADD_GRAPHIC_POLYLINE, IS_ACCELERATOR ); // add an accelerator, not a shortcut
282  AddMenuItem( aParentMenu, ID_LINE_COMMENT_BUTT, text,
284  KiBitmap( add_dashed_line_xpm ) );
285 
286  text = AddHotkeyName( _( "&Graphic Text" ), g_Schematic_Hokeys_Descr,
287  HK_ADD_GRAPHIC_TEXT, IS_ACCELERATOR ); // add an accelerator, not a shortcut
288  AddMenuItem( aParentMenu, ID_TEXT_COMMENT_BUTT, text,
290  KiBitmap( text_xpm ) );
291 
292  // Add graphic image
293  AddMenuItem( aParentMenu, ID_ADD_IMAGE_BUTT, _( "&Image" ),
295  KiBitmap( image_xpm ) );
296 }
297 
298 
299 void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject )
300 {
301  wxString text;
302 
303  if( aIsOutsideProject ) // not when under a project mgr
304  {
305  AddMenuItem( aParentMenu,
307  _( "&New Schematic Project" ),
308  _( "Clear current schematic hierarchy and start new schematic root sheet" ),
309  KiBitmap( new_generic_xpm ) );
310 
311  text = AddHotkeyName( _( "&Open Schematic Project" ), g_Schematic_Hokeys_Descr, HK_LOAD_SCH );
312  AddMenuItem( aParentMenu,
313  ID_LOAD_PROJECT, text,
314  _( "Open existing schematic hierarchy" ),
315  KiBitmap( open_document_xpm ) );
316  }
317 
318  // @todo: static probably not OK in multiple open projects.
319  // Open Recent submenu
320  static wxMenu* openRecentMenu;
321 
322  // Add this menu to list menu managed by m_fileHistory
323  // (the file history will be updated when adding/removing files in history
324  if( openRecentMenu )
325  Kiface().GetFileHistory().RemoveMenu( openRecentMenu );
326 
327  openRecentMenu = new wxMenu();
328 
329  Kiface().GetFileHistory().UseMenu( openRecentMenu );
330  Kiface().GetFileHistory().AddFilesToMenu( openRecentMenu );
331 
332  if( Kiface().IsSingle() ) // not when under a project mgr
333  {
334  AddMenuItem( aParentMenu, openRecentMenu,
335  wxID_ANY, _( "Open &Recent" ),
336  _( "Open recent opened schematic project" ),
337  KiBitmap( open_project_xpm ) );
338  }
339 
340  AddMenuItem( aParentMenu,
341  ID_APPEND_PROJECT, _( "App&end Schematic Sheet" ),
342  _( "Import schematic sheet content from another project to current sheet" ),
343  KiBitmap( open_document_xpm ) );
344 
345  AddMenuItem( aParentMenu,
346  ID_IMPORT_NON_KICAD_SCH, _( "&Import Non-Kicad Schematic File" ),
347  _( "Import schematic file from other applications" ),
348  KiBitmap( open_document_xpm ) ); // TODO needs a different icon
349 
350  aParentMenu->AppendSeparator();
351 
352  text = AddHotkeyName( _( "&Save Schematic Project" ),
354  AddMenuItem( aParentMenu,
355  ID_SAVE_PROJECT, text,
356  _( "Save all sheets in schematic project" ),
357  KiBitmap( save_project_xpm ) );
358 
359  AddMenuItem( aParentMenu,
361  _( "Save &Current Sheet Only" ),
362  _( "Save only current schematic sheet" ),
363  KiBitmap( save_xpm ) );
364 
365  if( aIsOutsideProject ) // not when under a project mgr
366  {
367  AddMenuItem( aParentMenu,
369  _( "Save C&urrent Sheet As" ),
370  _( "Save current schematic sheet with new name" ),
371  KiBitmap( save_as_xpm ) );
372  }
373 
374  aParentMenu->AppendSeparator();
375 
376  // Edit page layout:
377  AddMenuItem( aParentMenu, ID_SHEET_SET,
378  _( "Pa&ge Settings" ),
379  _( "Settings for sheet size and frame references" ),
380  KiBitmap( sheetset_xpm ) );
381 
382  AddMenuItem( aParentMenu,
383  wxID_PRINT,
384  _( "Pri&nt" ),
385  _( "Print schematic sheet" ),
386  KiBitmap( print_button_xpm ) );
387 
388  // Plot submenu
389  wxMenu* choice_plot_fmt = new wxMenu;
390 
391  AddMenuItem( choice_plot_fmt, ID_GEN_PLOT_SCHEMATIC, _( "&Plot" ),
392  _( "Plot schematic sheet in PostScript, PDF, SVG, DXF or HPGL format" ),
393  KiBitmap( plot_xpm ) );
394 
395  // Plot to Clipboard
397  _( "Plot to C&lipboard" ),
398  _( "Export drawings to clipboard" ),
399  KiBitmap( copy_xpm ) );
400 
401  // Add plot submenu
402  AddMenuItem( aParentMenu, choice_plot_fmt,
403  ID_GEN_PLOT, _( "&Plot" ),
404  _( "Plot schematic sheet in HPGL, PostScript or SVG format" ),
405  KiBitmap( plot_xpm ) );
406 
407  // Quit
408  aParentMenu->AppendSeparator();
409  AddMenuItem( aParentMenu, wxID_EXIT, _( "&Close" ), _( "Close Eeschema" ),
410  KiBitmap( exit_xpm ) );
411 }
412 
413 
414 void prepareEditMenu( wxMenu* aParentMenu )
415 {
416  wxString text;
417 
418  // Undo
419  text = AddHotkeyName( _( "&Undo" ), g_Schematic_Hokeys_Descr, HK_UNDO );
420 
421  AddMenuItem( aParentMenu, wxID_UNDO, text, HELP_UNDO, KiBitmap( undo_xpm ) );
422 
423  // Redo
424  text = AddHotkeyName( _( "&Redo" ), g_Schematic_Hokeys_Descr, HK_REDO );
425 
426  AddMenuItem( aParentMenu, wxID_REDO, text, HELP_REDO, KiBitmap( redo_xpm ) );
427 
428  // Delete
429  aParentMenu->AppendSeparator();
431  _( "&Delete" ), HELP_DELETE_ITEMS,
432  KiBitmap( delete_xpm ) );
433 
434  // Find
435  aParentMenu->AppendSeparator();
436  text = AddHotkeyName( _( "&Find" ), g_Schematic_Hokeys_Descr, HK_FIND_ITEM );
437  AddMenuItem( aParentMenu, ID_FIND_ITEMS, text, HELP_FIND, KiBitmap( find_xpm ) );
438 
439  // Find/Replace
440  text = AddHotkeyName( _( "Find and Re&place" ), g_Schematic_Hokeys_Descr,
441  HK_FIND_REPLACE );
442  AddMenuItem( aParentMenu, wxID_REPLACE, text, HELP_REPLACE,
443  KiBitmap( find_replace_xpm ) );
444 
445  // Import footprint association .cmp file which can be created by Pcbnew:
446  aParentMenu->AppendSeparator();
447  AddMenuItem( aParentMenu, ID_BACKANNO_ITEMS,
448  _( "Import Footprint Association File" ),
450  KiBitmap( import_footprint_names_xpm ) );
451 
452  // Update field values
453  AddMenuItem( aParentMenu, ID_UPDATE_FIELDS,
454  _( "Update Field Values" ),
455  _( "Sets component fields to original library values" ),
456  KiBitmap( update_fields_xpm ) );
457 
458  // Edit components to symbols library links (change LIB_ID values)
459  aParentMenu->AppendSeparator();
461  _( "Edit Components to Symbol Library Links" ),
462  _( "Edit components to symbols library links to switch to an other library link (library IDs)" ),
463  KiBitmap( edit_cmp_symb_links_xpm ) );
464 }
465 
466 
467 void prepareToolsMenu( wxMenu* aParentMenu )
468 {
469  wxString text;
470 
471  text = AddHotkeyName( _( "Update PCB from Schematic" ), g_Schematic_Hokeys_Descr, HK_UPDATE_PCB_FROM_SCH );
472 
473  AddMenuItem( aParentMenu,
475  text, _( "Updates PCB design with current schematic (forward annotation)." ),
476  KiBitmap( import_brd_file_xpm ) );
477 
478  // Run Pcbnew
479  AddMenuItem( aParentMenu,
480  ID_RUN_PCB,
481  _( "&Open PCB Editor" ),
482  _( "Run Pcbnew" ),
483  KiBitmap( pcbnew_xpm ) );
484 
485  aParentMenu->AppendSeparator();
486 
487  AddMenuItem( aParentMenu,
489  _( "Library &Editor" ), HELP_RUN_LIB_EDITOR,
490  KiBitmap( libedit_xpm ) );
491 
492  AddMenuItem( aParentMenu,
494  _( "Library &Browser" ), HELP_RUN_LIB_VIEWER,
495  KiBitmap( library_browse_xpm ) );
496 
497  AddMenuItem( aParentMenu,
499  _( "&Rescue Symbols" ),
500  _( "Find old symbols in project and rename/rescue them" ),
501  KiBitmap( rescue_xpm ) );
502 
503  AddMenuItem( aParentMenu,
505  _( "Remap Symbols" ),
506  _( "Remap legacy library symbols to symbol library table" ),
507  KiBitmap( rescue_xpm ) );
508 
509  aParentMenu->AppendSeparator();
510 
511  AddMenuItem( aParentMenu,
513  _( "&Annotate Schematic" ), HELP_ANNOTATE,
514  KiBitmap( annotate_xpm ) );
515 
516  // ERC
517  AddMenuItem( aParentMenu,
518  ID_GET_ERC,
519  _( "Electrical Rules &Checker" ),
520  _( "Perform electrical rules check" ),
521  KiBitmap( erc_xpm ) );
522 
523  AddMenuItem( aParentMenu,
525  _( "Generate &Netlist File" ),
526  _( "Generate component netlist file" ),
527  KiBitmap( netlist_xpm ) );
528 
529  AddMenuItem( aParentMenu,
531  _( "Component Table &View" ),
532  KiBitmap( spreadsheet_xpm ) );
533 
534  AddMenuItem( aParentMenu,
535  ID_GET_TOOLS,
536  _( "Generate Bill of &Materials" ),
538  KiBitmap( bom_xpm ) );
539 
540 
541 
542  aParentMenu->AppendSeparator();
543 
544  // Run CvPcb
545  AddMenuItem( aParentMenu,
546  ID_RUN_CVPCB,
547  _( "A&ssign Footprint" ),
548  _( "Run CvPcb" ),
549  KiBitmap( cvpcb_xpm ) );
550 
551  aParentMenu->AppendSeparator();
552 
553 #ifdef KICAD_SPICE
554  // Simulator
555  AddMenuItem( aParentMenu,
556  ID_SIM_SHOW,
557  _("Simula&tor"), _( "Simulate circuit" ),
558  KiBitmap( simulator_xpm ) );
559 #endif /* KICAD_SPICE */
560 
561 }
562 
563 
564 void prepareHelpMenu( wxMenu* aParentMenu )
565 {
566  AddMenuItem( aParentMenu,
567  wxID_HELP,
568  _( "Eeschema &Manual" ),
569  _( "Open Eeschema Manual" ),
570  KiBitmap( online_help_xpm ) );
571 
572  AddMenuItem( aParentMenu,
573  wxID_INDEX,
574  _( "&Getting Started in KiCad" ),
575  _( "Open \"Getting Started in KiCad\" guide for beginners" ),
576  KiBitmap( help_xpm ) );
577 
578  AddMenuItem( aParentMenu,
580  _( "&List Hotkeys" ),
581  _( "Displays current hotkeys list and corresponding commands" ),
582  KiBitmap( hotkeys_xpm ) );
583 
584  aParentMenu->AppendSeparator();
585  AddMenuItem( aParentMenu, ID_HELP_GET_INVOLVED,
586  _( "Get &Involved" ),
587  _( "Contribute to KiCad (open web browser)" ),
588  KiBitmap( info_xpm ) );
589 
590  aParentMenu->AppendSeparator();
591  AddMenuItem( aParentMenu,
592  wxID_ABOUT,
593  _( "&About KiCad" ),
594  _( "About KiCad" ),
595  KiBitmap( about_xpm ) );
596 }
597 
598 
599 void prepareImportExportMenu( wxMenu* aParentMenu )
600 {
601  AddMenuItem( aParentMenu,
603  _( "&Save Preferences" ),
604  _( "Save application preferences" ),
605  KiBitmap( save_setup_xpm ) );
606 
607  AddMenuItem( aParentMenu,
609  _( "Load Prefe&rences" ),
610  _( "Load application preferences" ),
611  KiBitmap( import_setup_xpm ) );
612 
613  aParentMenu->AppendSeparator();
614 
615  AddMenuItem( aParentMenu,
617  _( "E&xport Hotkeys" ),
618  _( "Create hotkey configuration file with current hotkeys" ),
619  KiBitmap( hotkeys_export_xpm ) );
620 
621  AddMenuItem( aParentMenu,
623  _( "&Import Hotkeys" ),
624  _( "Load existing hotkey configuration file" ),
625  KiBitmap( hotkeys_import_xpm ) );
626 }
627 
628 static void preparePreferencesMenu( SCH_EDIT_FRAME* aFrame, wxMenu* aParentMenu )
629 {
630  // Library
631  AddMenuItem( aParentMenu,
633  _( "Manage Symbol Library Tables" ),
634  _( "Edit the global and project symbol library tables (list of active libraries)." ),
635  KiBitmap( library_table_xpm ) );
636 
637  // Options (Preferences on WXMAC)
638 #ifdef __WXMAC__
639  aParentMenu->Append( wxID_PREFERENCES );
640 #else
641  AddMenuItem( aParentMenu,
642  wxID_PREFERENCES,
643  _( "General &Options" ),
644  _( "Edit Eeschema preferences" ),
645  KiBitmap( preference_xpm ) );
646 #endif // __WXMAC__
647 
648  // Language submenu
649  aParentMenu->AppendSeparator();
650  Pgm().AddMenuLanguageList( aParentMenu );
651 
652  // Icons options submenu
653  aFrame->AddMenuIconsOptions( aParentMenu );
654 
655  // Import/export (submenu in preferences menu)
656  aParentMenu->AppendSeparator();
657  wxMenu* importExportSubmenu = new wxMenu();
658  prepareImportExportMenu( importExportSubmenu );
659 
660  AddMenuItem( aParentMenu, importExportSubmenu,
661  wxID_ANY,
662  _( "&Import and Export" ),
663  _( "Import and export settings" ),
664  KiBitmap( save_setup_xpm ) );
665 }
#define HELP_PLACE_POWERPORT
#define HELP_PLACE_COMPONENTS
#define HELP_PLACE_SHEETPIN
#define HELP_PLACE_NETLABEL
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:55
void ReCreateMenuBar() override
Function ReCreateMenuBar Creates recreates the menu bar.
#define HELP_ZOOM_FIT
Definition: id.h:232
#define HELP_PLACE_WIRE2BUS_ENTRY
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
#define HELP_PLACE_SHEET
#define HELP_PLACE_JUNCTION
Schematic editor (Eeschema) main window.
Definition: schframe.h:118
Definition: id.h:66
#define HELP_PLACE_GLOBALLABEL
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
#define HELP_ZOOM_OUT
#define HELP_PLACE_BUS2BUS_ENTRY
static void prepareImportExportMenu(wxMenu *aParentMenu)
#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:36
static void preparePreferencesMenu(SCH_EDIT_FRAME *aFrame, wxMenu *aParentMenu)
strings common to toolbars and menubar
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...
Definition: basicframe.cpp:692
#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.
Definition: id.h:96
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:824
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[]