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

415 {
416  wxString text;
417 
418  // Undo
419  text = AddHotkeyName( _( "&Undo" ), g_Schematic_Hokeys_Descr, HK_UNDO );
420 
421  AddMenuItem( aParentMenu, wxID_UNDO, text, HELP_UNDO, KiBitmap( undo_xpm ) );
422 
423  // Redo
424  text = AddHotkeyName( _( "&Redo" ), g_Schematic_Hokeys_Descr, HK_REDO );
425 
426  AddMenuItem( aParentMenu, wxID_REDO, text, HELP_REDO, KiBitmap( redo_xpm ) );
427 
428  // Delete
429  aParentMenu->AppendSeparator();
431  _( "&Delete" ), HELP_DELETE_ITEMS,
432  KiBitmap( delete_xpm ) );
433 
434  // Find
435  aParentMenu->AppendSeparator();
436  text = AddHotkeyName( _( "&Find" ), g_Schematic_Hokeys_Descr, HK_FIND_ITEM );
437  AddMenuItem( aParentMenu, ID_FIND_ITEMS, text, HELP_FIND, KiBitmap( find_xpm ) );
438 
439  // Find/Replace
440  text = AddHotkeyName( _( "Find and Re&place" ), g_Schematic_Hokeys_Descr,
441  HK_FIND_REPLACE );
442  AddMenuItem( aParentMenu, wxID_REPLACE, text, HELP_REPLACE,
443  KiBitmap( find_replace_xpm ) );
444 
445  // Import footprint association .cmp file which can be created by Pcbnew:
446  aParentMenu->AppendSeparator();
447  AddMenuItem( aParentMenu, ID_BACKANNO_ITEMS,
448  _( "Import Footprint Association File" ),
450  KiBitmap( import_footprint_names_xpm ) );
451 
452  // Update field values
453  AddMenuItem( aParentMenu, ID_UPDATE_FIELDS,
454  _( "Update Field Values" ),
455  _( "Sets component fields to original library values" ),
456  KiBitmap( update_fields_xpm ) );
457 
458  // Edit components to symbols library links (change LIB_ID values)
459  aParentMenu->AppendSeparator();
461  _( "Edit Components to Symbol Library Links" ),
462  _( "Edit components to symbols library links to switch to an other library link (library IDs)" ),
463  KiBitmap( update_fields_xpm ) );
464 }
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_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().

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

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

565 {
566  AddMenuItem( aParentMenu,
567  wxID_HELP,
568  _( "Eeschema &Manual" ),
569  _( "Open Eeschema Manual" ),
570  KiBitmap( online_help_xpm ) );
571 
572  AddMenuItem( aParentMenu,
573  wxID_INDEX,
574  _( "&Getting Started in KiCad" ),
575  _( "Open \"Getting Started in KiCad\" guide for beginners" ),
576  KiBitmap( help_xpm ) );
577 
578  AddMenuItem( aParentMenu,
580  _( "&List Hotkeys" ),
581  _( "Displays current hotkeys list and corresponding commands" ),
582  KiBitmap( hotkeys_xpm ) );
583 
584  aParentMenu->AppendSeparator();
585  AddMenuItem( aParentMenu, ID_HELP_GET_INVOLVED,
586  _( "Get &Involved" ),
587  _( "Contribute to KiCad (open web browser)" ),
588  KiBitmap( info_xpm ) );
589 
590  aParentMenu->AppendSeparator();
591  AddMenuItem( aParentMenu,
592  wxID_ABOUT,
593  _( "&About KiCad" ),
594  _( "About KiCad" ),
595  KiBitmap( about_xpm ) );
596 }
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 599 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().

