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 452 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().

453 {
454  wxString text;
455 
456  // Undo
457  text = AddHotkeyName( _( "&Undo" ), g_Schematic_Hokeys_Descr, HK_UNDO );
458 
459  AddMenuItem( aParentMenu, wxID_UNDO, text, HELP_UNDO, KiBitmap( undo_xpm ) );
460 
461  // Redo
462  text = AddHotkeyName( _( "&Redo" ), g_Schematic_Hokeys_Descr, HK_REDO );
463 
464  AddMenuItem( aParentMenu, wxID_REDO, text, HELP_REDO, KiBitmap( redo_xpm ) );
465 
466  aParentMenu->AppendSeparator();
467 
468  text = AddHotkeyName( _( "&Cut" ), g_Schematic_Hokeys_Descr, HK_EDIT_CUT );
469  AddMenuItem( aParentMenu, wxID_CUT, text,
470  _( "Cuts the selected item(s) to the Clipboard" ),
471  KiBitmap( cut_xpm ) );
472 
473  text = AddHotkeyName( _( "&Copy" ), g_Schematic_Hokeys_Descr, HK_EDIT_COPY );
474  AddMenuItem( aParentMenu, wxID_COPY, text,
475  _( "Copies the selected item(s) to the Clipboard" ),
476  KiBitmap( copy_xpm ) );
477 
478  text = AddHotkeyName( _( "&Paste" ), g_Schematic_Hokeys_Descr, HK_EDIT_PASTE );
479  AddMenuItem( aParentMenu, wxID_PASTE, text,
480  _( "Pastes item(s) from the Clipboard" ),
481  KiBitmap( paste_xpm ) );
482 
483  // Delete
484  aParentMenu->AppendSeparator();
486  _( "&Delete" ), HELP_DELETE_ITEMS,
487  KiBitmap( delete_xpm ) );
488 
489  // Find
490  aParentMenu->AppendSeparator();
491  text = AddHotkeyName( _( "&Find..." ), g_Schematic_Hokeys_Descr, HK_FIND_ITEM );
492  AddMenuItem( aParentMenu, ID_FIND_ITEMS, text, HELP_FIND, KiBitmap( find_xpm ) );
493 
494  // Find/Replace
495  text = AddHotkeyName( _( "Find and Re&place..." ), g_Schematic_Hokeys_Descr,
496  HK_FIND_REPLACE );
497  AddMenuItem( aParentMenu, wxID_REPLACE, text, HELP_REPLACE,
498  KiBitmap( find_replace_xpm ) );
499 
500  aParentMenu->AppendSeparator();
501 
502  // Update field values
503  AddMenuItem( aParentMenu, ID_UPDATE_FIELDS,
504  _( "Update Fields from Library..." ),
505  _( "Sets symbol fields to original library values" ),
506  KiBitmap( update_fields_xpm ) );
507 }
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:223
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
#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 341 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().

