KiCad PCB EDA Suite
eeschema/menubar.cpp File Reference

(Re)Create the main menubar for the schematic frame More...

#include <kiface_i.h>
#include <menus_helpers.h>
#include <pgm_base.h>
#include "eeschema_id.h"
#include "general.h"
#include "help_common_strings.h"
#include "hotkeys.h"
#include "sch_edit_frame.h"

Go to the source code of this file.

Functions

static void preparePlaceMenu (wxMenu *aParentMenu)
 
static void prepareFilesMenu (wxMenu *aParentMenu, bool aIsOutsideProject)
 
static void prepareToolsMenu (wxMenu *aParentMenu)
 
static void prepareHelpMenu (wxMenu *aParentMenu)
 
static void prepareEditMenu (wxMenu *aParentMenu)
 
static void prepareViewMenu (wxMenu *aParentMenu)
 
static void preparePreferencesMenu (SCH_EDIT_FRAME *aFrame, wxMenu *aParentMenu)
 

Detailed Description

(Re)Create the main menubar for the schematic frame

Definition in file eeschema/menubar.cpp.

Function Documentation

void prepareEditMenu ( wxMenu *  aParentMenu)
static

Definition at line 402 of file eeschema/menubar.cpp.

References AddHotkeyName(), AddMenuItem(), g_Schematic_Hokeys_Descr, HELP_DELETE_ITEMS, HELP_FIND, HELP_IMPORT_FOOTPRINTS, HELP_REDO, HELP_REPLACE, HELP_UNDO, HK_FIND_ITEM, HK_FIND_REPLACE, HK_REDO, HK_UNDO, ID_BACKANNO_ITEMS, ID_EDIT_COMPONENTS_TO_SYMBOLS_LIB_ID, ID_FIND_ITEMS, ID_SCHEMATIC_DELETE_ITEM_BUTT, ID_UPDATE_FIELDS, and KiBitmap().

Referenced by SCH_EDIT_FRAME::ReCreateMenuBar().

403 {
404  wxString text;
405 
406  // Undo
407  text = AddHotkeyName( _( "&Undo" ), g_Schematic_Hokeys_Descr, HK_UNDO );
408 
409  AddMenuItem( aParentMenu, wxID_UNDO, text, HELP_UNDO, KiBitmap( undo_xpm ) );
410 
411  // Redo
412  text = AddHotkeyName( _( "&Redo" ), g_Schematic_Hokeys_Descr, HK_REDO );
413 
414  AddMenuItem( aParentMenu, wxID_REDO, text, HELP_REDO, KiBitmap( redo_xpm ) );
415 
416  // Delete
417  aParentMenu->AppendSeparator();
419  _( "&Delete" ), HELP_DELETE_ITEMS,
420  KiBitmap( delete_xpm ) );
421 
422  // Find
423  aParentMenu->AppendSeparator();
424  text = AddHotkeyName( _( "&Find..." ), g_Schematic_Hokeys_Descr, HK_FIND_ITEM );
425  AddMenuItem( aParentMenu, ID_FIND_ITEMS, text, HELP_FIND, KiBitmap( find_xpm ) );
426 
427  // Find/Replace
428  text = AddHotkeyName( _( "Find and Re&place..." ), g_Schematic_Hokeys_Descr,
429  HK_FIND_REPLACE );
430  AddMenuItem( aParentMenu, wxID_REPLACE, text, HELP_REPLACE,
431  KiBitmap( find_replace_xpm ) );
432 
433  // Import footprint association .cmp file which can be created by Pcbnew:
434  aParentMenu->AppendSeparator();
435  AddMenuItem( aParentMenu, ID_BACKANNO_ITEMS,
436  _( "Import Footprint Association File..." ),
438  KiBitmap( import_footprint_names_xpm ) );
439 
440  // Update field values
441  AddMenuItem( aParentMenu, ID_UPDATE_FIELDS,
442  _( "Update Field Values..." ),
443  _( "Sets symbol fields to original library values" ),
444  KiBitmap( update_fields_xpm ) );
445 
446  // Edit components to symbols library links (change LIB_ID values)
447  aParentMenu->AppendSeparator();
449  _( "Edit Symbol Library Links..." ),
450  _( "Edit schematic symbol's symbol library links" ),
451  KiBitmap( edit_cmp_symb_links_xpm ) );
452 }
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
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:78
#define HELP_REPLACE
#define HELP_IMPORT_FOOTPRINTS
#define HELP_REDO
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_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.
#define HELP_FIND
#define HELP_DELETE_ITEMS
struct EDA_HOTKEY_CONFIG g_Schematic_Hokeys_Descr[]
void prepareFilesMenu ( wxMenu *  aParentMenu,
bool  aIsOutsideProject 
)
static

