KiCad PCB EDA Suite
menubar_pcbframe.cpp File Reference

Pcbnew editor menu bar. More...

#include <menus_helpers.h>
#include <kiface_i.h>
#include <pgm_base.h>
#include <wxPcbStruct.h>
#include "help_common_strings.h"
#include "hotkeys.h"
#include "pcbnew.h"
#include "pcbnew_id.h"

Go to the source code of this file.

Functions

static void preparePlaceMenu (wxMenu *aParentMenu)
 
static void prepareFilesMenu (wxMenu *aParentMenu, bool aIsOutsideProject)
 
static void prepareExportMenu (wxMenu *aParentMenu)
 
static void prepareToolsMenu (wxMenu *aParentMenu)
 
static void prepareHelpMenu (wxMenu *aParentMenu)
 
static void prepareEditMenu (wxMenu *aParentMenu, bool aUseGal)
 
static void prepareRouteMenu (wxMenu *aParentMenu)
 
static void prepareViewMenu (wxMenu *aParentMenu)
 
static void prepareDimensionsMenu (wxMenu *aParentMenu)
 
static void prepareLibraryMenu (wxMenu *aParentMenu)
 
static void prepareDesignRulesMenu (wxMenu *aParentMenu)
 
static void preparePreferencesMenu (PCB_EDIT_FRAME *aFrame, wxMenu *aParentMenu)
 

Detailed Description

Pcbnew editor menu bar.

Definition in file menubar_pcbframe.cpp.

Function Documentation

void prepareDesignRulesMenu ( wxMenu *  aParentMenu)
static

Definition at line 180 of file menubar_pcbframe.cpp.

References AddMenuItem(), ID_MENU_PCB_SHOW_DESIGN_RULES_DIALOG, ID_PCB_LAYERS_SETUP, and KiBitmap().

Referenced by PCB_EDIT_FRAME::ReCreateMenuBar().

181 {
183  _( "&Design Rules" ),
184  _( "Open design rules editor" ), KiBitmap( config_xpm ) );
185 
186  AddMenuItem( aParentMenu, ID_PCB_LAYERS_SETUP,
187  _( "&Layers Setup" ), _( "Enable and set layer properties" ),
188  KiBitmap( copper_layers_setup_xpm ) );
189 }
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 prepareDimensionsMenu ( wxMenu *  aParentMenu)
static

Definition at line 589 of file menubar_pcbframe.cpp.

References AddMenuItem(), ID_CONFIG_SAVE, ID_MENU_DIFF_PAIR_DIMENSIONS, ID_PCB_DRAWINGS_WIDTHS_SETUP, ID_PCB_MASK_CLEARANCE, ID_PCB_PAD_SETUP, ID_PCB_USER_GRID_SETUP, KiBitmap(), and text_xpm.

Referenced by PCB_EDIT_FRAME::ReCreateMenuBar().

590 {
591  AddMenuItem( aParentMenu, ID_PCB_USER_GRID_SETUP,
592  _( "User Defined G&rid" ),_( "Adjust custom user-defined grid dimensions" ),
593  KiBitmap( grid_xpm ) );
594 
596  _( "Te&xts and Drawings" ),
597  _( "Adjust dimensions for texts and drawings" ),
598  KiBitmap( text_xpm ) );
599 
600  AddMenuItem( aParentMenu, ID_PCB_PAD_SETUP,
601  _( "&Pads Size" ), _( "Adjust default pad characteristics" ),
602  KiBitmap( pad_dimensions_xpm ) );
603 
604  AddMenuItem( aParentMenu, ID_PCB_MASK_CLEARANCE,
605  _( "Pads to &Mask Clearance" ),
606  _( "Adjust global clearance between pads and solder resist mask" ),
607  KiBitmap( pads_mask_layers_xpm ) );
608 
610  _( "&Differential Pairs" ),
611  _( "Define global gap/width for differential pairs." ),
612  KiBitmap( ps_diff_pair_xpm ) );
613 
614  aParentMenu->AppendSeparator();
615  AddMenuItem( aParentMenu, ID_CONFIG_SAVE,
616  _( "&Save Preferences" ), _( "Save dimension preferences" ),
617  KiBitmap( save_xpm ) );
618 }
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
static const char * text_xpm[]
void prepareEditMenu ( wxMenu *  aParentMenu,
bool  aUseGal 
)
static

Definition at line 463 of file menubar_pcbframe.cpp.

References AddHotkeyName(), AddMenuItem(), g_Pcbnew_Editor_Hokeys_Descr, HELP_FIND, HELP_REDO, HELP_UNDO, HK_FIND_ITEM, HK_REDO, HK_UNDO, ID_FIND_ITEMS, ID_MENU_PCB_CLEAN, ID_MENU_PCB_RESET_TEXTMODULE_FIELDS_SIZES, ID_MENU_PCB_SWAP_LAYERS, ID_PCB_DELETE_ITEM_BUTT, ID_PCB_EDIT_ALL_VIAS_AND_TRACK_SIZE, ID_PCB_GLOBAL_DELETE, and KiBitmap().