342 {
343  wxString text;
344 
345  // @todo: static probably not OK in multiple open projects.
346  // Open Recent submenu
347  static wxMenu* openRecentMenu;
348 
349  // Add this menu to list menu managed by m_fileHistory
350  // (the file history will be updated when adding/removing files in history
351  if( openRecentMenu )
352  Kiface().GetFileHistory().RemoveMenu( openRecentMenu );
353 
354  openRecentMenu = new wxMenu();
355 
356  Kiface().GetFileHistory().UseMenu( openRecentMenu );
357  Kiface().GetFileHistory().AddFilesToMenu( openRecentMenu );
358 
359  if( aIsOutsideProject ) // not when under a project mgr
360  {
361  text = AddHotkeyName( _( "&New..." ), g_Schematic_Hokeys_Descr, HK_NEW );
362  AddMenuItem( aParentMenu, ID_NEW_PROJECT, text,
363  _( "Start new schematic root sheet" ),
364  KiBitmap( new_document_xpm ) );
365 
366  text = AddHotkeyName( _( "&Open..." ), g_Schematic_Hokeys_Descr, HK_OPEN );
367  AddMenuItem( aParentMenu, ID_LOAD_PROJECT, text,
368  _( "Open existing schematic" ),
369  KiBitmap( open_document_xpm ) );
370 
371  AddMenuItem( aParentMenu, openRecentMenu, -1, _( "Open &Recent" ),
372  _( "Open recently opened schematic" ),
373  KiBitmap( recent_xpm ) );
374 
375  aParentMenu->AppendSeparator();
376  }
377 
378  text = AddHotkeyName( _( "&Save" ), g_Schematic_Hokeys_Descr, HK_SAVE );
379  AddMenuItem( aParentMenu, ID_SAVE_PROJECT, text,
380  _( "Save changes" ),
381  KiBitmap( save_xpm ) );
382 
383  AddMenuItem( aParentMenu, ID_UPDATE_ONE_SHEET, _( "Save &Current Sheet" ),
384  _( "Save only the current sheet" ),
385  KiBitmap( save_xpm ) );
386 
387  text = AddHotkeyName( _( "Save C&urrent Sheet As..." ), g_Schematic_Hokeys_Descr, HK_SAVEAS );
388  AddMenuItem( aParentMenu, ID_SAVE_ONE_SHEET_UNDER_NEW_NAME, text,
389  _( "Save a copy of the current sheet" ),
390  KiBitmap( save_as_xpm ) );
391 
392  aParentMenu->AppendSeparator();
393 
394  AddMenuItem( aParentMenu, ID_APPEND_PROJECT, _( "App&end Schematic Sheet Content..." ),
395  _( "Append schematic sheet content from another project to the current sheet" ),
396  KiBitmap( add_document_xpm ) );
397 
398  AddMenuItem( aParentMenu, ID_IMPORT_NON_KICAD_SCH, _( "&Import Non KiCad Schematic..." ),
399  _( "Replace current schematic sheet with one imported from another application" ),
400  KiBitmap( import_document_xpm ) ); // TODO needs a different icon
401 
402  aParentMenu->AppendSeparator();
403 
404  // Import submenu
405  wxMenu* submenuImport = new wxMenu();
406 
407  AddMenuItem( submenuImport, ID_BACKANNO_ITEMS, _( "&Footprint Association File..." ),
409  KiBitmap( import_footprint_names_xpm ) );
410 
411  AddMenuItem( aParentMenu, submenuImport, ID_GEN_IMPORT_FILE, _( "&Import" ),
412  _( "Import files" ),
413  KiBitmap( import_xpm ) );
414 
415 
416  // Export submenu
417  wxMenu* submenuExport = new wxMenu();
418 
419  AddMenuItem( submenuExport, ID_GEN_COPY_SHEET_TO_CLIPBOARD, _( "Drawing to C&lipboard" ),
420  _( "Export drawings to clipboard" ),
421  KiBitmap( copy_xpm ) );
422 
423  AddMenuItem( aParentMenu, submenuExport, ID_GEN_EXPORT_FILE, _( "E&xport" ),
424  _( "Export files" ),
425  KiBitmap( export_xpm ) );
426 
427  aParentMenu->AppendSeparator();
428 
429  // Edit page layout:
430  AddMenuItem( aParentMenu, ID_SHEET_SET, _( "Page S&ettings..." ),
431  _( "Settings for sheet size and frame references" ),
432  KiBitmap( sheetset_xpm ) );
433 
434  text = AddHotkeyName( _( "&Print..." ), g_Schematic_Hokeys_Descr, HK_PRINT );
435  AddMenuItem( aParentMenu, wxID_PRINT, text,
436  _( "Print schematic sheet" ),
437  KiBitmap( print_button_xpm ) );
438 
439  AddMenuItem( aParentMenu, ID_GEN_PLOT_SCHEMATIC, _( "P&lot..." ),
440  _( "Plot schematic sheet in PostScript, PDF, SVG, DXF or HPGL format" ),
441  KiBitmap( plot_xpm ) );
442 
443  aParentMenu->AppendSeparator();
444 
445  // Quit
446  AddMenuItem( aParentMenu, wxID_EXIT, _( "&Exit" ),
447  _( "Close Eeschema" ),
448  KiBitmap( exit_xpm ) );
449 }
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:223
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
#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) ...
FILE_HISTORY & GetFileHistory()
Definition: kiface_i.h:123
struct EDA_HOTKEY_CONFIG g_Schematic_Hokeys_Descr[]
void prepareHelpMenu ( wxMenu *  aParentMenu)
static

