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 "schframe.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 prepareImportExportMenu (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 409 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_FIND_ITEMS, ID_SCHEMATIC_DELETE_ITEM_BUTT, and KiBitmap().

Referenced by SCH_EDIT_FRAME::ReCreateMenuBar().

410 {
411  wxString text;
412 
413  // Undo
414  text = AddHotkeyName( _( "&Undo" ), g_Schematic_Hokeys_Descr, HK_UNDO );
415 
416  AddMenuItem( aParentMenu, wxID_UNDO, text, HELP_UNDO, KiBitmap( undo_xpm ) );
417 
418  // Redo
419  text = AddHotkeyName( _( "&Redo" ), g_Schematic_Hokeys_Descr, HK_REDO );
420 
421  AddMenuItem( aParentMenu, wxID_REDO, text, HELP_REDO, KiBitmap( redo_xpm ) );
422 
423  // Delete
424  aParentMenu->AppendSeparator();
426  _( "&Delete" ), HELP_DELETE_ITEMS,
427  KiBitmap( delete_xpm ) );
428 
429  // Find
430  aParentMenu->AppendSeparator();
431  text = AddHotkeyName( _( "&Find..." ), g_Schematic_Hokeys_Descr, HK_FIND_ITEM );
432  AddMenuItem( aParentMenu, ID_FIND_ITEMS, text, HELP_FIND, KiBitmap( find_xpm ) );
433 
434  // Find/Replace
435  text = AddHotkeyName( _( "Find and Re&place..." ), g_Schematic_Hokeys_Descr,
436  HK_FIND_REPLACE );
437  AddMenuItem( aParentMenu, wxID_REPLACE, text, HELP_REPLACE,
438  KiBitmap( find_replace_xpm ) );
439 
440  // Import footprint association .cmp file which can be created by Pcbnew:
441  aParentMenu->AppendSeparator();
442  AddMenuItem( aParentMenu, ID_BACKANNO_ITEMS,
443  _( "Import Footprint Association File" ),
445  KiBitmap( import_footprint_names_xpm ) );
446 }
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
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
#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 299 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, ID_GEN_PLOT_SCHEMATIC, 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().

