KiCad PCB EDA Suite
menubar_pcb_editor.cpp File Reference
#include <pcb_edit_frame.h>
#include <advanced_config.h>
#include <kiface_i.h>
#include <menus_helpers.h>
#include <pgm_base.h>
#include <tool/tool_manager.h>
#include <tool/conditional_menu.h>
#include <tool/actions.h>
#include <tool/selection_conditions.h>
#include <tools/selection_tool.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 prepareFilesMenu (wxMenu *aParentMenu, bool aIsOutsideProject)
 
static void prepareExportMenu (wxMenu *aParentMenu)
 
static void prepareEditMenu (wxMenu *aParentMenu, bool aUseGal)
 
static void preparePlaceMenu (wxMenu *aParentMenu)
 
static void prepareRouteMenu (wxMenu *aParentMenu)
 
static void prepareInspectMenu (wxMenu *aParentMenu)
 
static void prepareLibraryMenu (wxMenu *aParentMenu)
 
static void preparePreferencesMenu (PCB_EDIT_FRAME *aFrame, wxMenu *aParentMenu)
 
static void prepareToolsMenu (wxMenu *aParentMenu)
 
static void prepareHelpMenu (wxMenu *aParentMenu)
 
void prepareViewMenu (CONDITIONAL_MENU *aParentMenu, PCB_EDIT_FRAME *aFrame)
 

Function Documentation

◆ prepareEditMenu()

void prepareEditMenu ( wxMenu *  aParentMenu,
bool  aUseGal 
)
static

Definition at line 619 of file menubar_pcb_editor.cpp.

620 {
621  wxString text;
622 
623  // JEY TODO: convert to actions (PCB_CONTROL is already ready)...
624  text = AddHotkeyName( _( "&Undo" ), g_Board_Editor_Hotkeys_Descr, HK_UNDO );
625  AddMenuItem( aParentMenu, wxID_UNDO, text, HELP_UNDO, KiBitmap( undo_xpm ) );
626 
627  text = AddHotkeyName( _( "&Redo" ), g_Board_Editor_Hotkeys_Descr, HK_REDO );
628  AddMenuItem( aParentMenu, wxID_REDO, text, HELP_REDO, KiBitmap( redo_xpm ) );
629 
630  aParentMenu->AppendSeparator();
631 
632  // JEY TODO: convert to actions:
633  if( aUseGal )
634  {
636  AddMenuItem( aParentMenu, ID_EDIT_CUT, text,
637  _( "Cuts the selected item(s) to the Clipboard" ),
638  KiBitmap( cut_xpm ) );
639 
641  AddMenuItem( aParentMenu, ID_EDIT_COPY, text,
642  _( "Copies the selected item(s) to the Clipboard" ),
643  KiBitmap( copy_xpm ) );
644 
645  text = AddHotkeyName( _( "&Paste" ), g_Board_Editor_Hotkeys_Descr, HK_EDIT_PASTE );
646  AddMenuItem( aParentMenu, ID_EDIT_PASTE, text,
647  _( "Pastes item(s) from the Clipboard" ),
648  KiBitmap( paste_xpm ) );
649  }
650 
651  AddMenuItem( aParentMenu, ID_PCB_DELETE_ITEM_BUTT,
652  _( "&Delete" ), _( "Delete items" ),
653  KiBitmap( delete_xpm ) );
654 
655  aParentMenu->AppendSeparator();
656 
657  text = AddHotkeyName( _( "&Find..." ), g_Board_Editor_Hotkeys_Descr, HK_FIND_ITEM );
658  AddMenuItem( aParentMenu, ID_FIND_ITEMS, text, HELP_FIND , KiBitmap( find_xpm ) );
659 
660  aParentMenu->AppendSeparator();
662  _( "Edit &Track && Via Properties..." ), KiBitmap( width_track_via_xpm ) );
663 
665  _( "Edit Text && &Graphic Properties..." ), KiBitmap( reset_text_xpm ) );
666 
668  _( "C&hange Footprints..." ),
669  _( "Assign different footprints from the library" ),
670  KiBitmap( exchange_xpm ) );
671 
672  AddMenuItem( aParentMenu, ID_MENU_PCB_SWAP_LAYERS,
673  _( "&Swap Layers..." ),
674  _( "Move tracks or drawings from a layer to another layer" ),
675  KiBitmap( swap_layer_xpm ) );
676 
677  aParentMenu->AppendSeparator();
678 
679  text = AddHotkeyName( _( "Fill All &Zones" ), g_Board_Editor_Hotkeys_Descr,
682  text, _( "Fill all zones on the board" ),
683  KiBitmap( fill_zone_xpm ) );
684 
685  text = AddHotkeyName( _( "U&nfill All Zones" ), g_Board_Editor_Hotkeys_Descr,
688  text, _( "Remove fill from all zones on the board" ),
689  KiBitmap( zone_unfill_xpm ) );
690 
691  aParentMenu->AppendSeparator();
692 
693  AddMenuItem( aParentMenu, ID_PCB_GLOBAL_DELETE,
694  _( "Glo&bal Deletions..." ),
695  _( "Delete tracks, footprints and graphic items from board" ),
696  KiBitmap( general_deletions_xpm ) );
697 
698  AddMenuItem( aParentMenu, ID_MENU_PCB_CLEAN,
699  _( "C&leanup Tracks and Vias..." ),
700  _( "Clean stubs, vias, delete break points or unconnected tracks" ),
701  KiBitmap( delete_xpm ) );
702 }
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:251
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_Board_Editor_Hotkeys_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,...
#define HELP_FIND