Definition at line 593 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().

594 {
595  AddMenuItem( aParentMenu, wxID_HELP, _( "Eeschema &Manual" ),
596  _( "Open Eeschema Manual" ),
597  KiBitmap( online_help_xpm ) );
598 
599  AddMenuItem( aParentMenu, wxID_INDEX, _( "&Getting Started in KiCad" ),
600  _( "Open \"Getting Started in KiCad\" guide for beginners" ),
601  KiBitmap( help_xpm ) );
602 
603  wxString text = AddHotkeyName( _( "&List Hotkeys..." ), g_Eeschema_Hokeys_Descr, HK_HELP );
605  _( "Displays current hotkeys table and corresponding commands" ),
606  KiBitmap( hotkeys_xpm ) );
607 
608  aParentMenu->AppendSeparator();
609  AddMenuItem( aParentMenu, ID_HELP_GET_INVOLVED, _( "Get &Involved" ),
610  _( "Contribute to KiCad (opens a web browser)" ),
611  KiBitmap( info_xpm ) );
612 
613  aParentMenu->AppendSeparator();
614  AddMenuItem( aParentMenu, wxID_ABOUT, _( "&About KiCad" ), KiBitmap( about_xpm ) );
615 }
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:223
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
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 510 of file eeschema/menubar.cpp.

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

Referenced by SCH_EDIT_FRAME::ReCreateMenuBar().

511 {
512  AddMenuItem( aParentMenu, ID_GET_ERC,
513  _( "Electrical Rules &Checker" ),
514  _( "Perform electrical rules check" ),
515  KiBitmap( erc_xpm ) );
516 }
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:223
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
void preparePlaceMenu ( wxMenu *  aParentMenu)
static

Definition at line 231 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().

