2011-10-18 19:59:19 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2016-11-20 11:57:16 +00:00
|
|
|
* Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
2017-01-04 20:24:45 +00:00
|
|
|
* Copyright (C) 2009-2016 Wayne Stambaugh <stambaughw@verizon.net>
|
2017-02-07 21:16:26 +00:00
|
|
|
* Copyright (C) 1992-2017 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
|
|
|
|
*/
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/**
|
2010-12-14 15:56:30 +00:00
|
|
|
* @file eeschema/menubar.cpp
|
2011-04-06 13:52:47 +00:00
|
|
|
* @brief (Re)Create the main menubar for the schematic frame
|
2011-04-12 12:41:13 +00:00
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
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>
|
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"
|
|
|
|
#include "hotkeys.h"
|
|
|
|
#include "schframe.h"
|
2015-06-21 20:30:33 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
// helper functions that build specific submenus:
|
|
|
|
|
|
|
|
// Build the place submenu
|
|
|
|
static void preparePlaceMenu( wxMenu* aParentMenu );
|
|
|
|
|
|
|
|
// Build the files menu. Because some commands are available only if
|
|
|
|
// Eeschemat is run outside a project (run alone), aIsOutsideProject is false
|
|
|
|
// when Eeschema is run from Kicad manager, and true is run as stand alone app.
|
|
|
|
static void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject );
|
|
|
|
|
|
|
|
// Build the tools menu
|
|
|
|
static void prepareToolsMenu( wxMenu* aParentMenu );
|
|
|
|
|
|
|
|
// Build the help menu
|
|
|
|
static void prepareHelpMenu( wxMenu* aParentMenu );
|
|
|
|
|
2017-02-24 11:43:10 +00:00
|
|
|
// Build the import/export submenu
|
2016-11-20 11:57:16 +00:00
|
|
|
static void prepareImportExportMenu( wxMenu* aParentMenu );
|
|
|
|
|
|
|
|
// Build the edit menu
|
|
|
|
static void prepareEditMenu( wxMenu* aParentMenu );
|
|
|
|
|
|
|
|
// Build the view menu
|
|
|
|
static void prepareViewMenu( wxMenu* aParentMenu );
|
|
|
|
|
2017-02-07 21:16:26 +00:00
|
|
|
// Build the preferences menu
|
2017-03-03 13:18:07 +00:00
|
|
|
static void preparePreferencesMenu( SCH_EDIT_FRAME* aFrame, wxMenu* aParentMenu );
|
2017-02-07 21:16:26 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
|
2010-12-08 20:12:46 +00:00
|
|
|
void SCH_EDIT_FRAME::ReCreateMenuBar()
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2011-04-06 13:52:47 +00:00
|
|
|
// Create and try to get the current menubar
|
2011-05-16 19:32:57 +00:00
|
|
|
wxString text;
|
|
|
|
wxMenuBar* menuBar = GetMenuBar();
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-05-16 19:32:57 +00:00
|
|
|
if( !menuBar )
|
2010-12-17 20:34:29 +00:00
|
|
|
menuBar = new wxMenuBar();
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
// Delete all existing menus so they can be rebuilt.
|
|
|
|
// This allows language changes of the menu text on the fly.
|
|
|
|
menuBar->Freeze();
|
2011-10-18 19:59:19 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
while( menuBar->GetMenuCount() )
|
2011-05-16 19:32:57 +00:00
|
|
|
delete menuBar->Remove( 0 );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
// Recreate all menus:
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Menu File:
|
|
|
|
wxMenu* fileMenu = new wxMenu;
|
2016-11-20 11:57:16 +00:00
|
|
|
prepareFilesMenu( fileMenu, Kiface().IsSingle() );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
// Menu Edit:
|
|
|
|
wxMenu* editMenu = new wxMenu;
|
|
|
|
prepareEditMenu( editMenu );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
// Menu View:
|
|
|
|
wxMenu* viewMenu = new wxMenu;
|
|
|
|
prepareViewMenu( viewMenu );
|
2009-06-30 10:43:20 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
// Menu place:
|
|
|
|
wxMenu* placeMenu = new wxMenu;
|
|
|
|
preparePlaceMenu( placeMenu );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
// Menu Preferences:
|
|
|
|
wxMenu* preferencesMenu = new wxMenu;
|
2017-03-03 13:18:07 +00:00
|
|
|
preparePreferencesMenu( this, preferencesMenu );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
// Menu Tools:
|
|
|
|
wxMenu* toolsMenu = new wxMenu;
|
|
|
|
prepareToolsMenu( toolsMenu );
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
// Help Menu:
|
|
|
|
wxMenu* helpMenu = new wxMenu;
|
|
|
|
prepareHelpMenu( helpMenu );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
// Create the menubar and append all submenus
|
|
|
|
menuBar->Append( fileMenu, _( "&File" ) );
|
|
|
|
menuBar->Append( editMenu, _( "&Edit" ) );
|
|
|
|
menuBar->Append( viewMenu, _( "&View" ) );
|
|
|
|
menuBar->Append( placeMenu, _( "&Place" ) );
|
|
|
|
menuBar->Append( preferencesMenu, _( "P&references" ) );
|
|
|
|
menuBar->Append( toolsMenu, _( "&Tools" ) );
|
|
|
|
menuBar->Append( helpMenu, _( "&Help" ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
menuBar->Thaw();
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
// Associate the menu bar with the frame, if no previous menubar
|
|
|
|
if( GetMenuBar() == NULL )
|
|
|
|
SetMenuBar( menuBar );
|
|
|
|
else
|
|
|
|
menuBar->Refresh();
|
|
|
|
}
|
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 prepareViewMenu( wxMenu* aParentMenu )
|
|
|
|
{
|
|
|
|
wxString text;
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
/**
|
|
|
|
* Important Note for ZOOM IN and ZOOM OUT commands from menubar:
|
2010-07-27 09:01:26 +00:00
|
|
|
* we cannot add hotkey shortcut here, because the hotkey HK_ZOOM_IN and HK_ZOOM_OUT
|
2010-02-13 18:38:26 +00:00
|
|
|
* events(default = WXK_F1 and WXK_F2) are *NOT* equivalent to this menu command:
|
|
|
|
* zoom in and out from hotkeys are equivalent to the pop up menu zoom
|
2010-08-24 17:26:51 +00:00
|
|
|
* From here, zooming is made around the screen center
|
|
|
|
* From hotkeys, zooming is made around the mouse cursor position
|
|
|
|
* (obviously not possible from the toolbar or menubar command)
|
2010-02-13 18:38:26 +00:00
|
|
|
*
|
|
|
|
* in others words HK_ZOOM_IN and HK_ZOOM_OUT *are NOT* accelerators
|
|
|
|
* for Zoom in and Zoom out sub menus
|
2010-07-27 09:01:26 +00:00
|
|
|
* SO WE ADD THE NAME OF THE CORRESPONDING HOTKEY AS A COMMENT, NOT AS A SHORTCUT
|
|
|
|
* using in AddHotkeyName call the option "false" (not a shortcut)
|
2010-02-13 18:38:26 +00:00
|
|
|
*/
|
2011-04-06 13:52:47 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
text = AddHotkeyName( _( "Zoom &In" ), g_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ZOOM_IN, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, KiBitmap( zoom_in_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
text = AddHotkeyName( _( "Zoom &Out" ), g_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ZOOM_OUT, IS_ACCELERATOR ); // add accelerator, not a shortcut
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, KiBitmap( zoom_out_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
text = AddHotkeyName( _( "&Fit on Screen" ), g_Schematic_Hokeys_Descr, HK_ZOOM_AUTO );
|
2011-04-06 13:52:47 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, KiBitmap( zoom_fit_in_page_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2015-06-11 17:27:36 +00:00
|
|
|
text = AddHotkeyName( _( "&Redraw" ), g_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
|
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );
|
2015-06-11 17:27:36 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
aParentMenu->AppendSeparator();
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_HIERARCHY,
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "Show &Hierarchical Navigator" ),
|
|
|
|
_( "Navigate hierarchical sheets" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( hierarchy_nav_xpm ) );
|
2011-07-02 12:48:45 +00:00
|
|
|
|
2015-06-12 21:31:44 +00:00
|
|
|
text = AddHotkeyName( _( "&Leave Sheet" ), g_Schematic_Hokeys_Descr, HK_LEAVE_SHEET );
|
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
2015-06-11 17:27:36 +00:00
|
|
|
ID_POPUP_SCH_LEAVE_SHEET,
|
2015-06-12 21:31:44 +00:00
|
|
|
text,
|
2015-06-11 17:27:36 +00:00
|
|
|
_( "Leave Sheet" ),
|
|
|
|
KiBitmap( leave_sheet_xpm ) );
|
2016-11-20 11:57:16 +00:00
|
|
|
}
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
|
|
|
|
void preparePlaceMenu( wxMenu* aParentMenu )
|
|
|
|
{
|
|
|
|
wxString text;
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
text = AddHotkeyName( _( "&Component" ), g_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ADD_NEW_COMPONENT, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_SCH_PLACE_COMPONENT, text,
|
2011-10-18 19:59:19 +00:00
|
|
|
HELP_PLACE_COMPONENTS,
|
|
|
|
KiBitmap( add_component_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
text = AddHotkeyName( _( "&Power Port" ), g_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ADD_NEW_POWER, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_PLACE_POWER_BUTT, text,
|
2011-10-18 19:59:19 +00:00
|
|
|
HELP_PLACE_POWERPORT,
|
|
|
|
KiBitmap( add_power_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
text = AddHotkeyName( _( "&Wire" ), g_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_BEGIN_WIRE, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_WIRE_BUTT, text,
|
2011-10-18 19:59:19 +00:00
|
|
|
HELP_PLACE_WIRE,
|
|
|
|
KiBitmap( add_line_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
text = AddHotkeyName( _( "&Bus" ), g_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_BEGIN_BUS, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_BUS_BUTT, text,
|
2011-10-18 19:59:19 +00:00
|
|
|
HELP_PLACE_BUS,
|
|
|
|
KiBitmap( add_bus_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
text = AddHotkeyName( _( "Wire to Bus &Entry" ), g_Schematic_Hokeys_Descr,
|
2011-12-18 17:57:05 +00:00
|
|
|
HK_ADD_WIRE_ENTRY, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_WIRETOBUS_ENTRY_BUTT, text,
|
2011-10-18 19:59:19 +00:00
|
|
|
HELP_PLACE_WIRE2BUS_ENTRY,
|
|
|
|
KiBitmap( add_line2bus_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
text = AddHotkeyName( _( "Bus &to Bus Entry" ), g_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ADD_BUS_ENTRY, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_BUSTOBUS_ENTRY_BUTT, text,
|
2011-10-18 19:59:19 +00:00
|
|
|
HELP_PLACE_BUS2BUS_ENTRY,
|
|
|
|
KiBitmap( add_bus2bus_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
text = AddHotkeyName( _( "&No Connect Flag" ), g_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ADD_NOCONN_FLAG, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_NOCONN_BUTT, text, HELP_PLACE_NC_FLAG, KiBitmap( noconn_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
text = AddHotkeyName( _( "&Junction" ), g_Schematic_Hokeys_Descr,
|
2014-09-22 07:51:06 +00:00
|
|
|
HK_ADD_JUNCTION, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_JUNCTION_BUTT, text,
|
2014-09-22 07:51:06 +00:00
|
|
|
HELP_PLACE_JUNCTION,
|
|
|
|
KiBitmap( add_junction_xpm ) );
|
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
text = AddHotkeyName( _( "&Label" ), g_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ADD_LABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_LABEL_BUTT, text,
|
2011-10-18 19:59:19 +00:00
|
|
|
HELP_PLACE_NETLABEL,
|
|
|
|
KiBitmap( add_line_label_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
text = AddHotkeyName( _( "Gl&obal Label" ), g_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ADD_GLABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_GLABEL_BUTT, text,
|
2011-10-18 19:59:19 +00:00
|
|
|
HELP_PLACE_GLOBALLABEL,
|
|
|
|
KiBitmap( add_glabel_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
aParentMenu->AppendSeparator();
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
text = AddHotkeyName( _( "&Hierarchical Label" ), g_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ADD_HLABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_HIERLABEL_BUTT,
|
2011-10-18 19:59:19 +00:00
|
|
|
text, HELP_PLACE_HIER_LABEL,
|
|
|
|
KiBitmap( add_hierarchical_label_xpm ) );
|
2011-04-12 12:41:13 +00:00
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2015-04-19 11:07:31 +00:00
|
|
|
text = AddHotkeyName( _( "Hierarchical &Sheet" ), g_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ADD_HIER_SHEET, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_SHEET_SYMBOL_BUTT, text,
|
2011-10-18 19:59:19 +00:00
|
|
|
HELP_PLACE_SHEET,
|
|
|
|
KiBitmap( add_hierarchical_subsheet_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_IMPORT_HLABEL_BUTT,
|
|
|
|
_( "I&mport Hierarchical Label" ),
|
|
|
|
HELP_IMPORT_SHEETPIN,
|
|
|
|
KiBitmap( import_hierarchical_label_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_SHEET_PIN_BUTT,
|
|
|
|
_( "Hierarchical Pi&n to Sheet" ),
|
|
|
|
HELP_PLACE_SHEETPIN,
|
|
|
|
KiBitmap( add_hierar_pin_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
aParentMenu->AppendSeparator();
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2015-04-19 11:07:31 +00:00
|
|
|
text = AddHotkeyName( _( "Graphic Pol&yline" ), g_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ADD_GRAPHIC_POLYLINE, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_LINE_COMMENT_BUTT, text,
|
2011-10-18 19:59:19 +00:00
|
|
|
HELP_PLACE_GRAPHICLINES,
|
|
|
|
KiBitmap( add_dashed_line_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2015-04-23 19:43:45 +00:00
|
|
|
text = AddHotkeyName( _( "&Graphic Text" ), g_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ADD_GRAPHIC_TEXT, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_TEXT_COMMENT_BUTT, text,
|
2011-10-18 19:59:19 +00:00
|
|
|
HELP_PLACE_GRAPHICTEXTS,
|
|
|
|
KiBitmap( add_text_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
// Add graphic image
|
|
|
|
AddMenuItem( aParentMenu, ID_ADD_IMAGE_BUTT, _( "&Image" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
HELP_PLACE_GRAPHICIMAGES,
|
|
|
|
KiBitmap( image_xpm ) );
|
2016-11-20 11:57:16 +00:00
|
|
|
}
|
2010-01-18 19:33:45 +00:00
|
|
|
|
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject )
|
|
|
|
{
|
|
|
|
wxString text;
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
if( aIsOutsideProject ) // not when under a project mgr
|
|
|
|
{
|
|
|
|
AddMenuItem( aParentMenu,
|
|
|
|
ID_NEW_PROJECT,
|
|
|
|
_( "&New Schematic Project" ),
|
|
|
|
_( "Clear current schematic hierarchy and start a new schematic root sheet" ),
|
|
|
|
KiBitmap( new_sch_xpm ) );
|
2011-08-30 13:54:22 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
text = AddHotkeyName( _( "&Open Schematic Project" ), g_Schematic_Hokeys_Descr, HK_LOAD_SCH );
|
|
|
|
AddMenuItem( aParentMenu,
|
|
|
|
ID_LOAD_PROJECT, text,
|
|
|
|
_( "Open an existing schematic hierarchy" ),
|
|
|
|
KiBitmap( open_document_xpm ) );
|
|
|
|
}
|
2011-08-30 13:54:22 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
// @todo: static probably not OK in multiple open projects.
|
|
|
|
// Open Recent submenu
|
|
|
|
static wxMenu* openRecentMenu;
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
// 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 );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
openRecentMenu = new wxMenu();
|
2016-01-16 02:06:41 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
Kiface().GetFileHistory().UseMenu( openRecentMenu );
|
|
|
|
Kiface().GetFileHistory().AddFilesToMenu( openRecentMenu );
|
2016-01-16 02:06:41 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
if( Kiface().IsSingle() ) // not when under a project mgr
|
|
|
|
{
|
|
|
|
AddMenuItem( aParentMenu, openRecentMenu,
|
|
|
|
wxID_ANY, _( "Open &Recent" ),
|
|
|
|
_( "Open a recent opened schematic project" ),
|
|
|
|
KiBitmap( open_project_xpm ) );
|
|
|
|
}
|
2016-01-16 02:06:41 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
|
|
|
ID_APPEND_PROJECT, _( "Imp&ort Schematic Sheet Content" ),
|
|
|
|
_( "Import a schematic sheet content from an other project in the current sheet" ),
|
|
|
|
KiBitmap( open_document_xpm ) );
|
2016-01-16 02:06:41 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
aParentMenu->AppendSeparator();
|
2016-01-16 02:06:41 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
text = AddHotkeyName( _( "&Save Schematic Project" ),
|
|
|
|
g_Schematic_Hokeys_Descr, HK_SAVE_SCH );
|
|
|
|
AddMenuItem( aParentMenu,
|
|
|
|
ID_SAVE_PROJECT, text,
|
|
|
|
_( "Save all sheets in schematic project" ),
|
|
|
|
KiBitmap( save_project_xpm ) );
|
2016-01-16 02:06:41 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
|
|
|
ID_UPDATE_ONE_SHEET,
|
|
|
|
_( "Save &Current Sheet Only" ),
|
|
|
|
_( "Save only current schematic sheet" ),
|
|
|
|
KiBitmap( save_xpm ) );
|
|
|
|
|
|
|
|
if( aIsOutsideProject ) // not when under a project mgr
|
|
|
|
{
|
|
|
|
AddMenuItem( aParentMenu,
|
|
|
|
ID_SAVE_ONE_SHEET_UNDER_NEW_NAME,
|
|
|
|
_( "Save C&urrent Sheet As" ),
|
|
|
|
_( "Save current schematic sheet as..." ),
|
|
|
|
KiBitmap( save_as_xpm ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
aParentMenu->AppendSeparator();
|
|
|
|
|
2017-01-04 20:24:45 +00:00
|
|
|
// Edit page layout:
|
|
|
|
AddMenuItem( aParentMenu, ID_SHEET_SET,
|
|
|
|
_( "Pa&ge Settings" ),
|
|
|
|
_( "Settings for sheet size and frame references" ),
|
|
|
|
KiBitmap( sheetset_xpm ) );
|
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
|
|
|
wxID_PRINT,
|
2017-02-07 21:16:26 +00:00
|
|
|
_( "Pri&nt..." ),
|
2016-11-20 11:57:16 +00:00
|
|
|
_( "Print schematic sheet" ),
|
|
|
|
KiBitmap( print_button_xpm ) );
|
|
|
|
|
|
|
|
// Plot submenu
|
|
|
|
wxMenu* choice_plot_fmt = new wxMenu;
|
|
|
|
|
2017-02-07 21:16:26 +00:00
|
|
|
AddMenuItem( choice_plot_fmt, ID_GEN_PLOT_SCHEMATIC, _( u8"&Plot..." ),
|
2016-11-20 11:57:16 +00:00
|
|
|
_( "Plot schematic sheet in PostScript, PDF, SVG, DXF or HPGL format" ),
|
|
|
|
KiBitmap( plot_xpm ) );
|
|
|
|
|
|
|
|
// Plot to Clipboard
|
|
|
|
AddMenuItem( choice_plot_fmt, ID_GEN_COPY_SHEET_TO_CLIPBOARD,
|
|
|
|
_( "Plot to C&lipboard" ),
|
|
|
|
_( "Export drawings to clipboard" ),
|
|
|
|
KiBitmap( copy_button_xpm ) );
|
|
|
|
|
|
|
|
// Add plot submenu
|
|
|
|
AddMenuItem( aParentMenu, choice_plot_fmt,
|
|
|
|
ID_GEN_PLOT, _( "&Plot" ),
|
|
|
|
_( "Plot schematic sheet in HPGL, PostScript or SVG format" ),
|
|
|
|
KiBitmap( plot_xpm ) );
|
|
|
|
|
|
|
|
// Quit
|
|
|
|
aParentMenu->AppendSeparator();
|
|
|
|
AddMenuItem( aParentMenu, wxID_EXIT, _( "&Close" ), _( "Close Eeschema" ),
|
|
|
|
KiBitmap( exit_xpm ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void prepareEditMenu( wxMenu* aParentMenu )
|
|
|
|
{
|
|
|
|
wxString text;
|
|
|
|
|
|
|
|
// Undo
|
|
|
|
text = AddHotkeyName( _( "&Undo" ), g_Schematic_Hokeys_Descr, HK_UNDO );
|
|
|
|
|
|
|
|
AddMenuItem( aParentMenu, wxID_UNDO, text, HELP_UNDO, KiBitmap( undo_xpm ) );
|
|
|
|
|
|
|
|
// Redo
|
|
|
|
text = AddHotkeyName( _( "&Redo" ), g_Schematic_Hokeys_Descr, HK_REDO );
|
|
|
|
|
|
|
|
AddMenuItem( aParentMenu, wxID_REDO, text, HELP_REDO, KiBitmap( redo_xpm ) );
|
|
|
|
|
|
|
|
// Delete
|
|
|
|
aParentMenu->AppendSeparator();
|
|
|
|
AddMenuItem( aParentMenu, ID_SCHEMATIC_DELETE_ITEM_BUTT,
|
|
|
|
_( "&Delete" ), HELP_DELETE_ITEMS,
|
|
|
|
KiBitmap( delete_xpm ) );
|
|
|
|
|
|
|
|
// Find
|
|
|
|
aParentMenu->AppendSeparator();
|
2017-02-07 21:16:26 +00:00
|
|
|
text = AddHotkeyName( _( "&Find..." ), g_Schematic_Hokeys_Descr, HK_FIND_ITEM );
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu, ID_FIND_ITEMS, text, HELP_FIND, KiBitmap( find_xpm ) );
|
|
|
|
|
|
|
|
// Find/Replace
|
2017-02-07 21:16:26 +00:00
|
|
|
text = AddHotkeyName( _( "Find and Re&place..." ), g_Schematic_Hokeys_Descr,
|
2016-11-20 11:57:16 +00:00
|
|
|
HK_FIND_REPLACE );
|
|
|
|
AddMenuItem( aParentMenu, wxID_REPLACE, text, HELP_REPLACE,
|
|
|
|
KiBitmap( find_replace_xpm ) );
|
|
|
|
|
|
|
|
// Import footprint association .cmp file which can be created by Pcbnew:
|
|
|
|
aParentMenu->AppendSeparator();
|
|
|
|
AddMenuItem( aParentMenu, ID_BACKANNO_ITEMS,
|
|
|
|
_( "Import Footprint Association File" ),
|
|
|
|
HELP_IMPORT_FOOTPRINTS,
|
|
|
|
KiBitmap( import_footprint_names_xpm ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void prepareToolsMenu( wxMenu* aParentMenu )
|
|
|
|
{
|
|
|
|
wxString text;
|
2011-07-02 12:48:45 +00:00
|
|
|
|
2016-01-29 10:24:39 +00:00
|
|
|
text = AddHotkeyName( _( "Update PCB from Schematics" ), g_Schematic_Hokeys_Descr, HK_UPDATE_PCB_FROM_SCH );
|
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
2016-01-29 10:24:39 +00:00
|
|
|
ID_UPDATE_PCB_FROM_SCH,
|
2016-01-29 10:36:51 +00:00
|
|
|
text, _( "Updates the PCB design with the current schematic (forward annotation)." ),
|
2016-01-29 14:43:40 +00:00
|
|
|
KiBitmap( pcbnew_xpm ) );
|
2016-01-29 10:24:39 +00:00
|
|
|
|
2016-01-29 14:43:40 +00:00
|
|
|
// Run Pcbnew
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
2016-01-29 14:43:40 +00:00
|
|
|
ID_RUN_PCB,
|
|
|
|
_( "&Open PCB Editor" ),
|
|
|
|
_( "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
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
ID_RUN_LIBRARY,
|
2012-01-21 15:02:49 +00:00
|
|
|
_( "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
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
2012-01-21 15:02:49 +00:00
|
|
|
ID_TO_LIBVIEW,
|
|
|
|
_( "Library &Browser" ), HELP_RUN_LIB_VIEWER,
|
|
|
|
KiBitmap( library_browse_xpm ) );
|
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
2015-04-25 22:26:51 +00:00
|
|
|
ID_RESCUE_CACHED,
|
2015-06-22 15:38:54 +00:00
|
|
|
_( "&Rescue Old Components" ),
|
|
|
|
_( "Find old components in the project and rename/rescue them" ),
|
2015-04-25 22:26:51 +00:00
|
|
|
KiBitmap( copycomponent_xpm ) );
|
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
aParentMenu->AppendSeparator();
|
2011-07-02 12:48:45 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_GET_ANNOTATE,
|
2017-02-07 21:16:26 +00:00
|
|
|
_( "&Annotate Schematic..." ), HELP_ANNOTATE,
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( annotate_xpm ) );
|
2011-07-02 12:48:45 +00:00
|
|
|
|
|
|
|
// ERC
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_GET_ERC,
|
2015-01-05 21:01:35 +00:00
|
|
|
_( "Electrical Rules &Checker" ),
|
|
|
|
_( "Perform electrical rules check" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( erc_xpm ) );
|
2011-07-02 12:48:45 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_GET_NETLIST,
|
2017-02-07 21:16:26 +00:00
|
|
|
_( "Generate &Netlist File..." ),
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "Generate the component netlist file" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( netlist_xpm ) );
|
2011-07-02 12:48:45 +00:00
|
|
|
|
2017-04-02 12:09:01 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
|
|
|
ID_OPEN_CMP_TABLE,
|
|
|
|
_( "Component Table &View" ),
|
|
|
|
KiBitmap( spreadsheet_xpm ) );
|
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_GET_TOOLS,
|
2017-02-07 21:16:26 +00:00
|
|
|
_( "Generate Bill of &Materials..." ),
|
2012-01-21 15:02:49 +00:00
|
|
|
HELP_GENERATE_BOM,
|
|
|
|
KiBitmap( bom_xpm ) );
|
2011-07-02 12:48:45 +00:00
|
|
|
|
2017-04-02 12:09:01 +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
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
2015-09-08 18:45:11 +00:00
|
|
|
ID_RUN_CVPCB,
|
2016-01-29 14:43:40 +00:00
|
|
|
_( "A&ssign Component Footprints" ),
|
2015-09-08 18:45:11 +00:00
|
|
|
_( "Run CvPcb" ),
|
|
|
|
KiBitmap( cvpcb_xpm ) );
|
2011-09-01 12:54:34 +00:00
|
|
|
|
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
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
2016-08-11 12:41:16 +00:00
|
|
|
ID_SIM_SHOW,
|
2016-08-11 12:41:30 +00:00
|
|
|
_("Simula&tor"), _( "Simulate the 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
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
|
|
|
|
void prepareHelpMenu( wxMenu* aParentMenu )
|
|
|
|
{
|
|
|
|
AddMenuItem( aParentMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
wxID_HELP,
|
2015-09-23 18:11:56 +00:00
|
|
|
_( "Eeschema &Manual" ),
|
2015-09-23 18:29:21 +00:00
|
|
|
_( "Open Eeschema Manual" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( online_help_xpm ) );
|
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
wxID_INDEX,
|
|
|
|
_( "&Getting Started in KiCad" ),
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "Open \"Getting Started in KiCad\" guide for beginners" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( help_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
2016-06-12 01:22:13 +00:00
|
|
|
ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
|
|
|
|
_( "&List Hotkeys" ),
|
|
|
|
_( "Displays the current hotkeys list and corresponding commands" ),
|
|
|
|
KiBitmap( hotkeys_xpm ) );
|
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
aParentMenu->AppendSeparator();
|
|
|
|
AddMenuItem( aParentMenu, ID_HELP_GET_INVOLVED,
|
2016-09-24 00:44:52 +00:00
|
|
|
_( "Get &Involved" ),
|
|
|
|
_( "Contribute to KiCad (opens a web browser)" ),
|
|
|
|
KiBitmap( info_xpm ) );
|
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
aParentMenu->AppendSeparator();
|
|
|
|
AddMenuItem( aParentMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
wxID_ABOUT,
|
2015-10-08 13:52:03 +00:00
|
|
|
_( "&About KiCad" ),
|
|
|
|
_( "About KiCad" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( info_xpm ) );
|
2016-11-20 11:57:16 +00:00
|
|
|
}
|
2009-01-17 20:31:19 +00:00
|
|
|
|
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
void prepareImportExportMenu( wxMenu* aParentMenu )
|
|
|
|
{
|
|
|
|
AddMenuItem( aParentMenu,
|
|
|
|
ID_CONFIG_SAVE,
|
|
|
|
_( "&Save Preferences" ),
|
|
|
|
_( "Save application preferences" ),
|
|
|
|
KiBitmap( save_setup_xpm ) );
|
2010-12-17 20:34:29 +00:00
|
|
|
|
2016-11-20 11:57:16 +00:00
|
|
|
AddMenuItem( aParentMenu,
|
|
|
|
ID_CONFIG_READ,
|
|
|
|
_( "Load Prefe&rences" ),
|
|
|
|
_( "Load application preferences" ),
|
|
|
|
KiBitmap( import_setup_xpm ) );
|
|
|
|
|
|
|
|
aParentMenu->AppendSeparator();
|
|
|
|
|
|
|
|
AddMenuItem( aParentMenu,
|
|
|
|
ID_PREFERENCES_HOTKEY_EXPORT_CONFIG,
|
|
|
|
_( "E&xport Hotkeys" ),
|
|
|
|
_( "Create a hotkey configuration file to export the current hotkeys" ),
|
|
|
|
KiBitmap( hotkeys_export_xpm ) );
|
|
|
|
|
|
|
|
AddMenuItem( aParentMenu,
|
|
|
|
ID_PREFERENCES_HOTKEY_IMPORT_CONFIG,
|
|
|
|
_( "&Import Hotkeys" ),
|
|
|
|
_( "Load an existing hotkey configuration file" ),
|
|
|
|
KiBitmap( hotkeys_import_xpm ) );
|
2017-01-04 20:24:45 +00:00
|
|
|
}
|
2017-02-07 21:16:26 +00:00
|
|
|
|
2017-03-03 13:18:07 +00:00
|
|
|
static void preparePreferencesMenu( SCH_EDIT_FRAME* aFrame, wxMenu* aParentMenu )
|
2017-02-07 21:16:26 +00:00
|
|
|
{
|
|
|
|
// Library
|
|
|
|
AddMenuItem( aParentMenu,
|
|
|
|
ID_CONFIG_REQ,
|
|
|
|
_( "Component &Libraries" ),
|
|
|
|
_( "Configure component libraries and paths" ),
|
|
|
|
KiBitmap( library_xpm ) );
|
|
|
|
|
|
|
|
// Options (Preferences on WXMAC)
|
|
|
|
#ifdef __WXMAC__
|
|
|
|
aParentMenu->Append( wxID_PREFERENCES );
|
|
|
|
#else
|
|
|
|
AddMenuItem( aParentMenu,
|
|
|
|
wxID_PREFERENCES,
|
|
|
|
_( "Schematic Editor &Options" ),
|
|
|
|
_( "Set Eeschema preferences" ),
|
|
|
|
KiBitmap( preference_xpm ) );
|
|
|
|
#endif // __WXMAC__
|
|
|
|
|
|
|
|
// Language submenu
|
2017-03-02 13:46:18 +00:00
|
|
|
aParentMenu->AppendSeparator();
|
2017-02-07 21:16:26 +00:00
|
|
|
Pgm().AddMenuLanguageList( aParentMenu );
|
|
|
|
|
2017-03-02 13:46:18 +00:00
|
|
|
// Icons options submenu
|
2017-03-03 13:18:07 +00:00
|
|
|
aFrame->AddMenuIconsOptions( aParentMenu );
|
2017-03-02 13:46:18 +00:00
|
|
|
|
2017-02-07 21:16:26 +00:00
|
|
|
// Import/export (submenu in preferences menu)
|
2017-03-02 13:46:18 +00:00
|
|
|
aParentMenu->AppendSeparator();
|
2017-02-07 21:16:26 +00:00
|
|
|
wxMenu* importExportSubmenu = new wxMenu();
|
|
|
|
prepareImportExportMenu( importExportSubmenu );
|
|
|
|
|
|
|
|
AddMenuItem( aParentMenu, importExportSubmenu,
|
|
|
|
wxID_ANY,
|
|
|
|
_( "&Import and export" ),
|
|
|
|
_( "Import and export settings" ),
|
|
|
|
KiBitmap( save_setup_xpm ) );
|
|
|
|
}
|