Referenced by PCB_EDIT_FRAME::ReCreateMenuBar().

464 {
465  wxString text;
466 
467  text = AddHotkeyName( _( "&Undo" ), g_Pcbnew_Editor_Hokeys_Descr, HK_UNDO );
468  AddMenuItem( aParentMenu, wxID_UNDO, text, HELP_UNDO, KiBitmap( undo_xpm ) );
469 
470  text = AddHotkeyName( _( "&Redo" ), g_Pcbnew_Editor_Hokeys_Descr, HK_REDO );
471  AddMenuItem( aParentMenu, wxID_REDO, text, HELP_REDO, KiBitmap( redo_xpm ) );
472 
473  AddMenuItem( aParentMenu, ID_PCB_DELETE_ITEM_BUTT,
474  _( "&Delete" ), _( "Delete items" ),
475  KiBitmap( delete_xpm ) );
476 
477  aParentMenu->AppendSeparator();
478 
480  AddMenuItem( aParentMenu, ID_FIND_ITEMS, text, HELP_FIND , KiBitmap( find_xpm ) );
481 
482  aParentMenu->AppendSeparator();
484  _( "Edit All Tracks and Vias" ), KiBitmap( width_track_via_xpm ) );
485 
487  _( "Set Footp&rint Field Sizes" ),
488  _( "Set text size and width of footprint fields" ),
489  KiBitmap( reset_text_xpm ) );
490 
491  AddMenuItem( aParentMenu, ID_MENU_PCB_SWAP_LAYERS,
492  _( "&Swap Layers" ),
493  _( "Swap tracks on copper layers or drawings on other layers" ),
494  KiBitmap( swap_layer_xpm ) );
495 
496  aParentMenu->AppendSeparator();
497  AddMenuItem( aParentMenu, ID_PCB_GLOBAL_DELETE,
498  _( "&Global Deletions" ),
499  _( "Delete tracks, footprints and texts on board" ),
500  KiBitmap( general_deletions_xpm ) );
501 
502  AddMenuItem( aParentMenu, ID_MENU_PCB_CLEAN,
503  _( "&Cleanup Tracks and Vias" ),
504  _( "Clean stubs, vias, delete break points or unconnected tracks" ),
505  KiBitmap( delete_xpm ) );
506 }
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
struct EDA_HOTKEY_CONFIG g_Pcbnew_Editor_Hokeys_Descr[]
#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
void prepareExportMenu ( wxMenu *  aParentMenu)
static

Definition at line 824 of file menubar_pcbframe.cpp.

References AddMenuItem(), ID_GEN_EXPORT_FILE_GENCADFORMAT, ID_GEN_EXPORT_FILE_IDF3, ID_GEN_EXPORT_FILE_STEP, ID_GEN_EXPORT_FILE_VRML, ID_GEN_EXPORT_SPECCTRA, ID_PCB_GEN_CMP_FILE, and KiBitmap().

Referenced by prepareFilesMenu().

825 {
826  AddMenuItem( aParentMenu, ID_GEN_EXPORT_SPECCTRA,
827  _( "&Specctra DSN" ),
828  _( "Export current board to \"Specctra DSN\" file" ),
829  KiBitmap( export_dsn_xpm ) );
830 
832  _( "&GenCAD" ), _( "Export GenCAD format" ),
833  KiBitmap( export_xpm ) );
834 
835  AddMenuItem( aParentMenu, ID_GEN_EXPORT_FILE_VRML,
836  _( "&VRML" ),
837  _( "Export VRML board representation" ),
838  KiBitmap( three_d_xpm ) );
839 
840  AddMenuItem( aParentMenu, ID_GEN_EXPORT_FILE_IDF3,
841  _( "I&DFv3" ), _( "IDFv3 board and component export" ),
842  KiBitmap( export_idf_xpm ) );
843 
844  AddMenuItem( aParentMenu, ID_GEN_EXPORT_FILE_STEP,
845  _( "S&TEP" ), _( "STEP export" ),
846  KiBitmap( export_idf_xpm ) );
847 
848  AddMenuItem( aParentMenu, ID_PCB_GEN_CMP_FILE,
849  _( "&Component (.cmp) File" ),
850  _( "Export component file (*.cmp) for Eeschema footprint field back-annotation" ),
851  KiBitmap( create_cmp_file_xpm ) );
852 }
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 prepareFilesMenu ( wxMenu *  aParentMenu,
bool  aIsOutsideProject 
)
static

Definition at line 622 of file menubar_pcbframe.cpp.