Definition at line 296 of file eeschema/menubar.cpp.

References AddHotkeyName(), AddMenuItem(), g_Schematic_Hokeys_Descr, KIFACE_I::GetFileHistory(), HK_LOAD_SCH, HK_SAVE_SCH, ID_APPEND_PROJECT, ID_GEN_COPY_SHEET_TO_CLIPBOARD, ID_GEN_PLOT_SCHEMATIC, ID_IMPORT_NON_KICAD_SCH, ID_LOAD_PROJECT, ID_NEW_PROJECT, ID_SAVE_ONE_SHEET_UNDER_NEW_NAME, ID_SAVE_PROJECT, ID_SHEET_SET, ID_UPDATE_ONE_SHEET, KiBitmap(), and Kiface().

Referenced by SCH_EDIT_FRAME::ReCreateMenuBar().

297 {
298  wxString text;
299 
300  if( aIsOutsideProject ) // not when under a project mgr
301  {
302  AddMenuItem( aParentMenu,
304  _( "&New..." ),
305  _( "Clear current schematic hierarchy and start new schematic root sheet" ),
306  KiBitmap( new_document_xpm ) );
307 
308  text = AddHotkeyName( _( "&Open..." ), g_Schematic_Hokeys_Descr, HK_LOAD_SCH );
309  AddMenuItem( aParentMenu,
310  ID_LOAD_PROJECT, text,
311  _( "Open existing schematic" ),
312  KiBitmap( open_document_xpm ) );
313  }
314 
315  // @todo: static probably not OK in multiple open projects.
316  // Open Recent submenu
317  static wxMenu* openRecentMenu;
318 
319  // Add this menu to list menu managed by m_fileHistory
320  // (the file history will be updated when adding/removing files in history
321  if( openRecentMenu )
322  Kiface().GetFileHistory().RemoveMenu( openRecentMenu );
323 
324  openRecentMenu = new wxMenu();
325 
326  Kiface().GetFileHistory().UseMenu( openRecentMenu );
327  Kiface().GetFileHistory().AddFilesToMenu( openRecentMenu );
328 
329  if( Kiface().IsSingle() ) // not when under a project mgr
330  {
331  AddMenuItem( aParentMenu, openRecentMenu,
332  wxID_ANY, _( "Open &Recent" ),
333  _( "Open recently opened schematic" ),
334  KiBitmap( recent_xpm ) );
335  }
336 
337  AddMenuItem( aParentMenu,
338  ID_APPEND_PROJECT, _( "App&end Schematic Sheet..." ),
339  _( "Import schematic sheet content from another project to current sheet" ),
340  KiBitmap( add_document_xpm ) );
341 
342  AddMenuItem( aParentMenu,
343  ID_IMPORT_NON_KICAD_SCH, _( "&Import Non-Kicad Schematic File..." ),
344  _( "Import schematic file from other applications" ),
345  KiBitmap( import_document_xpm ) ); // TODO needs a different icon
346 
347  aParentMenu->AppendSeparator();
348 
349  text = AddHotkeyName( _( "&Save" ),
351  AddMenuItem( aParentMenu,
352  ID_SAVE_PROJECT, text,
353  _( "Save all sheets in schematic" ),
354  KiBitmap( save_xpm ) );
355 
356  AddMenuItem( aParentMenu,
358  _( "Save &Current Sheet" ),
359  _( "Save only current schematic sheet" ),
360  KiBitmap( save_xpm ) );
361 
362  if( aIsOutsideProject ) // not when under a project mgr
363  {
364  AddMenuItem( aParentMenu,
366  _( "Save C&urrent Sheet As..." ),
367  _( "Save current schematic sheet with new name" ),
368  KiBitmap( save_as_xpm ) );
369  }
370 
371  aParentMenu->AppendSeparator();
372 
373  // Edit page layout:
374  AddMenuItem( aParentMenu, ID_SHEET_SET,
375  _( "Pa&ge Settings..." ),
376  _( "Settings for sheet size and frame references" ),
377  KiBitmap( sheetset_xpm ) );
378 
379  AddMenuItem( aParentMenu,
380  wxID_PRINT,
381  _( "Pri&nt..." ),
382  _( "Print schematic sheet" ),
383  KiBitmap( print_button_xpm ) );
384 
385  AddMenuItem( aParentMenu, ID_GEN_PLOT_SCHEMATIC, _( "&Plot..." ),
386  _( "Plot schematic sheet in PostScript, PDF, SVG, DXF or HPGL format" ),
387  KiBitmap( plot_xpm ) );
388 
389  // Plot to Clipboard
391  _( "Plot to C&lipboard" ),
392  _( "Export drawings to clipboard" ),
393  KiBitmap( copy_xpm ) );
394 
395  // Quit
396  aParentMenu->AppendSeparator();
397  AddMenuItem( aParentMenu, wxID_EXIT, _( "&Close" ), _( "Close Eeschema" ),
398  KiBitmap( exit_xpm ) );
399 }
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
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:78
wxFileHistory & GetFileHistory()
Definition: kiface_i.h:123
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) ...
struct EDA_HOTKEY_CONFIG g_Schematic_Hokeys_Descr[]
void prepareHelpMenu ( wxMenu *  aParentMenu)
static

