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-2016 Wayne Stambaugh <stambaughw@verizon.net>
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( add_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 a new schematic root sheet" ),
309  KiBitmap( new_sch_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 an 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 a recent opened schematic project" ),
337  KiBitmap( open_project_xpm ) );
338  }
339 
340  AddMenuItem( aParentMenu,
341  ID_APPEND_PROJECT, _( "Imp&ort Schematic Sheet Content" ),
342  _( "Import a schematic sheet content from an other project in the current sheet" ),
343  KiBitmap( open_document_xpm ) );
344 
345  aParentMenu->AppendSeparator();
346 
347  text = AddHotkeyName( _( "&Save Schematic Project" ),
349  AddMenuItem( aParentMenu,
350  ID_SAVE_PROJECT, text,
351  _( "Save all sheets in schematic project" ),
352  KiBitmap( save_project_xpm ) );
353 
354  AddMenuItem( aParentMenu,
356  _( "Save &Current Sheet Only" ),
357  _( "Save only current schematic sheet" ),
358  KiBitmap( save_xpm ) );
359 
360  if( aIsOutsideProject ) // not when under a project mgr
361  {
362  AddMenuItem( aParentMenu,
364  _( "Save C&urrent Sheet As" ),
365  _( "Save current schematic sheet as..." ),
366  KiBitmap( save_as_xpm ) );
367  }
368 
369  aParentMenu->AppendSeparator();
370 
371  // Edit page layout:
372  AddMenuItem( aParentMenu, ID_SHEET_SET,
373  _( "Pa&ge Settings" ),
374  _( "Settings for sheet size and frame references" ),
375  KiBitmap( sheetset_xpm ) );
376 
377  AddMenuItem( aParentMenu,
378  wxID_PRINT,
379  _( "Pri&nt..." ),
380  _( "Print schematic sheet" ),
381  KiBitmap( print_button_xpm ) );
382 
383  // Plot submenu
384  wxMenu* choice_plot_fmt = new wxMenu;
385 
386  AddMenuItem( choice_plot_fmt, ID_GEN_PLOT_SCHEMATIC, _( u8"&Plot..." ),
387  _( "Plot schematic sheet in PostScript, PDF, SVG, DXF or HPGL format" ),
388  KiBitmap( plot_xpm ) );
389 
390  // Plot to Clipboard
392  _( "Plot to C&lipboard" ),
393  _( "Export drawings to clipboard" ),
394  KiBitmap( copy_button_xpm ) );
395 
396  // Add plot submenu
397  AddMenuItem( aParentMenu, choice_plot_fmt,
398  ID_GEN_PLOT, _( "&Plot" ),
399  _( "Plot schematic sheet in HPGL, PostScript or SVG format" ),
400  KiBitmap( plot_xpm ) );
401 
402  // Quit
403  aParentMenu->AppendSeparator();
404  AddMenuItem( aParentMenu, wxID_EXIT, _( "&Close" ), _( "Close Eeschema" ),
405  KiBitmap( exit_xpm ) );
406 }
407 
408 
409 void prepareEditMenu( wxMenu* aParentMenu )
410 {
411  wxString text;
412 
413  // Undo
414  text = AddHotkeyName( _( "&Undo" ), g_Schematic_Hokeys_Descr, HK_UNDO );
415 
416  AddMenuItem( aParentMenu, wxID_UNDO, text, HELP_UNDO, KiBitmap( undo_xpm ) );
417 
418  // Redo
419  text = AddHotkeyName( _( "&Redo" ), g_Schematic_Hokeys_Descr, HK_REDO );
420 
421  AddMenuItem( aParentMenu, wxID_REDO, text, HELP_REDO, KiBitmap( redo_xpm ) );
422 
423  // Delete
424  aParentMenu->AppendSeparator();
426  _( "&Delete" ), HELP_DELETE_ITEMS,
427  KiBitmap( delete_xpm ) );
428 
429  // Find
430  aParentMenu->AppendSeparator();
431  text = AddHotkeyName( _( "&Find..." ), g_Schematic_Hokeys_Descr, HK_FIND_ITEM );
432  AddMenuItem( aParentMenu, ID_FIND_ITEMS, text, HELP_FIND, KiBitmap( find_xpm ) );
433 
434  // Find/Replace
435  text = AddHotkeyName( _( "Find and Re&place..." ), g_Schematic_Hokeys_Descr,
436  HK_FIND_REPLACE );
437  AddMenuItem( aParentMenu, wxID_REPLACE, text, HELP_REPLACE,
438  KiBitmap( find_replace_xpm ) );
439 
440  // Import footprint association .cmp file which can be created by Pcbnew:
441  aParentMenu->AppendSeparator();
442  AddMenuItem( aParentMenu, ID_BACKANNO_ITEMS,
443  _( "Import Footprint Association File" ),
445  KiBitmap( import_footprint_names_xpm ) );
446 }
447 
448 
449 void prepareToolsMenu( wxMenu* aParentMenu )
450 {
451  wxString text;
452 
453  text = AddHotkeyName( _( "Update PCB from Schematics" ), g_Schematic_Hokeys_Descr, HK_UPDATE_PCB_FROM_SCH );
454 
455  AddMenuItem( aParentMenu,
457  text, _( "Updates the PCB design with the current schematic (forward annotation)." ),
458  KiBitmap( pcbnew_xpm ) );
459 
460  // Run Pcbnew
461  AddMenuItem( aParentMenu,
462  ID_RUN_PCB,
463  _( "&Open PCB Editor" ),
464  _( "Run Pcbnew" ),
465  KiBitmap( pcbnew_xpm ) );
466 
467  aParentMenu->AppendSeparator();
468 
469  AddMenuItem( aParentMenu,
471  _( "Library &Editor" ), HELP_RUN_LIB_EDITOR,
472  KiBitmap( libedit_xpm ) );
473 
474  AddMenuItem( aParentMenu,
476  _( "Library &Browser" ), HELP_RUN_LIB_VIEWER,
477  KiBitmap( library_browse_xpm ) );
478 
479  AddMenuItem( aParentMenu,
481  _( "&Rescue Old Components" ),
482  _( "Find old components in the project and rename/rescue them" ),
483  KiBitmap( copycomponent_xpm ) );
484 
485  aParentMenu->AppendSeparator();
486 
487  AddMenuItem( aParentMenu,
489  _( "&Annotate Schematic..." ), HELP_ANNOTATE,
490  KiBitmap( annotate_xpm ) );
491 
492  // ERC
493  AddMenuItem( aParentMenu,
494  ID_GET_ERC,
495  _( "Electrical Rules &Checker" ),
496  _( "Perform electrical rules check" ),
497  KiBitmap( erc_xpm ) );
498 
499  AddMenuItem( aParentMenu,
501  _( "Generate &Netlist File..." ),
502  _( "Generate the component netlist file" ),
503  KiBitmap( netlist_xpm ) );
504 
505  AddMenuItem( aParentMenu,
507  _( "Component Table &View" ),
508  KiBitmap( spreadsheet_xpm ) );
509 
510  AddMenuItem( aParentMenu,
511  ID_GET_TOOLS,
512  _( "Generate Bill of &Materials..." ),
514  KiBitmap( bom_xpm ) );
515 
516 
517 
518  aParentMenu->AppendSeparator();
519 
520  // Run CvPcb
521  AddMenuItem( aParentMenu,
522  ID_RUN_CVPCB,
523  _( "A&ssign Component Footprints" ),
524  _( "Run CvPcb" ),
525  KiBitmap( cvpcb_xpm ) );
526 
527  aParentMenu->AppendSeparator();
528 
529 #ifdef KICAD_SPICE
530  // Simulator
531  AddMenuItem( aParentMenu,
532  ID_SIM_SHOW,
533  _("Simula&tor"), _( "Simulate the circuit" ),
534  KiBitmap( simulator_xpm ) );
535 #endif /* KICAD_SPICE */
536 
537 }
538 
539 
540 void prepareHelpMenu( wxMenu* aParentMenu )
541 {
542  AddMenuItem( aParentMenu,
543  wxID_HELP,
544  _( "Eeschema &Manual" ),
545  _( "Open Eeschema Manual" ),
546  KiBitmap( online_help_xpm ) );
547 
548  AddMenuItem( aParentMenu,
549  wxID_INDEX,
550  _( "&Getting Started in KiCad" ),
551  _( "Open \"Getting Started in KiCad\" guide for beginners" ),
552  KiBitmap( help_xpm ) );
553 
554  AddMenuItem( aParentMenu,
556  _( "&List Hotkeys" ),
557  _( "Displays the current hotkeys list and corresponding commands" ),
558  KiBitmap( hotkeys_xpm ) );
559 
560  aParentMenu->AppendSeparator();
561  AddMenuItem( aParentMenu, ID_HELP_GET_INVOLVED,
562  _( "Get &Involved" ),
563  _( "Contribute to KiCad (opens a web browser)" ),
564  KiBitmap( info_xpm ) );
565 
566  aParentMenu->AppendSeparator();
567  AddMenuItem( aParentMenu,
568  wxID_ABOUT,
569  _( "&About KiCad" ),
570  _( "About KiCad" ),
571  KiBitmap( info_xpm ) );
572 }
573 
574 
575 void prepareImportExportMenu( wxMenu* aParentMenu )
576 {
577  AddMenuItem( aParentMenu,
579  _( "&Save Preferences" ),
580  _( "Save application preferences" ),
581  KiBitmap( save_setup_xpm ) );
582 
583  AddMenuItem( aParentMenu,
585  _( "Load Prefe&rences" ),
586  _( "Load application preferences" ),
587  KiBitmap( import_setup_xpm ) );
588 
589  aParentMenu->AppendSeparator();
590 
591  AddMenuItem( aParentMenu,
593  _( "E&xport Hotkeys" ),
594  _( "Create a hotkey configuration file to export the current hotkeys" ),
595  KiBitmap( hotkeys_export_xpm ) );
596 
597  AddMenuItem( aParentMenu,
599  _( "&Import Hotkeys" ),
600  _( "Load an existing hotkey configuration file" ),
601  KiBitmap( hotkeys_import_xpm ) );
602 }
603 
604 static void preparePreferencesMenu( SCH_EDIT_FRAME* aFrame, wxMenu* aParentMenu )
605 {
606  // Library
607  AddMenuItem( aParentMenu,
609  _( "Component &Libraries" ),
610  _( "Configure component libraries and paths" ),
611  KiBitmap( library_xpm ) );
612 
613  // Options (Preferences on WXMAC)
614 #ifdef __WXMAC__
615  aParentMenu->Append( wxID_PREFERENCES );
616 #else
617  AddMenuItem( aParentMenu,
618  wxID_PREFERENCES,
619  _( "Schematic Editor &Options" ),
620  _( "Set Eeschema preferences" ),
621  KiBitmap( preference_xpm ) );
622 #endif // __WXMAC__
623 
624  // Language submenu
625  aParentMenu->AppendSeparator();
626  Pgm().AddMenuLanguageList( aParentMenu );
627 
628  // Icons options submenu
629  aFrame->AddMenuIconsOptions( aParentMenu );
630 
631  // Import/export (submenu in preferences menu)
632  aParentMenu->AppendSeparator();
633  wxMenu* importExportSubmenu = new wxMenu();
634  prepareImportExportMenu( importExportSubmenu );
635 
636  AddMenuItem( aParentMenu, importExportSubmenu,
637  wxID_ANY,
638  _( "&Import and export" ),
639  _( "Import and export settings" ),
640  KiBitmap( save_setup_xpm ) );
641 }
#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:117
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:121
#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:671
#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:816
#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[]