300 {
301  wxString text;
302 
303  if( aIsOutsideProject ) // not when under a project mgr
304  {
305  AddMenuItem( aParentMenu,
307  _( "&New Schematic Project" ),
308  _( "Clear current schematic hierarchy and start a new schematic root sheet" ),
309  KiBitmap( new_sch_xpm ) );
310 
311  text = AddHotkeyName( _( "&Open Schematic Project" ), g_Schematic_Hokeys_Descr, HK_LOAD_SCH );
312  AddMenuItem( aParentMenu,
313  ID_LOAD_PROJECT, text,
314  _( "Open an existing schematic hierarchy" ),
315  KiBitmap( open_document_xpm ) );
316  }
317 
318  // @todo: static probably not OK in multiple open projects.
319  // Open Recent submenu
320  static wxMenu* openRecentMenu;
321 
322  // Add this menu to list menu managed by m_fileHistory
323  // (the file history will be updated when adding/removing files in history
324  if( openRecentMenu )
325  Kiface().GetFileHistory().RemoveMenu( openRecentMenu );
326 
327  openRecentMenu = new wxMenu();
328 
329  Kiface().GetFileHistory().UseMenu( openRecentMenu );
330  Kiface().GetFileHistory().AddFilesToMenu( openRecentMenu );
331 
332  if( Kiface().IsSingle() ) // not when under a project mgr
333  {
334  AddMenuItem( aParentMenu, openRecentMenu,
335  wxID_ANY, _( "Open &Recent" ),
336  _( "Open a recent opened schematic project" ),
337  KiBitmap( open_project_xpm ) );
338  }
339 
340  AddMenuItem( aParentMenu,
341  ID_APPEND_PROJECT, _( "Imp&ort Schematic Sheet Content" ),
342  _( "Import a schematic sheet content from an other project in the current sheet" ),
343  KiBitmap( open_document_xpm ) );
344 
345  aParentMenu->AppendSeparator();
346 
347  text = AddHotkeyName( _( "&Save Schematic Project" ),
349  AddMenuItem( aParentMenu,
350  ID_SAVE_PROJECT, text,
351  _( "Save all sheets in schematic project" ),
352  KiBitmap( save_project_xpm ) );
353 
354  AddMenuItem( aParentMenu,
356  _( "Save &Current Sheet Only" ),
357  _( "Save only current schematic sheet" ),
358  KiBitmap( save_xpm ) );
359 
360  if( aIsOutsideProject ) // not when under a project mgr
361  {
362  AddMenuItem( aParentMenu,
364  _( "Save C&urrent Sheet As" ),
365  _( "Save current schematic sheet as..." ),
366  KiBitmap( save_as_xpm ) );
367  }
368 
369  aParentMenu->AppendSeparator();
370 
371  // Edit page layout:
372  AddMenuItem( aParentMenu, ID_SHEET_SET,
373  _( "Pa&ge Settings" ),
374  _( "Settings for sheet size and frame references" ),
375  KiBitmap( sheetset_xpm ) );
376 
377  AddMenuItem( aParentMenu,
378  wxID_PRINT,
379  _( "Pri&nt..." ),
380  _( "Print schematic sheet" ),
381  KiBitmap( print_button_xpm ) );
382 
383  // Plot submenu
384  wxMenu* choice_plot_fmt = new wxMenu;
385 
386  AddMenuItem( choice_plot_fmt, ID_GEN_PLOT_SCHEMATIC, _( u8"&Plot..." ),
387  _( "Plot schematic sheet in PostScript, PDF, SVG, DXF or HPGL format" ),
388  KiBitmap( plot_xpm ) );
389 
390  // Plot to Clipboard
392  _( "Plot to C&lipboard" ),
393  _( "Export drawings to clipboard" ),
394  KiBitmap( copy_button_xpm ) );
395 
396  // Add plot submenu
397  AddMenuItem( aParentMenu, choice_plot_fmt,
398  ID_GEN_PLOT, _( "&Plot" ),
399  _( "Plot schematic sheet in HPGL, PostScript or SVG format" ),
400  KiBitmap( plot_xpm ) );
401 
402  // Quit
403  aParentMenu->AppendSeparator();
404  AddMenuItem( aParentMenu, wxID_EXIT, _( "&Close" ), _( "Close Eeschema" ),
405  KiBitmap( exit_xpm ) );
406 }
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
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:36
wxFileHistory & GetFileHistory()
Definition: kiface_i.h:121
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) ...
Definition: id.h:96
struct EDA_HOTKEY_CONFIG g_Schematic_Hokeys_Descr[]
void prepareHelpMenu ( wxMenu *  aParentMenu)
static

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

References AddMenuItem(), ID_HELP_GET_INVOLVED, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, and KiBitmap().

Referenced by SCH_EDIT_FRAME::ReCreateMenuBar().

534 {
535  AddMenuItem( aParentMenu,
536  wxID_HELP,
537  _( "Eeschema &Manual" ),
538  _( "Open Eeschema Manual" ),
539  KiBitmap( online_help_xpm ) );
540 
541  AddMenuItem( aParentMenu,
542  wxID_INDEX,
543  _( "&Getting Started in KiCad" ),
544  _( "Open \"Getting Started in KiCad\" guide for beginners" ),
545  KiBitmap( help_xpm ) );
546 
547  AddMenuItem( aParentMenu,
549  _( "&List Hotkeys" ),
550  _( "Displays the current hotkeys list and corresponding commands" ),
551  KiBitmap( hotkeys_xpm ) );
552 
553  aParentMenu->AppendSeparator();
554  AddMenuItem( aParentMenu, ID_HELP_GET_INVOLVED,
555  _( "Get &Involved" ),
556  _( "Contribute to KiCad (opens a web browser)" ),
557  KiBitmap( info_xpm ) );
558 
559  aParentMenu->AppendSeparator();
560  AddMenuItem( aParentMenu,
561  wxID_ABOUT,
562  _( "&About KiCad" ),
563  _( "About KiCad" ),
564  KiBitmap( info_xpm ) );
565 }
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
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
void prepareImportExportMenu ( wxMenu *  aParentMenu)
static

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