Definition at line 553 of file eeschema/menubar.cpp.

References AddHotkeyName(), AddMenuItem(), g_Eeschema_Hokeys_Descr, HK_HELP, ID_HELP_GET_INVOLVED, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, and KiBitmap().

Referenced by SCH_EDIT_FRAME::ReCreateMenuBar().

554 {
555  AddMenuItem( aParentMenu,
556  wxID_HELP,
557  _( "Eeschema &Manual" ),
558  _( "Open Eeschema Manual" ),
559  KiBitmap( online_help_xpm ) );
560 
561  AddMenuItem( aParentMenu,
562  wxID_INDEX,
563  _( "&Getting Started in KiCad" ),
564  _( "Open \"Getting Started in KiCad\" guide for beginners" ),
565  KiBitmap( help_xpm ) );
566 
567  wxString text = AddHotkeyName( _( "&List Hotkeys..." ), g_Eeschema_Hokeys_Descr, HK_HELP );
568  AddMenuItem( aParentMenu,
570  text,
571  _( "Displays current hotkeys list and corresponding commands" ),
572  KiBitmap( hotkeys_xpm ) );
573 
574  aParentMenu->AppendSeparator();
575  AddMenuItem( aParentMenu, ID_HELP_GET_INVOLVED,
576  _( "Get &Involved" ),
577  _( "Contribute to KiCad (open web browser)" ),
578  KiBitmap( info_xpm ) );
579 
580  aParentMenu->AppendSeparator();
581  AddMenuItem( aParentMenu,
582  wxID_ABOUT,
583  _( "&About KiCad" ),
584  _( "About KiCad" ),
585  KiBitmap( about_xpm ) );
586 }
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
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:78
struct EDA_HOTKEY_CONFIG g_Eeschema_Hokeys_Descr[]
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) ...
void preparePlaceMenu ( wxMenu *  aParentMenu)
static

Definition at line 186 of file eeschema/menubar.cpp.

