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 prepareInspectMenu (wxMenu *aParentMenu)
 
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 473 of file eeschema/menubar.cpp.

References AddHotkeyName(), AddMenuItem(), g_Schematic_Hokeys_Descr, HELP_DELETE_ITEMS, HELP_FIND, HELP_REDO, HELP_REPLACE, HELP_UNDO, HK_EDIT_COPY, HK_EDIT_CUT, HK_EDIT_PASTE, HK_FIND_ITEM, HK_FIND_REPLACE, HK_REDO, HK_UNDO, ID_FIND_ITEMS, ID_MENU_DELETE_ITEM_BUTT, ID_UPDATE_FIELDS, and KiBitmap().

Referenced by SCH_EDIT_FRAME::ReCreateMenuBar().

474 {
475  wxString text;
476 
477  // Undo
478  text = AddHotkeyName( _( "&Undo" ), g_Schematic_Hokeys_Descr, HK_UNDO );
479 
480  AddMenuItem( aParentMenu, wxID_UNDO, text, HELP_UNDO, KiBitmap( undo_xpm ) );
481 
482  // Redo
483  text = AddHotkeyName( _( "&Redo" ), g_Schematic_Hokeys_Descr, HK_REDO );
484 
485  AddMenuItem( aParentMenu, wxID_REDO, text, HELP_REDO, KiBitmap( redo_xpm ) );
486 
487  aParentMenu->AppendSeparator();
488 
489  text = AddHotkeyName( _( "&Cut" ), g_Schematic_Hokeys_Descr, HK_EDIT_CUT );
490  AddMenuItem( aParentMenu, wxID_CUT, text,
491  _( "Cuts the selected item(s) to the Clipboard" ),
492  KiBitmap( cut_xpm ) );
493 
494  text = AddHotkeyName( _( "&Copy" ), g_Schematic_Hokeys_Descr, HK_EDIT_COPY );
495  AddMenuItem( aParentMenu, wxID_COPY, text,
496  _( "Copies the selected item(s) to the Clipboard" ),
497  KiBitmap( copy_xpm ) );
498 
499  text = AddHotkeyName( _( "&Paste" ), g_Schematic_Hokeys_Descr, HK_EDIT_PASTE );
500  AddMenuItem( aParentMenu, wxID_PASTE, text,
501  _( "Pastes item(s) from the Clipboard" ),
502  KiBitmap( paste_xpm ) );
503 
504  // Delete
505  aParentMenu->AppendSeparator();
507  _( "&Delete" ), HELP_DELETE_ITEMS,
508  KiBitmap( delete_xpm ) );
509 
510  // Find
511  aParentMenu->AppendSeparator();
512  text = AddHotkeyName( _( "&Find..." ), g_Schematic_Hokeys_Descr, HK_FIND_ITEM );
513  AddMenuItem( aParentMenu, ID_FIND_ITEMS, text, HELP_FIND, KiBitmap( find_xpm ) );
514 
515  // Find/Replace
516  text = AddHotkeyName( _( "Find and Re&place..." ), g_Schematic_Hokeys_Descr,
517  HK_FIND_REPLACE );
518  AddMenuItem( aParentMenu, wxID_REPLACE, text, HELP_REPLACE,
519  KiBitmap( find_replace_xpm ) );
520 
521  aParentMenu->AppendSeparator();
522 
523  // Update field values
524  AddMenuItem( aParentMenu, ID_UPDATE_FIELDS,
525  _( "Update Field Values..." ),
526  _( "Sets symbol fields to original library values" ),
527  KiBitmap( update_fields_xpm ) );
528 }
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_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 345 of file eeschema/menubar.cpp.

References AddHotkeyName(), AddMenuItem(), g_Schematic_Hokeys_Descr, KIFACE_I::GetFileHistory(), HELP_IMPORT_FOOTPRINTS, HK_NEW, HK_OPEN, HK_PRINT, HK_SAVE, HK_SAVEAS, ID_APPEND_PROJECT, ID_BACKANNO_ITEMS, ID_GEN_COPY_SHEET_TO_CLIPBOARD, ID_GEN_EXPORT_FILE, ID_GEN_IMPORT_FILE, 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().

