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( 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 
459 
460 void prepareToolsMenu( wxMenu* aParentMenu )
461 {
462  wxString text;
463 
464  text = AddHotkeyName( _( "Update PCB from Schematic" ), g_Schematic_Hokeys_Descr, HK_UPDATE_PCB_FROM_SCH );
465 
466  AddMenuItem( aParentMenu,
468  text, _( "Updates PCB design with current schematic (forward annotation)." ),
469  KiBitmap( import_brd_file_xpm ) );
470 
471  // Run Pcbnew
472  AddMenuItem( aParentMenu,
473  ID_RUN_PCB,
474  _( "&Open PCB Editor" ),
475  _( "Run Pcbnew" ),
476  KiBitmap( pcbnew_xpm ) );
477 
478  aParentMenu->AppendSeparator();
479 
480  AddMenuItem( aParentMenu,
482  _( "Library &Editor" ), HELP_RUN_LIB_EDITOR,
483  KiBitmap( libedit_xpm ) );
484 
485  AddMenuItem( aParentMenu,
487  _( "Library &Browser" ), HELP_RUN_LIB_VIEWER,
488  KiBitmap( library_browse_xpm ) );
489 
490  AddMenuItem( aParentMenu,
492  _( "&Rescue Old Component" ),
493  _( "Find old components in project and rename/rescue them" ),
494  KiBitmap( rescue_xpm ) );
495 
496  aParentMenu->AppendSeparator();
497 
498  AddMenuItem( aParentMenu,
500  _( "&Annotate Schematic" ), HELP_ANNOTATE,
501  KiBitmap( annotate_xpm ) );
502 
503  // ERC
504  AddMenuItem( aParentMenu,
505  ID_GET_ERC,
506  _( "Electrical Rules &Checker" ),
507  _( "Perform electrical rules check" ),
508  KiBitmap( erc_xpm ) );
509 
510  AddMenuItem( aParentMenu,
512  _( "Generate &Netlist File" ),
513  _( "Generate component netlist file" ),
514  KiBitmap( netlist_xpm ) );
515 
516  AddMenuItem( aParentMenu,
518  _( "Component Table &View" ),
519  KiBitmap( spreadsheet_xpm ) );
520 
521  AddMenuItem( aParentMenu,
522  ID_GET_TOOLS,
523  _( "Generate Bill of &Materials" ),
525  KiBitmap( bom_xpm ) );
526 
527 
528 
529  aParentMenu->AppendSeparator();
530 
531  // Run CvPcb
532  AddMenuItem( aParentMenu,
533  ID_RUN_CVPCB,
534  _( "A&ssign Footprint" ),
535  _( "Run CvPcb" ),
536  KiBitmap( cvpcb_xpm ) );
537 
538  aParentMenu->AppendSeparator();
539 
540 #ifdef KICAD_SPICE
541  // Simulator
542  AddMenuItem( aParentMenu,
543  ID_SIM_SHOW,
544  _("Simula&tor"), _( "Simulate circuit" ),
545  KiBitmap( simulator_xpm ) );
546 #endif /* KICAD_SPICE */
547 
548 }
549 
550 
551 void prepareHelpMenu( wxMenu* aParentMenu )
552 {
553  AddMenuItem( aParentMenu,
554  wxID_HELP,
555  _( "Eeschema &Manual" ),
556  _( "Open Eeschema Manual" ),
557  KiBitmap( online_help_xpm ) );
558 
559  AddMenuItem( aParentMenu,
560  wxID_INDEX,
561  _( "&Getting Started in KiCad" ),
562  _( "Open \"Getting Started in KiCad\" guide for beginners" ),
563  KiBitmap( help_xpm ) );
564 
565  AddMenuItem( aParentMenu,
567  _( "&List Hotkeys" ),
568  _( "Displays current hotkeys list and corresponding commands" ),
569  KiBitmap( hotkeys_xpm ) );
570 
571  aParentMenu->AppendSeparator();
572  AddMenuItem( aParentMenu, ID_HELP_GET_INVOLVED,
573  _( "Get &Involved" ),
574  _( "Contribute to KiCad (open web browser)" ),
575  KiBitmap( info_xpm ) );
576 
577  aParentMenu->AppendSeparator();
578  AddMenuItem( aParentMenu,
579  wxID_ABOUT,
580  _( "&About KiCad" ),
581  _( "About KiCad" ),
582  KiBitmap( about_xpm ) );
583 }
584 
585 
586 void prepareImportExportMenu( wxMenu* aParentMenu )
587 {
588  AddMenuItem( aParentMenu,
590  _( "&Save Preferences" ),
591  _( "Save application preferences" ),
592  KiBitmap( save_setup_xpm ) );
593 
594  AddMenuItem( aParentMenu,
596  _( "Load Prefe&rences" ),
597  _( "Load application preferences" ),
598  KiBitmap( import_setup_xpm ) );
599 
600  aParentMenu->AppendSeparator();
601 
602  AddMenuItem( aParentMenu,
604  _( "E&xport Hotkeys" ),
605  _( "Create hotkey configuration file with current hotkeys" ),
606  KiBitmap( hotkeys_export_xpm ) );
607 
608  AddMenuItem( aParentMenu,
610  _( "&Import Hotkeys" ),
611  _( "Load existing hotkey configuration file" ),
612  KiBitmap( hotkeys_import_xpm ) );
613 }
614 
615 static void preparePreferencesMenu( SCH_EDIT_FRAME* aFrame, wxMenu* aParentMenu )
616 {
617  // Library
618  AddMenuItem( aParentMenu,
620  _( "Component &Libraries" ),
621  _( "Configure component libraries and paths" ),
622  KiBitmap( library_xpm ) );
623 
624  AddMenuItem( aParentMenu,
626  _( "Manage Symbol Library" ),
627  _( "Manage the symbol library" ),
628  KiBitmap( library_table_xpm ) );
629 
630  // Options (Preferences on WXMAC)
631 #ifdef __WXMAC__
632  aParentMenu->Append( wxID_PREFERENCES );
633 #else
634  AddMenuItem( aParentMenu,
635  wxID_PREFERENCES,
636  _( "General &Options" ),
637  _( "Edit Eeschema preferences" ),
638  KiBitmap( preference_xpm ) );
639 #endif // __WXMAC__
640 
641  // Language submenu
642  aParentMenu->AppendSeparator();
643  Pgm().AddMenuLanguageList( aParentMenu );
644 
645  // Icons options submenu
646  aFrame->AddMenuIconsOptions( aParentMenu );
647 
648  // Import/export (submenu in preferences menu)
649  aParentMenu->AppendSeparator();
650  wxMenu* importExportSubmenu = new wxMenu();
651  prepareImportExportMenu( importExportSubmenu );
652 
653  AddMenuItem( aParentMenu, importExportSubmenu,
654  wxID_ANY,
655  _( "&Import and Export" ),
656  _( "Import and export settings" ),
657  KiBitmap( save_setup_xpm ) );
658 }
#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: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[]