References AddHotkeyName(), AddMenuItem(), g_Schematic_Hokeys_Descr, HELP_IMPORT_SHEETPIN, HELP_PLACE_BUS, HELP_PLACE_BUS2BUS_ENTRY, HELP_PLACE_COMPONENTS, HELP_PLACE_GLOBALLABEL, HELP_PLACE_GRAPHICIMAGES, HELP_PLACE_GRAPHICLINES, HELP_PLACE_GRAPHICTEXTS, HELP_PLACE_HIER_LABEL, HELP_PLACE_JUNCTION, HELP_PLACE_NC_FLAG, HELP_PLACE_NETLABEL, HELP_PLACE_POWERPORT, HELP_PLACE_SHEET, HELP_PLACE_SHEETPIN, HELP_PLACE_WIRE, HELP_PLACE_WIRE2BUS_ENTRY, HK_ADD_BUS_ENTRY, HK_ADD_GLABEL, HK_ADD_GRAPHIC_POLYLINE, HK_ADD_GRAPHIC_TEXT, HK_ADD_HIER_SHEET, HK_ADD_HLABEL, HK_ADD_JUNCTION, HK_ADD_LABEL, HK_ADD_NEW_COMPONENT, HK_ADD_NEW_POWER, HK_ADD_NOCONN_FLAG, HK_ADD_WIRE_ENTRY, HK_BEGIN_BUS, HK_BEGIN_WIRE, ID_ADD_IMAGE_BUTT, ID_BUS_BUTT, ID_BUSTOBUS_ENTRY_BUTT, ID_GLABEL_BUTT, ID_HIERLABEL_BUTT, ID_IMPORT_HLABEL_BUTT, ID_JUNCTION_BUTT, ID_LABEL_BUTT, ID_LINE_COMMENT_BUTT, ID_NOCONN_BUTT, ID_PLACE_POWER_BUTT, ID_SCH_PLACE_COMPONENT, ID_SHEET_PIN_BUTT, ID_SHEET_SYMBOL_BUTT, ID_TEXT_COMMENT_BUTT, ID_WIRE_BUTT, ID_WIRETOBUS_ENTRY_BUTT, IS_ACCELERATOR, KiBitmap(), and text_xpm.

Referenced by SCH_EDIT_FRAME::ReCreateMenuBar().