References AddHotkeyName(), AddMenuItem(), g_Pcbnew_Editor_Hokeys_Descr, KIFACE_I::GetFileHistory(), HK_LOAD_BOARD, HK_SAVE_BOARD, HK_SAVE_BOARD_AS, ID_APPEND_FILE, ID_COPY_BOARD_AS, ID_GEN_EXPORT_FILE, ID_GEN_EXPORT_FILE_MODULE_REPORT, ID_GEN_IMPORT_DXF_FILE, ID_GEN_IMPORT_FILE, ID_GEN_IMPORT_SPECCTRA_SESSION, ID_GEN_PLOT, ID_GEN_PLOT_SVG, ID_IMPORT_NON_KICAD_BOARD, ID_LOAD_FILE, ID_MENU_ARCHIVE_MODULES, ID_MENU_ARCHIVE_MODULES_IN_LIBRARY, ID_MENU_CREATE_LIBRARY_AND_ARCHIVE_MODULES, ID_MENU_READ_BOARD_BACKUP_FILE, ID_MENU_RECOVER_BOARD_AUTOSAVE, ID_NEW_BOARD, ID_PCB_GEN_BOM_FILE_FROM_BOARD, ID_PCB_GEN_D356_FILE, ID_PCB_GEN_DRILL_FILE, ID_PCB_GEN_POS_MODULES_FILE, ID_SAVE_BOARD, ID_SAVE_BOARD_AS, ID_SHEET_SET, KiBitmap(), Kiface(), and prepareExportMenu().

Referenced by PCB_EDIT_FRAME::ReCreateMenuBar().

