You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

852 lines
32 KiB

16 years ago
16 years ago
* KIWAY Milestone A): Make major modules into DLL/DSOs. ! The initial testing of this commit should be done using a Debug build so that all the wxASSERT()s are enabled. Also, be sure and keep enabled the USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it off is senseless anyways. If you want stable code, go back to a prior version, the one tagged with "stable". * Relocate all functionality out of the wxApp derivative into more finely targeted purposes: a) DLL/DSO specific b) PROJECT specific c) EXE or process specific d) configuration file specific data e) configuration file manipulations functions. All of this functionality was blended into an extremely large wxApp derivative and that was incompatible with the desire to support multiple concurrently loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects. An amazing amount of organization come from simply sorting each bit of functionality into the proper box. * Switch to wxConfigBase from wxConfig everywhere except instantiation. * Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD, PGM_SINGLE_TOP, * Remove "Return" prefix on many function names. * Remove obvious comments from CMakeLists.txt files, and from else() and endif()s. * Fix building boost for use in a DSO on linux. * Remove some of the assumptions in the CMakeLists.txt files that windows had to be the host platform when building windows binaries. * Reduce the number of wxStrings being constructed at program load time via static construction. * Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that these functions are useful even when the wxConfigBase comes from another source, as is the case in the KICAD_MANAGER_FRAME. * Move the setting of the KIPRJMOD environment variable into class PROJECT, so that it can be moved into a project variable soon, and out of FP_LIB_TABLE. * Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all its child wxFrames and wxDialogs now have a Kiway() member function which returns a KIWAY& that that window tree branch is in support of. This is like wxWindows DNA in that child windows get this member with proper value at time of construction. * Anticipate some of the needs for milestones B) and C) and make code adjustments now in an effort to reduce work in those milestones. * No testing has been done for python scripting, since milestone C) has that being largely reworked and re-thought-out.
12 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
* KIWAY Milestone A): Make major modules into DLL/DSOs. ! The initial testing of this commit should be done using a Debug build so that all the wxASSERT()s are enabled. Also, be sure and keep enabled the USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it off is senseless anyways. If you want stable code, go back to a prior version, the one tagged with "stable". * Relocate all functionality out of the wxApp derivative into more finely targeted purposes: a) DLL/DSO specific b) PROJECT specific c) EXE or process specific d) configuration file specific data e) configuration file manipulations functions. All of this functionality was blended into an extremely large wxApp derivative and that was incompatible with the desire to support multiple concurrently loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects. An amazing amount of organization come from simply sorting each bit of functionality into the proper box. * Switch to wxConfigBase from wxConfig everywhere except instantiation. * Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD, PGM_SINGLE_TOP, * Remove "Return" prefix on many function names. * Remove obvious comments from CMakeLists.txt files, and from else() and endif()s. * Fix building boost for use in a DSO on linux. * Remove some of the assumptions in the CMakeLists.txt files that windows had to be the host platform when building windows binaries. * Reduce the number of wxStrings being constructed at program load time via static construction. * Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that these functions are useful even when the wxConfigBase comes from another source, as is the case in the KICAD_MANAGER_FRAME. * Move the setting of the KIPRJMOD environment variable into class PROJECT, so that it can be moved into a project variable soon, and out of FP_LIB_TABLE. * Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all its child wxFrames and wxDialogs now have a Kiway() member function which returns a KIWAY& that that window tree branch is in support of. This is like wxWindows DNA in that child windows get this member with proper value at time of construction. * Anticipate some of the needs for milestones B) and C) and make code adjustments now in an effort to reduce work in those milestones. * No testing has been done for python scripting, since milestone C) has that being largely reworked and re-thought-out.
12 years ago
* KIWAY Milestone A): Make major modules into DLL/DSOs. ! The initial testing of this commit should be done using a Debug build so that all the wxASSERT()s are enabled. Also, be sure and keep enabled the USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it off is senseless anyways. If you want stable code, go back to a prior version, the one tagged with "stable". * Relocate all functionality out of the wxApp derivative into more finely targeted purposes: a) DLL/DSO specific b) PROJECT specific c) EXE or process specific d) configuration file specific data e) configuration file manipulations functions. All of this functionality was blended into an extremely large wxApp derivative and that was incompatible with the desire to support multiple concurrently loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects. An amazing amount of organization come from simply sorting each bit of functionality into the proper box. * Switch to wxConfigBase from wxConfig everywhere except instantiation. * Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD, PGM_SINGLE_TOP, * Remove "Return" prefix on many function names. * Remove obvious comments from CMakeLists.txt files, and from else() and endif()s. * Fix building boost for use in a DSO on linux. * Remove some of the assumptions in the CMakeLists.txt files that windows had to be the host platform when building windows binaries. * Reduce the number of wxStrings being constructed at program load time via static construction. * Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that these functions are useful even when the wxConfigBase comes from another source, as is the case in the KICAD_MANAGER_FRAME. * Move the setting of the KIPRJMOD environment variable into class PROJECT, so that it can be moved into a project variable soon, and out of FP_LIB_TABLE. * Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all its child wxFrames and wxDialogs now have a Kiway() member function which returns a KIWAY& that that window tree branch is in support of. This is like wxWindows DNA in that child windows get this member with proper value at time of construction. * Anticipate some of the needs for milestones B) and C) and make code adjustments now in an effort to reduce work in those milestones. * No testing has been done for python scripting, since milestone C) has that being largely reworked and re-thought-out.
12 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
14 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
14 years ago
14 years ago
16 years ago
14 years ago
16 years ago
16 years ago
16 years ago
16 years ago
14 years ago
16 years ago
14 years ago
16 years ago
14 years ago
Introduction of Graphics Abstraction Layer based rendering for pcbnew. New classes: - VIEW - represents view that is seen by user, takes care of layer ordering & visibility and how it is displayed (which location, how much zoomed, etc.) - VIEW_ITEM - Base class for every item that can be displayed on VIEW (the biggest change is that now it may be necessary to override ViewBBox & ViewGetLayers method for derived classes). - EDA_DRAW_PANEL_GAL - Inherits after EDA_DRAW_PANEL, displays VIEW output, right now it is not editable (in opposite to usual EDA_DRAW_PANEL). - GAL/OPENGL_GAL/CAIRO_GAL - Base Graphics Abstraction Layer class + two different flavours (Cairo is not fully supported yet), that offers methods to draw primitives using different libraries. - WX_VIEW_CONTROLS - Controller for VIEW, handles user events, allows zooming, panning, etc. - PAINTER/PCB_PAINTER - Classes that uses GAL interface to draw items (as you may have already guessed - PCB_PAINTER is a class for drawing PCB specific object, PAINTER is an abstract class). Its methods are invoked by VIEW, when an item has to be drawn. To display a new type of item - you need to implement draw(ITEM_TYPE*) method that draws it using GAL methods. - STROKE_FONT - Implements stroke font drawing using GAL methods. Most important changes to Kicad original code: * EDA_ITEM now inherits from VIEW_ITEM, which is a base class for all drawable objects. * EDA_DRAW_FRAME contains both usual EDA_DRAW_PANEL and new EDA_DRAW_PANEL_GAL, that can be switched anytime. * There are some new layers for displaying multilayer pads, vias & pads holes (these are not shown yet on the right sidebar in pcbnew) * Display order of layers is different than in previous versions (if you are curious - you may check m_galLayerOrder@pcbnew/basepcbframe.cpp). Preserving usual order would result in not very natural display, such as showing silkscreen texts on the bottom. * Introduced new hotkey (Alt+F12) and new menu option (View->Switch canvas) for switching canvas during runtime. * Some of classes (mostly derived from BOARD_ITEM) now includes ViewBBox & ViewGetLayers methods. * Removed tools/class_painter.h, as now it is extended and included in source code. Build changes: * GAL-based rendering option is turned on by a new compilation CMake option KICAD_GAL. * When compiling with CMake option KICAD_GAL=ON, GLEW and Cairo libraries are required. * GAL-related code is compiled into a static library (common/libgal). * Build with KICAD_GAL=OFF should not need any new libraries and should come out as a standard version of Kicad Currently most of items in pcbnew can be displayed using OpenGL (to be done are DIMENSIONS and MARKERS). More details about GAL can be found in: http://www.ohwr.org/attachments/1884/view-spec.pdf
13 years ago
Introduction of Graphics Abstraction Layer based rendering for pcbnew. New classes: - VIEW - represents view that is seen by user, takes care of layer ordering & visibility and how it is displayed (which location, how much zoomed, etc.) - VIEW_ITEM - Base class for every item that can be displayed on VIEW (the biggest change is that now it may be necessary to override ViewBBox & ViewGetLayers method for derived classes). - EDA_DRAW_PANEL_GAL - Inherits after EDA_DRAW_PANEL, displays VIEW output, right now it is not editable (in opposite to usual EDA_DRAW_PANEL). - GAL/OPENGL_GAL/CAIRO_GAL - Base Graphics Abstraction Layer class + two different flavours (Cairo is not fully supported yet), that offers methods to draw primitives using different libraries. - WX_VIEW_CONTROLS - Controller for VIEW, handles user events, allows zooming, panning, etc. - PAINTER/PCB_PAINTER - Classes that uses GAL interface to draw items (as you may have already guessed - PCB_PAINTER is a class for drawing PCB specific object, PAINTER is an abstract class). Its methods are invoked by VIEW, when an item has to be drawn. To display a new type of item - you need to implement draw(ITEM_TYPE*) method that draws it using GAL methods. - STROKE_FONT - Implements stroke font drawing using GAL methods. Most important changes to Kicad original code: * EDA_ITEM now inherits from VIEW_ITEM, which is a base class for all drawable objects. * EDA_DRAW_FRAME contains both usual EDA_DRAW_PANEL and new EDA_DRAW_PANEL_GAL, that can be switched anytime. * There are some new layers for displaying multilayer pads, vias & pads holes (these are not shown yet on the right sidebar in pcbnew) * Display order of layers is different than in previous versions (if you are curious - you may check m_galLayerOrder@pcbnew/basepcbframe.cpp). Preserving usual order would result in not very natural display, such as showing silkscreen texts on the bottom. * Introduced new hotkey (Alt+F12) and new menu option (View->Switch canvas) for switching canvas during runtime. * Some of classes (mostly derived from BOARD_ITEM) now includes ViewBBox & ViewGetLayers methods. * Removed tools/class_painter.h, as now it is extended and included in source code. Build changes: * GAL-based rendering option is turned on by a new compilation CMake option KICAD_GAL. * When compiling with CMake option KICAD_GAL=ON, GLEW and Cairo libraries are required. * GAL-related code is compiled into a static library (common/libgal). * Build with KICAD_GAL=OFF should not need any new libraries and should come out as a standard version of Kicad Currently most of items in pcbnew can be displayed using OpenGL (to be done are DIMENSIONS and MARKERS). More details about GAL can be found in: http://www.ohwr.org/attachments/1884/view-spec.pdf
13 years ago
Introduction of Graphics Abstraction Layer based rendering for pcbnew. New classes: - VIEW - represents view that is seen by user, takes care of layer ordering & visibility and how it is displayed (which location, how much zoomed, etc.) - VIEW_ITEM - Base class for every item that can be displayed on VIEW (the biggest change is that now it may be necessary to override ViewBBox & ViewGetLayers method for derived classes). - EDA_DRAW_PANEL_GAL - Inherits after EDA_DRAW_PANEL, displays VIEW output, right now it is not editable (in opposite to usual EDA_DRAW_PANEL). - GAL/OPENGL_GAL/CAIRO_GAL - Base Graphics Abstraction Layer class + two different flavours (Cairo is not fully supported yet), that offers methods to draw primitives using different libraries. - WX_VIEW_CONTROLS - Controller for VIEW, handles user events, allows zooming, panning, etc. - PAINTER/PCB_PAINTER - Classes that uses GAL interface to draw items (as you may have already guessed - PCB_PAINTER is a class for drawing PCB specific object, PAINTER is an abstract class). Its methods are invoked by VIEW, when an item has to be drawn. To display a new type of item - you need to implement draw(ITEM_TYPE*) method that draws it using GAL methods. - STROKE_FONT - Implements stroke font drawing using GAL methods. Most important changes to Kicad original code: * EDA_ITEM now inherits from VIEW_ITEM, which is a base class for all drawable objects. * EDA_DRAW_FRAME contains both usual EDA_DRAW_PANEL and new EDA_DRAW_PANEL_GAL, that can be switched anytime. * There are some new layers for displaying multilayer pads, vias & pads holes (these are not shown yet on the right sidebar in pcbnew) * Display order of layers is different than in previous versions (if you are curious - you may check m_galLayerOrder@pcbnew/basepcbframe.cpp). Preserving usual order would result in not very natural display, such as showing silkscreen texts on the bottom. * Introduced new hotkey (Alt+F12) and new menu option (View->Switch canvas) for switching canvas during runtime. * Some of classes (mostly derived from BOARD_ITEM) now includes ViewBBox & ViewGetLayers methods. * Removed tools/class_painter.h, as now it is extended and included in source code. Build changes: * GAL-based rendering option is turned on by a new compilation CMake option KICAD_GAL. * When compiling with CMake option KICAD_GAL=ON, GLEW and Cairo libraries are required. * GAL-related code is compiled into a static library (common/libgal). * Build with KICAD_GAL=OFF should not need any new libraries and should come out as a standard version of Kicad Currently most of items in pcbnew can be displayed using OpenGL (to be done are DIMENSIONS and MARKERS). More details about GAL can be found in: http://www.ohwr.org/attachments/1884/view-spec.pdf
13 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
14 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
  5. * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
  6. * Copyright (C) 2012 Wayne Stambaugh <stambaughw@gmail.com>
  7. * Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2
  12. * of the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, you may find one here:
  21. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  22. * or you may search the http://www.gnu.org website for the version 2 license,
  23. * or you may write to the Free Software Foundation, Inc.,
  24. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  25. */
  26. /**
  27. * @file menubar_pcbframe.cpp
  28. * Pcbnew editor menu bar
  29. */
  30. #include <menus_helpers.h>
  31. #include <kiface_i.h>
  32. #include <pgm_base.h>
  33. #include <wxPcbStruct.h>
  34. #include "help_common_strings.h"
  35. #include "hotkeys.h"
  36. #include "pcbnew.h"
  37. #include "pcbnew_id.h"
  38. // Build the place submenu
  39. static void preparePlaceMenu( wxMenu* aParentMenu );
  40. // Build the files menu. Because some commands are available only if
  41. // Pcbnew is run outside a project (run alone), aIsOutsideProject is false
  42. // when Pcbnew is run from Kicad manager, and true is run as stand alone app.
  43. static void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject );
  44. // Build the export submenu (inside files menu)
  45. static void prepareExportMenu( wxMenu* aParentMenu );
  46. // Build the tools menu
  47. static void prepareToolsMenu( wxMenu* aParentMenu );
  48. // Build the help menu
  49. static void prepareHelpMenu( wxMenu* aParentMenu );
  50. // Build the edit menu
  51. static void prepareEditMenu( wxMenu* aParentMenu, bool aUseGal );
  52. // Build the route menu
  53. static void prepareRouteMenu( wxMenu* aParentMenu );
  54. // Build the view menu
  55. static void prepareViewMenu( wxMenu* aParentMenu );
  56. // Build the dimensions menu
  57. static void prepareDimensionsMenu( wxMenu* aParentMenu );
  58. // Build the library management menu
  59. static void prepareLibraryMenu( wxMenu* aParentMenu );
  60. // Build the design rules menu
  61. static void prepareDesignRulesMenu( wxMenu* aParentMenu );
  62. // Build the preferences menu
  63. static void preparePreferencesMenu( PCB_EDIT_FRAME* aFrame, wxMenu* aParentMenu );
  64. void PCB_EDIT_FRAME::ReCreateMenuBar()
  65. {
  66. wxString text;
  67. wxMenuBar* menuBar = GetMenuBar();
  68. if( !menuBar )
  69. menuBar = new wxMenuBar();
  70. // Delete all existing menus so they can be rebuilt.
  71. // This allows language changes of the menu text on the fly.
  72. menuBar->Freeze();
  73. while( menuBar->GetMenuCount() )
  74. delete menuBar->Remove( 0 );
  75. // Recreate all menus:
  76. // Create File Menu
  77. wxMenu* filesMenu = new wxMenu;
  78. prepareFilesMenu( filesMenu, Kiface().IsSingle() );
  79. //----- Edit menu -----------------------------------------------------------
  80. wxMenu* editMenu = new wxMenu;
  81. prepareEditMenu( editMenu, IsGalCanvasActive() );
  82. //----- View menu -----------------------------------------------------------
  83. wxMenu* viewMenu = new wxMenu;
  84. prepareViewMenu( viewMenu );
  85. //----- Place Menu ----------------------------------------------------------
  86. wxMenu* placeMenu = new wxMenu;
  87. preparePlaceMenu( placeMenu );
  88. //----------- Route Menu ----------------------------------------------------
  89. wxMenu* routeMenu = new wxMenu;
  90. prepareRouteMenu( routeMenu );
  91. //----- Preferences and configuration menu------------------------------------
  92. wxMenu* configmenu = new wxMenu;
  93. prepareLibraryMenu( configmenu );
  94. configmenu->AppendSeparator();
  95. preparePreferencesMenu( this, configmenu );
  96. // Update menu labels:
  97. configmenu->SetLabel( ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER,
  98. m_show_layer_manager_tools ?
  99. _( "Hide La&yers Manager" ) : _("Show La&yers Manager" ) );
  100. configmenu->SetLabel( ID_MENU_PCB_SHOW_HIDE_MUWAVE_TOOLBAR,
  101. m_show_microwave_tools ?
  102. _( "Hide Microwa&ve Toolbar" ): _( "Show Microwa&ve Toolbar" ) );
  103. //--- dimensions submenu ------------------------------------------------------
  104. wxMenu* dimensionsMenu = new wxMenu;
  105. prepareDimensionsMenu( dimensionsMenu );
  106. //----- Tools menu ----------------------------------------------------------
  107. wxMenu* toolsMenu = new wxMenu;
  108. prepareToolsMenu( toolsMenu );
  109. //----- Design Rules menu -----------------------------------------------------
  110. wxMenu* designRulesMenu = new wxMenu;
  111. prepareDesignRulesMenu( designRulesMenu );
  112. //------ Help menu ----------------------------------------------------------------
  113. wxMenu* helpMenu = new wxMenu;
  114. prepareHelpMenu( helpMenu );
  115. // Append all menus to the menuBar
  116. menuBar->Append( filesMenu, _( "&File" ) );
  117. menuBar->Append( editMenu, _( "&Edit" ) );
  118. menuBar->Append( viewMenu, _( "&View" ) );
  119. menuBar->Append( placeMenu, _( "&Place" ) );
  120. menuBar->Append( routeMenu, _( "Ro&ute" ) );
  121. menuBar->Append( configmenu, _( "P&references" ) );
  122. menuBar->Append( dimensionsMenu, _( "D&imensions" ) );
  123. menuBar->Append( toolsMenu, _( "&Tools" ) );
  124. menuBar->Append( designRulesMenu, _( "&Design Rules" ) );
  125. menuBar->Append( helpMenu, _( "&Help" ) );
  126. menuBar->Thaw();
  127. // Associate the menu bar with the frame, if no previous menubar
  128. if( GetMenuBar() == NULL )
  129. SetMenuBar( menuBar );
  130. else
  131. menuBar->Refresh();
  132. #if defined(KICAD_SCRIPTING) && defined(KICAD_SCRIPTING_ACTION_MENU)
  133. // Populate the Action Plugin sub-menu
  134. RebuildActionPluginMenus();
  135. #endif
  136. }
  137. // Build the design rules menu
  138. void prepareDesignRulesMenu( wxMenu* aParentMenu )
  139. {
  140. AddMenuItem( aParentMenu, ID_MENU_PCB_SHOW_DESIGN_RULES_DIALOG,
  141. _( "&Design Rules" ),
  142. _( "Open design rules editor" ), KiBitmap( config_xpm ) );
  143. AddMenuItem( aParentMenu, ID_PCB_LAYERS_SETUP,
  144. _( "&Layers Setup" ), _( "Enable and set layer properties" ),
  145. KiBitmap( copper_layers_setup_xpm ) );
  146. }
  147. // Build the preferences menu
  148. void preparePreferencesMenu( PCB_EDIT_FRAME* aFrame, wxMenu* aParentMenu )
  149. {
  150. AddMenuItem( aParentMenu, ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER,
  151. _( "Hide La&yers Manager" ),
  152. HELP_SHOW_HIDE_LAYERMANAGER,
  153. KiBitmap( layers_manager_xpm ) );
  154. AddMenuItem( aParentMenu, ID_MENU_PCB_SHOW_HIDE_MUWAVE_TOOLBAR,
  155. _( "Hide Microwa&ve Toolbar" ),
  156. HELP_SHOW_HIDE_MICROWAVE_TOOLS,
  157. KiBitmap( mw_toolbar_xpm ) );
  158. #ifdef __WXMAC__
  159. aParentMenu->Append( wxID_PREFERENCES );
  160. #else
  161. AddMenuItem( aParentMenu, wxID_PREFERENCES,
  162. _( "&General Settings" ), _( "Select general options for Pcbnew" ),
  163. KiBitmap( preference_xpm ) );
  164. #endif
  165. AddMenuItem( aParentMenu, ID_PCB_DISPLAY_OPTIONS_SETUP,
  166. _( "&Display and Hide" ),
  167. _( "Select how items (pads, tracks, texts) are displayed" ),
  168. KiBitmap( display_options_xpm ) );
  169. AddMenuItem( aParentMenu, ID_MENU_INTERACTIVE_ROUTER_SETTINGS,
  170. _( "&Interactive Routing" ),
  171. _( "Configure interactive router" ),
  172. KiBitmap( add_tracks_xpm ) ); // fixme: icon
  173. // Language submenu
  174. aParentMenu->AppendSeparator();
  175. Pgm().AddMenuLanguageList( aParentMenu );
  176. // Icons options submenu
  177. aFrame->AddMenuIconsOptions( aParentMenu );
  178. // Hotkey submenu
  179. AddHotkeyConfigMenu( aParentMenu );
  180. aParentMenu->AppendSeparator();
  181. AddMenuItem( aParentMenu, ID_CONFIG_SAVE,
  182. _( "&Save Preferences" ),
  183. _( "Save application preferences" ),
  184. KiBitmap( save_setup_xpm ) );
  185. AddMenuItem( aParentMenu, ID_CONFIG_READ,
  186. _( "Load Prefe&rences" ),
  187. _( "Load application preferences" ),
  188. KiBitmap( read_setup_xpm ) );
  189. }
  190. // Build the route menu
  191. void prepareRouteMenu( wxMenu* aParentMenu )
  192. {
  193. AddMenuItem( aParentMenu, ID_TRACK_BUTT,
  194. _( "&Single Track" ),
  195. _( "Interactively route single track" ),
  196. KiBitmap( add_tracks_xpm ) );
  197. AddMenuItem( aParentMenu, ID_DIFF_PAIR_BUTT,
  198. _( "&Differential Pair" ),
  199. _( "Interactively route differential pair" ),
  200. KiBitmap( ps_diff_pair_xpm ) );
  201. aParentMenu->AppendSeparator();
  202. AddMenuItem( aParentMenu, ID_TUNE_SINGLE_TRACK_LEN_BUTT,
  203. _( "&Tune Track Length" ),
  204. _( "Tune length of single track" ),
  205. KiBitmap( ps_tune_length_xpm ) );
  206. AddMenuItem( aParentMenu, ID_TUNE_DIFF_PAIR_LEN_BUTT,
  207. _( "Tune Differential Pair &Length" ),
  208. _( "Tune length of differential pair" ),
  209. KiBitmap( ps_diff_pair_tune_length_xpm ) );
  210. AddMenuItem( aParentMenu, ID_TUNE_DIFF_PAIR_SKEW_BUTT,
  211. _( "Tune Differential Pair &Skew/Phase" ),
  212. _( "Tune skew/phase of a differential pair" ),
  213. KiBitmap( ps_diff_pair_tune_phase_xpm ) );
  214. }
  215. // Build the library management menu
  216. void prepareLibraryMenu( wxMenu* aParentMenu )
  217. {
  218. AddMenuItem( aParentMenu, ID_PCB_LIB_WIZARD,
  219. _( "&Footprint Library Wizard" ), _( "Add footprint library using wizard" ),
  220. KiBitmap( wizard_add_fplib_small_xpm ) );
  221. AddMenuItem( aParentMenu, ID_PCB_LIB_TABLE_EDIT,
  222. _( "Footprint Li&brary Table" ), _( "Configure footprint library table" ),
  223. KiBitmap( library_table_xpm ) );
  224. // Path configuration edit dialog.
  225. AddMenuItem( aParentMenu,
  226. ID_PREFERENCES_CONFIGURE_PATHS,
  227. _( "Configure Pa&ths" ),
  228. _( "Edit path configuration environment variables" ),
  229. KiBitmap( path_xpm ) );
  230. #ifdef BUILD_GITHUB_PLUGIN
  231. AddMenuItem( aParentMenu, ID_PCB_3DSHAPELIB_WIZARD,
  232. _( "&3D Shape Downloader" ),
  233. _( "Download from Github 3D shape libraries using wizard" ),
  234. KiBitmap( import3d_xpm ) );
  235. #endif
  236. }
  237. // Build the place submenu
  238. void preparePlaceMenu( wxMenu* aParentMenu )
  239. {
  240. wxString text;
  241. text = AddHotkeyName( _( "&Footprint" ), g_Pcbnew_Editor_Hokeys_Descr,
  242. HK_ADD_MODULE );
  243. AddMenuItem( aParentMenu, ID_PCB_MODULE_BUTT, text,
  244. _( "Add footprints" ), KiBitmap( module_xpm ) );
  245. text = AddHotkeyName( _( "&Track" ), g_Pcbnew_Editor_Hokeys_Descr,
  246. HK_ADD_NEW_TRACK, IS_ACCELERATOR );
  247. AddMenuItem( aParentMenu, ID_TRACK_BUTT, text,
  248. _( "Add tracks and vias" ), KiBitmap( add_tracks_xpm ) );
  249. AddMenuItem( aParentMenu, ID_PCB_ZONES_BUTT,
  250. _( "&Zone" ), _( "Add filled zones" ), KiBitmap( add_zone_xpm ) );
  251. AddMenuItem( aParentMenu, ID_PCB_KEEPOUT_AREA_BUTT,
  252. _( "&Keepout Area" ), _( "Add keepout areas" ), KiBitmap( add_keepout_area_xpm ) );
  253. AddMenuItem( aParentMenu, ID_PCB_ADD_TEXT_BUTT,
  254. _( "Te&xt" ), _( "Add text on copper layers or graphic text" ),
  255. KiBitmap( text_xpm ) );
  256. AddMenuItem( aParentMenu, ID_PCB_ARC_BUTT,
  257. _( "&Arc" ), _( "Add graphic arc" ),KiBitmap( add_arc_xpm ) );
  258. AddMenuItem( aParentMenu, ID_PCB_CIRCLE_BUTT,
  259. _( "&Circle" ), _( "Add graphic circle" ),
  260. KiBitmap( add_circle_xpm ) );
  261. AddMenuItem( aParentMenu, ID_PCB_ADD_LINE_BUTT,
  262. _( "&Lines" ),
  263. _( "Add graphic lines" ),
  264. KiBitmap( add_graphical_segments_xpm ) );
  265. AddMenuItem( aParentMenu, ID_PCB_ADD_POLYGON_BUTT,
  266. _( "&Polygons" ),
  267. _( "Add graphic polygons" ),
  268. KiBitmap( add_graphical_polygon_xpm ) );
  269. aParentMenu->AppendSeparator();
  270. AddMenuItem( aParentMenu, ID_PCB_DIMENSION_BUTT,
  271. _( "&Dimension" ), _( "Add dimension" ),
  272. KiBitmap( add_dimension_xpm ) );
  273. AddMenuItem( aParentMenu, ID_PCB_MIRE_BUTT,
  274. _( "La&yer Alignment Target" ), _( "Add layer alignment target" ),
  275. KiBitmap( add_mires_xpm ) );
  276. aParentMenu->AppendSeparator();
  277. AddMenuItem( aParentMenu, ID_PCB_PLACE_OFFSET_COORD_BUTT,
  278. _( "Drill and &Place Offset" ),
  279. _( "Place origin point for drill and place files" ),
  280. KiBitmap( pcb_offset_xpm ) );
  281. AddMenuItem( aParentMenu, ID_PCB_PLACE_GRID_COORD_BUTT,
  282. _( "&Grid Origin" ),
  283. _( "Set grid origin point" ),
  284. KiBitmap( grid_select_axis_xpm ) );
  285. }
  286. // Build the tools menu
  287. void prepareToolsMenu( wxMenu* aParentMenu )
  288. {
  289. AddMenuItem( aParentMenu,
  290. ID_UPDATE_PCB_FROM_SCH,
  291. _( "Update PCB from Schematic" ),
  292. _( "Update PCB design with current schematic (forward annotation)" ),
  293. KiBitmap( import_brd_file_xpm ) );
  294. aParentMenu->AppendSeparator( );
  295. AddMenuItem( aParentMenu, ID_GET_NETLIST,
  296. _( "Load &Netlist" ),
  297. _( "Read netlist and update board connectivity" ),
  298. KiBitmap( netlist_xpm ) );
  299. AddMenuItem( aParentMenu, ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR,
  300. _( "Set &Layer Pair" ), _( "Change active layer pair" ),
  301. KiBitmap( select_layer_pair_xpm ) );
  302. AddMenuItem( aParentMenu, ID_DRC_CONTROL,
  303. _( "&Design Rules Check" ),
  304. _( "Perform design rules check" ), KiBitmap( erc_xpm ) );
  305. AddMenuItem( aParentMenu, ID_TOOLBARH_PCB_FREEROUTE_ACCESS,
  306. _( "&FreeRoute" ),
  307. _( "Fast access to the FreeROUTE external advanced router" ),
  308. KiBitmap( web_support_xpm ) );
  309. #if defined(KICAD_SCRIPTING_WXPYTHON)
  310. AddMenuItem( aParentMenu, ID_TOOLBARH_PCB_SCRIPTING_CONSOLE,
  311. _( "&Scripting Console" ),
  312. _( "Show/Hide the Python scripting console" ),
  313. KiBitmap( py_script_xpm ) );
  314. #endif
  315. #if defined(KICAD_SCRIPTING) && defined(KICAD_SCRIPTING_ACTION_MENU)
  316. aParentMenu->AppendSeparator( );
  317. wxMenu* submenuActionPluginsMenu = new wxMenu();
  318. AddMenuItem( aParentMenu, submenuActionPluginsMenu, ID_TOOLBARH_PCB_ACTION_PLUGIN,
  319. _( "&External Plugins" ),
  320. _( "Execute or reload python action plugins" ),
  321. KiBitmap( hammer_xpm ) );
  322. AddMenuItem( submenuActionPluginsMenu, ID_TOOLBARH_PCB_ACTION_PLUGIN_REFRESH,
  323. _( "&Refresh Plugins" ),
  324. _( "Reload all python plugins and refresh plugin menus" ),
  325. KiBitmap( reload_xpm ) );
  326. submenuActionPluginsMenu->AppendSeparator();
  327. #endif
  328. }
  329. // Build the help menu
  330. void prepareHelpMenu( wxMenu* aParentMenu )
  331. {
  332. AddMenuItem( aParentMenu, wxID_HELP,
  333. _( "Pcbnew &Manual" ),
  334. _( "Open Pcbnew Manual" ),
  335. KiBitmap( online_help_xpm ) );
  336. AddMenuItem( aParentMenu, wxID_INDEX,
  337. _( "&Getting Started in KiCad" ),
  338. _( "Open \"Getting Started in KiCad\" guide for beginners" ),
  339. KiBitmap( help_xpm ) );
  340. AddMenuItem( aParentMenu, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
  341. _( "&List Hotkeys" ),
  342. _( "Display current hotkeys list and corresponding commands" ),
  343. KiBitmap( hotkeys_xpm ) );
  344. aParentMenu->AppendSeparator();
  345. AddMenuItem( aParentMenu, ID_HELP_GET_INVOLVED,
  346. _( "Get &Involved" ),
  347. _( "Contribute to KiCad - open web browser" ),
  348. KiBitmap( info_xpm ) );
  349. aParentMenu->AppendSeparator();
  350. AddMenuItem( aParentMenu, wxID_ABOUT,
  351. _( "&About KiCad" ),
  352. _( "Display KiCad About dialog" ),
  353. KiBitmap( about_xpm ) );
  354. }
  355. // Build the edit menu
  356. void prepareEditMenu( wxMenu* aParentMenu, bool aUseGal )
  357. {
  358. wxString text;
  359. text = AddHotkeyName( _( "&Undo" ), g_Pcbnew_Editor_Hokeys_Descr, HK_UNDO );
  360. AddMenuItem( aParentMenu, wxID_UNDO, text, HELP_UNDO, KiBitmap( undo_xpm ) );
  361. text = AddHotkeyName( _( "&Redo" ), g_Pcbnew_Editor_Hokeys_Descr, HK_REDO );
  362. AddMenuItem( aParentMenu, wxID_REDO, text, HELP_REDO, KiBitmap( redo_xpm ) );
  363. AddMenuItem( aParentMenu, ID_PCB_DELETE_ITEM_BUTT,
  364. _( "&Delete" ), _( "Delete items" ),
  365. KiBitmap( delete_xpm ) );
  366. aParentMenu->AppendSeparator();
  367. text = AddHotkeyName( _( "&Find" ), g_Pcbnew_Editor_Hokeys_Descr, HK_FIND_ITEM );
  368. AddMenuItem( aParentMenu, ID_FIND_ITEMS, text, HELP_FIND , KiBitmap( find_xpm ) );
  369. aParentMenu->AppendSeparator();
  370. AddMenuItem( aParentMenu, ID_PCB_EDIT_ALL_VIAS_AND_TRACK_SIZE,
  371. _( "Edit All Tracks and Vias" ), KiBitmap( width_track_via_xpm ) );
  372. AddMenuItem( aParentMenu, ID_MENU_PCB_RESET_TEXTMODULE_FIELDS_SIZES,
  373. _( "Set Footp&rint Field Sizes" ),
  374. _( "Set text size and width of footprint fields" ),
  375. KiBitmap( reset_text_xpm ) );
  376. AddMenuItem( aParentMenu, ID_MENU_PCB_SWAP_LAYERS,
  377. _( "&Swap Layers" ),
  378. _( "Swap tracks on copper layers or drawings on other layers" ),
  379. KiBitmap( swap_layer_xpm ) );
  380. aParentMenu->AppendSeparator();
  381. AddMenuItem( aParentMenu, ID_PCB_GLOBAL_DELETE,
  382. _( "&Global Deletions" ),
  383. _( "Delete tracks, footprints and texts on board" ),
  384. KiBitmap( general_deletions_xpm ) );
  385. AddMenuItem( aParentMenu, ID_MENU_PCB_CLEAN,
  386. _( "&Cleanup Tracks and Vias" ),
  387. _( "Clean stubs, vias, delete break points or unconnected tracks" ),
  388. KiBitmap( delete_xpm ) );
  389. }
  390. // Build the view menu
  391. void prepareViewMenu( wxMenu* aParentMenu )
  392. {
  393. wxString text;
  394. /* Important Note for ZOOM IN and ZOOM OUT commands from menubar:
  395. * we cannot add hotkey info here, because the hotkey HK_ZOOM_IN and HK_ZOOM_OUT
  396. * events(default = WXK_F1 and WXK_F2) are *NOT* equivalent to this menu command:
  397. * zoom in and out from hotkeys are equivalent to the pop up menu zoom
  398. * From here, zooming is made around the screen center
  399. * From hotkeys, zooming is made around the mouse cursor position
  400. * (obviously not possible from the toolbar or menubar command)
  401. *
  402. * in other words HK_ZOOM_IN and HK_ZOOM_OUT *are NOT* accelerators
  403. * for Zoom in and Zoom out sub menus
  404. */
  405. text = AddHotkeyName( _( "Zoom &In" ), g_Pcbnew_Editor_Hokeys_Descr,
  406. HK_ZOOM_IN, IS_ACCELERATOR );
  407. AddMenuItem( aParentMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, KiBitmap( zoom_in_xpm ) );
  408. text = AddHotkeyName( _( "Zoom &Out" ), g_Pcbnew_Editor_Hokeys_Descr,
  409. HK_ZOOM_OUT, IS_ACCELERATOR );
  410. AddMenuItem( aParentMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, KiBitmap( zoom_out_xpm ) );
  411. text = AddHotkeyName( _( "&Fit on Screen" ), g_Pcbnew_Editor_Hokeys_Descr,
  412. HK_ZOOM_AUTO );
  413. AddMenuItem( aParentMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT,
  414. KiBitmap( zoom_fit_in_page_xpm ) );
  415. text = AddHotkeyName( _( "&Redraw" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_REDRAW );
  416. AddMenuItem( aParentMenu, ID_ZOOM_REDRAW, text,
  417. HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );
  418. aParentMenu->AppendSeparator();
  419. text = AddHotkeyName( _( "&3D Viewer" ), g_Pcbnew_Editor_Hokeys_Descr, HK_3D_VIEWER );
  420. AddMenuItem( aParentMenu, ID_MENU_PCB_SHOW_3D_FRAME, text, _( "Show board in 3D viewer" ),
  421. KiBitmap( three_d_xpm ) );
  422. AddMenuItem( aParentMenu, ID_MENU_LIST_NETS,
  423. _( "&List Nets" ), _( "View list of nets with names and IDs" ),
  424. KiBitmap( list_nets_xpm ) );
  425. aParentMenu->AppendSeparator();
  426. AddMenuItem( aParentMenu, ID_MENU_PCB_FLIP_VIEW,
  427. _( "Flip &Board View" ),
  428. _( "Flip (mirror) the board view" ),
  429. KiBitmap( flip_board_xpm ), wxITEM_CHECK );
  430. aParentMenu->AppendSeparator();
  431. text = AddHotkeyName( _( "Legacy Canva&s" ), g_Pcbnew_Editor_Hokeys_Descr,
  432. HK_CANVAS_LEGACY );
  433. aParentMenu->Append(
  434. new wxMenuItem( aParentMenu, ID_MENU_CANVAS_LEGACY,
  435. text, _( "Switch canvas implementation to Legacy" ),
  436. wxITEM_RADIO ) );
  437. text = AddHotkeyName( _( "Open&GL Canvas" ), g_Pcbnew_Editor_Hokeys_Descr,
  438. HK_CANVAS_OPENGL );
  439. aParentMenu->Append(
  440. new wxMenuItem( aParentMenu, ID_MENU_CANVAS_OPENGL,
  441. text, _( "Switch canvas implementation to OpenGL" ),
  442. wxITEM_RADIO ) );
  443. text = AddHotkeyName( _( "&Cairo Canvas" ), g_Pcbnew_Editor_Hokeys_Descr,
  444. HK_CANVAS_CAIRO );
  445. aParentMenu->Append(
  446. new wxMenuItem( aParentMenu, ID_MENU_CANVAS_CAIRO,
  447. text, _( "Switch canvas implementation to Cairo" ),
  448. wxITEM_RADIO ) );
  449. }
  450. // Build the dimensions menu
  451. void prepareDimensionsMenu( wxMenu* aParentMenu )
  452. {
  453. AddMenuItem( aParentMenu, ID_PCB_USER_GRID_SETUP,
  454. _( "User Defined G&rid" ),_( "Adjust custom user-defined grid dimensions" ),
  455. KiBitmap( grid_xpm ) );
  456. AddMenuItem( aParentMenu, ID_PCB_DRAWINGS_WIDTHS_SETUP,
  457. _( "Te&xts and Drawings" ),
  458. _( "Adjust dimensions for texts and drawings" ),
  459. KiBitmap( text_xpm ) );
  460. AddMenuItem( aParentMenu, ID_PCB_PAD_SETUP,
  461. _( "&Pads Size" ), _( "Adjust default pad characteristics" ),
  462. KiBitmap( pad_dimensions_xpm ) );
  463. AddMenuItem( aParentMenu, ID_PCB_MASK_CLEARANCE,
  464. _( "Pads to &Mask Clearance" ),
  465. _( "Adjust global clearance between pads and solder resist mask" ),
  466. KiBitmap( pads_mask_layers_xpm ) );
  467. AddMenuItem( aParentMenu, ID_MENU_DIFF_PAIR_DIMENSIONS,
  468. _( "&Differential Pairs" ),
  469. _( "Define global gap/width for differential pairs." ),
  470. KiBitmap( ps_diff_pair_xpm ) );
  471. aParentMenu->AppendSeparator();
  472. AddMenuItem( aParentMenu, ID_CONFIG_SAVE,
  473. _( "&Save Preferences" ), _( "Save dimension preferences" ),
  474. KiBitmap( save_xpm ) );
  475. }
  476. // Build the files menu.
  477. void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject )
  478. {
  479. wxString text;
  480. // Some commands are available only if Pcbnew is run outside a project (run alone).
  481. // aIsOutsideProject is false when Pcbnew is run from Kicad manager.
  482. if( aIsOutsideProject )
  483. {
  484. AddMenuItem( aParentMenu, ID_NEW_BOARD,
  485. _( "&New Board" ),
  486. _( "Create new board" ),
  487. KiBitmap( new_generic_xpm ) );
  488. text = AddHotkeyName( _( "&Open Board" ), g_Pcbnew_Editor_Hokeys_Descr, HK_LOAD_BOARD );
  489. AddMenuItem( aParentMenu, ID_LOAD_FILE, text,
  490. _( "Load existing board" ),
  491. KiBitmap( open_brd_file_xpm ) );
  492. }
  493. wxFileHistory& fhist = Kiface().GetFileHistory();
  494. // Load Recent submenu
  495. static wxMenu* openRecentMenu;
  496. // Add this menu to list menu managed by m_fileHistory
  497. // (the file history will be updated when adding/removing files in history
  498. if( openRecentMenu )
  499. fhist.RemoveMenu( openRecentMenu );
  500. openRecentMenu = new wxMenu();
  501. fhist.UseMenu( openRecentMenu );
  502. fhist.AddFilesToMenu();
  503. if( aIsOutsideProject )
  504. {
  505. AddMenuItem( aParentMenu, openRecentMenu,
  506. -1, _( "Open &Recent" ),
  507. _( "Open recently opened board" ),
  508. KiBitmap( open_project_xpm ) );
  509. AddMenuItem( aParentMenu, ID_APPEND_FILE,
  510. _( "&Append Board" ),
  511. _( "Append another board to currently loaded board" ),
  512. KiBitmap( import_xpm ) );
  513. AddMenuItem( aParentMenu, ID_IMPORT_NON_KICAD_BOARD,
  514. _( "Import Non-Kicad Board File" ),
  515. _( "Import board file from other applications" ),
  516. KiBitmap( import_brd_file_xpm ) );
  517. aParentMenu->AppendSeparator();
  518. }
  519. text = AddHotkeyName( _( "&Save" ), g_Pcbnew_Editor_Hokeys_Descr, HK_SAVE_BOARD );
  520. AddMenuItem( aParentMenu, ID_SAVE_BOARD, text,
  521. _( "Save current board" ),
  522. KiBitmap( save_xpm ) );
  523. // Save as menu:
  524. // under a project mgr we do not want to modify the board filename
  525. // to keep consistency with the project mgr which expects files names same as prj name
  526. // for main files
  527. // when not under a project mgr, we are free to change filenames, cwd ...
  528. if( Kiface().IsSingle() ) // not when under a project mgr (pcbnew is run as stand alone)
  529. {
  530. text = AddHotkeyName( _( "Sa&ve As" ), g_Pcbnew_Editor_Hokeys_Descr, HK_SAVE_BOARD_AS );
  531. AddMenuItem( aParentMenu, ID_SAVE_BOARD_AS, text,
  532. _( "Save current board with new name" ),
  533. KiBitmap( save_as_xpm ) );
  534. }
  535. // under a project mgr, we can save a copy of the board,
  536. // but do not change the current board file name
  537. else
  538. {
  539. text = AddHotkeyName( _( "Sa&ve Copy As" ), g_Pcbnew_Editor_Hokeys_Descr, HK_SAVE_BOARD_AS );
  540. AddMenuItem( aParentMenu, ID_COPY_BOARD_AS, text,
  541. _( "Save copy of the current board" ),
  542. KiBitmap( save_as_xpm ) );
  543. }
  544. aParentMenu->AppendSeparator();
  545. AddMenuItem( aParentMenu, ID_MENU_READ_BOARD_BACKUP_FILE,
  546. _( "Revert to Las&t Backup" ),
  547. _( "Clear board and get previous backup version of board" ),
  548. KiBitmap( undo_xpm ) );
  549. AddMenuItem( aParentMenu, ID_MENU_RECOVER_BOARD_AUTOSAVE,
  550. _( "Resc&ue" ),
  551. _( "Clear board and get last rescue file automatically saved by Pcbnew" ),
  552. KiBitmap( rescue_xpm ) );
  553. aParentMenu->AppendSeparator();
  554. //----- Fabrication Outputs submenu -----------------------------------------
  555. wxMenu* fabricationOutputsMenu = new wxMenu;
  556. AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_POS_MODULES_FILE,
  557. _( "Footprint &Position (.pos) File" ),
  558. _( "Generate footprint position file for pick and place" ),
  559. KiBitmap( post_compo_xpm ) );
  560. AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_DRILL_FILE,
  561. _( "&Drill (.drl) File" ),
  562. _( "Generate excellon2 drill file" ),
  563. KiBitmap( post_drill_xpm ) );
  564. AddMenuItem( fabricationOutputsMenu, ID_GEN_EXPORT_FILE_MODULE_REPORT,
  565. _( "&Footprint (.rpt) Report.." ),
  566. _( "Create report of all footprints from current board" ),
  567. KiBitmap( tools_xpm ) );
  568. AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_D356_FILE,
  569. _( "IPC-D-356 Netlist File" ),
  570. _( "Generate IPC-D-356 netlist file" ),
  571. KiBitmap( netlist_xpm ) );
  572. AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_BOM_FILE_FROM_BOARD,
  573. _( "&BOM File" ),
  574. _( "Create bill of materials from current schematic" ),
  575. KiBitmap( bom_xpm ) );
  576. AddMenuItem( aParentMenu, fabricationOutputsMenu,
  577. -1, _( "&Fabrication Outputs" ),
  578. _( "Generate files for fabrication" ),
  579. KiBitmap( fabrication_xpm ) );
  580. //----- Import submenu ------------------------------------------------------
  581. wxMenu* submenuImport = new wxMenu();
  582. AddMenuItem( submenuImport, ID_GEN_IMPORT_SPECCTRA_SESSION,
  583. _( "&Specctra Session" ),
  584. _( "Import routed \"Specctra Session\" (*.ses) file" ),
  585. KiBitmap( import_xpm ) );
  586. AddMenuItem( submenuImport, ID_GEN_IMPORT_DXF_FILE,
  587. _( "&DXF File" ),
  588. _( "Import 2D Drawing DXF file to Pcbnew on Drawings layer" ),
  589. KiBitmap( import_xpm ) );
  590. AddMenuItem( aParentMenu, submenuImport,
  591. ID_GEN_IMPORT_FILE, _( "&Import" ),
  592. _( "Import files" ), KiBitmap( import_xpm ) );
  593. //----- Export submenu ------------------------------------------------------
  594. wxMenu* submenuexport = new wxMenu();
  595. prepareExportMenu( submenuexport );
  596. AddMenuItem( aParentMenu, submenuexport,
  597. ID_GEN_EXPORT_FILE, _( "E&xport" ),
  598. _( "Export board" ), KiBitmap( export_xpm ) );
  599. aParentMenu->AppendSeparator();
  600. AddMenuItem( aParentMenu, ID_SHEET_SET,
  601. _( "Page S&ettings" ),
  602. _( "Settings for sheet size and frame references" ),
  603. KiBitmap( sheetset_xpm ) );
  604. AddMenuItem( aParentMenu, wxID_PRINT,
  605. _( "&Print" ), _( "Print board" ),
  606. KiBitmap( print_button_xpm ) );
  607. AddMenuItem( aParentMenu, ID_GEN_PLOT_SVG,
  608. _( "Export SV&G" ),
  609. _( "Export board file in Scalable Vector Graphics format" ),
  610. KiBitmap( plot_svg_xpm ) );
  611. AddMenuItem( aParentMenu, ID_GEN_PLOT,
  612. _( "P&lot" ),
  613. _( "Plot board in HPGL, PostScript or Gerber RS-274X format)" ),
  614. KiBitmap( plot_xpm ) );
  615. aParentMenu->AppendSeparator();
  616. //----- archive submenu -----------------------------------------------------
  617. wxMenu* submenuarchive = new wxMenu();
  618. AddMenuItem( submenuarchive, ID_MENU_ARCHIVE_MODULES_IN_LIBRARY,
  619. _( "&Archive Footprints in Project Library" ),
  620. _( "Archive all footprints in existing library in footprint Lib table"
  621. "(does not remove other footprints in this library)" ),
  622. KiBitmap( library_archive_xpm ) );
  623. AddMenuItem( submenuarchive, ID_MENU_CREATE_LIBRARY_AND_ARCHIVE_MODULES,
  624. _( "&Create New Library and Archive Footprints" ),
  625. _( "Archive all footprints in new library\n"
  626. "(if the library already exists it will be deleted)" ),
  627. KiBitmap( library_archive_as_xpm ) );
  628. AddMenuItem( aParentMenu, submenuarchive,
  629. ID_MENU_ARCHIVE_MODULES,
  630. _( "Arc&hive Footprints" ),
  631. _( "Archive or add all footprints in library file" ),
  632. KiBitmap( library_archive_xpm ) );
  633. aParentMenu->AppendSeparator();
  634. AddMenuItem( aParentMenu, wxID_EXIT, _( "&Close" ), _( "Close Pcbnew" ), KiBitmap( exit_xpm ) );
  635. }
  636. // Build the import/export submenu (inside files menu)
  637. void prepareExportMenu( wxMenu* aParentMenu )
  638. {
  639. AddMenuItem( aParentMenu, ID_GEN_EXPORT_SPECCTRA,
  640. _( "&Specctra DSN" ),
  641. _( "Export current board to \"Specctra DSN\" file" ),
  642. KiBitmap( export_dsn_xpm ) );
  643. AddMenuItem( aParentMenu, ID_GEN_EXPORT_FILE_GENCADFORMAT,
  644. _( "&GenCAD" ), _( "Export GenCAD format" ),
  645. KiBitmap( export_xpm ) );
  646. AddMenuItem( aParentMenu, ID_GEN_EXPORT_FILE_VRML,
  647. _( "&VRML" ),
  648. _( "Export VRML board representation" ),
  649. KiBitmap( three_d_xpm ) );
  650. AddMenuItem( aParentMenu, ID_GEN_EXPORT_FILE_IDF3,
  651. _( "I&DFv3" ), _( "IDFv3 board and component export" ),
  652. KiBitmap( export_idf_xpm ) );
  653. AddMenuItem( aParentMenu, ID_GEN_EXPORT_FILE_STEP,
  654. _( "S&TEP" ), _( "STEP export" ),
  655. KiBitmap( export_idf_xpm ) );
  656. AddMenuItem( aParentMenu, ID_PCB_GEN_CMP_FILE,
  657. _( "&Component (.cmp) File" ),
  658. _( "Export component file (*.cmp) for Eeschema footprint field back-annotation" ),
  659. KiBitmap( create_cmp_file_xpm ) );
  660. }