187 {
188  wxString text;
189 
190  text = AddHotkeyName( _( "&Symbol" ), g_Schematic_Hokeys_Descr,
191  HK_ADD_NEW_COMPONENT, IS_ACCELERATOR ); // add an accelerator, not a shortcut
192  AddMenuItem( aParentMenu, ID_SCH_PLACE_COMPONENT, text,
194  KiBitmap( add_component_xpm ) );
195 
196  text = AddHotkeyName( _( "&Power Port" ), g_Schematic_Hokeys_Descr,
197  HK_ADD_NEW_POWER, IS_ACCELERATOR ); // add an accelerator, not a shortcut
198  AddMenuItem( aParentMenu, ID_PLACE_POWER_BUTT, text,
200  KiBitmap( add_power_xpm ) );
201 
202  text = AddHotkeyName( _( "&Wire" ), g_Schematic_Hokeys_Descr,
203  HK_BEGIN_WIRE, IS_ACCELERATOR ); // add an accelerator, not a shortcut
204  AddMenuItem( aParentMenu, ID_WIRE_BUTT, text,
206  KiBitmap( add_line_xpm ) );
207 
208  text = AddHotkeyName( _( "&Bus" ), g_Schematic_Hokeys_Descr,
209  HK_BEGIN_BUS, IS_ACCELERATOR ); // add an accelerator, not a shortcut
210  AddMenuItem( aParentMenu, ID_BUS_BUTT, text,
212  KiBitmap( add_bus_xpm ) );
213 
214  text = AddHotkeyName( _( "Wire to Bus &Entry" ), g_Schematic_Hokeys_Descr,
215  HK_ADD_WIRE_ENTRY, IS_ACCELERATOR ); // add an accelerator, not a shortcut
216  AddMenuItem( aParentMenu, ID_WIRETOBUS_ENTRY_BUTT, text,
218  KiBitmap( add_line2bus_xpm ) );
219 
220  text = AddHotkeyName( _( "Bus &to Bus Entry" ), g_Schematic_Hokeys_Descr,
221  HK_ADD_BUS_ENTRY, IS_ACCELERATOR ); // add an accelerator, not a shortcut
222  AddMenuItem( aParentMenu, ID_BUSTOBUS_ENTRY_BUTT, text,
224  KiBitmap( add_bus2bus_xpm ) );
225 
226  text = AddHotkeyName( _( "&No Connect Flag" ), g_Schematic_Hokeys_Descr,
227  HK_ADD_NOCONN_FLAG, IS_ACCELERATOR ); // add an accelerator, not a shortcut
228  AddMenuItem( aParentMenu, ID_NOCONN_BUTT, text, HELP_PLACE_NC_FLAG, KiBitmap( noconn_xpm ) );
229 
230  text = AddHotkeyName( _( "&Junction" ), g_Schematic_Hokeys_Descr,
231  HK_ADD_JUNCTION, IS_ACCELERATOR ); // add an accelerator, not a shortcut
232  AddMenuItem( aParentMenu, ID_JUNCTION_BUTT, text,
234  KiBitmap( add_junction_xpm ) );
235 
236  text = AddHotkeyName( _( "&Label" ), g_Schematic_Hokeys_Descr,
237  HK_ADD_LABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
238  AddMenuItem( aParentMenu, ID_LABEL_BUTT, text,
240  KiBitmap( add_line_label_xpm ) );
241 
242  text = AddHotkeyName( _( "Gl&obal Label" ), g_Schematic_Hokeys_Descr,
243  HK_ADD_GLABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
244  AddMenuItem( aParentMenu, ID_GLABEL_BUTT, text,
246  KiBitmap( add_glabel_xpm ) );
247 
248  aParentMenu->AppendSeparator();
249 
250  text = AddHotkeyName( _( "&Hierarchical Label" ), g_Schematic_Hokeys_Descr,
251  HK_ADD_HLABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
252  AddMenuItem( aParentMenu, ID_HIERLABEL_BUTT,
253  text, HELP_PLACE_HIER_LABEL,
254  KiBitmap( add_hierarchical_label_xpm ) );
255 
256 
257  text = AddHotkeyName( _( "Hierar&chical Sheet" ), g_Schematic_Hokeys_Descr,
258  HK_ADD_HIER_SHEET, IS_ACCELERATOR ); // add an accelerator, not a shortcut
259  AddMenuItem( aParentMenu, ID_SHEET_SYMBOL_BUTT, text,
261  KiBitmap( add_hierarchical_subsheet_xpm ) );
262 
263  AddMenuItem( aParentMenu,
265  _( "I&mport Hierarchical Label" ),
267  KiBitmap( import_hierarchical_label_xpm ) );
268 
269  AddMenuItem( aParentMenu,
271  _( "Hierarchical Pi&n to Sheet" ),
273  KiBitmap( add_hierar_pin_xpm ) );
274 
275  aParentMenu->AppendSeparator();
276 
277  text = AddHotkeyName( _( "Graphic Pol&yline" ), g_Schematic_Hokeys_Descr,
278  HK_ADD_GRAPHIC_POLYLINE, IS_ACCELERATOR ); // add an accelerator, not a shortcut
279  AddMenuItem( aParentMenu, ID_LINE_COMMENT_BUTT, text,
281  KiBitmap( add_dashed_line_xpm ) );
282 
283  text = AddHotkeyName( _( "&Graphic Text" ), g_Schematic_Hokeys_Descr,
284  HK_ADD_GRAPHIC_TEXT, IS_ACCELERATOR ); // add an accelerator, not a shortcut
285  AddMenuItem( aParentMenu, ID_TEXT_COMMENT_BUTT, text,
287  KiBitmap( text_xpm ) );
288 
289  // Add graphic image
290  AddMenuItem( aParentMenu, ID_ADD_IMAGE_BUTT, _( "&Image" ),
292  KiBitmap( image_xpm ) );
293 }
#define HELP_PLACE_POWERPORT
#define HELP_PLACE_COMPONENTS
#define HELP_PLACE_SHEETPIN
#define HELP_PLACE_NETLABEL
#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
#define HELP_PLACE_WIRE2BUS_ENTRY
#define HELP_PLACE_SHEET
#define HELP_PLACE_JUNCTION
#define HELP_PLACE_GLOBALLABEL
#define HELP_PLACE_BUS2BUS_ENTRY
#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
#define HELP_PLACE_NC_FLAG
#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
#define HELP_IMPORT_SHEETPIN
static const char * text_xpm[]
#define HELP_PLACE_HIER_LABEL
#define HELP_PLACE_WIRE
struct EDA_HOTKEY_CONFIG g_Schematic_Hokeys_Descr[]
static void preparePreferencesMenu ( SCH_EDIT_FRAME aFrame,
wxMenu *  aParentMenu 
)
static

Definition at line 589 of file eeschema/menubar.cpp.

References EDA_BASE_FRAME::AddMenuIconsOptions(), AddMenuItem(), PGM_BASE::AddMenuLanguageList(), ID_CONFIG_READ, ID_CONFIG_SAVE, ID_EDIT_SYM_LIB_TABLE, ID_PREFERENCES_CONFIGURE_PATHS, ID_PREFERENCES_HOTKEY_EXPORT_CONFIG, ID_PREFERENCES_HOTKEY_IMPORT_CONFIG, KiBitmap(), and Pgm().

Referenced by SCH_EDIT_FRAME::ReCreateMenuBar().

590 {
591  // Library
592  AddMenuItem( aParentMenu,
594  _( "Manage Symbol Library Tables..." ),
595  _( "Edit the global and project symbol library tables (list of active libraries)." ),
596  KiBitmap( library_table_xpm ) );
597 
598  // Path configuration edit dialog.
599  AddMenuItem( aParentMenu,
601  _( "Configure &Paths..." ),
602  _( "Edit path configuration environment variables" ),
603  KiBitmap( path_xpm ) );
604 
605  // Options (Preferences on WXMAC)
606 #ifdef __WXMAC__
607  aParentMenu->Append( wxID_PREFERENCES );
608 #else
609  AddMenuItem( aParentMenu,
610  wxID_PREFERENCES,
611  _( "General &Options" ),
612  _( "Edit Eeschema preferences" ),
613  KiBitmap( preference_xpm ) );
614 #endif // __WXMAC__
615 
616  // Language submenu
617  aParentMenu->AppendSeparator();
618  Pgm().AddMenuLanguageList( aParentMenu );
619 
620  // Icons options submenu
621  aFrame->AddMenuIconsOptions( aParentMenu );
622 
623  // Import/export
624  aParentMenu->AppendSeparator();
625  AddMenuItem( aParentMenu,
627  _( "&Save Preferences..." ),
628  _( "Save application preferences" ),
629  KiBitmap( save_setup_xpm ) );
630 
631  AddMenuItem( aParentMenu,
633  _( "Load Prefe&rences..." ),
634  _( "Load application preferences" ),
635  KiBitmap( import_setup_xpm ) );
636 
637  aParentMenu->AppendSeparator();
638 
639  AddMenuItem( aParentMenu,
641  _( "E&xport Hotkeys..." ),
642  _( "Create hotkey configuration file with current hotkeys" ),
643  KiBitmap( hotkeys_export_xpm ) );
644 
645  AddMenuItem( aParentMenu,
647  _( "&Import Hotkeys..." ),
648  _( "Load existing hotkey configuration file" ),
649  KiBitmap( hotkeys_import_xpm ) );
650 }
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
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:78
void AddMenuIconsOptions(wxMenu *MasterMenu)
Function AddMenuIconsOptions creates a menu list for icons in menu and icon sizes choice...
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
void prepareToolsMenu ( wxMenu *  aParentMenu)
static

Definition at line 455 of file eeschema/menubar.cpp.

References AddHotkeyName(), AddMenuItem(), g_Schematic_Hokeys_Descr, HELP_ANNOTATE, HELP_GENERATE_BOM, HELP_RUN_LIB_EDITOR, HELP_RUN_LIB_VIEWER, HK_UPDATE_PCB_FROM_SCH, ID_GET_ANNOTATE, ID_GET_ERC, ID_GET_NETLIST, ID_GET_TOOLS, ID_OPEN_CMP_TABLE, ID_REMAP_SYMBOLS, ID_RESCUE_CACHED, ID_RUN_CVPCB, ID_RUN_LIBRARY, ID_RUN_PCB, ID_SIM_SHOW, ID_TO_LIBVIEW, ID_UPDATE_PCB_FROM_SCH, and KiBitmap().

Referenced by SCH_EDIT_FRAME::ReCreateMenuBar().

456 {
457  wxString text;
458 
459  text = AddHotkeyName( _( "Update PCB from Schematic..." ), g_Schematic_Hokeys_Descr,
461 
462  AddMenuItem( aParentMenu,
464  text, _( "Updates PCB design with current schematic (forward annotation)." ),
465  KiBitmap( import_brd_file_xpm ) );
466 
467  // Run Pcbnew
468  AddMenuItem( aParentMenu,
469  ID_RUN_PCB,
470  _( "&Open PCB Editor" ),
471  _( "Run Pcbnew" ),
472  KiBitmap( pcbnew_xpm ) );
473 
474  aParentMenu->AppendSeparator();
475 
476  AddMenuItem( aParentMenu,
478  _( "Library &Editor" ), HELP_RUN_LIB_EDITOR,
479  KiBitmap( libedit_xpm ) );
480 
481  AddMenuItem( aParentMenu,
483  _( "Library &Browser" ), HELP_RUN_LIB_VIEWER,
484  KiBitmap( library_browse_xpm ) );
485 
486  AddMenuItem( aParentMenu,
488  _( "&Rescue Symbols..." ),
489  _( "Find old symbols in project and rename/rescue them" ),
490  KiBitmap( rescue_xpm ) );
491 
492  AddMenuItem( aParentMenu,
494  _( "Remap Symbols..." ),
495  _( "Remap legacy library symbols to symbol library table" ),
496  KiBitmap( rescue_xpm ) );
497 
498  aParentMenu->AppendSeparator();
499 
500  AddMenuItem( aParentMenu,
502  _( "&Annotate Schematic..." ), HELP_ANNOTATE,
503  KiBitmap( annotate_xpm ) );
504 
505  // ERC
506  AddMenuItem( aParentMenu,
507  ID_GET_ERC,
508  _( "Electrical Rules &Checker" ),
509  _( "Perform electrical rules check" ),
510  KiBitmap( erc_xpm ) );
511 
512  AddMenuItem( aParentMenu,
514  _( "Generate &Netlist File..." ),
515  _( "Generate netlist file" ),
516  KiBitmap( netlist_xpm ) );
517 
518  AddMenuItem( aParentMenu,
520  _( "S&ymbol Table..." ),
521  KiBitmap( spreadsheet_xpm ) );
522 
523  AddMenuItem( aParentMenu,
524  ID_GET_TOOLS,
525  _( "Generate Bill of &Materials..." ),
527  KiBitmap( bom_xpm ) );
528 
529 
530 
531  aParentMenu->AppendSeparator();
532 
533  // Run CvPcb
534  AddMenuItem( aParentMenu,
535  ID_RUN_CVPCB,
536  _( "A&ssign Footprints" ),
537  _( "Run CvPcb" ),
538  KiBitmap( cvpcb_xpm ) );
539 
540  aParentMenu->AppendSeparator();
541 
542 #ifdef KICAD_SPICE
543  // Simulator
544  AddMenuItem( aParentMenu,
545  ID_SIM_SHOW,
546  _("Simula&tor"), _( "Simulate circuit" ),
547  KiBitmap( simulator_xpm ) );
548 #endif /* KICAD_SPICE */
549 
550 }
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
Definition: id.h:66
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:78
#define HELP_RUN_LIB_VIEWER
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_RUN_LIB_EDITOR
#define HELP_GENERATE_BOM
#define HELP_ANNOTATE
struct EDA_HOTKEY_CONFIG g_Schematic_Hokeys_Descr[]
void prepareViewMenu ( wxMenu *  aParentMenu)
static

Important Note for ZOOM IN and ZOOM OUT commands from menubar: we cannot add hotkey shortcut here, because the hotkey HK_ZOOM_IN and HK_ZOOM_OUT events(default = WXK_F1 and WXK_F2) are NOT equivalent to this menu command: zoom in and out from hotkeys are equivalent to the pop up menu zoom From here, zooming is made around the screen center From hotkeys, zooming is made around the mouse cursor position (obviously not possible from the toolbar or menubar command)

in others words HK_ZOOM_IN and HK_ZOOM_OUT are NOT accelerators for Zoom in and Zoom out sub menus SO WE ADD THE NAME OF THE CORRESPONDING HOTKEY AS A COMMENT, NOT AS A SHORTCUT using in AddHotkeyName call the option "false" (not a shortcut)

Definition at line 133 of file eeschema/menubar.cpp.

References AddHotkeyName(), AddMenuItem(), g_Schematic_Hokeys_Descr, HELP_ZOOM_FIT, HELP_ZOOM_IN, HELP_ZOOM_OUT, HELP_ZOOM_REDRAW, HK_LEAVE_SHEET, HK_ZOOM_AUTO, HK_ZOOM_IN, HK_ZOOM_OUT, HK_ZOOM_REDRAW, ID_HIERARCHY, ID_POPUP_SCH_LEAVE_SHEET, ID_ZOOM_IN, ID_ZOOM_OUT, ID_ZOOM_PAGE, ID_ZOOM_REDRAW, IS_ACCELERATOR, and KiBitmap().

Referenced by SCH_EDIT_FRAME::ReCreateMenuBar().

134 {
135  wxString text;
136 
152  text = AddHotkeyName( _( "Zoom &In" ), g_Schematic_Hokeys_Descr,
153  HK_ZOOM_IN, IS_ACCELERATOR ); // add an accelerator, not a shortcut
154  AddMenuItem( aParentMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, KiBitmap( zoom_in_xpm ) );
155 
156  text = AddHotkeyName( _( "Zoom &Out" ), g_Schematic_Hokeys_Descr,
157  HK_ZOOM_OUT, IS_ACCELERATOR ); // add accelerator, not a shortcut
158  AddMenuItem( aParentMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, KiBitmap( zoom_out_xpm ) );
159 
160  text = AddHotkeyName( _( "&Fit on Screen" ), g_Schematic_Hokeys_Descr, HK_ZOOM_AUTO );
161 
162  AddMenuItem( aParentMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, KiBitmap( zoom_fit_in_page_xpm ) );
163 
164  text = AddHotkeyName( _( "&Redraw" ), g_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
165 
166  AddMenuItem( aParentMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );
167 
168  aParentMenu->AppendSeparator();
169 
170  AddMenuItem( aParentMenu,
171  ID_HIERARCHY,
172  _( "Show &Hierarchical Navigator" ),
173  _( "Navigate hierarchical sheets" ),
174  KiBitmap( hierarchy_nav_xpm ) );
175 
176  text = AddHotkeyName( _( "&Leave Sheet" ), g_Schematic_Hokeys_Descr, HK_LEAVE_SHEET );
177 
178  AddMenuItem( aParentMenu,
180  text,
181  _( "Leave Sheet" ),
182  KiBitmap( leave_sheet_xpm ) );
183 }
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
#define HELP_ZOOM_FIT
Definition: id.h:241
#define HELP_ZOOM_OUT
#define HELP_ZOOM_REDRAW
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:78
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_ZOOM_IN
struct EDA_HOTKEY_CONFIG g_Schematic_Hokeys_Descr[]