References AddHotkeyName(), AddMenuItem(), g_Board_Editor_Hotkeys_Descr, HELP_FIND, HELP_REDO, HELP_UNDO, HK_EDIT_COPY, HK_EDIT_CUT, HK_EDIT_PASTE, HK_FIND_ITEM, HK_REDO, HK_UNDO, HK_ZONE_FILL_OR_REFILL, HK_ZONE_REMOVE_FILLED, ID_EDIT_COPY, ID_EDIT_CUT, ID_EDIT_PASTE, ID_FIND_ITEMS, ID_MENU_PCB_CLEAN, ID_MENU_PCB_EDIT_TEXT_AND_GRAPHICS, ID_MENU_PCB_EXCHANGE_FOOTPRINTS, ID_MENU_PCB_SWAP_LAYERS, ID_PCB_DELETE_ITEM_BUTT, ID_PCB_EDIT_TRACKS_AND_VIAS, ID_PCB_GLOBAL_DELETE, ID_POPUP_PCB_FILL_ALL_ZONES, ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_ALL_ZONES, and KiBitmap().

Referenced by PCB_EDIT_FRAME::ReCreateMenuBar().

◆ prepareExportMenu()

void prepareExportMenu ( wxMenu *  aParentMenu)
static

Definition at line 933 of file menubar_pcb_editor.cpp.

934 {
935  AddMenuItem( aParentMenu, ID_GEN_EXPORT_SPECCTRA,
936  _( "S&pecctra DSN..." ),
937  _( "Export current board to \"Specctra DSN\" file" ),
938  KiBitmap( export_dsn_xpm ) );
939 
941  _( "&GenCAD..." ), _( "Export GenCAD format" ),
942  KiBitmap( export_xpm ) );
943 
944  AddMenuItem( aParentMenu, ID_GEN_EXPORT_FILE_VRML,
945  _( "&VRML..." ),
946  _( "Export VRML board representation" ),
947  KiBitmap( export3d_xpm ) );
948 
949  AddMenuItem( aParentMenu, ID_GEN_EXPORT_FILE_IDF3,
950  _( "I&DFv3..." ), _( "IDFv3 board and symbol export" ),
951  KiBitmap( export_idf_xpm ) );
952 
953  AddMenuItem( aParentMenu, ID_GEN_EXPORT_FILE_STEP,
954  _( "S&TEP..." ), _( "STEP export" ),
955  KiBitmap( export_step_xpm ) );
956 
957  AddMenuItem( aParentMenu, ID_GEN_PLOT_SVG,
958  _( "&SVG..." ),
959  _( "Export board file in Scalable Vector Graphics format" ),
960  KiBitmap( plot_svg_xpm ) );
961 
962  AddMenuItem( aParentMenu, ID_PCB_GEN_CMP_FILE,
963  _( "&Footprint Association (.cmp) File..." ),
964  _( "Export footprint association file (*.cmp) for schematic back annotation" ),
965  KiBitmap( create_cmp_file_xpm ) );
966 
968  _( "&Hyperlynx..." ), _( "Hyperlynx export" ),
969  KiBitmap( export_step_xpm ) );
970 
971 }
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:251
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79

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

Referenced by prepareFilesMenu().

◆ prepareFilesMenu()

void prepareFilesMenu ( wxMenu *  aParentMenu,
bool  aIsOutsideProject 
)
static

Definition at line 715 of file menubar_pcb_editor.cpp.