346 {
347  wxString text;
348 
349  // @todo: static probably not OK in multiple open projects.
350  // Open Recent submenu
351  static wxMenu* openRecentMenu;
352 
353  // Add this menu to list menu managed by m_fileHistory
354  // (the file history will be updated when adding/removing files in history
355  if( openRecentMenu )
356  Kiface().GetFileHistory().RemoveMenu( openRecentMenu );
357 
358  openRecentMenu = new wxMenu();
359 
360  Kiface().GetFileHistory().UseMenu( openRecentMenu );
361  Kiface().GetFileHistory().AddFilesToMenu( openRecentMenu );
362 
363  if( aIsOutsideProject ) // not when under a project mgr
364  {
365  text = AddHotkeyName( _( "&New..." ), g_Schematic_Hokeys_Descr, HK_NEW );
366  AddMenuItem( aParentMenu, ID_NEW_PROJECT, text,
367  _( "Clear current schematic hierarchy and start new schematic root sheet" ),
368  KiBitmap( new_document_xpm ) );
369 
370  text = AddHotkeyName( _( "&Open..." ), g_Schematic_Hokeys_Descr, HK_OPEN );
371  AddMenuItem( aParentMenu, ID_LOAD_PROJECT, text,
372  _( "Open existing schematic" ),
373  KiBitmap( open_document_xpm ) );
374 
375  AddMenuItem( aParentMenu, openRecentMenu,
376  -1, _( "Open &Recent" ),
377  _( "Open recently opened schematic" ),
378  KiBitmap( recent_xpm ) );
379 
380  aParentMenu->AppendSeparator();
381  }
382 
383  text = AddHotkeyName( _( "&Save" ), g_Schematic_Hokeys_Descr, HK_SAVE );
384  AddMenuItem( aParentMenu,
385  ID_SAVE_PROJECT, text,
386  _( "Save all sheets in schematic" ),
387  KiBitmap( save_xpm ) );
388 
389  AddMenuItem( aParentMenu,
391  _( "Save &Current Sheet" ),
392  _( "Save only current schematic sheet" ),
393  KiBitmap( save_xpm ) );
394 
395  if( aIsOutsideProject ) // not when under a project mgr
396  {
397  text = AddHotkeyName( _( "Save C&urrent Sheet As..." ),
399  AddMenuItem( aParentMenu,
401  _( "Save current schematic sheet with new name" ),
402  KiBitmap( save_as_xpm ) );
403  }
404 
405  aParentMenu->AppendSeparator();
406 
407  AddMenuItem( aParentMenu, ID_APPEND_PROJECT,
408  _( "App&end Schematic Sheet..." ),
409  _( "Import schematic sheet content from another project to current sheet" ),
410  KiBitmap( add_document_xpm ) );
411 
412  AddMenuItem( aParentMenu, ID_IMPORT_NON_KICAD_SCH,
413  _( "&Import Non KiCad Schematic File..." ),
414  _( "Import schematic file from other applications" ),
415  KiBitmap( import_document_xpm ) ); // TODO needs a different icon
416 
417  aParentMenu->AppendSeparator();
418 
419  // Import submenu
420  wxMenu* submenuImport = new wxMenu();
421 
422  AddMenuItem( submenuImport, ID_BACKANNO_ITEMS,
423  _( "&Footprint Association File..." ),
425  KiBitmap( import_footprint_names_xpm ) );
426 
427  AddMenuItem( aParentMenu, submenuImport,
429  _( "&Import" ),
430  _( "Import files" ),
431  KiBitmap( import_xpm ) );
432 
433 
434  // Export submenu
435  wxMenu* submenuExport = new wxMenu();
436 
438  _( "Drawing to C&lipboard" ),
439  _( "Export drawings to clipboard" ),
440  KiBitmap( copy_xpm ) );
441 
442  AddMenuItem( aParentMenu, submenuExport,
444  _( "E&xport" ),
445  _( "Export files" ),
446  KiBitmap( export_xpm ) );
447 
448  aParentMenu->AppendSeparator();
449 
450  // Edit page layout:
451  AddMenuItem( aParentMenu, ID_SHEET_SET,
452  _( "Page S&ettings..." ),
453  _( "Settings for sheet size and frame references" ),
454  KiBitmap( sheetset_xpm ) );
455 
456  text = AddHotkeyName( _( "&Print..." ), g_Schematic_Hokeys_Descr, HK_PRINT );
457  AddMenuItem( aParentMenu, wxID_PRINT, text,
458  _( "Print schematic sheet" ),
459  KiBitmap( print_button_xpm ) );
460 
461  AddMenuItem( aParentMenu, ID_GEN_PLOT_SCHEMATIC, _( "P&lot..." ),
462  _( "Plot schematic sheet in PostScript, PDF, SVG, DXF or HPGL format" ),
463  KiBitmap( plot_xpm ) );
464 
465  aParentMenu->AppendSeparator();
466 
467  // Quit
468  AddMenuItem( aParentMenu, wxID_EXIT, _( "&Exit" ), _( "Close Eeschema" ),
469  KiBitmap( exit_xpm ) );
470 }
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
#define HELP_IMPORT_FOOTPRINTS
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 632 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().