References AddMenuItem(), ID_CONFIG_READ, ID_CONFIG_SAVE, ID_PREFERENCES_HOTKEY_EXPORT_CONFIG, ID_PREFERENCES_HOTKEY_IMPORT_CONFIG, and KiBitmap().

Referenced by preparePreferencesMenu().

569 {
570  AddMenuItem( aParentMenu,
572  _( "&Save Preferences" ),
573  _( "Save application preferences" ),
574  KiBitmap( save_setup_xpm ) );
575 
576  AddMenuItem( aParentMenu,
578  _( "Load Prefe&rences" ),
579  _( "Load application preferences" ),
580  KiBitmap( import_setup_xpm ) );
581 
582  aParentMenu->AppendSeparator();
583 
584  AddMenuItem( aParentMenu,
586  _( "E&xport Hotkeys" ),
587  _( "Create a hotkey configuration file to export the current hotkeys" ),
588  KiBitmap( hotkeys_export_xpm ) );
589 
590  AddMenuItem( aParentMenu,
592  _( "&Import Hotkeys" ),
593  _( "Load an existing hotkey configuration file" ),
594  KiBitmap( hotkeys_import_xpm ) );
595 }
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
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
void preparePlaceMenu ( wxMenu *  aParentMenu)
static

Definition at line 189 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, and KiBitmap().

Referenced by SCH_EDIT_FRAME::ReCreateMenuBar().