716 {
717  wxString text;
718 
719  // Some commands are available only if Pcbnew is run outside a project (run alone).
720  // aIsOutsideProject is false when Pcbnew is run from Kicad manager.
721 
722  FILE_HISTORY& fhist = Kiface().GetFileHistory();
723 
724  // Load Recent submenu
725  static wxMenu* openRecentMenu;
726 
727  // Add this menu to list menu managed by m_fileHistory
728  // (the file history will be updated when adding/removing files in history
729  if( openRecentMenu )
730  fhist.RemoveMenu( openRecentMenu );
731 
732  openRecentMenu = new wxMenu();
733 
734  fhist.UseMenu( openRecentMenu );
735  fhist.AddFilesToMenu();
736 
737  if( aIsOutsideProject )
738  {
739  text = AddHotkeyName( _( "&New" ), g_Board_Editor_Hotkeys_Descr, HK_NEW );
740  AddMenuItem( aParentMenu, ID_NEW_BOARD,
741  text, _( "Create new board" ),
742  KiBitmap( new_board_xpm ) );
743 
744  text = AddHotkeyName( _( "&Open..." ), g_Board_Editor_Hotkeys_Descr, HK_OPEN );
745  AddMenuItem( aParentMenu, ID_LOAD_FILE, text,
746  _( "Open existing board" ),
747  KiBitmap( open_brd_file_xpm ) );
748 
749  AddMenuItem( aParentMenu, openRecentMenu,
750  -1, _( "Open &Recent" ),
751  _( "Open recently opened board" ),
752  KiBitmap( recent_xpm ) );
753 
754  aParentMenu->AppendSeparator();
755  }
756 
757  text = AddHotkeyName( _( "&Save" ), g_Board_Editor_Hotkeys_Descr, HK_SAVE );
758  AddMenuItem( aParentMenu, ID_SAVE_BOARD, text,
759  _( "Save current board" ),
760  KiBitmap( save_xpm ) );
761 
762  // Save as menu:
763  // under a project mgr we do not want to modify the board filename
764  // to keep consistency with the project mgr which expects files names same as prj name
765  // for main files
766  // when not under a project mgr, we are free to change filenames, cwd ...
767  if( Kiface().IsSingle() ) // not when under a project mgr (pcbnew is run as stand alone)
768  {
769  text = AddHotkeyName( _( "Sa&ve As..." ), g_Board_Editor_Hotkeys_Descr, HK_SAVEAS );
770  AddMenuItem( aParentMenu, ID_SAVE_BOARD_AS, text,
771  _( "Save current board with new name" ),
772  KiBitmap( save_as_xpm ) );
773  }
774  // under a project mgr, we can save a copy of the board,
775  // but do not change the current board file name
776  else
777  {
778  text = AddHotkeyName( _( "Sa&ve Copy As..." ), g_Board_Editor_Hotkeys_Descr, HK_SAVEAS );
779  AddMenuItem( aParentMenu, ID_COPY_BOARD_AS, text,
780  _( "Save copy of the current board" ),
781  KiBitmap( save_as_xpm ) );
782  }
783 
784  aParentMenu->AppendSeparator();
785 
787  _( "Resc&ue" ),
788  _( "Clear board and get last rescue file automatically saved by Pcbnew" ),
789  KiBitmap( rescue_xpm ) );
790 
791  if( aIsOutsideProject )
792  {
793  AddMenuItem( aParentMenu, ID_APPEND_FILE,
794  _( "&Append Board..." ),
795  _( "Append another board to currently loaded board" ),
796  KiBitmap( add_board_xpm ) );
797 
799  _( "Import Non-KiCad Board File..." ),
800  _( "Import board file from other applications" ),
801  KiBitmap( import_brd_file_xpm ) );
802  }
803 
805  _( "Revert to Las&t Backup" ),
806  _( "Clear board and get previous backup version of board" ),
807  KiBitmap( undo_xpm ) );
808 
809  aParentMenu->AppendSeparator();
810 
811  //----- Import submenu ------------------------------------------------------
812  wxMenu* submenuImport = new wxMenu();
813 
814  AddMenuItem( submenuImport, ID_GET_NETLIST,
815  _( "&Netlist..." ),
816  _( "Read netlist and update board connectivity" ),
817  KiBitmap( netlist_xpm ) );
818 
820  _( "&Specctra Session..." ),
821  _( "Import routed \"Specctra Session\" (*.ses) file" ),
822  KiBitmap( import_xpm ) );
823 
825  _( "&Graphics..." ),
826  _( "Import 2D Drawing file to Pcbnew on Drawings layer" ),
827  KiBitmap( import_vector_xpm ) );
828 
829  AddMenuItem( aParentMenu, submenuImport,
830  ID_GEN_IMPORT_FILE, _( "&Import" ),
831  _( "Import files" ), KiBitmap( import_xpm ) );
832 
833 
834  //----- Export submenu ------------------------------------------------------
835  wxMenu* submenuexport = new wxMenu();
836  prepareExportMenu( submenuexport );
837 
838  AddMenuItem( aParentMenu, submenuexport,
839  ID_GEN_EXPORT_FILE, _( "E&xport" ),
840  _( "Export board" ), KiBitmap( export_xpm ) );
841 
842 
843  //----- Fabrication Outputs submenu -----------------------------------------
844  wxMenu* fabricationOutputsMenu = new wxMenu;
845  AddMenuItem( fabricationOutputsMenu, ID_GEN_PLOT_GERBER,
846  _( "&Gerbers (.gbr)..." ),
847  _( "Generate Gerbers for fabrication" ),
848  KiBitmap( post_compo_xpm ) );
849 
850  AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_DRILL_FILE,
851  _( "&Drill Files (.drl)..." ),
852  _( "Generate Excellon drill file(s)" ),
853  KiBitmap( post_drill_xpm ) );
854 
855  AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_POS_MODULES_FILE,
856  _( "Footprint &Positions (.pos)..." ),
857  _( "Generate footprint position file for pick and place" ),
858  KiBitmap( post_compo_xpm ) );
859 
860  AddMenuItem( fabricationOutputsMenu, ID_GEN_EXPORT_FILE_MODULE_REPORT,
861  _( "&Footprint Report (.rpt)..." ),
862  _( "Create report of all footprints from current board" ),
863  KiBitmap( tools_xpm ) );
864 
865  AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_D356_FILE,
866  _( "IPC-D-356 Netlist File..." ),
867  _( "Generate IPC-D-356 netlist file" ),
868  KiBitmap( netlist_xpm ) );
869 
870  AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_BOM_FILE_FROM_BOARD,
871  _( "&BOM..." ),
872  _( "Create bill of materials from current schematic" ),
873  KiBitmap( bom_xpm ) );
874 
875  AddMenuItem( aParentMenu, fabricationOutputsMenu,
876  -1, _( "&Fabrication Outputs" ),
877  _( "Generate files for fabrication" ),
878  KiBitmap( fabrication_xpm ) );
879 
880  aParentMenu->AppendSeparator();
881 
882  AddMenuItem( aParentMenu, ID_BOARD_SETUP_DIALOG,
883  _( "&Board Setup..." ),
884  _( "Edit board setup including layers, design rules and various defaults" ),
885  KiBitmap( options_board_xpm ) );
886 
887  aParentMenu->AppendSeparator();
888 
889  AddMenuItem( aParentMenu, ID_SHEET_SET,
890  _( "Page S&ettings..." ),
891  _( "Settings for sheet size and frame references" ),
892  KiBitmap( sheetset_xpm ) );
893 
894  text = AddHotkeyName( _( "&Print..." ), g_Board_Editor_Hotkeys_Descr, HK_PRINT );
895  AddMenuItem( aParentMenu, wxID_PRINT, text,
896  _( "Print board" ),
897  KiBitmap( print_button_xpm ) );
898 
899  AddMenuItem( aParentMenu, ID_GEN_PLOT,
900  _( "P&lot..." ),
901  _( "Plot board in HPGL, PostScript or Gerber RS-274X format)" ),
902  KiBitmap( plot_xpm ) );
903 
904  aParentMenu->AppendSeparator();
905 
906  //----- archive submenu -----------------------------------------------------
907  wxMenu* submenuarchive = new wxMenu();
908 
910  _( "&Archive Footprints in Existing Library..." ),
911  _( "Archive all footprints to existing library in footprint Lib table"
912  "(does not remove other footprints in this library)" ),
913  KiBitmap( library_archive_xpm ) );
914 
916  _( "&Create New Library and Archive Footprints..." ),
917  _( "Archive all footprints to a new library\n"
918  "(if the library already exists it will be replaced)" ),
919  KiBitmap( library_archive_as_xpm ) );
920 
921  AddMenuItem( aParentMenu, submenuarchive,
923  _( "Arc&hive Footprints" ),
924  _( "Archive or add all footprints in library file" ),
925  KiBitmap( library_archive_xpm ) );
926 
927  aParentMenu->AppendSeparator();
928  AddMenuItem( aParentMenu, wxID_EXIT, _( "&Exit" ), _( "Close Pcbnew" ), KiBitmap( exit_xpm ) );
929 }
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:251
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
struct EDA_HOTKEY_CONFIG g_Board_Editor_Hotkeys_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)
FILE_HISTORY & GetFileHistory()
Definition: kiface_i.h:123
Definition: id.h:97