232 {
233  wxString text;
234 
235  text = AddHotkeyName( _( "&Symbol" ), g_Schematic_Hokeys_Descr,
236  HK_ADD_NEW_COMPONENT, IS_ACCELERATOR ); // add an accelerator, not a shortcut
237  AddMenuItem( aParentMenu, ID_MENU_PLACE_COMPONENT, text,
239  KiBitmap( add_component_xpm ) );
240 
241  text = AddHotkeyName( _( "&Power Port" ), g_Schematic_Hokeys_Descr,
242  HK_ADD_NEW_POWER, IS_ACCELERATOR ); // add an accelerator, not a shortcut
243  AddMenuItem( aParentMenu, ID_MENU_PLACE_POWER_BUTT, text,
245  KiBitmap( add_power_xpm ) );
246 
247  text = AddHotkeyName( _( "&Wire" ), g_Schematic_Hokeys_Descr,
248  HK_BEGIN_WIRE, IS_ACCELERATOR ); // add an accelerator, not a shortcut
249  AddMenuItem( aParentMenu, ID_MENU_WIRE_BUTT, text,
251  KiBitmap( add_line_xpm ) );
252 
253  text = AddHotkeyName( _( "&Bus" ), g_Schematic_Hokeys_Descr,
254  HK_BEGIN_BUS, IS_ACCELERATOR ); // add an accelerator, not a shortcut
255  AddMenuItem( aParentMenu, ID_MENU_BUS_BUTT, text,
257  KiBitmap( add_bus_xpm ) );
258 
259  text = AddHotkeyName( _( "Wire to Bus &Entry" ), g_Schematic_Hokeys_Descr,
260  HK_ADD_WIRE_ENTRY, IS_ACCELERATOR ); // add an accelerator, not a shortcut
261  AddMenuItem( aParentMenu, ID_MENU_WIRETOBUS_ENTRY_BUTT, text,
263  KiBitmap( add_line2bus_xpm ) );
264 
265  text = AddHotkeyName( _( "Bus &to Bus Entry" ), g_Schematic_Hokeys_Descr,
266  HK_ADD_BUS_ENTRY, IS_ACCELERATOR ); // add an accelerator, not a shortcut
267  AddMenuItem( aParentMenu, ID_MENU_BUSTOBUS_ENTRY_BUTT, text,
269  KiBitmap( add_bus2bus_xpm ) );
270 
271  text = AddHotkeyName( _( "&No Connect Flag" ), g_Schematic_Hokeys_Descr,
272  HK_ADD_NOCONN_FLAG, IS_ACCELERATOR ); // add an accelerator, not a shortcut
273  AddMenuItem( aParentMenu, ID_MENU_NOCONN_BUTT, text, HELP_PLACE_NC_FLAG, KiBitmap( noconn_xpm ) );
274 
275  text = AddHotkeyName( _( "&Junction" ), g_Schematic_Hokeys_Descr,
276  HK_ADD_JUNCTION, IS_ACCELERATOR ); // add an accelerator, not a shortcut
277  AddMenuItem( aParentMenu, ID_MENU_JUNCTION_BUTT, text,
279  KiBitmap( add_junction_xpm ) );
280 
281  text = AddHotkeyName( _( "&Label" ), g_Schematic_Hokeys_Descr,
282  HK_ADD_LABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
283  AddMenuItem( aParentMenu, ID_MENU_LABEL_BUTT, text,
285  KiBitmap( add_line_label_xpm ) );
286 
287  text = AddHotkeyName( _( "Gl&obal Label" ), g_Schematic_Hokeys_Descr,
288  HK_ADD_GLABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
289  AddMenuItem( aParentMenu, ID_MENU_GLABEL_BUTT, text,
291  KiBitmap( add_glabel_xpm ) );
292 
293  aParentMenu->AppendSeparator();
294 
295  text = AddHotkeyName( _( "&Hierarchical Label" ), g_Schematic_Hokeys_Descr,
296  HK_ADD_HLABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
297  AddMenuItem( aParentMenu, ID_MENU_HIERLABEL_BUTT,
298  text, HELP_PLACE_HIER_LABEL,
299  KiBitmap( add_hierarchical_label_xpm ) );
300 
301 
302  text = AddHotkeyName( _( "Hierar&chical Sheet" ), g_Schematic_Hokeys_Descr,
303  HK_ADD_HIER_SHEET, IS_ACCELERATOR ); // add an accelerator, not a shortcut
304  AddMenuItem( aParentMenu, ID_MENU_SHEET_SYMBOL_BUTT, text,
306  KiBitmap( add_hierarchical_subsheet_xpm ) );
307 
308  AddMenuItem( aParentMenu,
310  _( "I&mport Hierarchical Label" ),
312  KiBitmap( import_hierarchical_label_xpm ) );
313 
314  AddMenuItem( aParentMenu,
316  _( "Hierarchical Pi&n to Sheet" ),
318  KiBitmap( add_hierar_pin_xpm ) );
319 
320  aParentMenu->AppendSeparator();
321 
322  text = AddHotkeyName( _( "Graphic Pol&yline" ), g_Schematic_Hokeys_Descr,
323  HK_ADD_GRAPHIC_POLYLINE, IS_ACCELERATOR ); // add an accelerator, not a shortcut
324  AddMenuItem( aParentMenu, ID_MENU_LINE_COMMENT_BUTT, text,
326  KiBitmap( add_dashed_line_xpm ) );
327 
328  text = AddHotkeyName( _( "&Graphic Text" ), g_Schematic_Hokeys_Descr,
329  HK_ADD_GRAPHIC_TEXT, IS_ACCELERATOR ); // add an accelerator, not a shortcut
330  AddMenuItem( aParentMenu, ID_MENU_TEXT_COMMENT_BUTT, text,
332  KiBitmap( text_xpm ) );
333 
334  // Add graphic image
335  AddMenuItem( aParentMenu, ID_MENU_ADD_IMAGE_BUTT, _( "&Image" ),
337  KiBitmap( image_xpm ) );
338 }
#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:223
#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)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
#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 618 of file eeschema/menubar.cpp.

References AddHotkeyName(), AddMenuItem(), PGM_BASE::AddMenuLanguageList(), g_Eeschema_Hokeys_Descr, HK_CANVAS_CAIRO, HK_CANVAS_OPENGL, ID_CONFIG_READ, ID_CONFIG_SAVE, ID_EDIT_SYM_LIB_TABLE, ID_MENU_CANVAS_CAIRO, ID_MENU_CANVAS_OPENGL, ID_PREFERENCES_CONFIGURE_PATHS, KiBitmap(), and Pgm().

Referenced by SCH_EDIT_FRAME::ReCreateMenuBar().

619 {
620  // Path configuration edit dialog.
621  AddMenuItem( aParentMenu, ID_PREFERENCES_CONFIGURE_PATHS, _( "Configure Pa&ths..." ),
622  _( "Edit path configuration environment variables" ),
623  KiBitmap( path_xpm ) );
624 
625  // Library
626  AddMenuItem( aParentMenu, ID_EDIT_SYM_LIB_TABLE, _( "Manage Symbol Libraries..." ),
627  _( "Edit the global and project symbol library lists" ),
628  KiBitmap( library_table_xpm ) );
629 
630  // Options (Preferences on WXMAC)
631  AddMenuItem( aParentMenu, wxID_PREFERENCES, _( "Preferences..." ),
632  _( "Show preferences for all open tools" ),
633  KiBitmap( preference_xpm ) );
634 
635  aParentMenu->AppendSeparator();
636 
637  // Language submenu
638  Pgm().AddMenuLanguageList( aParentMenu );
639 
640  aParentMenu->AppendSeparator();
641 
642  wxString text = AddHotkeyName( _( "Modern Toolset (&Accelerated)" ), g_Eeschema_Hokeys_Descr,
644  AddMenuItem( aParentMenu, ID_MENU_CANVAS_OPENGL, text,
645  _( "Use Modern Toolset with hardware-accelerated graphics (recommended)" ),
646  KiBitmap( tools_xpm ), wxITEM_RADIO );
647 
648  text = AddHotkeyName( _( "Modern Toolset (Fallba&ck)" ), g_Eeschema_Hokeys_Descr,
649  HK_CANVAS_CAIRO );
650  AddMenuItem( aParentMenu, ID_MENU_CANVAS_CAIRO, text,
651  _( "Use Modern Toolset with software graphics (fall-back)" ),
652  KiBitmap( tools_xpm ), wxITEM_RADIO );
653 
654  aParentMenu->AppendSeparator();
655 
656  // Import/export
657  AddMenuItem( aParentMenu, ID_CONFIG_SAVE, _( "&Save Project File..." ),
658  _( "Save project preferences into a project file" ),
659  KiBitmap( save_setup_xpm ) );
660 
661  AddMenuItem( aParentMenu, ID_CONFIG_READ, _( "Load P&roject File..." ),
662  _( "Load project preferences from a project file" ),
663  KiBitmap( import_setup_xpm ) );
664 }
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:223
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:66
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
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) ...
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:800
void prepareToolsMenu ( wxMenu *  aParentMenu)
static

Definition at line 519 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().

520 {
521  wxString text;
522 
523  text = AddHotkeyName( _( "Update PCB from Schematic..." ), g_Schematic_Hokeys_Descr,
525 
526  AddMenuItem( aParentMenu,
528  text, _( "Updates PCB design with current schematic (forward annotation)." ),
529  KiBitmap( update_pcb_from_sch_xpm ) );
530 
531  // Run Pcbnew
532  AddMenuItem( aParentMenu, ID_RUN_PCB, _( "&Open PCB Editor" ),
533  _( "Run Pcbnew" ),
534  KiBitmap( pcbnew_xpm ) );
535 
536  aParentMenu->AppendSeparator();
537 
538  AddMenuItem( aParentMenu, ID_RUN_LIBRARY, _( "Symbol Library &Editor" ),
540  KiBitmap( libedit_xpm ) );
541 
542  AddMenuItem( aParentMenu, ID_RESCUE_CACHED, _( "&Rescue Symbols..." ),
543  _( "Find old symbols in project and rename/rescue them" ),
544  KiBitmap( rescue_xpm ) );
545 
546  AddMenuItem( aParentMenu, ID_REMAP_SYMBOLS, _( "Remap Symbols..." ),
547  _( "Remap legacy library symbols to symbol library table" ),
548  KiBitmap( rescue_xpm ) );
549 
550  aParentMenu->AppendSeparator();
551 
552  AddMenuItem( aParentMenu, ID_OPEN_CMP_TABLE, _( "Edit Symbol Field&s..." ),
553  KiBitmap( spreadsheet_xpm ) );
554 
556  _( "Edit Symbol Library References..." ),
557  _( "Edit links between schematic symbols and library symbols" ),
558  KiBitmap( edit_cmp_symb_links_xpm ) );
559 
560  aParentMenu->AppendSeparator();
561 
562  AddMenuItem( aParentMenu, ID_GET_ANNOTATE, _( "&Annotate Schematic..." ),
564  KiBitmap( annotate_xpm ) );
565 
566  AddMenuItem( aParentMenu, ID_GET_NETLIST, _( "Generate &Netlist File..." ),
567  _( "Generate netlist file" ),
568  KiBitmap( netlist_xpm ) );
569 
570  AddMenuItem( aParentMenu, ID_GET_TOOLS, _( "Generate Bill of &Materials..." ),
572  KiBitmap( bom_xpm ) );
573 
574  aParentMenu->AppendSeparator();
575 
576  // Run CvPcb
577  AddMenuItem( aParentMenu, ID_RUN_CVPCB, _( "A&ssign Footprints..." ),
578  _( "Assign PCB footprints to schematic symbols" ),
579  KiBitmap( cvpcb_xpm ) );
580 
581  aParentMenu->AppendSeparator();
582 
583 #ifdef KICAD_SPICE
584  // Simulator
585  AddMenuItem( aParentMenu, ID_SIM_SHOW, _("Simula&tor"),
586  _( "Simulate circuit" ),
587  KiBitmap( simulator_xpm ) );
588 #endif /* KICAD_SPICE */
589 
590 }
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:223
Definition: id.h:66
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
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_GRID_SETTINGS, 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  _( "Return to parent schematic 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  AddMenuItem( aParentMenu, ID_GRID_SETTINGS,
195  _( "Grid Settings..." ), wxEmptyString,
196  KiBitmap( grid_xpm ) );
197 
198  // Units submenu
199  wxMenu* unitsSubMenu = new wxMenu;
201  _( "&Imperial" ), _( "Use imperial units" ),
202  KiBitmap( unit_inch_xpm ), wxITEM_RADIO );
203 
205  _( "&Metric" ), _( "Use metric units" ),
206  KiBitmap( unit_mm_xpm ), wxITEM_RADIO );
207 
208  AddMenuItem( aParentMenu, unitsSubMenu,
209  -1, _( "&Units" ),
210  _( "Select which units are displayed" ),
211  KiBitmap( unit_mm_xpm ) );
212 
214  _( "Full &Window Crosshair" ),
215  _( "Change cursor shape" ),
216  KiBitmap( cursor_shape_xpm ), wxITEM_CHECK );
217 
218  aParentMenu->AppendSeparator();
219 
221  _( "Show Hidden &Pins" ),
222  wxEmptyString,
223  KiBitmap( hidden_pin_xpm ), wxITEM_CHECK );
224 
225 #ifdef __APPLE__
226  aParentMenu->AppendSeparator();
227 #endif
228 }
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:223
#define HELP_ZOOM_FIT
Definition: id.h:241
#define HELP_ZOOM_OUT
#define HELP_ZOOM_REDRAW
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
EDA_DRAW_FRAME::OnSelectGrid ID_TB_OPTIONS_SELECT_UNIT_INCH
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[]