623 {
624  wxString text;
625 
626  // Some commands are available only if Pcbnew is run outside a project (run alone).
627  // aIsOutsideProject is false when Pcbnew is run from Kicad manager.
628  if( aIsOutsideProject )
629  {
630  AddMenuItem( aParentMenu, ID_NEW_BOARD,
631  _( "&New Board" ),
632  _( "Create new board" ),
633  KiBitmap( new_generic_xpm ) );
634 
635  text = AddHotkeyName( _( "&Open Board" ), g_Pcbnew_Editor_Hokeys_Descr, HK_LOAD_BOARD );
636  AddMenuItem( aParentMenu, ID_LOAD_FILE, text,
637  _( "Load existing board" ),
638  KiBitmap( open_brd_file_xpm ) );
639  }
640 
641  wxFileHistory& fhist = Kiface().GetFileHistory();
642 
643  // Load Recent submenu
644  static wxMenu* openRecentMenu;
645 
646  // Add this menu to list menu managed by m_fileHistory
647  // (the file history will be updated when adding/removing files in history
648  if( openRecentMenu )
649  fhist.RemoveMenu( openRecentMenu );
650 
651  openRecentMenu = new wxMenu();
652 
653  fhist.UseMenu( openRecentMenu );
654  fhist.AddFilesToMenu();
655 
656  if( aIsOutsideProject )
657  {
658  AddMenuItem( aParentMenu, openRecentMenu,
659  -1, _( "Open &Recent" ),
660  _( "Open recently opened board" ),
661  KiBitmap( open_project_xpm ) );
662 
663  AddMenuItem( aParentMenu, ID_APPEND_FILE,
664  _( "&Append Board" ),
665  _( "Append another board to currently loaded board" ),
666  KiBitmap( import_xpm ) );
667 
669  _( "Import Non-Kicad Board File" ),
670  _( "Import board file from other applications" ),
671  KiBitmap( import_brd_file_xpm ) );
672 
673  aParentMenu->AppendSeparator();
674  }
675 
677  AddMenuItem( aParentMenu, ID_SAVE_BOARD, text,
678  _( "Save current board" ),
679  KiBitmap( save_xpm ) );
680 
681  // Save as menu:
682  // under a project mgr we do not want to modify the board filename
683  // to keep consistency with the project mgr which expects files names same as prj name
684  // for main files
685  // when not under a project mgr, we are free to change filenames, cwd ...
686  if( Kiface().IsSingle() ) // not when under a project mgr (pcbnew is run as stand alone)
687  {
688  text = AddHotkeyName( _( "Sa&ve As" ), g_Pcbnew_Editor_Hokeys_Descr, HK_SAVE_BOARD_AS );
689  AddMenuItem( aParentMenu, ID_SAVE_BOARD_AS, text,
690  _( "Save current board with new name" ),
691  KiBitmap( save_as_xpm ) );
692  }
693  // under a project mgr, we can save a copy of the board,
694  // but do not change the current board file name
695  else
696  {
697  text = AddHotkeyName( _( "Sa&ve Copy As" ), g_Pcbnew_Editor_Hokeys_Descr, HK_SAVE_BOARD_AS );
698  AddMenuItem( aParentMenu, ID_COPY_BOARD_AS, text,
699  _( "Save copy of the current board" ),
700  KiBitmap( save_as_xpm ) );
701  }
702 
703  aParentMenu->AppendSeparator();
704 
706  _( "Revert to Las&t Backup" ),
707  _( "Clear board and get previous backup version of board" ),
708  KiBitmap( undo_xpm ) );
709 
711  _( "Resc&ue" ),
712  _( "Clear board and get last rescue file automatically saved by Pcbnew" ),
713  KiBitmap( rescue_xpm ) );
714  aParentMenu->AppendSeparator();
715 
716  //----- Fabrication Outputs submenu -----------------------------------------
717  wxMenu* fabricationOutputsMenu = new wxMenu;
718  AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_POS_MODULES_FILE,
719  _( "Footprint &Position (.pos) File" ),
720  _( "Generate footprint position file for pick and place" ),
721  KiBitmap( post_compo_xpm ) );
722 
723  AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_DRILL_FILE,
724  _( "&Drill (.drl) File" ),
725  _( "Generate excellon2 drill file" ),
726  KiBitmap( post_drill_xpm ) );
727 
728  AddMenuItem( fabricationOutputsMenu, ID_GEN_EXPORT_FILE_MODULE_REPORT,
729  _( "&Footprint (.rpt) Report.." ),
730  _( "Create report of all footprints from current board" ),
731  KiBitmap( tools_xpm ) );
732 
733  AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_D356_FILE,
734  _( "IPC-D-356 Netlist File" ),
735  _( "Generate IPC-D-356 netlist file" ),
736  KiBitmap( netlist_xpm ) );
737 
738  AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_BOM_FILE_FROM_BOARD,
739  _( "&BOM File" ),
740  _( "Create bill of materials from current schematic" ),
741  KiBitmap( bom_xpm ) );
742 
743  AddMenuItem( aParentMenu, fabricationOutputsMenu,
744  -1, _( "&Fabrication Outputs" ),
745  _( "Generate files for fabrication" ),
746  KiBitmap( fabrication_xpm ) );
747 
748  //----- Import submenu ------------------------------------------------------
749  wxMenu* submenuImport = new wxMenu();
750 
752  _( "&Specctra Session" ),
753  _( "Import routed \"Specctra Session\" (*.ses) file" ),
754  KiBitmap( import_xpm ) );
755 
756  AddMenuItem( submenuImport, ID_GEN_IMPORT_DXF_FILE,
757  _( "&DXF File" ),
758  _( "Import 2D Drawing DXF file to Pcbnew on Drawings layer" ),
759  KiBitmap( import_xpm ) );
760 
761  AddMenuItem( aParentMenu, submenuImport,
762  ID_GEN_IMPORT_FILE, _( "&Import" ),
763  _( "Import files" ), KiBitmap( import_xpm ) );
764 
765 
766  //----- Export submenu ------------------------------------------------------
767  wxMenu* submenuexport = new wxMenu();
768  prepareExportMenu( submenuexport );
769 
770  AddMenuItem( aParentMenu, submenuexport,
771  ID_GEN_EXPORT_FILE, _( "E&xport" ),
772  _( "Export board" ), KiBitmap( export_xpm ) );
773 
774  aParentMenu->AppendSeparator();
775 
776  AddMenuItem( aParentMenu, ID_SHEET_SET,
777  _( "Page S&ettings" ),
778  _( "Settings for sheet size and frame references" ),
779  KiBitmap( sheetset_xpm ) );
780 
781  AddMenuItem( aParentMenu, wxID_PRINT,
782  _( "&Print" ), _( "Print board" ),
783  KiBitmap( print_button_xpm ) );
784 
785  AddMenuItem( aParentMenu, ID_GEN_PLOT_SVG,
786  _( "Export SV&G" ),
787  _( "Export board file in Scalable Vector Graphics format" ),
788  KiBitmap( plot_svg_xpm ) );
789 
790  AddMenuItem( aParentMenu, ID_GEN_PLOT,
791  _( "P&lot" ),
792  _( "Plot board in HPGL, PostScript or Gerber RS-274X format)" ),
793  KiBitmap( plot_xpm ) );
794 
795  aParentMenu->AppendSeparator();
796 
797  //----- archive submenu -----------------------------------------------------
798  wxMenu* submenuarchive = new wxMenu();
799 
801  _( "&Archive Footprints in Project Library" ),
802  _( "Archive all footprints in existing library in footprint Lib table"
803  "(does not remove other footprints in this library)" ),
804  KiBitmap( library_archive_xpm ) );
805 
807  _( "&Create New Library and Archive Footprints" ),
808  _( "Archive all footprints in new library\n"
809  "(if the library already exists it will be deleted)" ),
810  KiBitmap( library_archive_as_xpm ) );
811 
812  AddMenuItem( aParentMenu, submenuarchive,
814  _( "Arc&hive Footprints" ),
815  _( "Archive or add all footprints in library file" ),
816  KiBitmap( library_archive_xpm ) );
817 
818  aParentMenu->AppendSeparator();
819  AddMenuItem( aParentMenu, wxID_EXIT, _( "&Close" ), _( "Close Pcbnew" ), KiBitmap( exit_xpm ) );
820 }
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
struct EDA_HOTKEY_CONFIG g_Pcbnew_Editor_Hokeys_Descr[]
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
void prepareHelpMenu ( wxMenu *  aParentMenu)
static