References AddHotkeyName(), AddMenuItem(), g_Board_Editor_Hotkeys_Descr, KIFACE_I::GetFileHistory(), HK_NEW, HK_OPEN, HK_PRINT, HK_SAVE, HK_SAVEAS, ID_APPEND_FILE, ID_BOARD_SETUP_DIALOG, ID_COPY_BOARD_AS, ID_GEN_EXPORT_FILE, ID_GEN_EXPORT_FILE_MODULE_REPORT, ID_GEN_IMPORT_FILE, ID_GEN_IMPORT_GRAPHICS_FILE, ID_GEN_IMPORT_SPECCTRA_SESSION, ID_GEN_PLOT, ID_GEN_PLOT_GERBER, ID_GET_NETLIST, 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().

◆ prepareHelpMenu()

void prepareHelpMenu ( wxMenu *  aParentMenu)
static

Definition at line 586 of file menubar_pcb_editor.cpp.

587 {
588 
589  AddMenuItem( aParentMenu, wxID_HELP,
590  _( "Pcbnew &Manual" ),
591  _( "Open Pcbnew Manual" ),
592  KiBitmap( online_help_xpm ) );
593 
594  AddMenuItem( aParentMenu, wxID_INDEX,
595  _( "&Getting Started in KiCad" ),
596  _( "Open \"Getting Started in KiCad\" guide for beginners" ),
597  KiBitmap( help_xpm ) );
598 
599  wxString text = AddHotkeyName( _( "&List Hotkeys..." ), g_Board_Editor_Hotkeys_Descr, HK_HELP );
601  text,
602  _( "Display current hotkeys list and corresponding commands" ),
603  KiBitmap( hotkeys_xpm ) );
604 
605  aParentMenu->AppendSeparator();
606 
607  AddMenuItem( aParentMenu, ID_HELP_GET_INVOLVED,
608  _( "Get &Involved" ),
609  _( "Contribute to KiCad (opens a web browser)" ),
610  KiBitmap( info_xpm ) );
611 
612  aParentMenu->AppendSeparator();
613 
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:251
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_Board_Editor_Hotkeys_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)