633 {
634  AddMenuItem( aParentMenu,
635  wxID_HELP,
636  _( "Eeschema &Manual" ),
637  _( "Open Eeschema Manual" ),
638  KiBitmap( online_help_xpm ) );
639 
640  AddMenuItem( aParentMenu,
641  wxID_INDEX,
642  _( "&Getting Started in KiCad" ),
643  _( "Open \"Getting Started in KiCad\" guide for beginners" ),
644  KiBitmap( help_xpm ) );
645 
646  wxString text = AddHotkeyName( _( "&List Hotkeys..." ), g_Eeschema_Hokeys_Descr, HK_HELP );
647  AddMenuItem( aParentMenu,
649  text,
650  _( "Displays current hotkeys table and corresponding commands" ),
651  KiBitmap( hotkeys_xpm ) );
652 
653  aParentMenu->AppendSeparator();
654  AddMenuItem( aParentMenu, ID_HELP_GET_INVOLVED,
655  _( "Get &Involved" ),
656  _( "Contribute to KiCad (opens a web browser)" ),
657  KiBitmap( info_xpm ) );
658 
659  aParentMenu->AppendSeparator();
660  AddMenuItem( aParentMenu,
661  wxID_ABOUT,
662  _( "&About KiCad" ),
663  _( "About KiCad" ),
664  KiBitmap( about_xpm ) );
665 }
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 prepareInspectMenu ( wxMenu *  aParentMenu)
static

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

References AddMenuItem(), ID_GET_ERC, and KiBitmap().

Referenced by SCH_EDIT_FRAME::ReCreateMenuBar().

532 {
533  AddMenuItem( aParentMenu, ID_GET_ERC,
534  _( "Electrical Rules &Checker" ),
535  _( "Perform electrical rules check" ),
536  KiBitmap( erc_xpm ) );
537 }
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
void preparePlaceMenu ( wxMenu *  aParentMenu)
static

Definition at line 235 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_MENU_ADD_IMAGE_BUTT, ID_MENU_BUS_BUTT, ID_MENU_BUSTOBUS_ENTRY_BUTT, ID_MENU_GLABEL_BUTT, ID_MENU_HIERLABEL_BUTT, ID_MENU_IMPORT_HLABEL_BUTT, ID_MENU_JUNCTION_BUTT, ID_MENU_LABEL_BUTT, ID_MENU_LINE_COMMENT_BUTT, ID_MENU_NOCONN_BUTT, ID_MENU_PLACE_COMPONENT, ID_MENU_PLACE_POWER_BUTT, ID_MENU_SHEET_PIN_BUTT, ID_MENU_SHEET_SYMBOL_BUTT, ID_MENU_TEXT_COMMENT_BUTT, ID_MENU_WIRE_BUTT, ID_MENU_WIRETOBUS_ENTRY_BUTT, IS_ACCELERATOR, KiBitmap(), and text_xpm.

Referenced by SCH_EDIT_FRAME::ReCreateMenuBar().