Definition at line 428 of file menubar_pcbframe.cpp.

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

Referenced by PCB_EDIT_FRAME::ReCreateMenuBar().

429 {
430 
431  AddMenuItem( aParentMenu, wxID_HELP,
432  _( "Pcbnew &Manual" ),
433  _( "Open Pcbnew Manual" ),
434  KiBitmap( online_help_xpm ) );
435 
436  AddMenuItem( aParentMenu, wxID_INDEX,
437  _( "&Getting Started in KiCad" ),
438  _( "Open \"Getting Started in KiCad\" guide for beginners" ),
439  KiBitmap( help_xpm ) );
440 
442  _( "&List Hotkeys" ),
443  _( "Display current hotkeys list and corresponding commands" ),
444  KiBitmap( hotkeys_xpm ) );
445 
446  aParentMenu->AppendSeparator();
447 
448  AddMenuItem( aParentMenu, ID_HELP_GET_INVOLVED,
449  _( "Get &Involved" ),
450  _( "Contribute to KiCad - open web browser" ),
451  KiBitmap( info_xpm ) );
452 
453  aParentMenu->AppendSeparator();
454 
455  AddMenuItem( aParentMenu, wxID_ABOUT,
456  _( "&About KiCad" ),
457  _( "Display KiCad About dialog" ),
458  KiBitmap( about_xpm ) );
459 }
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 prepareLibraryMenu ( wxMenu *  aParentMenu)
static

Definition at line 279 of file menubar_pcbframe.cpp.

References AddMenuItem(), ID_PCB_3DSHAPELIB_WIZARD, ID_PCB_LIB_TABLE_EDIT, ID_PCB_LIB_WIZARD, ID_PREFERENCES_CONFIGURE_PATHS, and KiBitmap().

Referenced by PCB_EDIT_FRAME::ReCreateMenuBar().

280 {
281  AddMenuItem( aParentMenu, ID_PCB_LIB_WIZARD,
282  _( "&Footprint Library Wizard" ), _( "Add footprint library using wizard" ),
283  KiBitmap( wizard_add_fplib_small_xpm ) );
284 
285  AddMenuItem( aParentMenu, ID_PCB_LIB_TABLE_EDIT,
286  _( "Footprint Li&brary Table" ), _( "Configure footprint library table" ),
287  KiBitmap( library_table_xpm ) );
288 
289  // Path configuration edit dialog.
290  AddMenuItem( aParentMenu,
292  _( "Configure Pa&ths" ),
293  _( "Edit path configuration environment variables" ),
294  KiBitmap( path_xpm ) );
295 
296 #ifdef BUILD_GITHUB_PLUGIN
298  _( "&3D Shape Downloader" ),
299  _( "Download from Github 3D shape libraries using wizard" ),
300  KiBitmap( import3d_xpm ) );
301 #endif
302 }
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 306 of file menubar_pcbframe.cpp.

References AddHotkeyName(), AddMenuItem(), g_Pcbnew_Editor_Hokeys_Descr, HK_ADD_MODULE, HK_ADD_NEW_TRACK, ID_PCB_ADD_LINE_BUTT, ID_PCB_ADD_POLYGON_BUTT, ID_PCB_ADD_TEXT_BUTT, ID_PCB_ARC_BUTT, ID_PCB_CIRCLE_BUTT, ID_PCB_DIMENSION_BUTT, ID_PCB_KEEPOUT_AREA_BUTT, ID_PCB_MIRE_BUTT, ID_PCB_MODULE_BUTT, ID_PCB_PLACE_GRID_COORD_BUTT, ID_PCB_PLACE_OFFSET_COORD_BUTT, ID_PCB_ZONES_BUTT, ID_TRACK_BUTT, IS_ACCELERATOR, KiBitmap(), and text_xpm.

Referenced by PCB_EDIT_FRAME::ReCreateMenuBar().