References AddHotkeyName(), AddMenuItem(), g_Board_Editor_Hotkeys_Descr, HK_HELP, ID_HELP_GET_INVOLVED, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, and KiBitmap().

Referenced by PCB_EDIT_FRAME::ReCreateMenuBar().

◆ prepareInspectMenu()

void prepareInspectMenu ( wxMenu *  aParentMenu)
static

Definition at line 404 of file menubar_pcb_editor.cpp.

405 {
406  wxString text;
407 
408  AddMenuItem( aParentMenu, ID_MENU_LIST_NETS,
409  _( "&List Nets" ),
410  _( "View list of nets with names and IDs" ),
411  KiBitmap( list_nets_xpm ) );
412 
413  text = AddHotkeyName( _( "&Measure" ), g_Board_Editor_Hotkeys_Descr, HK_MEASURE_TOOL );
414  AddMenuItem( aParentMenu, ID_PCB_MEASUREMENT_TOOL, text,
415  _( "Measure distance" ),
416  KiBitmap( measurement_xpm ) );
417 
418  aParentMenu->AppendSeparator();
419 
420  AddMenuItem( aParentMenu, ID_DRC_CONTROL,
421  _( "&Design Rules Checker" ),
422  _( "Perform design rules check" ),
423  KiBitmap( erc_xpm ) );
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:251
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_Board_Editor_Hotkeys_Descr[]
PCB_EDIT_FRAME::OnSelectOptionToolbar ID_PCB_MEASUREMENT_TOOL
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)

References AddHotkeyName(), AddMenuItem(), g_Board_Editor_Hotkeys_Descr, HK_MEASURE_TOOL, ID_DRC_CONTROL, ID_MENU_LIST_NETS, ID_PCB_MEASUREMENT_TOOL, and KiBitmap().

Referenced by PCB_EDIT_FRAME::ReCreateMenuBar().

◆ prepareLibraryMenu()

void prepareLibraryMenu ( wxMenu *  aParentMenu)
static

Definition at line 428 of file menubar_pcb_editor.cpp.

429 {
430  AddMenuItem( aParentMenu,
432  _( "&Configure Paths..." ),
433  _( "Edit path configuration environment variables" ),
434  KiBitmap( path_xpm ) );
435 
436  AddMenuItem( aParentMenu, ID_PCB_LIB_TABLE_EDIT,
437  _( "Manage &Footprint Libraries..." ),
438  _( "Edit the global and project footprint library lists" ),
439  KiBitmap( library_table_xpm ) );
440 
441 #ifdef BUILD_GITHUB_PLUGIN
443  _( "Add &3D Shapes Libraries Wizard..." ),
444  _( "Download 3D shape libraries from GitHub" ),
445  KiBitmap( import3d_xpm ) );
446 #endif
447 }
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:251
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79

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

Referenced by PCB_EDIT_FRAME::ReCreateMenuBar().

◆ preparePlaceMenu()

void preparePlaceMenu ( wxMenu *  aParentMenu)
static

Definition at line 451 of file menubar_pcb_editor.cpp.

