2011-10-18 19:59:19 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
|
|
|
* Copyright (C) 2009-2011 Wayne Stambaugh <stambaughw@verizon.net>
|
|
|
|
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
|
|
|
|
*
|
|
|
|
* 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
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "fctsys.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
#include "appl_wxstruct.h"
|
2010-11-10 15:30:12 +00:00
|
|
|
#include "wxEeschemaStruct.h"
|
2009-09-25 18:49:04 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "general.h"
|
|
|
|
#include "protos.h"
|
2009-09-22 12:27:57 +00:00
|
|
|
#include "eeschema_id.h"
|
2007-09-19 15:29:50 +00:00
|
|
|
#include "hotkeys.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2010-06-30 11:15:34 +00:00
|
|
|
#include "help_common_strings.h"
|
|
|
|
|
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,
|
|
|
|
_( "&New\tCtrl+N" ),
|
|
|
|
_( "New schematic project" ),
|
|
|
|
KiBitmap( new_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
// Open
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_LOAD_PROJECT,
|
|
|
|
_( "&Open\tCtrl+O" ),
|
|
|
|
_( "Open an existing schematic project" ),
|
|
|
|
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 )
|
|
|
|
wxGetApp().m_fileHistory.RemoveMenu( openRecentMenu );
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2011-04-17 13:54:17 +00:00
|
|
|
openRecentMenu = new wxMenu();
|
|
|
|
wxGetApp().m_fileHistory.UseMenu( openRecentMenu );
|
2010-01-17 20:25:10 +00:00
|
|
|
wxGetApp().m_fileHistory.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
|
|
|
|
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
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_SAVE_PROJECT,
|
|
|
|
_( "&Save Whole Schematic Project\tCtrl+S" ),
|
|
|
|
_( "Save all sheets in the schematic project" ),
|
|
|
|
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,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_SAVE_ONE_SHEET,
|
|
|
|
_( "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,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_SAVE_ONE_SHEET_AS,
|
|
|
|
_( "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" ),
|
|
|
|
_( "Settigns for page size and information" ),
|
|
|
|
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" ),
|
|
|
|
_( "Print schematic" ),
|
|
|
|
KiBitmap( print_button_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
// Plot submenu
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* choice_plot_fmt = new wxMenu;
|
2011-04-06 13:52:47 +00:00
|
|
|
|
|
|
|
// Plot PostScript
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( choice_plot_fmt, ID_GEN_PLOT_PS,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "Plot &PostScript" ),
|
|
|
|
_( "Plot schematic sheet in PostScript format" ),
|
|
|
|
KiBitmap( plot_ps_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Plot HPGL
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( choice_plot_fmt,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_GEN_PLOT_HPGL,
|
|
|
|
_( "Plot &HPGL" ),
|
|
|
|
_( "Plot schematic sheet in HPGL format" ),
|
|
|
|
KiBitmap( plot_hpg_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
// Plot SVG
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( choice_plot_fmt,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_GEN_PLOT_SVG,
|
|
|
|
_( "Plot &SVG" ),
|
|
|
|
_( "Plot schematic sheet in SVG format" ),
|
|
|
|
KiBitmap( plot_xpm ) );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
// Plot DXF
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( choice_plot_fmt,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_GEN_PLOT_DXF,
|
|
|
|
_( "Plot &DXF" ),
|
|
|
|
_( "Plot schematic sheet in DXF 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)
|
2010-01-18 19:33:45 +00:00
|
|
|
#ifdef __WINDOWS__
|
|
|
|
|
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
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
#endif // __WINDOWS__
|
|
|
|
|
|
|
|
// Plot submenu
|
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
|
|
|
|
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,
|
|
|
|
KiBitmap( delete_body_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
|
|
|
|
// AddMenuItem( editMenu, wxID_REPLACE, _( "Find and Re&place\tCtrl+Shift+F" ), HELP_REPLACE,
|
|
|
|
// KiBitmap( find_replace_xpm ) );
|
|
|
|
|
2011-07-03 18:51:07 +00:00
|
|
|
// Backannotate
|
2009-01-17 20:31:19 +00:00
|
|
|
editMenu->AppendSeparator();
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( editMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_BACKANNO_ITEMS,
|
|
|
|
_( "&Backannotate" ),
|
|
|
|
_( "Back annotate the footprint fields" ),
|
|
|
|
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,
|
|
|
|
_( "&Hierarchy" ),
|
|
|
|
_( "Navigate schematic hierarchy" ),
|
|
|
|
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-09-23 20:00:30 +00:00
|
|
|
HK_ADD_WIRE_ENTRY, IS_ACCELERATOR ); // addan 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,
|
|
|
|
_( "&Library" ),
|
|
|
|
_( "Library preferences" ),
|
|
|
|
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,
|
|
|
|
_( "&Colors" ),
|
|
|
|
_( "Color preferences" ),
|
|
|
|
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,
|
|
|
|
_( "&Options" ),
|
|
|
|
_( "Eeschema preferences" ),
|
|
|
|
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
|
|
|
|
wxGetApp().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 viewer
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( toolsMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_TO_LIBRARY,
|
|
|
|
_( "Library &Browser" ),
|
|
|
|
_( "Library browser" ),
|
|
|
|
KiBitmap( library_browse_xpm ) );
|
2011-07-02 12:48:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Library editor
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( toolsMenu,
|
2011-10-18 19:59:19 +00:00
|
|
|
ID_TO_LIBRARY,
|
|
|
|
_( "Library &Editor" ),
|
|
|
|
_( "Library editor" ),
|
|
|
|
KiBitmap( libedit_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,
|
|
|
|
_( "&Annotate" ),
|
|
|
|
_( "Annotate the components in the schematic" ),
|
|
|
|
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,
|
|
|
|
_( "ER&C" ),
|
|
|
|
_( "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,
|
|
|
|
_( "Generate &Netlist" ),
|
|
|
|
_( "Generate the component netlist" ),
|
|
|
|
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" ),
|
|
|
|
_( "Generate bill of materials" ),
|
|
|
|
KiBitmap( tools_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,
|
|
|
|
_( "A&ssign Component Footprints" ),
|
|
|
|
_( "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,
|
|
|
|
_( "&Contents" ),
|
|
|
|
_( "Open the Eeschema handbook" ),
|
|
|
|
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" ),
|
|
|
|
_( "Open the \"Getting Started in KiCad\" guide for beginners" ),
|
|
|
|
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
|
|
|
}
|