307 {
308  wxString text;
309 
310  text = AddHotkeyName( _( "&Footprint" ), g_Pcbnew_Editor_Hokeys_Descr,
311  HK_ADD_MODULE );
312  AddMenuItem( aParentMenu, ID_PCB_MODULE_BUTT, text,
313  _( "Add footprints" ), KiBitmap( module_xpm ) );
314 
315  text = AddHotkeyName( _( "&Track" ), g_Pcbnew_Editor_Hokeys_Descr,
317  AddMenuItem( aParentMenu, ID_TRACK_BUTT, text,
318  _( "Add tracks and vias" ), KiBitmap( add_tracks_xpm ) );
319 
320  AddMenuItem( aParentMenu, ID_PCB_ZONES_BUTT,
321  _( "&Zone" ), _( "Add filled zones" ), KiBitmap( add_zone_xpm ) );
322 
324  _( "&Keepout Area" ), _( "Add keepout areas" ), KiBitmap( add_keepout_area_xpm ) );
325 
326  AddMenuItem( aParentMenu, ID_PCB_ADD_TEXT_BUTT,
327  _( "Te&xt" ), _( "Add text on copper layers or graphic text" ),
328  KiBitmap( text_xpm ) );
329 
330  AddMenuItem( aParentMenu, ID_PCB_ARC_BUTT,
331  _( "&Arc" ), _( "Add graphic arc" ),KiBitmap( add_arc_xpm ) );
332 
333  AddMenuItem( aParentMenu, ID_PCB_CIRCLE_BUTT,
334  _( "&Circle" ), _( "Add graphic circle" ),
335  KiBitmap( add_circle_xpm ) );
336 
337  AddMenuItem( aParentMenu, ID_PCB_ADD_LINE_BUTT,
338  _( "&Lines" ),
339  _( "Add graphic lines" ),
340  KiBitmap( add_graphical_segments_xpm ) );
341 
342  AddMenuItem( aParentMenu, ID_PCB_ADD_POLYGON_BUTT,
343  _( "&Polygons" ),
344  _( "Add graphic polygons" ),
345  KiBitmap( add_graphical_polygon_xpm ) );
346 
347  aParentMenu->AppendSeparator();
348 
349  AddMenuItem( aParentMenu, ID_PCB_DIMENSION_BUTT,
350  _( "&Dimension" ), _( "Add dimension" ),
351  KiBitmap( add_dimension_xpm ) );
352 
353  AddMenuItem( aParentMenu, ID_PCB_MIRE_BUTT,
354  _( "La&yer Alignment Target" ), _( "Add layer alignment target" ),
355  KiBitmap( add_mires_xpm ) );
356 
357  aParentMenu->AppendSeparator();
358 
360  _( "Drill and &Place Offset" ),
361  _( "Place origin point for drill and place files" ),
362  KiBitmap( pcb_offset_xpm ) );
363 
365  _( "&Grid Origin" ),
366  _( "Set grid origin point" ),
367  KiBitmap( grid_select_axis_xpm ) );
368 }
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
struct EDA_HOTKEY_CONFIG g_Pcbnew_Editor_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) ...
static const char * text_xpm[]
void preparePreferencesMenu ( PCB_EDIT_FRAME aFrame,
wxMenu *  aParentMenu 
)
static

Definition at line 193 of file menubar_pcbframe.cpp.

References AddHotkeyConfigMenu(), EDA_BASE_FRAME::AddMenuIconsOptions(), AddMenuItem(), PGM_BASE::AddMenuLanguageList(), HELP_SHOW_HIDE_LAYERMANAGER, HELP_SHOW_HIDE_MICROWAVE_TOOLS, ID_CONFIG_READ, ID_CONFIG_SAVE, ID_MENU_INTERACTIVE_ROUTER_SETTINGS, ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER, ID_MENU_PCB_SHOW_HIDE_MUWAVE_TOOLBAR, ID_PCB_DISPLAY_OPTIONS_SETUP, KiBitmap(), and Pgm().

Referenced by PCB_EDIT_FRAME::ReCreateMenuBar().

194 {
196  _( "Hide La&yers Manager" ),
198  KiBitmap( layers_manager_xpm ) );
199 
201  _( "Hide Microwa&ve Toolbar" ),
203  KiBitmap( mw_toolbar_xpm ) );
204 #ifdef __WXMAC__
205  aParentMenu->Append( wxID_PREFERENCES );
206 #else
207  AddMenuItem( aParentMenu, wxID_PREFERENCES,
208  _( "&General Settings" ), _( "Select general options for Pcbnew" ),
209  KiBitmap( preference_xpm ) );
210 #endif
211 
213  _( "&Display and Hide" ),
214  _( "Select how items (pads, tracks, texts) are displayed" ),
215  KiBitmap( display_options_xpm ) );
216 
218  _( "&Interactive Routing" ),
219  _( "Configure interactive router" ),
220  KiBitmap( add_tracks_xpm ) ); // fixme: icon
221 
222  // Language submenu
223  aParentMenu->AppendSeparator();
224  Pgm().AddMenuLanguageList( aParentMenu );
225 
226  // Icons options submenu
227  aFrame->AddMenuIconsOptions( aParentMenu );
228 
229  // Hotkey submenu
230  AddHotkeyConfigMenu( aParentMenu );
231 
232  aParentMenu->AppendSeparator();
233 
234  AddMenuItem( aParentMenu, ID_CONFIG_SAVE,
235  _( "&Save Preferences" ),
236  _( "Save application preferences" ),
237  KiBitmap( save_setup_xpm ) );
238 
239  AddMenuItem( aParentMenu, ID_CONFIG_READ,
240  _( "Load Prefe&rences" ),
241  _( "Load application preferences" ),
242  KiBitmap( read_setup_xpm ) );
243 }
#define HELP_SHOW_HIDE_MICROWAVE_TOOLS
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
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
void AddHotkeyConfigMenu(wxMenu *aMenu)
void AddMenuIconsOptions(wxMenu *MasterMenu)
Function AddMenuIconsOptions creates a menu list for icons in menu and icon sizes choice...
Definition: basicframe.cpp:692
#define HELP_SHOW_HIDE_LAYERMANAGER
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 prepareRouteMenu ( wxMenu *  aParentMenu)
static