452 {
453  wxString text;
454 
455  text = AddHotkeyName( _( "&Footprint" ), g_Board_Editor_Hotkeys_Descr, HK_ADD_MODULE );
456  AddMenuItem( aParentMenu, ID_PCB_MODULE_BUTT, text, _( "Add footprint" ),
457  KiBitmap( module_xpm ) );
458 
460  AddMenuItem( aParentMenu, ID_PCB_DRAW_VIA_BUTT, text, _( "Add via" ),
461  KiBitmap( add_via_xpm ) );
462 
463  text = AddHotkeyName( _( "&Zone" ), g_Board_Editor_Hotkeys_Descr, HK_ADD_ZONE );
464  AddMenuItem( aParentMenu, ID_PCB_ZONES_BUTT, text, _( "Add filled zone" ),
465  KiBitmap( add_zone_xpm ) );
466 
467  text = AddHotkeyName( _( "&Keepout Area" ), g_Board_Editor_Hotkeys_Descr, HK_ADD_KEEPOUT );
468  AddMenuItem( aParentMenu, ID_PCB_KEEPOUT_AREA_BUTT, text, _( "Add keepout area" ),
469  KiBitmap( add_keepout_area_xpm ) );
470 
471  text = AddHotkeyName( _( "Te&xt" ), g_Board_Editor_Hotkeys_Descr, HK_ADD_TEXT );
472  AddMenuItem( aParentMenu, ID_PCB_ADD_TEXT_BUTT, text,
473  _( "Add text on copper layers or graphic text" ), KiBitmap( text_xpm ) );
474 
475  text = AddHotkeyName( _( "&Arc" ), g_Board_Editor_Hotkeys_Descr, HK_ADD_ARC );
476  AddMenuItem( aParentMenu, ID_PCB_ARC_BUTT, text, _( "Add graphic arc" ),
477  KiBitmap( add_arc_xpm ) );
478 
479  text = AddHotkeyName( _( "&Circle" ), g_Board_Editor_Hotkeys_Descr, HK_ADD_CIRCLE );
480  AddMenuItem( aParentMenu, ID_PCB_CIRCLE_BUTT, text, _( "Add graphic circle" ),
481  KiBitmap( add_circle_xpm ) );
482 
483  text = AddHotkeyName( _( "&Line" ), g_Board_Editor_Hotkeys_Descr, HK_ADD_LINE );
484  AddMenuItem( aParentMenu, ID_PCB_ADD_LINE_BUTT, text, _( "Add graphic line" ),
485  KiBitmap( add_graphical_segments_xpm ) );
486 
487  text = AddHotkeyName( _( "&Polygon" ), g_Board_Editor_Hotkeys_Descr, HK_ADD_POLYGON );
488  AddMenuItem( aParentMenu, ID_PCB_ADD_POLYGON_BUTT, text, _( "Add graphic polygon" ),
489  KiBitmap( add_graphical_polygon_xpm ) );
490 
491  aParentMenu->AppendSeparator();
492 
493  text = AddHotkeyName( _( "&Dimension" ), g_Board_Editor_Hotkeys_Descr, HK_ADD_DIMENSION );
494  AddMenuItem( aParentMenu, ID_PCB_DIMENSION_BUTT, text, _( "Add dimension" ),
495  KiBitmap( add_dimension_xpm ) );
496 
497  AddMenuItem( aParentMenu, ID_PCB_TARGET_BUTT, _( "La&yer Alignment Target" ),
498  _( "Add layer alignment target" ), KiBitmap( add_pcb_target_xpm ) );
499 
500  aParentMenu->AppendSeparator();
501 
503  _( "Dr&ill and Place Offset" ),
504  _( "Place origin point for drill and place files" ),
505  KiBitmap( pcb_offset_xpm ) );
506 
508  _( "&Grid Origin" ),
509  _( "Set grid origin point" ),
510  KiBitmap( grid_select_axis_xpm ) );
511 
512  aParentMenu->AppendSeparator();
513 
514  wxMenu* autoplaceSubmenu = new wxMenu;
516  _( "A&utomatically Place Off-Board Footprints" ), "",
517  KiBitmap( grid_select_axis_xpm ) // fixme: icons
518  );
519 
521  _( "Automatically Place &Selected Components" ), "",
522  KiBitmap( grid_select_axis_xpm ) // fixme: icons
523  );
524 
525  AddMenuItem( aParentMenu, autoplaceSubmenu, -1, _( "Place Footprints Au&tomatically" ),
526  _( "Automatically place all footprints" ),
527  KiBitmap( grid_select_axis_xpm ) // fixme: icons
528  );
529 }
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:251
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_Board_Editor_Hotkeys_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[]

