2011-10-18 19:59:19 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2014-02-21 07:54:13 +00:00
|
|
|
* Copyright (C) 2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
|
|
|
* Copyright (C) 2009-2014 Wayne Stambaugh <stambaughw@verizon.net>
|
|
|
|
* Copyright (C) 1992-2014 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
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <fctsys.h>
|
* 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.
2014-03-20 00:42:08 +00:00
|
|
|
#include <kiface_i.h>
|
|
|
|
#include <pgm_base.h>
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <wxEeschemaStruct.h>
|
2009-09-25 18:49:04 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <general.h>
|
|
|
|
#include <eeschema_id.h>
|
|
|
|
#include <hotkeys.h>
|
2012-04-09 09:16:47 +00:00
|
|
|
#include <menus_helpers.h>
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <help_common_strings.h>
|
2010-06-30 11:15:34 +00:00
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/**
|
2011-04-06 13:52:47 +00:00
|
|
|
* @brief (Re)Create the menubar for the schematic frame
|
2008-02-15 22:50:52 +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;
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
// New
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_NEW_PROJECT,
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "&New Schematic Project" ),
|
|
|
|
_( "Clear current schematic hierarchy and start a new schematic root sheet" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( new_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
// Open
|
2014-02-28 17:31:00 +00:00
|
|
|
text = AddHotkeyName( _( "&Open Schematic Project" ), s_Schematic_Hokeys_Descr, HK_LOAD_SCH );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu,
|
2012-09-12 09:53:11 +00:00
|
|
|
ID_LOAD_PROJECT, text,
|
2014-02-28 17:31:00 +00:00
|
|
|
_( "Open an existing schematic hierarchy" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( open_document_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
// Open Recent submenu
|
2011-04-17 13:54:17 +00:00
|
|
|
static wxMenu* openRecentMenu;
|
2011-05-16 19:32:57 +00:00
|
|
|
|
2011-04-17 13:54:17 +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 )
|
* 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.
2014-03-20 00:42:08 +00:00
|
|
|
Kiface().GetFileHistory().RemoveMenu( openRecentMenu );
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2011-04-17 13:54:17 +00:00
|
|
|
openRecentMenu = new wxMenu();
|
* 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.
2014-03-20 00:42:08 +00:00
|
|
|
|
|
|
|
Kiface().GetFileHistory().UseMenu( openRecentMenu );
|
|
|
|
Kiface().GetFileHistory().AddFilesToMenu( openRecentMenu );
|
|
|
|
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu, openRecentMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
wxID_ANY, _( "Open &Recent" ),
|
|
|
|
_( "Open a recent opened schematic project" ),
|
|
|
|
KiBitmap( open_project_xpm ) );
|
2011-05-16 19:32:57 +00:00
|
|
|
|
2013-01-24 17:46:37 +00:00
|
|
|
// Import
|
|
|
|
AddMenuItem( fileMenu,
|
2014-02-21 07:54:13 +00:00
|
|
|
ID_APPEND_PROJECT, _( "&Append Schematic Sheet" ),
|
|
|
|
_( "Append schematic sheet to current project" ),
|
2013-01-24 17:46:37 +00:00
|
|
|
KiBitmap( open_document_xpm ) );
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Separator
|
|
|
|
fileMenu->AppendSeparator();
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Save schematic project
|
2014-02-21 07:54:13 +00:00
|
|
|
text = AddHotkeyName( _( "&Save Schematic Project" ),
|
2012-09-12 09:53:11 +00:00
|
|
|
s_Schematic_Hokeys_Descr, HK_SAVE_SCH );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu,
|
2012-09-12 09:53:11 +00:00
|
|
|
ID_SAVE_PROJECT, text,
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "Save all sheets in schematic project" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( save_project_xpm ) );
|
2010-01-19 20:43:44 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Save current sheet
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu,
|
2012-09-28 17:47:41 +00:00
|
|
|
ID_UPDATE_ONE_SHEET,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "Save &Current Sheet Only" ),
|
|
|
|
_( "Save only current schematic sheet" ),
|
|
|
|
KiBitmap( save_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Save current sheet as
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu,
|
2012-09-28 17:47:41 +00:00
|
|
|
ID_SAVE_ONE_SHEET_UNDER_NEW_NAME,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "Save Current Sheet &As" ),
|
|
|
|
_( "Save current schematic sheet as..." ),
|
|
|
|
KiBitmap( save_as_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Separator
|
|
|
|
fileMenu->AppendSeparator();
|
2010-01-17 20:25:10 +00:00
|
|
|
|
2011-07-02 12:48:45 +00:00
|
|
|
// Page settings
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_SHEET_SET,
|
|
|
|
_( "Pa&ge Settings" ),
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "Setting for sheet size and frame references" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( sheetset_xpm ) );
|
2011-07-02 12:48:45 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
// Print
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
wxID_PRINT,
|
|
|
|
_( "Pri&nt" ),
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "Print schematic sheet" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( print_button_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2013-02-23 20:08:28 +00:00
|
|
|
#ifdef __WINDOWS__ // __WINDOWS__
|
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
// Plot submenu
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* choice_plot_fmt = new wxMenu;
|
2012-09-17 17:42:27 +00:00
|
|
|
AddMenuItem( choice_plot_fmt, ID_GEN_PLOT_SCHEMATIC,
|
|
|
|
_( "&Plot" ),
|
|
|
|
_( "Plot schematic sheet in PostScript, PDF, SVG, DXF or HPGL format" ),
|
|
|
|
KiBitmap( plot_xpm ) );
|
2009-06-30 10:43:20 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Plot to Clipboard (Windows only)
|
2013-02-23 20:08:28 +00:00
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( choice_plot_fmt, ID_GEN_COPY_SHEET_TO_CLIPBOARD,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "Plot to &Clipboard" ),
|
|
|
|
_( "Export drawings to clipboard" ),
|
|
|
|
KiBitmap( copy_button_xpm ) );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2013-02-23 20:08:28 +00:00
|
|
|
// Plot
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu, choice_plot_fmt,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_GEN_PLOT, _( "&Plot" ),
|
|
|
|
_( "Plot schematic sheet in HPGL, PostScript or SVG format" ),
|
|
|
|
KiBitmap( plot_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2013-02-23 20:08:28 +00:00
|
|
|
#else // Other
|
|
|
|
|
|
|
|
// Plot
|
|
|
|
AddMenuItem( fileMenu,
|
|
|
|
ID_GEN_PLOT_SCHEMATIC,
|
|
|
|
_( "&Plot" ),
|
|
|
|
_( "Plot schematic sheet in HPGL, PostScript or SVG format" ),
|
|
|
|
KiBitmap( plot_xpm ) );
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Separator
|
|
|
|
fileMenu->AppendSeparator();
|
2011-04-04 18:05:55 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Quit
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
wxID_EXIT,
|
|
|
|
_( "&Quit" ),
|
|
|
|
_( "Quit Eeschema" ),
|
|
|
|
KiBitmap( exit_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Menu Edit:
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* editMenu = new wxMenu;
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
// Undo
|
2011-10-18 19:59:19 +00:00
|
|
|
text = AddHotkeyName( _( "&Undo" ), s_Schematic_Hokeys_Descr, HK_UNDO );
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2011-09-08 05:58:45 +00:00
|
|
|
AddMenuItem( editMenu, wxID_UNDO, text, HELP_UNDO, KiBitmap( undo_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Redo
|
2011-10-18 19:59:19 +00:00
|
|
|
text = AddHotkeyName( _( "&Redo" ), s_Schematic_Hokeys_Descr, HK_REDO );
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2011-09-08 05:58:45 +00:00
|
|
|
AddMenuItem( editMenu, wxID_REDO, text, HELP_REDO, KiBitmap( redo_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Delete
|
2010-12-17 20:34:29 +00:00
|
|
|
editMenu->AppendSeparator();
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( editMenu, ID_SCHEMATIC_DELETE_ITEM_BUTT,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "&Delete" ), HELP_DELETE_ITEMS,
|
2012-03-20 14:17:58 +00:00
|
|
|
KiBitmap( delete_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Find
|
2011-07-03 18:51:07 +00:00
|
|
|
editMenu->AppendSeparator();
|
2010-02-16 10:42:57 +00:00
|
|
|
text = AddHotkeyName( _( "&Find" ), s_Schematic_Hokeys_Descr, HK_FIND_ITEM );
|
2011-09-08 05:58:45 +00:00
|
|
|
AddMenuItem( editMenu, ID_FIND_ITEMS, text, HELP_FIND, KiBitmap( find_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-12-01 16:49:28 +00:00
|
|
|
// Find/Replace
|
2014-04-03 07:40:55 +00:00
|
|
|
text = AddHotkeyName( _( "Find and Re&place" ), s_Schematic_Hokeys_Descr,
|
|
|
|
HK_FIND_REPLACE );
|
|
|
|
AddMenuItem( editMenu, wxID_REPLACE, text, HELP_REPLACE,
|
2011-12-13 15:37:33 +00:00
|
|
|
KiBitmap( find_replace_xpm ) );
|
2011-12-01 16:49:28 +00:00
|
|
|
|
2013-02-11 18:50:55 +00:00
|
|
|
// Import footprint association from the CvPcb cmp file:
|
2009-01-17 20:31:19 +00:00
|
|
|
editMenu->AppendSeparator();
|
2013-02-11 18:50:55 +00:00
|
|
|
AddMenuItem( editMenu, ID_BACKANNO_ITEMS,
|
|
|
|
_( "Import Footprint Selection" ),
|
|
|
|
HELP_IMPORT_FOOTPRINTS,
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( import_footprint_names_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Menu View:
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* viewMenu = new wxMenu;
|
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
|
|
|
|
2011-04-12 12:41:13 +00:00
|
|
|
// Zoom in
|
2011-10-18 19:59:19 +00:00
|
|
|
text = AddHotkeyName( _( "Zoom &In" ), s_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ZOOM_IN, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2011-09-08 05:58:45 +00:00
|
|
|
AddMenuItem( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, KiBitmap( zoom_in_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-12 12:41:13 +00:00
|
|
|
// Zoom out
|
2011-10-18 19:59:19 +00:00
|
|
|
text = AddHotkeyName( _( "Zoom &Out" ), s_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ZOOM_OUT, IS_ACCELERATOR ); // add accelerator, not a shortcut
|
2011-09-08 05:58:45 +00:00
|
|
|
AddMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, KiBitmap( zoom_out_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-12 12:41:13 +00:00
|
|
|
// Fit on screen
|
2011-10-18 19:59:19 +00:00
|
|
|
text = AddHotkeyName( _( "&Fit on Screen" ), s_Schematic_Hokeys_Descr, HK_ZOOM_AUTO );
|
2011-04-06 13:52:47 +00:00
|
|
|
|
2011-09-08 05:58:45 +00:00
|
|
|
AddMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, KiBitmap( zoom_fit_in_page_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Separator
|
2009-01-17 20:31:19 +00:00
|
|
|
viewMenu->AppendSeparator();
|
|
|
|
|
2011-07-03 18:51:07 +00:00
|
|
|
// Hierarchy
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( viewMenu,
|
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
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Redraw
|
2011-10-18 19:59:19 +00:00
|
|
|
text = AddHotkeyName( _( "&Redraw" ), s_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
|
2011-09-08 05:58:45 +00:00
|
|
|
AddMenuItem( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Menu place:
|
|
|
|
// @todo unify IDs
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* placeMenu = new wxMenu;
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Component
|
2011-10-18 19:59:19 +00:00
|
|
|
text = AddHotkeyName( _( "&Component" ), s_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ADD_NEW_COMPONENT, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( placeMenu, 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
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Power port
|
2011-10-18 19:59:19 +00:00
|
|
|
text = AddHotkeyName( _( "&Power Port" ), s_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ADD_NEW_POWER, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( placeMenu, 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
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Wire
|
2011-10-18 19:59:19 +00:00
|
|
|
text = AddHotkeyName( _( "&Wire" ), s_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_BEGIN_WIRE, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( placeMenu, 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
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Bus
|
2011-10-18 19:59:19 +00:00
|
|
|
text = AddHotkeyName( _( "&Bus" ), s_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_BEGIN_BUS, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( placeMenu, 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
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Wire to Bus entry
|
2011-10-18 19:59:19 +00:00
|
|
|
text = AddHotkeyName( _( "Wire to Bus &Entry" ), s_Schematic_Hokeys_Descr,
|
2011-12-18 17:57:05 +00:00
|
|
|
HK_ADD_WIRE_ENTRY, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( placeMenu, 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
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Bus to Bus entry
|
2011-10-18 19:59:19 +00:00
|
|
|
text = AddHotkeyName( _( "Bus &to Bus Entry" ), s_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ADD_BUS_ENTRY, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( placeMenu, 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
|
|
|
|
2011-09-06 07:02:18 +00:00
|
|
|
// No Connect Flag
|
2011-10-18 19:59:19 +00:00
|
|
|
text = AddHotkeyName( _( "&No Connect Flag" ), s_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ADD_NOCONN_FLAG, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2011-09-08 05:58:45 +00:00
|
|
|
AddMenuItem( placeMenu, ID_NOCONN_BUTT, text, HELP_PLACE_NC_FLAG, KiBitmap( noconn_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-12 12:41:13 +00:00
|
|
|
// Net name
|
2011-10-18 19:59:19 +00:00
|
|
|
text = AddHotkeyName( _( "&Label" ), s_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ADD_LABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( placeMenu, 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
|
|
|
|
2011-04-12 12:41:13 +00:00
|
|
|
// Global label
|
2011-10-18 19:59:19 +00:00
|
|
|
text = AddHotkeyName( _( "Gl&obal Label" ), s_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ADD_GLABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( placeMenu, 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
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Junction
|
2011-10-18 19:59:19 +00:00
|
|
|
text = AddHotkeyName( _( "&Junction" ), s_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ADD_JUNCTION, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( placeMenu, ID_JUNCTION_BUTT, text,
|
2011-10-18 19:59:19 +00:00
|
|
|
HELP_PLACE_JUNCTION,
|
|
|
|
KiBitmap( add_junction_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Separator
|
2009-01-17 20:31:19 +00:00
|
|
|
placeMenu->AppendSeparator();
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Hierarchical label
|
2011-10-18 19:59:19 +00:00
|
|
|
text = AddHotkeyName( _( "&Hierarchical Label" ), s_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ADD_HLABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( placeMenu, 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
|
|
|
|
2011-04-12 12:41:13 +00:00
|
|
|
// Hierarchical sheet
|
2011-10-18 19:59:19 +00:00
|
|
|
text = AddHotkeyName( _( "H&ierarchical &Sheet" ), s_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ADD_HIER_SHEET, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( placeMenu, 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
|
|
|
|
2011-04-12 12:41:13 +00:00
|
|
|
// Import hierarchical sheet
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( placeMenu,
|
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
|
|
|
|
2011-04-12 12:41:13 +00:00
|
|
|
// Add hierarchical Pin to Sheet
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( placeMenu,
|
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
|
|
|
|
2011-04-12 12:41:13 +00:00
|
|
|
// Separator
|
2009-01-17 20:31:19 +00:00
|
|
|
placeMenu->AppendSeparator();
|
|
|
|
|
2011-04-12 12:41:13 +00:00
|
|
|
// Graphic line or polygon
|
2011-09-06 07:02:18 +00:00
|
|
|
text = AddHotkeyName( _( "Graphic Polyline" ), s_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ADD_GRAPHIC_POLYLINE, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( placeMenu, 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
|
|
|
|
2011-04-12 12:41:13 +00:00
|
|
|
// Graphic text
|
2011-09-06 07:02:18 +00:00
|
|
|
text = AddHotkeyName( _( "Graphic Text" ), s_Schematic_Hokeys_Descr,
|
2011-09-23 20:00:30 +00:00
|
|
|
HK_ADD_GRAPHIC_TEXT, IS_ACCELERATOR ); // add an accelerator, not a shortcut
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( placeMenu, 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
|
|
|
|
2011-09-06 07:02:18 +00:00
|
|
|
// Graphic image
|
2011-09-23 20:00:30 +00:00
|
|
|
AddMenuItem( placeMenu, ID_ADD_IMAGE_BUTT, _( "Image" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
HELP_PLACE_GRAPHICIMAGES,
|
|
|
|
KiBitmap( image_xpm ) );
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Menu Preferences:
|
|
|
|
wxMenu* preferencesMenu = new wxMenu;
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2011-04-12 12:41:13 +00:00
|
|
|
// Library
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( preferencesMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_CONFIG_REQ,
|
2014-02-22 12:39:59 +00:00
|
|
|
_( "Set Active &Libraries" ),
|
|
|
|
_( "Set active library list and library paths" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( library_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Colors
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( preferencesMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_COLORS_SETUP,
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "Set &Colors Scheme" ),
|
|
|
|
_( "Set color preferences" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( palette_xpm ) );
|
2011-04-04 18:05:55 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Options (Preferences on WXMAC)
|
2011-08-30 13:54:22 +00:00
|
|
|
|
2011-04-04 18:05:55 +00:00
|
|
|
#ifdef __WXMAC__
|
2011-09-23 20:00:30 +00:00
|
|
|
preferencesMenu->Append( wxID_PREFERENCES );
|
2011-04-04 18:05:55 +00:00
|
|
|
#else
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( preferencesMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
wxID_PREFERENCES,
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "Schematic Editor &Options" ),
|
|
|
|
_( "Set Eeschema preferences" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( preference_xpm ) );
|
2011-08-30 13:54:22 +00:00
|
|
|
#endif // __WXMAC__
|
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Language submenu
|
* 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.
2014-03-20 00:42:08 +00:00
|
|
|
Pgm().AddMenuLanguageList( preferencesMenu );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Hotkey submenu
|
|
|
|
AddHotkeyConfigMenu( preferencesMenu );
|
2009-10-27 13:48:24 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Separator
|
|
|
|
preferencesMenu->AppendSeparator();
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Save preferences
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( preferencesMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_CONFIG_SAVE,
|
|
|
|
_( "&Save Preferences" ),
|
|
|
|
_( "Save application preferences" ),
|
|
|
|
KiBitmap( save_setup_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Read preferences
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( preferencesMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_CONFIG_READ,
|
|
|
|
_( "&Read Preferences" ),
|
|
|
|
_( "Read application preferences" ),
|
|
|
|
KiBitmap( read_setup_xpm ) );
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2011-07-02 12:48:45 +00:00
|
|
|
// Menu Tools:
|
|
|
|
wxMenu* toolsMenu = new wxMenu;
|
|
|
|
|
|
|
|
// Library editor
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( toolsMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_TO_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
|
|
|
|
2012-01-21 15:02:49 +00:00
|
|
|
// Library viewer
|
|
|
|
AddMenuItem( toolsMenu,
|
|
|
|
ID_TO_LIBVIEW,
|
|
|
|
_( "Library &Browser" ), HELP_RUN_LIB_VIEWER,
|
|
|
|
KiBitmap( library_browse_xpm ) );
|
|
|
|
|
2011-07-02 12:48:45 +00:00
|
|
|
// Separator
|
|
|
|
toolsMenu->AppendSeparator();
|
|
|
|
|
|
|
|
// Annotate
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( toolsMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_GET_ANNOTATE,
|
2014-02-21 07:54:13 +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
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( toolsMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_GET_ERC,
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "Electric Rules &Checker" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "Perform electrical rule check" ),
|
|
|
|
KiBitmap( erc_xpm ) );
|
2011-07-02 12:48:45 +00:00
|
|
|
|
|
|
|
// Generate netlist
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( toolsMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_GET_NETLIST,
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "Generate &Netlist File" ),
|
|
|
|
_( "Generate the component netlist file" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( netlist_xpm ) );
|
2011-07-02 12:48:45 +00:00
|
|
|
|
|
|
|
// Generate bill of materials
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( toolsMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_GET_TOOLS,
|
|
|
|
_( "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
|
|
|
|
2011-08-29 20:45:22 +00:00
|
|
|
// Separator
|
|
|
|
toolsMenu->AppendSeparator();
|
|
|
|
|
2011-09-30 18:15:37 +00:00
|
|
|
//Run CvPcb
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( toolsMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_TO_CVPCB,
|
2014-02-28 17:31:00 +00:00
|
|
|
_( "A&ssign Component Footprint" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "Run CvPcb" ),
|
|
|
|
KiBitmap( cvpcb_xpm ) );
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2011-09-30 18:15:37 +00:00
|
|
|
// Run Pcbnew
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( toolsMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_TO_PCB,
|
|
|
|
_( "&Layout Printed Circuit Board" ),
|
|
|
|
_( "Run Pcbnew" ),
|
|
|
|
KiBitmap( pcbnew_xpm ) );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Help Menu:
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* helpMenu = new wxMenu;
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Version info
|
2010-08-24 17:26:51 +00:00
|
|
|
AddHelpVersionInfoMenuEntry( helpMenu );
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Contents
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( helpMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
wxID_HELP,
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "Eesc&hema Manual" ),
|
|
|
|
_( "Open Eeschema manual" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( online_help_xpm ) );
|
|
|
|
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( helpMenu,
|
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
|
|
|
|
2011-10-16 08:02:36 +00:00
|
|
|
// About Eeschema
|
2011-08-04 18:03:26 +00:00
|
|
|
helpMenu->AppendSeparator();
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( helpMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
wxID_ABOUT,
|
|
|
|
_( "&About Eeschema" ),
|
|
|
|
_( "About Eeschema schematic designer" ),
|
|
|
|
KiBitmap( info_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
// Create the menubar and append all submenus
|
2011-05-16 19:32:57 +00:00
|
|
|
menuBar->Append( fileMenu, _( "&File" ) );
|
|
|
|
menuBar->Append( editMenu, _( "&Edit" ) );
|
|
|
|
menuBar->Append( viewMenu, _( "&View" ) );
|
|
|
|
menuBar->Append( placeMenu, _( "&Place" ) );
|
2011-10-18 19:59:19 +00:00
|
|
|
menuBar->Append( preferencesMenu, _( "P&references" ) );
|
2011-07-02 12:48:45 +00:00
|
|
|
menuBar->Append( toolsMenu, _( "&Tools" ) );
|
2011-05-16 19:32:57 +00:00
|
|
|
menuBar->Append( helpMenu, _( "&Help" ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
menuBar->Thaw();
|
|
|
|
|
|
|
|
// Associate the menu bar with the frame, if no previous menubar
|
|
|
|
if( GetMenuBar() == NULL )
|
|
|
|
SetMenuBar( menuBar );
|
|
|
|
else
|
|
|
|
menuBar->Refresh();
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|