2011-10-18 19:59:19 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2018-04-01 19:09:52 +00:00
|
|
|
* Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
2017-10-22 00:48:25 +00:00
|
|
|
* Copyright (C) 2009 Wayne Stambaugh <stambaughw@gmail.com>
|
2019-04-02 12:31:28 +00:00
|
|
|
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
2011-10-18 19:59:19 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2009-09-25 18:49:04 +00:00
|
|
|
|
2016-03-11 16:40:24 +00:00
|
|
|
#include <kiface_i.h>
|
2012-04-09 09:16:47 +00:00
|
|
|
#include <menus_helpers.h>
|
2016-03-11 16:40:24 +00:00
|
|
|
#include <pgm_base.h>
|
2019-05-13 20:42:40 +00:00
|
|
|
#include <tool/conditional_menu.h>
|
|
|
|
#include <tool/tool_manager.h>
|
|
|
|
#include <tools/ee_selection_tool.h>
|
|
|
|
#include <tools/ee_actions.h>
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2016-03-11 16:40:24 +00:00
|
|
|
#include "eeschema_id.h"
|
|
|
|
#include "general.h"
|
|
|
|
#include "help_common_strings.h"
|
2019-05-10 17:19:48 +00:00
|
|
|
#include "ee_hotkeys.h"
|
2018-01-30 10:49:51 +00:00
|
|
|
#include "sch_edit_frame.h"
|
2015-06-21 20:30:33 +00:00
|
|
|
|
2019-05-13 20:42:40 +00:00
|
|
|
class CONDITIONAL_MENU;
|
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
// helper functions that build specific submenus:
|
|
|
|
|
|
|
|
// Build the tools menu
|
|
|
|
static void prepareToolsMenu( wxMenu* aParentMenu );
|
|
|
|
|
|
|
|
|
2010-12-08 20:12:46 +00:00
|
|
|
void SCH_EDIT_FRAME::ReCreateMenuBar()
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2019-05-13 20:42:40 +00:00
|
|
|
EE_SELECTION_TOOL* selTool = m_toolManager->GetTool<EE_SELECTION_TOOL>();
|
2018-04-07 13:13:38 +00:00
|
|
|
// wxWidgets handles the Mac Application menu behind the scenes, but that means
|
|
|
|
// we always have to start from scratch with a new wxMenuBar.
|
|
|
|
wxMenuBar* oldMenuBar = GetMenuBar();
|
|
|
|
wxMenuBar* menuBar = new wxMenuBar();
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2019-05-24 23:36:31 +00:00
|
|
|
auto modifiedDocumentCondition = [] ( const SELECTION& sel ) {
|
|
|
|
SCH_SHEET_LIST sheetList( g_RootSheet );
|
|
|
|
return sheetList.IsModified();
|
|
|
|
};
|
|
|
|
|
2019-05-28 13:51:47 +00:00
|
|
|
//-- File menu -----------------------------------------------------------
|
2019-05-13 21:49:05 +00:00
|
|
|
//
|
2019-05-24 23:36:31 +00:00
|
|
|
CONDITIONAL_MENU* fileMenu = new CONDITIONAL_MENU( false, selTool );
|
|
|
|
static ACTION_MENU* openRecentMenu;
|
|
|
|
|
|
|
|
if( Kiface().IsSingle() ) // not when under a project mgr
|
|
|
|
{
|
|
|
|
// Add this menu to list menu managed by m_fileHistory
|
|
|
|
// (the file history will be updated when adding/removing files in history)
|
|
|
|
if( openRecentMenu )
|
|
|
|
Kiface().GetFileHistory().RemoveMenu( openRecentMenu );
|
|
|
|
|
|
|
|
openRecentMenu = new ACTION_MENU();
|
|
|
|
openRecentMenu->SetTool( selTool );
|
|
|
|
openRecentMenu->SetTitle( _( "Open Recent" ) );
|
|
|
|
openRecentMenu->SetIcon( recent_xpm );
|
|
|
|
|
|
|
|
Kiface().GetFileHistory().UseMenu( openRecentMenu );
|
|
|
|
Kiface().GetFileHistory().AddFilesToMenu( openRecentMenu );
|
|
|
|
|
|
|
|
fileMenu->AddItem( ACTIONS::doNew, EE_CONDITIONS::ShowAlways );
|
|
|
|
fileMenu->AddItem( ACTIONS::open, EE_CONDITIONS::ShowAlways );
|
|
|
|
fileMenu->AddMenu( openRecentMenu, EE_CONDITIONS::ShowAlways );
|
|
|
|
fileMenu->AddSeparator();
|
|
|
|
}
|
|
|
|
|
|
|
|
fileMenu->AddItem( ACTIONS::save, modifiedDocumentCondition );
|
|
|
|
fileMenu->AddItem( ACTIONS::saveAs, EE_CONDITIONS::ShowAlways );
|
|
|
|
fileMenu->AddItem( ACTIONS::saveAll, modifiedDocumentCondition );
|
|
|
|
|
2019-05-26 15:36:40 +00:00
|
|
|
fileMenu->AddSeparator();
|
2019-05-24 23:36:31 +00:00
|
|
|
|
|
|
|
fileMenu->AddItem( ID_APPEND_PROJECT, _( "Append Schematic Sheet Content..." ),
|
|
|
|
_( "Append schematic sheet content from another project to the current sheet" ),
|
|
|
|
add_document_xpm, EE_CONDITIONS::ShowAlways );
|
|
|
|
|
|
|
|
fileMenu->AddItem( ID_IMPORT_NON_KICAD_SCH, _( "Import Non KiCad Schematic..." ),
|
|
|
|
_( "Replace current schematic sheet with one imported from another application" ),
|
|
|
|
import_document_xpm, EE_CONDITIONS::ShowAlways );
|
|
|
|
|
|
|
|
fileMenu->AddSeparator();
|
|
|
|
|
|
|
|
// Import submenu
|
|
|
|
ACTION_MENU* submenuImport = new ACTION_MENU();
|
|
|
|
submenuImport->SetTool( selTool );
|
|
|
|
submenuImport->SetTitle( _( "Import" ) );
|
|
|
|
submenuImport->SetIcon( import_xpm );
|
|
|
|
|
|
|
|
submenuImport->Add( _( "Footprint Association File..." ), HELP_IMPORT_FOOTPRINTS,
|
|
|
|
ID_BACKANNO_ITEMS, import_footprint_names_xpm );
|
|
|
|
|
|
|
|
fileMenu->AddMenu( submenuImport, EE_CONDITIONS::ShowAlways );
|
|
|
|
|
|
|
|
|
|
|
|
// Export submenu
|
|
|
|
ACTION_MENU* submenuExport = new ACTION_MENU();
|
|
|
|
submenuExport->SetTool( selTool );
|
|
|
|
submenuExport->SetTitle( _( "Export" ) );
|
|
|
|
submenuExport->SetIcon( export_xpm );
|
|
|
|
|
|
|
|
submenuExport->Add( _( "Drawing to Clipboard" ), _( "Export drawings to clipboard" ),
|
|
|
|
ID_GEN_COPY_SHEET_TO_CLIPBOARD, copy_xpm );
|
|
|
|
|
|
|
|
submenuExport->Add( _( "Netlist..." ), _( "Export netlist file" ),
|
|
|
|
ID_GET_NETLIST, netlist_xpm );
|
|
|
|
|
|
|
|
fileMenu->AddMenu( submenuExport, EE_CONDITIONS::ShowAlways );
|
|
|
|
|
|
|
|
fileMenu->AddSeparator();
|
2019-05-26 22:22:03 +00:00
|
|
|
fileMenu->AddItem( ACTIONS::pageSettings, EE_CONDITIONS::ShowAlways );
|
2019-05-24 23:36:31 +00:00
|
|
|
fileMenu->AddItem( ACTIONS::print, EE_CONDITIONS::ShowAlways );
|
|
|
|
fileMenu->AddItem( ACTIONS::plot, EE_CONDITIONS::ShowAlways );
|
|
|
|
|
|
|
|
fileMenu->AddSeparator();
|
2019-05-26 22:22:03 +00:00
|
|
|
// Don't use ACTIONS::quit; wxWidgets moves this on OSX and expects to find it via wxID_EXIT
|
|
|
|
fileMenu->AddItem( wxID_EXIT, _( "Quit" ), "", exit_xpm, EE_CONDITIONS::ShowAlways );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2019-05-28 13:51:47 +00:00
|
|
|
//-- Edit menu -----------------------------------------------------------
|
2019-05-13 21:49:05 +00:00
|
|
|
//
|
2019-05-15 22:49:48 +00:00
|
|
|
CONDITIONAL_MENU* editMenu = new CONDITIONAL_MENU( false, selTool );
|
|
|
|
|
|
|
|
auto enableUndoCondition = [ this ] ( const SELECTION& sel ) {
|
|
|
|
return GetScreen() && GetScreen()->GetUndoCommandCount() > 0;
|
|
|
|
};
|
|
|
|
auto enableRedoCondition = [ this ] ( const SELECTION& sel ) {
|
|
|
|
return GetScreen() && GetScreen()->GetRedoCommandCount() > 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
editMenu->AddItem( ACTIONS::undo, enableUndoCondition );
|
|
|
|
editMenu->AddItem( ACTIONS::redo, enableRedoCondition );
|
|
|
|
|
|
|
|
editMenu->AddSeparator();
|
2019-05-27 10:40:52 +00:00
|
|
|
editMenu->AddItem( ACTIONS::cut, EE_CONDITIONS::NotEmpty );
|
|
|
|
editMenu->AddItem( ACTIONS::copy, EE_CONDITIONS::NotEmpty );
|
|
|
|
editMenu->AddItem( ACTIONS::paste, EE_CONDITIONS::Idle );
|
|
|
|
editMenu->AddItem( ACTIONS::duplicate, EE_CONDITIONS::NotEmpty );
|
2019-05-15 22:49:48 +00:00
|
|
|
|
|
|
|
editMenu->AddSeparator();
|
2019-05-27 10:40:52 +00:00
|
|
|
editMenu->AddItem( EE_ACTIONS::deleteItemCursor, EE_CONDITIONS::ShowAlways );
|
2019-05-15 22:49:48 +00:00
|
|
|
|
|
|
|
// Find
|
|
|
|
editMenu->AddSeparator();
|
2019-05-27 10:40:52 +00:00
|
|
|
editMenu->AddItem( ACTIONS::find, EE_CONDITIONS::ShowAlways );
|
|
|
|
editMenu->AddItem( ACTIONS::findAndReplace, EE_CONDITIONS::ShowAlways );
|
2019-05-15 22:49:48 +00:00
|
|
|
|
|
|
|
editMenu->AddSeparator();
|
|
|
|
// Update field values
|
|
|
|
editMenu->AddItem( ID_UPDATE_FIELDS, _( "Update Fields from Library..." ),
|
|
|
|
_( "Sets symbol fields to original library values" ),
|
2019-05-27 10:40:52 +00:00
|
|
|
update_fields_xpm, EE_CONDITIONS::ShowAlways );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2019-05-28 13:51:47 +00:00
|
|
|
//-- View menu -----------------------------------------------------------
|
2019-05-13 21:49:05 +00:00
|
|
|
//
|
2019-05-13 20:42:40 +00:00
|
|
|
CONDITIONAL_MENU* viewMenu = new CONDITIONAL_MENU( false, selTool );
|
2009-06-30 10:43:20 +00:00
|
|
|
|
2019-05-13 21:49:05 +00:00
|
|
|
auto belowRootSheetCondition = [] ( const SELECTION& aSel ) {
|
|
|
|
return g_CurrentSheet->Last() != g_RootSheet;
|
|
|
|
};
|
|
|
|
auto gridShownCondition = [ this ] ( const SELECTION& aSel ) {
|
|
|
|
return IsGridVisible();
|
|
|
|
};
|
|
|
|
auto imperialUnitsCondition = [ this ] ( const SELECTION& aSel ) {
|
|
|
|
return GetUserUnits() == INCHES;
|
|
|
|
};
|
|
|
|
auto metricUnitsCondition = [ this ] ( const SELECTION& aSel ) {
|
|
|
|
return GetUserUnits() == MILLIMETRES;
|
|
|
|
};
|
|
|
|
auto fullCrosshairCondition = [ this ] ( const SELECTION& aSel ) {
|
|
|
|
return GetGalDisplayOptions().m_fullscreenCursor;
|
|
|
|
};
|
|
|
|
auto hiddenPinsCondition = [ this ] ( const SELECTION& aSel ) {
|
|
|
|
return GetShowAllPins();
|
|
|
|
};
|
|
|
|
|
|
|
|
viewMenu->AddItem( EE_ACTIONS::showLibraryBrowser, EE_CONDITIONS::ShowAlways );
|
|
|
|
viewMenu->AddItem( EE_ACTIONS::navigateHierarchy, EE_CONDITIONS::ShowAlways );
|
|
|
|
viewMenu->AddItem( EE_ACTIONS::leaveSheet, belowRootSheetCondition );
|
|
|
|
|
|
|
|
viewMenu->AddSeparator();
|
|
|
|
viewMenu->AddItem( ACTIONS::zoomInCenter, EE_CONDITIONS::ShowAlways );
|
|
|
|
viewMenu->AddItem( ACTIONS::zoomOutCenter, EE_CONDITIONS::ShowAlways );
|
|
|
|
viewMenu->AddItem( ACTIONS::zoomFitScreen, EE_CONDITIONS::ShowAlways );
|
|
|
|
viewMenu->AddItem( ACTIONS::zoomTool, EE_CONDITIONS::ShowAlways );
|
|
|
|
viewMenu->AddItem( ACTIONS::zoomRedraw, EE_CONDITIONS::ShowAlways );
|
|
|
|
|
|
|
|
viewMenu->AddSeparator();
|
|
|
|
viewMenu->AddCheckItem( ACTIONS::toggleGrid, gridShownCondition );
|
|
|
|
viewMenu->AddItem( ACTIONS::gridProperties, EE_CONDITIONS::ShowAlways );
|
|
|
|
|
|
|
|
// Units submenu
|
|
|
|
CONDITIONAL_MENU* unitsSubMenu = new CONDITIONAL_MENU( false, selTool );
|
|
|
|
unitsSubMenu->SetTitle( _( "&Units" ) );
|
2019-05-14 19:21:10 +00:00
|
|
|
unitsSubMenu->SetIcon( unit_mm_xpm );
|
2019-05-13 21:49:05 +00:00
|
|
|
unitsSubMenu->AddCheckItem( ACTIONS::imperialUnits, imperialUnitsCondition );
|
|
|
|
unitsSubMenu->AddCheckItem( ACTIONS::metricUnits, metricUnitsCondition );
|
|
|
|
viewMenu->AddMenu( unitsSubMenu );
|
|
|
|
|
|
|
|
viewMenu->AddCheckItem( ACTIONS::toggleCursorStyle, fullCrosshairCondition );
|
|
|
|
|
|
|
|
viewMenu->AddSeparator();
|
|
|
|
viewMenu->AddCheckItem( EE_ACTIONS::toggleHiddenPins, hiddenPinsCondition );
|
|
|
|
|
|
|
|
#ifdef __APPLE__
|
|
|
|
viewMenu->AppendSeparator();
|
|
|
|
#endif
|
|
|
|
|
2019-05-28 13:51:47 +00:00
|
|
|
//-- Place menu -----------------------------------------------------------
|
2019-05-13 21:49:05 +00:00
|
|
|
//
|
2019-05-13 20:42:40 +00:00
|
|
|
CONDITIONAL_MENU* placeMenu = new CONDITIONAL_MENU( false, selTool );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2019-05-13 21:49:05 +00:00
|
|
|
placeMenu->AddItem( EE_ACTIONS::placeSymbol, EE_CONDITIONS::ShowAlways );
|
|
|
|
placeMenu->AddItem( EE_ACTIONS::placePower, EE_CONDITIONS::ShowAlways );
|
|
|
|
placeMenu->AddItem( EE_ACTIONS::drawWire, EE_CONDITIONS::ShowAlways );
|
|
|
|
placeMenu->AddItem( EE_ACTIONS::drawBus, EE_CONDITIONS::ShowAlways );
|
|
|
|
placeMenu->AddItem( EE_ACTIONS::placeBusWireEntry, EE_CONDITIONS::ShowAlways );
|
|
|
|
placeMenu->AddItem( EE_ACTIONS::placeBusBusEntry, EE_CONDITIONS::ShowAlways );
|
|
|
|
placeMenu->AddItem( EE_ACTIONS::placeNoConnect, EE_CONDITIONS::ShowAlways );
|
|
|
|
placeMenu->AddItem( EE_ACTIONS::placeJunction, EE_CONDITIONS::ShowAlways );
|
|
|
|
placeMenu->AddItem( EE_ACTIONS::placeLabel, EE_CONDITIONS::ShowAlways );
|
|
|
|
placeMenu->AddItem( EE_ACTIONS::placeGlobalLabel, EE_CONDITIONS::ShowAlways );
|
|
|
|
|
|
|
|
placeMenu->AddSeparator();
|
|
|
|
placeMenu->AddItem( EE_ACTIONS::placeHierarchicalLabel, EE_CONDITIONS::ShowAlways );
|
|
|
|
placeMenu->AddItem( EE_ACTIONS::drawSheet, EE_CONDITIONS::ShowAlways );
|
|
|
|
placeMenu->AddItem( EE_ACTIONS::importSheetPin, EE_CONDITIONS::ShowAlways );
|
|
|
|
placeMenu->AddItem( EE_ACTIONS::placeSheetPin, EE_CONDITIONS::ShowAlways );
|
|
|
|
|
|
|
|
placeMenu->AddSeparator();
|
|
|
|
placeMenu->AddItem( EE_ACTIONS::drawLines, EE_CONDITIONS::ShowAlways );
|
|
|
|
placeMenu->AddItem( EE_ACTIONS::placeSchematicText, EE_CONDITIONS::ShowAlways );
|
|
|
|
placeMenu->AddItem( EE_ACTIONS::placeImage, EE_CONDITIONS::ShowAlways );
|
|
|
|
|
2019-05-28 13:51:47 +00:00
|
|
|
//-- Inspect menu -----------------------------------------------
|
2019-05-13 21:49:05 +00:00
|
|
|
//
|
2018-02-22 19:05:10 +00:00
|
|
|
wxMenu* inspectMenu = new wxMenu;
|
2019-05-24 23:36:31 +00:00
|
|
|
AddMenuItem( inspectMenu, ID_GET_ERC, _( "Electrical Rules &Checker" ),
|
|
|
|
_( "Perform electrical rules check" ), KiBitmap( erc_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2019-05-28 13:51:47 +00:00
|
|
|
//-- Tools menu -----------------------------------------------
|
2019-05-13 21:49:05 +00:00
|
|
|
//
|
2016-11-20 11:57:16 +00:00
|
|
|
wxMenu* toolsMenu = new wxMenu;
|
|
|
|
prepareToolsMenu( toolsMenu );
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2019-05-28 13:51:47 +00:00
|
|
|
//-- Preferences menu -----------------------------------------------
|
2019-05-13 21:49:05 +00:00
|
|
|
//
|
2019-05-28 13:51:47 +00:00
|
|
|
CONDITIONAL_MENU* prefsMenu = new CONDITIONAL_MENU( false, selTool );
|
|
|
|
|
|
|
|
auto acceleratedGraphicsCondition = [ this ] ( const SELECTION& aSel ) {
|
|
|
|
return GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL;
|
|
|
|
};
|
|
|
|
auto standardGraphicsCondition = [ this ] ( const SELECTION& aSel ) {
|
|
|
|
return GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO;
|
|
|
|
};
|
|
|
|
|
|
|
|
prefsMenu->AddItem( ID_PREFERENCES_CONFIGURE_PATHS, _( "Configure Pa&ths..." ),
|
|
|
|
_( "Edit path configuration environment variables" ),
|
|
|
|
path_xpm, EE_CONDITIONS::ShowAlways );
|
|
|
|
|
|
|
|
prefsMenu->AddItem( ID_EDIT_SYM_LIB_TABLE, _( "Manage Symbol Libraries..." ),
|
|
|
|
_( "Edit the global and project symbol library lists" ),
|
|
|
|
library_table_xpm, EE_CONDITIONS::ShowAlways );
|
|
|
|
|
|
|
|
prefsMenu->AddItem( wxID_PREFERENCES,
|
|
|
|
AddHotkeyName( _( "&Preferences..." ), g_Eeschema_Hotkeys_Descr, HK_PREFERENCES ),
|
|
|
|
_( "Show preferences for all open tools" ),
|
|
|
|
preference_xpm, EE_CONDITIONS::ShowAlways );
|
|
|
|
|
|
|
|
prefsMenu->AddSeparator();
|
|
|
|
Pgm().AddMenuLanguageList( prefsMenu );
|
|
|
|
|
|
|
|
prefsMenu->AddSeparator();
|
|
|
|
prefsMenu->AddCheckItem( ACTIONS::acceleratedGraphics, acceleratedGraphicsCondition );
|
|
|
|
prefsMenu->AddCheckItem( ACTIONS::standardGraphics, standardGraphicsCondition );
|
2018-02-22 19:05:10 +00:00
|
|
|
|
2019-05-28 13:51:47 +00:00
|
|
|
//-- Menubar -----------------------------------------------
|
|
|
|
//
|
2016-11-20 11:57:16 +00:00
|
|
|
menuBar->Append( fileMenu, _( "&File" ) );
|
|
|
|
menuBar->Append( editMenu, _( "&Edit" ) );
|
|
|
|
menuBar->Append( viewMenu, _( "&View" ) );
|
|
|
|
menuBar->Append( placeMenu, _( "&Place" ) );
|
2018-02-22 19:05:10 +00:00
|
|
|
menuBar->Append( inspectMenu, _( "&Inspect" ) );
|
2016-11-20 11:57:16 +00:00
|
|
|
menuBar->Append( toolsMenu, _( "&Tools" ) );
|
2019-05-28 13:51:47 +00:00
|
|
|
menuBar->Append( prefsMenu, _( "P&references" ) );
|
2019-05-18 10:27:36 +00:00
|
|
|
AddStandardHelpMenu( menuBar );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2018-04-07 13:13:38 +00:00
|
|
|
SetMenuBar( menuBar );
|
|
|
|
delete oldMenuBar;
|
2016-11-20 11:57:16 +00:00
|
|
|
}
|
2011-12-01 16:49:28 +00:00
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
void prepareToolsMenu( wxMenu* aParentMenu )
|
|
|
|
{
|
|
|
|
wxString text;
|
2011-07-02 12:48:45 +00:00
|
|
|
|
2019-04-01 17:14:16 +00:00
|
|
|
text = AddHotkeyName( _( "Update PCB from Schematic..." ), g_Schematic_Hotkeys_Descr,
|
2017-12-24 15:04:02 +00:00
|
|
|
HK_UPDATE_PCB_FROM_SCH );
|
2016-01-29 10:24:39 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
2016-01-29 10:24:39 +00:00
|
|
|
ID_UPDATE_PCB_FROM_SCH,
|
2019-03-07 13:59:32 +00:00
|
|
|
text, _( "Update PCB design with current schematic." ),
|
2018-07-25 22:44:57 +00:00
|
|
|
KiBitmap( update_pcb_from_sch_xpm ) );
|
2016-01-29 10:24:39 +00:00
|
|
|
|
2016-01-29 14:43:40 +00:00
|
|
|
// Run Pcbnew
|
2018-05-14 17:34:18 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_RUN_PCB, _( "&Open PCB Editor" ),
|
2016-01-29 14:43:40 +00:00
|
|
|
_( "Run Pcbnew" ),
|
|
|
|
KiBitmap( pcbnew_xpm ) );
|
2016-01-29 10:24:39 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
aParentMenu->AppendSeparator();
|
2016-01-29 10:24:39 +00:00
|
|
|
|
2018-05-14 17:34:18 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_RUN_LIBRARY, _( "Symbol Library &Editor" ),
|
|
|
|
HELP_RUN_LIB_EDITOR,
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( libedit_xpm ) );
|
2011-07-02 12:48:45 +00:00
|
|
|
|
2018-05-14 17:34:18 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_RESCUE_CACHED, _( "&Rescue Symbols..." ),
|
2017-10-22 00:48:25 +00:00
|
|
|
_( "Find old symbols in project and rename/rescue them" ),
|
|
|
|
KiBitmap( rescue_xpm ) );
|
|
|
|
|
2019-04-02 12:31:28 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_REMAP_SYMBOLS, _( "Remap S&ymbols..." ),
|
2017-10-22 00:48:25 +00:00
|
|
|
_( "Remap legacy library symbols to symbol library table" ),
|
2017-06-02 09:51:11 +00:00
|
|
|
KiBitmap( rescue_xpm ) );
|
2015-04-25 22:26:51 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
aParentMenu->AppendSeparator();
|
2011-07-02 12:48:45 +00:00
|
|
|
|
2018-05-14 17:34:18 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_OPEN_CMP_TABLE, _( "Edit Symbol Field&s..." ),
|
2018-02-22 19:05:10 +00:00
|
|
|
KiBitmap( spreadsheet_xpm ) );
|
2018-03-16 12:38:36 +00:00
|
|
|
|
2018-05-14 17:34:18 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_EDIT_COMPONENTS_TO_SYMBOLS_LIB_ID,
|
2019-04-02 12:31:28 +00:00
|
|
|
_( "Edit Symbol &Library References..." ),
|
2018-04-20 14:31:45 +00:00
|
|
|
_( "Edit links between schematic symbols and library symbols" ),
|
|
|
|
KiBitmap( edit_cmp_symb_links_xpm ) );
|
|
|
|
|
|
|
|
aParentMenu->AppendSeparator();
|
|
|
|
|
2018-05-14 17:34:18 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_GET_ANNOTATE, _( "&Annotate Schematic..." ),
|
|
|
|
HELP_ANNOTATE,
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( annotate_xpm ) );
|
2011-07-02 12:48:45 +00:00
|
|
|
|
2019-03-07 13:59:32 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_BUS_MANAGER, _( "Bus &Definitions..." ),
|
2019-03-11 21:32:05 +00:00
|
|
|
HELP_BUS_MANAGER,
|
2019-04-02 12:31:28 +00:00
|
|
|
KiBitmap( bus_definition_tool_xpm ) );
|
2019-03-11 21:32:05 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
aParentMenu->AppendSeparator();
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2015-09-08 18:45:11 +00:00
|
|
|
// Run CvPcb
|
2018-05-14 17:34:18 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_RUN_CVPCB, _( "A&ssign Footprints..." ),
|
2018-04-04 18:22:28 +00:00
|
|
|
_( "Assign PCB footprints to schematic symbols" ),
|
2015-09-08 18:45:11 +00:00
|
|
|
KiBitmap( cvpcb_xpm ) );
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2019-03-07 13:59:32 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_GET_TOOLS, _( "Generate Bill of &Materials..." ),
|
|
|
|
HELP_GENERATE_BOM,
|
|
|
|
KiBitmap( bom_xpm ) );
|
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
aParentMenu->AppendSeparator();
|
2016-08-11 12:41:16 +00:00
|
|
|
|
2016-08-11 12:42:13 +00:00
|
|
|
#ifdef KICAD_SPICE
|
2016-08-11 12:41:16 +00:00
|
|
|
// Simulator
|
2018-05-14 17:34:18 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_SIM_SHOW, _("Simula&tor"),
|
|
|
|
_( "Simulate circuit" ),
|
2016-08-29 09:39:54 +00:00
|
|
|
KiBitmap( simulator_xpm ) );
|
2016-08-11 12:42:13 +00:00
|
|
|
#endif /* KICAD_SPICE */
|
2016-08-11 12:41:16 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
}
|
2010-08-24 17:26:51 +00:00
|
|
|
|