References AddHotkeyName(), AddMenuItem(), g_Board_Editor_Hotkeys_Descr, HK_ADD_ARC, HK_ADD_CIRCLE, HK_ADD_DIMENSION, HK_ADD_FREE_VIA, HK_ADD_KEEPOUT, HK_ADD_LINE, HK_ADD_MODULE, HK_ADD_POLYGON, HK_ADD_TEXT, HK_ADD_ZONE, 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_DRAW_VIA_BUTT, ID_PCB_KEEPOUT_AREA_BUTT, ID_PCB_MODULE_BUTT, ID_PCB_PLACE_GRID_COORD_BUTT, ID_PCB_PLACE_OFFSET_COORD_BUTT, ID_PCB_TARGET_BUTT, ID_PCB_ZONES_BUTT, ID_POPUP_PCB_AUTOPLACE_OFF_BOARD_MODULES, ID_POPUP_PCB_AUTOPLACE_SELECTED_MODULES, KiBitmap(), and text_xpm.

Referenced by PCB_EDIT_FRAME::ReCreateMenuBar().

◆ preparePreferencesMenu()

void preparePreferencesMenu ( PCB_EDIT_FRAME aFrame,
wxMenu *  aParentMenu 
)
static

Definition at line 313 of file menubar_pcb_editor.cpp.