236 {
237  wxString text;
238 
239  text = AddHotkeyName( _( "&Symbol" ), g_Schematic_Hokeys_Descr,
240  HK_ADD_NEW_COMPONENT, IS_ACCELERATOR ); // add an accelerator, not a shortcut
241  AddMenuItem( aParentMenu, ID_MENU_PLACE_COMPONENT, text,
243  KiBitmap( add_component_xpm ) );
244 
245  text = AddHotkeyName( _( "&Power Port" ), g_Schematic_Hokeys_Descr,
246  HK_ADD_NEW_POWER, IS_ACCELERATOR ); // add an accelerator, not a shortcut
247  AddMenuItem( aParentMenu, ID_MENU_PLACE_POWER_BUTT, text,
249  KiBitmap( add_power_xpm ) );
250 
251  text = AddHotkeyName( _( "&Wire" ), g_Schematic_Hokeys_Descr,
252  HK_BEGIN_WIRE, IS_ACCELERATOR ); // add an accelerator, not a shortcut
253  AddMenuItem( aParentMenu, ID_MENU_WIRE_BUTT, text,
255  KiBitmap( add_line_xpm ) );
256 
257  text = AddHotkeyName( _( "&Bus" ), g_Schematic_Hokeys_Descr,
258  HK_BEGIN_BUS, IS_ACCELERATOR ); // add an accelerator, not a shortcut
259  AddMenuItem( aParentMenu, ID_MENU_BUS_BUTT, text,
261  KiBitmap( add_bus_xpm ) );
262 
263  text = AddHotkeyName( _( "Wire to Bus &Entry" ), g_Schematic_Hokeys_Descr,
264  HK_ADD_WIRE_ENTRY, IS_ACCELERATOR ); // add an accelerator, not a shortcut
265  AddMenuItem( aParentMenu, ID_MENU_WIRETOBUS_ENTRY_BUTT, text,
267  KiBitmap( add_line2bus_xpm ) );
268 
269  text = AddHotkeyName( _( "Bus &to Bus Entry" ), g_Schematic_Hokeys_Descr,
270  HK_ADD_BUS_ENTRY, IS_ACCELERATOR ); // add an accelerator, not a shortcut
271  AddMenuItem( aParentMenu, ID_MENU_BUSTOBUS_ENTRY_BUTT, text,
273  KiBitmap( add_bus2bus_xpm ) );
274 
275  text = AddHotkeyName( _( "&No Connect Flag" ), g_Schematic_Hokeys_Descr,
276  HK_ADD_NOCONN_FLAG, IS_ACCELERATOR ); // add an accelerator, not a shortcut
277  AddMenuItem( aParentMenu, ID_MENU_NOCONN_BUTT, text, HELP_PLACE_NC_FLAG, KiBitmap( noconn_xpm ) );
278 
279  text = AddHotkeyName( _( "&Junction" ), g_Schematic_Hokeys_Descr,
280  HK_ADD_JUNCTION, IS_ACCELERATOR ); // add an accelerator, not a shortcut
281  AddMenuItem( aParentMenu, ID_MENU_JUNCTION_BUTT, text,
283  KiBitmap( add_junction_xpm ) );
284 
285  text = AddHotkeyName( _( "&Label" ), g_Schematic_Hokeys_Descr,
286  HK_ADD_LABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
287  AddMenuItem( aParentMenu, ID_MENU_LABEL_BUTT, text,
289  KiBitmap( add_line_label_xpm ) );
290 
291  text = AddHotkeyName( _( "Gl&obal Label" ), g_Schematic_Hokeys_Descr,
292  HK_ADD_GLABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
293  AddMenuItem( aParentMenu, ID_MENU_GLABEL_BUTT, text,
295  KiBitmap( add_glabel_xpm ) );
296 
297  aParentMenu->AppendSeparator();
298 
299  text = AddHotkeyName( _( "&Hierarchical Label" ), g_Schematic_Hokeys_Descr,
300  HK_ADD_HLABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
301  AddMenuItem( aParentMenu, ID_MENU_HIERLABEL_BUTT,
302  text, HELP_PLACE_HIER_LABEL,
303  KiBitmap( add_hierarchical_label_xpm ) );
304 
305 
306  text = AddHotkeyName( _( "Hierar&chical Sheet" ), g_Schematic_Hokeys_Descr,
307  HK_ADD_HIER_SHEET, IS_ACCELERATOR ); // add an accelerator, not a shortcut
308  AddMenuItem( aParentMenu, ID_MENU_SHEET_SYMBOL_BUTT, text,
310  KiBitmap( add_hierarchical_subsheet_xpm ) );
311 
312  AddMenuItem( aParentMenu,
314  _( "I&mport Hierarchical Label" ),
316  KiBitmap( import_hierarchical_label_xpm ) );
317 
318  AddMenuItem( aParentMenu,
320  _( "Hierarchical Pi&n to Sheet" ),
322  KiBitmap( add_hierar_pin_xpm ) );
323 
324  aParentMenu->AppendSeparator();
325 
326  text = AddHotkeyName( _( "Graphic Pol&yline" ), g_Schematic_Hokeys_Descr,
327  HK_ADD_GRAPHIC_POLYLINE, IS_ACCELERATOR ); // add an accelerator, not a shortcut
328  AddMenuItem( aParentMenu, ID_MENU_LINE_COMMENT_BUTT, text,
330  KiBitmap( add_dashed_line_xpm ) );
331 
332  text = AddHotkeyName( _( "&Graphic Text" ), g_Schematic_Hokeys_Descr,
333  HK_ADD_GRAPHIC_TEXT, IS_ACCELERATOR ); // add an accelerator, not a shortcut
334  AddMenuItem( aParentMenu, ID_MENU_TEXT_COMMENT_BUTT, text,
336  KiBitmap( text_xpm ) );
337 
338  // Add graphic image
339  AddMenuItem( aParentMenu, ID_MENU_ADD_IMAGE_BUTT, _( "&Image" ),
341  KiBitmap( image_xpm ) );
342 }
#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 668 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().

669 {
670  // Path configuration edit dialog.
671  AddMenuItem( aParentMenu,
673  _( "Configure &Paths..." ),
674  _( "Edit path configuration environment variables" ),
675  KiBitmap( path_xpm ) );
676 
677  // Library
678  AddMenuItem( aParentMenu,
680  _( "Manage Symbol Libraries..." ),
681  _( "Edit the global and project symbol library lists" ),
682  KiBitmap( library_table_xpm ) );
683 
684  // Options (Preferences on WXMAC)
685 #ifdef __WXMAC__
686  aParentMenu->Append( wxID_PREFERENCES );
687 #else
688  AddMenuItem( aParentMenu,
689  wxID_PREFERENCES,
690  _( "General &Options" ),
691  _( "Edit Eeschema preferences" ),
692  KiBitmap( preference_xpm ) );
693 #endif // __WXMAC__
694 
695  aParentMenu->AppendSeparator();
696 
697  // Icons options submenu
698  aFrame->AddMenuIconsOptions( aParentMenu );
699 
700  aParentMenu->AppendSeparator();
701 
702  // Language submenu
703  Pgm().AddMenuLanguageList( aParentMenu );
704 
705  // Hotkeys submenu
706  wxMenu* HotkeySubmenu = new wxMenu;
708  _( "E&xport Hotkeys..." ),
709  _( "Export current hotkeys into configuration file" ),
710  KiBitmap( hotkeys_export_xpm ) );
711 
712  // Reload hotkey file
714  _( "&Import Hotkeys..." ),
715  _( "Load existing hotkey configuration file" ),
716  KiBitmap( hotkeys_import_xpm ) );
717 
718  AddMenuItem( aParentMenu, HotkeySubmenu, -1,
719  _( "&Hotkeys Options" ),
720  _( "Edit hotkeys configuration and preferences" ),
721  KiBitmap( hotkeys_xpm ) );
722 
723 
724  aParentMenu->AppendSeparator();
725 
726  // Import/export
727  AddMenuItem( aParentMenu,
729  _( "&Save Project File..." ),
730  _( "Save project preferences into a project file" ),
731  KiBitmap( save_setup_xpm ) );
732 
733  AddMenuItem( aParentMenu,
735  _( "Load P&roject File..." ),
736  _( "Load project preferences from a project file" ),
737  KiBitmap( import_setup_xpm ) );
738 }
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:831
void prepareToolsMenu ( wxMenu *  aParentMenu)
static

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

References AddHotkeyName(), AddMenuItem(), g_Schematic_Hokeys_Descr, HELP_ANNOTATE, HELP_GENERATE_BOM, HELP_RUN_LIB_EDITOR, HK_UPDATE_PCB_FROM_SCH, ID_EDIT_COMPONENTS_TO_SYMBOLS_LIB_ID, ID_GET_ANNOTATE, 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_UPDATE_PCB_FROM_SCH, and KiBitmap().

Referenced by SCH_EDIT_FRAME::ReCreateMenuBar().

541 {
542  wxString text;
543 
544  text = AddHotkeyName( _( "Update PCB from Schematic..." ), g_Schematic_Hokeys_Descr,
546 
547  AddMenuItem( aParentMenu,
549  text, _( "Updates PCB design with current schematic (forward annotation)." ),
550  KiBitmap( import_brd_file_xpm ) );
551 
552  // Run Pcbnew
553  AddMenuItem( aParentMenu,
554  ID_RUN_PCB,
555  _( "&Open PCB Editor" ),
556  _( "Run Pcbnew" ),
557  KiBitmap( pcbnew_xpm ) );
558 
559  aParentMenu->AppendSeparator();
560 
561  AddMenuItem( aParentMenu,
563  _( "Symbol Library &Editor" ), HELP_RUN_LIB_EDITOR,
564  KiBitmap( libedit_xpm ) );
565 
566  AddMenuItem( aParentMenu,
568  _( "&Rescue Symbols..." ),
569  _( "Find old symbols in project and rename/rescue them" ),
570  KiBitmap( rescue_xpm ) );
571 
572  AddMenuItem( aParentMenu,
574  _( "Remap Symbols..." ),
575  _( "Remap legacy library symbols to symbol library table" ),
576  KiBitmap( rescue_xpm ) );
577 
578  aParentMenu->AppendSeparator();
579 
580  AddMenuItem( aParentMenu,
582  _( "Edit Symbol Field&s..." ),
583  KiBitmap( spreadsheet_xpm ) );
584 
585  AddMenuItem( aParentMenu,
587  _( "Edit Symbol Library References..." ),
588  _( "Edit links between schematic symbols and library symbols" ),
589  KiBitmap( edit_cmp_symb_links_xpm ) );
590 
591  aParentMenu->AppendSeparator();
592 
593  AddMenuItem( aParentMenu,
595  _( "&Annotate Schematic..." ), HELP_ANNOTATE,
596  KiBitmap( annotate_xpm ) );
597 
598  AddMenuItem( aParentMenu,
600  _( "Generate &Netlist File..." ),
601  _( "Generate netlist file" ),
602  KiBitmap( netlist_xpm ) );
603 
604  AddMenuItem( aParentMenu,
605  ID_GET_TOOLS,
606  _( "Generate Bill of &Materials..." ),
608  KiBitmap( bom_xpm ) );
609 
610  aParentMenu->AppendSeparator();
611 
612  // Run CvPcb
613  AddMenuItem( aParentMenu,
614  ID_RUN_CVPCB,
615  _( "A&ssign Footprints..." ),
616  _( "Assign PCB footprints to schematic symbols" ),
617  KiBitmap( cvpcb_xpm ) );
618 
619  aParentMenu->AppendSeparator();
620 
621 #ifdef KICAD_SPICE
622  // Simulator
623  AddMenuItem( aParentMenu,
624  ID_SIM_SHOW,
625  _("Simula&tor"), _( "Simulate circuit" ),
626  KiBitmap( simulator_xpm ) );
627 #endif /* KICAD_SPICE */
628 
629 }
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
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 128 of file eeschema/menubar.cpp.

References AddHotkeyName(), AddMenuItem(), g_Eeschema_Hokeys_Descr, g_Schematic_Hokeys_Descr, HELP_RUN_LIB_VIEWER, 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, HK_ZOOM_SELECTION, ID_HIERARCHY, ID_MENU_ZOOM_SELECTION, ID_POPUP_SCH_LEAVE_SHEET, ID_TB_OPTIONS_HIDDEN_PINS, ID_TB_OPTIONS_SELECT_CURSOR, ID_TB_OPTIONS_SELECT_UNIT_INCH, ID_TB_OPTIONS_SELECT_UNIT_MM, ID_TB_OPTIONS_SHOW_GRID, ID_TO_LIBVIEW, ID_ZOOM_IN, ID_ZOOM_OUT, ID_ZOOM_PAGE, ID_ZOOM_REDRAW, IS_ACCELERATOR, and KiBitmap().

Referenced by SCH_EDIT_FRAME::ReCreateMenuBar().

129 {
130  wxString text;
131 
132  AddMenuItem( aParentMenu,
134  _( "&Library Browser" ), HELP_RUN_LIB_VIEWER,
135  KiBitmap( library_browse_xpm ) );
136 
137  AddMenuItem( aParentMenu,
138  ID_HIERARCHY,
139  _( "Show &Hierarchical Navigator" ),
140  _( "Navigate schematic hierarchy" ),
141  KiBitmap( hierarchy_nav_xpm ) );
142 
143  text = AddHotkeyName( _( "&Leave Sheet" ), g_Schematic_Hokeys_Descr, HK_LEAVE_SHEET );
144  AddMenuItem( aParentMenu,
146  _( "Leave Sheet" ),
147  KiBitmap( leave_sheet_xpm ) );
148 
149  aParentMenu->AppendSeparator();
150 
166  text = AddHotkeyName( _( "Zoom &In" ), g_Schematic_Hokeys_Descr,
167  HK_ZOOM_IN, IS_ACCELERATOR ); // add an accelerator, not a shortcut
168  AddMenuItem( aParentMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, KiBitmap( zoom_in_xpm ) );
169 
170  text = AddHotkeyName( _( "Zoom &Out" ), g_Schematic_Hokeys_Descr,
171  HK_ZOOM_OUT, IS_ACCELERATOR ); // add accelerator, not a shortcut
172  AddMenuItem( aParentMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, KiBitmap( zoom_out_xpm ) );
173 
174  text = AddHotkeyName( _( "&Zoom to Fit" ), g_Schematic_Hokeys_Descr, HK_ZOOM_AUTO );
175 
176  AddMenuItem( aParentMenu, ID_ZOOM_PAGE, text,
177  HELP_ZOOM_FIT, KiBitmap( zoom_fit_in_page_xpm ) );
178 
179  text = AddHotkeyName( _( "Zoom to Selection" ), g_Eeschema_Hokeys_Descr, HK_ZOOM_SELECTION );
180 
181  AddMenuItem( aParentMenu, ID_MENU_ZOOM_SELECTION, text, KiBitmap( zoom_area_xpm ) );
182 
183  text = AddHotkeyName( _( "&Redraw" ), g_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
184 
185  AddMenuItem( aParentMenu, ID_ZOOM_REDRAW, text,
186  HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );
187 
188  aParentMenu->AppendSeparator();
189 
190  AddMenuItem( aParentMenu, ID_TB_OPTIONS_SHOW_GRID,
191  _( "Show &Grid" ), wxEmptyString,
192  KiBitmap( grid_xpm ), wxITEM_CHECK );
193 
194  // Units submenu
195  wxMenu* unitsSubMenu = new wxMenu;
197  _( "&Imperial" ), _( "Use imperial units" ),
198  KiBitmap( unit_inch_xpm ), wxITEM_RADIO );
199 
201  _( "&Metric" ), _( "Use metric units" ),
202  KiBitmap( unit_mm_xpm ), wxITEM_RADIO );
203 
204  AddMenuItem( aParentMenu, unitsSubMenu,
205  -1, _( "&Units" ),
206  _( "Select which units are displayed" ),
207  KiBitmap( unit_mm_xpm ) );
208 
209 
210 #ifndef __APPLE__
212  _( "Full Window Crosshair" ),
213  _( "Change cursor shape" ),
214  KiBitmap( cursor_shape_xpm ), wxITEM_CHECK );
215 #else
217  _( "Full Window Crosshair" ),
218  _( "Change cursor shape (not supported in Legacy graphics)" ),
219  KiBitmap( cursor_shape_xpm ), wxITEM_CHECK );
220 #endif
221 
222  aParentMenu->AppendSeparator();
223 
225  _( "Show hidden pins" ),
226  wxEmptyString,
227  KiBitmap( hidden_pin_xpm ), wxITEM_CHECK );
228 
229 #ifdef __APPLE__
230  aParentMenu->AppendSeparator();
231 #endif
232 }
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:242
#define HELP_ZOOM_OUT
EDA_DRAW_FRAME::OnSelectGrid ID_TB_OPTIONS_SELECT_UNIT_INCH
Definition: draw_frame.cpp:123
#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
struct EDA_HOTKEY_CONFIG g_Eeschema_Hokeys_Descr[]
#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_ZOOM_IN
struct EDA_HOTKEY_CONFIG g_Schematic_Hokeys_Descr[]