190 {
191  wxString text;
192 
193  text = AddHotkeyName( _( "&Component" ), g_Schematic_Hokeys_Descr,
194  HK_ADD_NEW_COMPONENT, IS_ACCELERATOR ); // add an accelerator, not a shortcut
195  AddMenuItem( aParentMenu, ID_SCH_PLACE_COMPONENT, text,
197  KiBitmap( add_component_xpm ) );
198 
199  text = AddHotkeyName( _( "&Power Port" ), g_Schematic_Hokeys_Descr,
200  HK_ADD_NEW_POWER, IS_ACCELERATOR ); // add an accelerator, not a shortcut
201  AddMenuItem( aParentMenu, ID_PLACE_POWER_BUTT, text,
203  KiBitmap( add_power_xpm ) );
204 
205  text = AddHotkeyName( _( "&Wire" ), g_Schematic_Hokeys_Descr,
206  HK_BEGIN_WIRE, IS_ACCELERATOR ); // add an accelerator, not a shortcut
207  AddMenuItem( aParentMenu, ID_WIRE_BUTT, text,
209  KiBitmap( add_line_xpm ) );
210 
211  text = AddHotkeyName( _( "&Bus" ), g_Schematic_Hokeys_Descr,
212  HK_BEGIN_BUS, IS_ACCELERATOR ); // add an accelerator, not a shortcut
213  AddMenuItem( aParentMenu, ID_BUS_BUTT, text,
215  KiBitmap( add_bus_xpm ) );
216 
217  text = AddHotkeyName( _( "Wire to Bus &Entry" ), g_Schematic_Hokeys_Descr,
218  HK_ADD_WIRE_ENTRY, IS_ACCELERATOR ); // add an accelerator, not a shortcut
219  AddMenuItem( aParentMenu, ID_WIRETOBUS_ENTRY_BUTT, text,
221  KiBitmap( add_line2bus_xpm ) );
222 
223  text = AddHotkeyName( _( "Bus &to Bus Entry" ), g_Schematic_Hokeys_Descr,
224  HK_ADD_BUS_ENTRY, IS_ACCELERATOR ); // add an accelerator, not a shortcut
225  AddMenuItem( aParentMenu, ID_BUSTOBUS_ENTRY_BUTT, text,
227  KiBitmap( add_bus2bus_xpm ) );
228 
229  text = AddHotkeyName( _( "&No Connect Flag" ), g_Schematic_Hokeys_Descr,
230  HK_ADD_NOCONN_FLAG, IS_ACCELERATOR ); // add an accelerator, not a shortcut
231  AddMenuItem( aParentMenu, ID_NOCONN_BUTT, text, HELP_PLACE_NC_FLAG, KiBitmap( noconn_xpm ) );
232 
233  text = AddHotkeyName( _( "&Junction" ), g_Schematic_Hokeys_Descr,
234  HK_ADD_JUNCTION, IS_ACCELERATOR ); // add an accelerator, not a shortcut
235  AddMenuItem( aParentMenu, ID_JUNCTION_BUTT, text,
237  KiBitmap( add_junction_xpm ) );
238 
239  text = AddHotkeyName( _( "&Label" ), g_Schematic_Hokeys_Descr,
240  HK_ADD_LABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
241  AddMenuItem( aParentMenu, ID_LABEL_BUTT, text,
243  KiBitmap( add_line_label_xpm ) );
244 
245  text = AddHotkeyName( _( "Gl&obal Label" ), g_Schematic_Hokeys_Descr,
246  HK_ADD_GLABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
247  AddMenuItem( aParentMenu, ID_GLABEL_BUTT, text,
249  KiBitmap( add_glabel_xpm ) );
250 
251  aParentMenu->AppendSeparator();
252 
253  text = AddHotkeyName( _( "&Hierarchical Label" ), g_Schematic_Hokeys_Descr,
254  HK_ADD_HLABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
255  AddMenuItem( aParentMenu, ID_HIERLABEL_BUTT,
256  text, HELP_PLACE_HIER_LABEL,
257  KiBitmap( add_hierarchical_label_xpm ) );
258 
259 
260  text = AddHotkeyName( _( "Hierarchical &Sheet" ), g_Schematic_Hokeys_Descr,
261  HK_ADD_HIER_SHEET, IS_ACCELERATOR ); // add an accelerator, not a shortcut
262  AddMenuItem( aParentMenu, ID_SHEET_SYMBOL_BUTT, text,
264  KiBitmap( add_hierarchical_subsheet_xpm ) );
265 
266  AddMenuItem( aParentMenu,
268  _( "I&mport Hierarchical Label" ),
270  KiBitmap( import_hierarchical_label_xpm ) );
271 
272  AddMenuItem( aParentMenu,
274  _( "Hierarchical Pi&n to Sheet" ),
276  KiBitmap( add_hierar_pin_xpm ) );
277 
278  aParentMenu->AppendSeparator();
279 
280  text = AddHotkeyName( _( "Graphic Pol&yline" ), g_Schematic_Hokeys_Descr,
281  HK_ADD_GRAPHIC_POLYLINE, IS_ACCELERATOR ); // add an accelerator, not a shortcut
282  AddMenuItem( aParentMenu, ID_LINE_COMMENT_BUTT, text,
284  KiBitmap( add_dashed_line_xpm ) );
285 
286  text = AddHotkeyName( _( "&Graphic Text" ), g_Schematic_Hokeys_Descr,
287  HK_ADD_GRAPHIC_TEXT, IS_ACCELERATOR ); // add an accelerator, not a shortcut
288  AddMenuItem( aParentMenu, ID_TEXT_COMMENT_BUTT, text,
290  KiBitmap( add_text_xpm ) );
291 
292  // Add graphic image
293  AddMenuItem( aParentMenu, ID_ADD_IMAGE_BUTT, _( "&Image" ),
295  KiBitmap( image_xpm ) );
296 }
#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:55
#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:36
#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
#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 597 of file eeschema/menubar.cpp.

References EDA_BASE_FRAME::AddMenuIconsOptions(), AddMenuItem(), PGM_BASE::AddMenuLanguageList(), ID_CONFIG_REQ, KiBitmap(), Pgm(), and prepareImportExportMenu().

Referenced by SCH_EDIT_FRAME::ReCreateMenuBar().

598 {
599  // Library
600  AddMenuItem( aParentMenu,
602  _( "Component &Libraries" ),
603  _( "Configure component libraries and paths" ),
604  KiBitmap( library_xpm ) );
605 
606  // Options (Preferences on WXMAC)
607 #ifdef __WXMAC__
608  aParentMenu->Append( wxID_PREFERENCES );
609 #else
610  AddMenuItem( aParentMenu,
611  wxID_PREFERENCES,
612  _( "Schematic Editor &Options" ),
613  _( "Set Eeschema preferences" ),
614  KiBitmap( preference_xpm ) );
615 #endif // __WXMAC__
616 
617  // Language submenu
618  aParentMenu->AppendSeparator();
619  Pgm().AddMenuLanguageList( aParentMenu );
620 
621  // Icons options submenu
622  aFrame->AddMenuIconsOptions( aParentMenu );
623 
624  // Import/export (submenu in preferences menu)
625  aParentMenu->AppendSeparator();
626  wxMenu* importExportSubmenu = new wxMenu();
627  prepareImportExportMenu( importExportSubmenu );
628 
629  AddMenuItem( aParentMenu, importExportSubmenu,
630  wxID_ANY,
631  _( "&Import and export" ),
632  _( "Import and export settings" ),
633  KiBitmap( save_setup_xpm ) );
634 }
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
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
static void prepareImportExportMenu(wxMenu *aParentMenu)
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
void AddMenuIconsOptions(wxMenu *MasterMenu)
Function AddMenuIconsOptions creates a menu list for icons in menu and icon sizes choice...
Definition: basicframe.cpp:671
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:795
void prepareToolsMenu ( wxMenu *  aParentMenu)
static

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

450 {
451  wxString text;
452 
453  text = AddHotkeyName( _( "Update PCB from Schematics" ), g_Schematic_Hokeys_Descr, HK_UPDATE_PCB_FROM_SCH );
454 
455  AddMenuItem( aParentMenu,
457  text, _( "Updates the PCB design with the current schematic (forward annotation)." ),
458  KiBitmap( pcbnew_xpm ) );
459 
460  // Run Pcbnew
461  AddMenuItem( aParentMenu,
462  ID_RUN_PCB,
463  _( "&Open PCB Editor" ),
464  _( "Run Pcbnew" ),
465  KiBitmap( pcbnew_xpm ) );
466 
467  aParentMenu->AppendSeparator();
468 
469  AddMenuItem( aParentMenu,
471  _( "Library &Editor" ), HELP_RUN_LIB_EDITOR,
472  KiBitmap( libedit_xpm ) );
473 
474  AddMenuItem( aParentMenu,
476  _( "Library &Browser" ), HELP_RUN_LIB_VIEWER,
477  KiBitmap( library_browse_xpm ) );
478 
479  AddMenuItem( aParentMenu,
481  _( "&Rescue Old Components" ),
482  _( "Find old components in the project and rename/rescue them" ),
483  KiBitmap( copycomponent_xpm ) );
484 
485  aParentMenu->AppendSeparator();
486 
487  AddMenuItem( aParentMenu,
489  _( "&Annotate Schematic..." ), HELP_ANNOTATE,
490  KiBitmap( annotate_xpm ) );
491 
492  // ERC
493  AddMenuItem( aParentMenu,
494  ID_GET_ERC,
495  _( "Electrical Rules &Checker" ),
496  _( "Perform electrical rules check" ),
497  KiBitmap( erc_xpm ) );
498 
499  AddMenuItem( aParentMenu,
501  _( "Generate &Netlist File..." ),
502  _( "Generate the component netlist file" ),
503  KiBitmap( netlist_xpm ) );
504 
505  AddMenuItem( aParentMenu,
506  ID_GET_TOOLS,
507  _( "Generate Bill of &Materials..." ),
509  KiBitmap( bom_xpm ) );
510 
511  aParentMenu->AppendSeparator();
512 
513  // Run CvPcb
514  AddMenuItem( aParentMenu,
515  ID_RUN_CVPCB,
516  _( "A&ssign Component Footprints" ),
517  _( "Run CvPcb" ),
518  KiBitmap( cvpcb_xpm ) );
519 
520  aParentMenu->AppendSeparator();
521 
522 #ifdef KICAD_SPICE
523  // Simulator
524  AddMenuItem( aParentMenu,
525  ID_SIM_SHOW,
526  _("Simula&tor"), _( "Simulate the circuit" ),
527  KiBitmap( simulator_xpm ) );
528 #endif /* KICAD_SPICE */
529 
530 }
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
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:36
#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 136 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().

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 }
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
#define HELP_ZOOM_FIT
Definition: id.h:232
#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:36
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[]