314 {
315 
316  wxString text;
317 
318  text = AddHotkeyName( _( "&Preferences..." ), g_Board_Editor_Hotkeys_Descr, HK_PREFERENCES );
319  AddMenuItem( aParentMenu, wxID_PREFERENCES, text,
320  _( "Show preferences for all open tools" ),
321  KiBitmap( preference_xpm ) );
322 
323  if( ADVANCED_CFG::GetCfg().AllowLegacyCanvas() )
324  {
325  text = AddHotkeyName(
326  _( "Legacy Tool&set" ), g_Board_Editor_Hotkeys_Descr, HK_CANVAS_LEGACY );
327  AddMenuItem( aParentMenu, ID_MENU_CANVAS_LEGACY, text,
328  _( "Use Legacy Toolset (not all features will be available)" ),
329  KiBitmap( tools_xpm ), wxITEM_RADIO );
330  }
331 
332  text = AddHotkeyName( _( "Modern Toolset (&Accelerated)" ), g_Board_Editor_Hotkeys_Descr,
334  AddMenuItem( aParentMenu, ID_MENU_CANVAS_OPENGL, text,
335  _( "Use Modern Toolset with hardware-accelerated graphics (recommended)" ),
336  KiBitmap( tools_xpm ), wxITEM_RADIO );
337 
338  text = AddHotkeyName( _( "Modern Toolset (Fallbac&k)" ), g_Board_Editor_Hotkeys_Descr,
339  HK_CANVAS_CAIRO );
340  AddMenuItem( aParentMenu, ID_MENU_CANVAS_CAIRO, text,
341  _( "Use Modern Toolset with software graphics (fall-back)" ),
342  KiBitmap( tools_xpm ), wxITEM_RADIO );
343 
344  aParentMenu->AppendSeparator();
345 
346  // Language submenu
347  Pgm().AddMenuLanguageList( aParentMenu );
348 }
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:251
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_Board_Editor_Hotkeys_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 ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers of advanced config.
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:815

References AddHotkeyName(), AddMenuItem(), PGM_BASE::AddMenuLanguageList(), g_Board_Editor_Hotkeys_Descr, ADVANCED_CFG::GetCfg(), HK_CANVAS_CAIRO, HK_CANVAS_LEGACY, HK_CANVAS_OPENGL, HK_PREFERENCES, ID_MENU_CANVAS_CAIRO, ID_MENU_CANVAS_LEGACY, ID_MENU_CANVAS_OPENGL, KiBitmap(), and Pgm().

Referenced by PCB_EDIT_FRAME::ReCreateMenuBar().

◆ prepareRouteMenu()

void prepareRouteMenu ( wxMenu *  aParentMenu)
static

Definition at line 352 of file menubar_pcb_editor.cpp.

353 {
354  wxString text;
355 
357  _( "Set &Layer Pair..." ), _( "Change active layer pair" ),
358  KiBitmap( select_layer_pair_xpm ) );
359 
360  aParentMenu->AppendSeparator();
361 
362  text = AddHotkeyName( _( "&Single Track" ), g_Board_Editor_Hotkeys_Descr,
364  AddMenuItem( aParentMenu, ID_TRACK_BUTT, text,
365  _( "Interactively route single track" ),
366  KiBitmap( add_tracks_xpm ) );
367 
368  text = AddHotkeyName( _( "&Differential Pair" ), g_Board_Editor_Hotkeys_Descr,
370  AddMenuItem( aParentMenu, ID_DIFF_PAIR_BUTT, text,
371  _( "Interactively route differential pair" ),
372  KiBitmap( ps_diff_pair_xpm ) );
373 
374  aParentMenu->AppendSeparator();
375 
376  text = AddHotkeyName( _( "&Tune Track Length" ), g_Board_Editor_Hotkeys_Descr,
378  AddMenuItem( aParentMenu, ID_TUNE_SINGLE_TRACK_LEN_BUTT, text,
379  _( "Tune length of single track" ),
380  KiBitmap( ps_tune_length_xpm ) );
381 
382  text = AddHotkeyName( _( "Tune Differential Pair &Length" ), g_Board_Editor_Hotkeys_Descr,
384  AddMenuItem( aParentMenu, ID_TUNE_DIFF_PAIR_LEN_BUTT, text,
385  _( "Tune length of differential pair" ),
386  KiBitmap( ps_diff_pair_tune_length_xpm ) );
387 
388  text = AddHotkeyName( _( "Tune Differential Pair S&kew/Phase" ), g_Board_Editor_Hotkeys_Descr,
390  AddMenuItem( aParentMenu, ID_TUNE_DIFF_PAIR_SKEW_BUTT, text,
391  _( "Tune skew/phase of a differential pair" ),
392  KiBitmap( ps_diff_pair_tune_phase_xpm ) );
393 
394  aParentMenu->AppendSeparator();
395 
397  _( "&Interactive Router Settings..." ),
398  _( "Configure interactive router" ),
399  KiBitmap( tools_xpm ) );
400 }
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:251
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_Board_Editor_Hotkeys_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)

References AddHotkeyName(), AddMenuItem(), g_Board_Editor_Hotkeys_Descr, HK_ADD_NEW_TRACK, HK_ROUTE_DIFF_PAIR, HK_ROUTE_TUNE_DIFF_PAIR, HK_ROUTE_TUNE_SINGLE, HK_ROUTE_TUNE_SKEW, ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, ID_DIFF_PAIR_BUTT, ID_MENU_INTERACTIVE_ROUTER_SETTINGS, ID_TRACK_BUTT, ID_TUNE_DIFF_PAIR_LEN_BUTT, ID_TUNE_DIFF_PAIR_SKEW_BUTT, ID_TUNE_SINGLE_TRACK_LEN_BUTT, IS_ACCELERATOR, and KiBitmap().

Referenced by PCB_EDIT_FRAME::ReCreateMenuBar().

◆ prepareToolsMenu()

void prepareToolsMenu ( wxMenu *  aParentMenu)
static

Definition at line 533 of file menubar_pcb_editor.cpp.

534 {
535  AddMenuItem( aParentMenu,
537  _( "Update &PCB from Schematic..." ),
538  _( "Update PCB design with current schematic (forward annotation)" ),
539  KiBitmap( update_pcb_from_sch_xpm ) );
540 
542  _( "Update &Footprints from Library..." ),
543  _( "Update footprints to include any changes from the library" ),
544  KiBitmap( reload_xpm ) );
545 
546  bool needsSeparator = true;
547 
548 #if defined(KICAD_SCRIPTING_WXPYTHON)
549  if( needsSeparator )
550  {
551  aParentMenu->AppendSeparator();
552  needsSeparator = false;
553  }
554 
556  _( "&Scripting Console" ),
557  _( "Show/Hide the Python scripting console" ),
558  KiBitmap( py_script_xpm ) );
559 #endif
560 
561 #if defined(KICAD_SCRIPTING) && defined(KICAD_SCRIPTING_ACTION_MENU)
562  if( needsSeparator )
563  {
564  aParentMenu->AppendSeparator();
565  needsSeparator = false;
566  }
567 
568  wxMenu* submenuActionPluginsMenu = new wxMenu();
569 
570  AddMenuItem( aParentMenu, submenuActionPluginsMenu, ID_TOOLBARH_PCB_ACTION_PLUGIN,
571  _( "&External Plugins..." ),
572  _( "Execute or reload python action plugins" ),
573  KiBitmap( hammer_xpm ) );
574 
575  AddMenuItem( submenuActionPluginsMenu, ID_TOOLBARH_PCB_ACTION_PLUGIN_REFRESH,
576  _( "&Refresh Plugins" ),
577  _( "Reload all python plugins and refresh plugin menus" ),
578  KiBitmap( reload_xpm ) );
579 
580  submenuActionPluginsMenu->AppendSeparator();
581 #endif
582 }
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:251
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79

References AddMenuItem(), ID_MENU_PCB_UPDATE_FOOTPRINTS, ID_TOOLBARH_PCB_ACTION_PLUGIN, ID_TOOLBARH_PCB_ACTION_PLUGIN_REFRESH, ID_TOOLBARH_PCB_SCRIPTING_CONSOLE, ID_UPDATE_PCB_FROM_SCH, and KiBitmap().

Referenced by PCB_EDIT_FRAME::ReCreateMenuBar().

◆ prepareViewMenu()

void prepareViewMenu ( CONDITIONAL_MENU aParentMenu,
PCB_EDIT_FRAME aFrame 
)

Definition at line 706 of file menubar_pcb_editor.cpp.

707 {
708  wxString text;
709 
710 
711 }