Definition at line 247 of file menubar_pcbframe.cpp.

References AddMenuItem(), ID_DIFF_PAIR_BUTT, ID_TRACK_BUTT, ID_TUNE_DIFF_PAIR_LEN_BUTT, ID_TUNE_DIFF_PAIR_SKEW_BUTT, ID_TUNE_SINGLE_TRACK_LEN_BUTT, and KiBitmap().

Referenced by PCB_EDIT_FRAME::ReCreateMenuBar().

248 {
249  AddMenuItem( aParentMenu, ID_TRACK_BUTT,
250  _( "&Single Track" ),
251  _( "Interactively route single track" ),
252  KiBitmap( add_tracks_xpm ) );
253 
254  AddMenuItem( aParentMenu, ID_DIFF_PAIR_BUTT,
255  _( "&Differential Pair" ),
256  _( "Interactively route differential pair" ),
257  KiBitmap( ps_diff_pair_xpm ) );
258 
259  aParentMenu->AppendSeparator();
260 
262  _( "&Tune Track Length" ),
263  _( "Tune length of single track" ),
264  KiBitmap( ps_tune_length_xpm ) );
265 
267  _( "Tune Differential Pair &Length" ),
268  _( "Tune length of differential pair" ),
269  KiBitmap( ps_diff_pair_tune_length_xpm ) );
270 
272  _( "Tune Differential Pair &Skew/Phase" ),
273  _( "Tune skew/phase of a differential pair" ),
274  KiBitmap( ps_diff_pair_tune_phase_xpm ) );
275 }
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 prepareToolsMenu ( wxMenu *  aParentMenu)
static

Definition at line 372 of file menubar_pcbframe.cpp.

References AddMenuItem(), ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, ID_DRC_CONTROL, ID_GET_NETLIST, ID_TOOLBARH_PCB_ACTION_PLUGIN, ID_TOOLBARH_PCB_ACTION_PLUGIN_REFRESH, ID_TOOLBARH_PCB_FREEROUTE_ACCESS, ID_TOOLBARH_PCB_SCRIPTING_CONSOLE, ID_UPDATE_PCB_FROM_SCH, and KiBitmap().

Referenced by PCB_EDIT_FRAME::ReCreateMenuBar().

373 {
374  AddMenuItem( aParentMenu,
376  _( "Update PCB from Schematic" ),
377  _( "Update PCB design with current schematic (forward annotation)" ),
378  KiBitmap( import_brd_file_xpm ) );
379 
380  aParentMenu->AppendSeparator( );
381 
382  AddMenuItem( aParentMenu, ID_GET_NETLIST,
383  _( "Load &Netlist" ),
384  _( "Read netlist and update board connectivity" ),
385  KiBitmap( netlist_xpm ) );
386 
388  _( "Set &Layer Pair" ), _( "Change active layer pair" ),
389  KiBitmap( select_layer_pair_xpm ) );
390 
391  AddMenuItem( aParentMenu, ID_DRC_CONTROL,
392  _( "&Design Rules Check" ),
393  _( "Perform design rules check" ), KiBitmap( erc_xpm ) );
394 
396  _( "&FreeRoute" ),
397  _( "Fast access to the FreeROUTE external advanced router" ),
398  KiBitmap( web_support_xpm ) );
399 
400 #if defined(KICAD_SCRIPTING_WXPYTHON)
402  _( "&Scripting Console" ),
403  _( "Show/Hide the Python scripting console" ),
404  KiBitmap( py_script_xpm ) );
405 #endif
406 
407 #if defined(KICAD_SCRIPTING) && defined(KICAD_SCRIPTING_ACTION_MENU)
408  aParentMenu->AppendSeparator( );
409 
410  wxMenu* submenuActionPluginsMenu = new wxMenu();
411 
412  AddMenuItem( aParentMenu, submenuActionPluginsMenu, ID_TOOLBARH_PCB_ACTION_PLUGIN,
413  _( "&External Plugins" ),
414  _( "Execute or reload python action plugins" ),
415  KiBitmap( hammer_xpm ) );
416 
417  AddMenuItem( submenuActionPluginsMenu, ID_TOOLBARH_PCB_ACTION_PLUGIN_REFRESH,
418  _( "&Refresh Plugins" ),
419  _( "Reload all python plugins and refresh plugin menus" ),
420  KiBitmap( reload_xpm ) );
421 
422  submenuActionPluginsMenu->AppendSeparator();
423 #endif
424 }
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 prepareViewMenu ( wxMenu *  aParentMenu)
static

Definition at line 510 of file menubar_pcbframe.cpp.