600 {
601  AddMenuItem( aParentMenu,
603  _( "&Save Preferences" ),
604  _( "Save application preferences" ),
605  KiBitmap( save_setup_xpm ) );
606 
607  AddMenuItem( aParentMenu,
609  _( "Load Prefe&rences" ),
610  _( "Load application preferences" ),
611  KiBitmap( import_setup_xpm ) );
612 
613  aParentMenu->AppendSeparator();
614 
615  AddMenuItem( aParentMenu,
617  _( "E&xport Hotkeys" ),
618  _( "Create hotkey configuration file with current hotkeys" ),
619  KiBitmap( hotkeys_export_xpm ) );
620 
621  AddMenuItem( aParentMenu,
623  _( "&Import Hotkeys" ),
624  _( "Load existing hotkey configuration file" ),
625  KiBitmap( hotkeys_import_xpm ) );
626 }
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, KiBitmap(), and text_xpm.

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( 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
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 628 of file eeschema/menubar.cpp.

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

Referenced by SCH_EDIT_FRAME::ReCreateMenuBar().

629 {
630  // Library
631  AddMenuItem( aParentMenu,
633  _( "Manage Symbol Library Tables" ),
634  _( "Edit the global and project symbol library tables (list of active libraries)." ),
635  KiBitmap( library_table_xpm ) );
636 
637  // Options (Preferences on WXMAC)
638 #ifdef __WXMAC__
639  aParentMenu->Append( wxID_PREFERENCES );
640 #else
641  AddMenuItem( aParentMenu,
642  wxID_PREFERENCES,
643  _( "General &Options" ),
644  _( "Edit Eeschema preferences" ),
645  KiBitmap( preference_xpm ) );
646 #endif // __WXMAC__
647 
648  // Language submenu
649  aParentMenu->AppendSeparator();
650  Pgm().AddMenuLanguageList( aParentMenu );
651 
652  // Icons options submenu
653  aFrame->AddMenuIconsOptions( aParentMenu );
654 
655  // Import/export (submenu in preferences menu)
656  aParentMenu->AppendSeparator();
657  wxMenu* importExportSubmenu = new wxMenu();
658  prepareImportExportMenu( importExportSubmenu );
659 
660  AddMenuItem( aParentMenu, importExportSubmenu,
661  wxID_ANY,
662  _( "&Import and Export" ),
663  _( "Import and export settings" ),
664  KiBitmap( save_setup_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: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:692
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 467 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().

468 {
469  wxString text;
470 
471  text = AddHotkeyName( _( "Update PCB from Schematic" ), g_Schematic_Hokeys_Descr, HK_UPDATE_PCB_FROM_SCH );
472 
473  AddMenuItem( aParentMenu,
475  text, _( "Updates PCB design with current schematic (forward annotation)." ),
476  KiBitmap( import_brd_file_xpm ) );
477 
478  // Run Pcbnew
479  AddMenuItem( aParentMenu,
480  ID_RUN_PCB,
481  _( "&Open PCB Editor" ),
482  _( "Run Pcbnew" ),
483  KiBitmap( pcbnew_xpm ) );
484 
485  aParentMenu->AppendSeparator();
486 
487  AddMenuItem( aParentMenu,
489  _( "Library &Editor" ), HELP_RUN_LIB_EDITOR,
490  KiBitmap( libedit_xpm ) );
491 
492  AddMenuItem( aParentMenu,
494  _( "Library &Browser" ), HELP_RUN_LIB_VIEWER,
495  KiBitmap( library_browse_xpm ) );
496 
497  AddMenuItem( aParentMenu,
499  _( "&Rescue Symbols" ),
500  _( "Find old symbols in project and rename/rescue them" ),
501  KiBitmap( rescue_xpm ) );
502 
503  AddMenuItem( aParentMenu,
505  _( "Remap Symbols" ),
506  _( "Remap legacy library symbols to symbol library table" ),
507  KiBitmap( rescue_xpm ) );
508 
509  aParentMenu->AppendSeparator();
510 
511  AddMenuItem( aParentMenu,
513  _( "&Annotate Schematic" ), HELP_ANNOTATE,
514  KiBitmap( annotate_xpm ) );
515 
516  // ERC
517  AddMenuItem( aParentMenu,
518  ID_GET_ERC,
519  _( "Electrical Rules &Checker" ),
520  _( "Perform electrical rules check" ),
521  KiBitmap( erc_xpm ) );
522 
523  AddMenuItem( aParentMenu,
525  _( "Generate &Netlist File" ),
526  _( "Generate component netlist file" ),
527  KiBitmap( netlist_xpm ) );
528 
529  AddMenuItem( aParentMenu,
531  _( "Component Table &View" ),
532  KiBitmap( spreadsheet_xpm ) );
533 
534  AddMenuItem( aParentMenu,
535  ID_GET_TOOLS,
536  _( "Generate Bill of &Materials" ),
538  KiBitmap( bom_xpm ) );
539 
540 
541 
542  aParentMenu->AppendSeparator();
543 
544  // Run CvPcb
545  AddMenuItem( aParentMenu,
546  ID_RUN_CVPCB,
547  _( "A&ssign Footprint" ),
548  _( "Run CvPcb" ),
549  KiBitmap( cvpcb_xpm ) );
550 
551  aParentMenu->AppendSeparator();
552 
553 #ifdef KICAD_SPICE
554  // Simulator
555  AddMenuItem( aParentMenu,
556  ID_SIM_SHOW,
557  _("Simula&tor"), _( "Simulate circuit" ),
558  KiBitmap( simulator_xpm ) );
559 #endif /* KICAD_SPICE */
560 
561 }
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[]