References AddHotkeyName(), AddMenuItem(), g_Pcbnew_Editor_Hokeys_Descr, HELP_ZOOM_FIT, HELP_ZOOM_IN, HELP_ZOOM_OUT, HELP_ZOOM_REDRAW, HK_3D_VIEWER, HK_CANVAS_CAIRO, HK_CANVAS_LEGACY, HK_CANVAS_OPENGL, HK_ZOOM_AUTO, HK_ZOOM_IN, HK_ZOOM_OUT, HK_ZOOM_REDRAW, ID_MENU_CANVAS_CAIRO, ID_MENU_CANVAS_LEGACY, ID_MENU_CANVAS_OPENGL, ID_MENU_LIST_NETS, ID_MENU_PCB_FLIP_VIEW, ID_MENU_PCB_SHOW_3D_FRAME, ID_ZOOM_IN, ID_ZOOM_OUT, ID_ZOOM_PAGE, ID_ZOOM_REDRAW, IS_ACCELERATOR, and KiBitmap().

Referenced by PCB_EDIT_FRAME::ReCreateMenuBar().

511 {
512  wxString text;
513  /* Important Note for ZOOM IN and ZOOM OUT commands from menubar:
514  * we cannot add hotkey info here, because the hotkey HK_ZOOM_IN and HK_ZOOM_OUT
515  * events(default = WXK_F1 and WXK_F2) are *NOT* equivalent to this menu command:
516  * zoom in and out from hotkeys are equivalent to the pop up menu zoom
517  * From here, zooming is made around the screen center
518  * From hotkeys, zooming is made around the mouse cursor position
519  * (obviously not possible from the toolbar or menubar command)
520  *
521  * in other words HK_ZOOM_IN and HK_ZOOM_OUT *are NOT* accelerators
522  * for Zoom in and Zoom out sub menus
523  */
524  text = AddHotkeyName( _( "Zoom &In" ), g_Pcbnew_Editor_Hokeys_Descr,
526  AddMenuItem( aParentMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, KiBitmap( zoom_in_xpm ) );
527 
528  text = AddHotkeyName( _( "Zoom &Out" ), g_Pcbnew_Editor_Hokeys_Descr,
530  AddMenuItem( aParentMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, KiBitmap( zoom_out_xpm ) );
531 
532  text = AddHotkeyName( _( "&Fit on Screen" ), g_Pcbnew_Editor_Hokeys_Descr,
533  HK_ZOOM_AUTO );
534  AddMenuItem( aParentMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT,
535  KiBitmap( zoom_fit_in_page_xpm ) );
536 
537  text = AddHotkeyName( _( "&Redraw" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_REDRAW );
538  AddMenuItem( aParentMenu, ID_ZOOM_REDRAW, text,
539  HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );
540 
541  aParentMenu->AppendSeparator();
542 
543  text = AddHotkeyName( _( "&3D Viewer" ), g_Pcbnew_Editor_Hokeys_Descr, HK_3D_VIEWER );
544 
545  AddMenuItem( aParentMenu, ID_MENU_PCB_SHOW_3D_FRAME, text, _( "Show board in 3D viewer" ),
546  KiBitmap( three_d_xpm ) );
547 
548  AddMenuItem( aParentMenu, ID_MENU_LIST_NETS,
549  _( "&List Nets" ), _( "View list of nets with names and IDs" ),
550  KiBitmap( list_nets_xpm ) );
551 
552  aParentMenu->AppendSeparator();
553 
554  AddMenuItem( aParentMenu, ID_MENU_PCB_FLIP_VIEW,
555  _( "Flip &Board View" ),
556  _( "Flip (mirror) the board view" ),
557  KiBitmap( flip_board_xpm ), wxITEM_CHECK );
558 
559 
560  aParentMenu->AppendSeparator();
561 
562  text = AddHotkeyName( _( "Legacy Canva&s" ), g_Pcbnew_Editor_Hokeys_Descr,
564 
565  aParentMenu->Append(
566  new wxMenuItem( aParentMenu, ID_MENU_CANVAS_LEGACY,
567  text, _( "Switch canvas implementation to Legacy" ),
568  wxITEM_RADIO ) );
569 
570  text = AddHotkeyName( _( "Open&GL Canvas" ), g_Pcbnew_Editor_Hokeys_Descr,
572 
573  aParentMenu->Append(
574  new wxMenuItem( aParentMenu, ID_MENU_CANVAS_OPENGL,
575  text, _( "Switch canvas implementation to OpenGL" ),
576  wxITEM_RADIO ) );
577 
578  text = AddHotkeyName( _( "&Cairo Canvas" ), g_Pcbnew_Editor_Hokeys_Descr,
579  HK_CANVAS_CAIRO );
580 
581  aParentMenu->Append(
582  new wxMenuItem( aParentMenu, ID_MENU_CANVAS_CAIRO,
583  text, _( "Switch canvas implementation to Cairo" ),
584  wxITEM_RADIO ) );
585 }
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
struct EDA_HOTKEY_CONFIG g_Pcbnew_Editor_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) ...
#define HELP_ZOOM_IN