2012-12-28 20:52:12 +00:00
|
|
|
|
2011-10-18 19:59:19 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2015-01-30 18:42:46 +00:00
|
|
|
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
|
|
|
* Copyright (C) 2015 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
|
|
|
* Copyright (C) 2015 Wayne Stambaugh <stambaughw@verizon.net>
|
|
|
|
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
2012-06-08 09:56:42 +00:00
|
|
|
*
|
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
|
|
|
|
*/
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
/**
|
|
|
|
* @file pcbnew/menubar_modedit.cpp
|
|
|
|
* @brief (Re)Create the main menubar for the module editor
|
|
|
|
*/
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <fctsys.h>
|
2015-01-30 18:42:46 +00:00
|
|
|
#include <pgm_base.h>
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <pcbnew.h>
|
|
|
|
#include <wxPcbStruct.h>
|
|
|
|
#include <module_editor_frame.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 <pcbnew_id.h>
|
2012-09-12 11:11:30 +00:00
|
|
|
#include <hotkeys.h>
|
2014-10-15 11:40:38 +00:00
|
|
|
#include <help_common_strings.h>
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-08-26 17:01:17 +00:00
|
|
|
|
|
|
|
void FOOTPRINT_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-10-18 17:28:49 +00:00
|
|
|
wxMenuBar* menuBar = GetMenuBar();
|
2009-11-18 12:52:19 +00:00
|
|
|
|
2011-10-18 17:28:49 +00:00
|
|
|
if( !menuBar )
|
2010-12-17 20:34:29 +00:00
|
|
|
menuBar = new wxMenuBar();
|
2010-07-29 20:00:24 +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-08-26 17:01:17 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
while( menuBar->GetMenuCount() )
|
2011-10-18 17:28:49 +00:00
|
|
|
delete menuBar->Remove( 0 );
|
2010-12-17 20:34:29 +00:00
|
|
|
|
|
|
|
// Recreate all menus:
|
2012-09-12 09:53:11 +00:00
|
|
|
wxString text;
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Menu File:
|
2010-08-24 17:26:51 +00:00
|
|
|
wxMenu* fileMenu = new wxMenu;
|
|
|
|
|
2012-08-31 19:19:48 +00:00
|
|
|
// Active library selection
|
2015-04-23 19:43:45 +00:00
|
|
|
AddMenuItem( fileMenu, ID_MODEDIT_SELECT_CURRENT_LIB, _("Set Acti&ve Library"),
|
2012-08-31 19:19:48 +00:00
|
|
|
_( "Select active library" ),
|
|
|
|
KiBitmap( open_library_xpm ) );
|
|
|
|
fileMenu->AppendSeparator();
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// New module
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( fileMenu, ID_MODEDIT_NEW_MODULE,
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "&New Footprint" ), _( "Create new footprint" ),
|
2011-10-18 17:28:49 +00:00
|
|
|
KiBitmap( new_footprint_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Open submenu
|
2010-08-24 17:26:51 +00:00
|
|
|
wxMenu* openSubmenu = new wxMenu;
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// from File
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( openSubmenu, ID_MODEDIT_IMPORT_PART,
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "&Import Footprint From File" ),
|
2014-02-28 17:31:00 +00:00
|
|
|
_( "Import footprint from an existing file" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( import_module_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// from Library
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( openSubmenu, ID_MODEDIT_LOAD_MODULE,
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "Load Footprint From Current Li&brary" ),
|
|
|
|
_( "Open a footprint from library" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( module_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// from current Board
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( openSubmenu, ID_MODEDIT_LOAD_MODULE_FROM_BOARD,
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "Load Footprint From &Current Board" ),
|
|
|
|
_( "Load a footprint from the current board" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( load_module_board_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
|
|
|
/* Append openSubmenu to fileMenu */
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu, openSubmenu, -1,
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "&Load Footprint" ),
|
|
|
|
_( "Load footprint" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( open_document_xpm ) );
|
2012-08-31 19:19:48 +00:00
|
|
|
fileMenu->AppendSeparator();
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2012-10-07 15:37:25 +00:00
|
|
|
// Save the currently loaded legacy library as an s-expression library.
|
2012-11-19 16:19:38 +00:00
|
|
|
AddMenuItem( fileMenu, ID_MODEDIT_SAVE_LIBRARY_AS,
|
2015-04-23 19:43:45 +00:00
|
|
|
_( "Save &Current Library As..." ),
|
2013-04-05 07:38:00 +00:00
|
|
|
_( "Save entire current library under a new name." ),
|
2014-04-04 18:35:07 +00:00
|
|
|
KiBitmap( copy_library_xpm ) );
|
2012-10-07 15:37:25 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Save module
|
2014-10-08 05:50:56 +00:00
|
|
|
text = AddHotkeyName( _( "&Save Footprint in Active Library" ),
|
2015-05-19 16:39:05 +00:00
|
|
|
m_hotkeysDescrList, HK_SAVE_MODULE );
|
2012-11-19 16:19:38 +00:00
|
|
|
|
2012-09-12 09:53:11 +00:00
|
|
|
AddMenuItem( fileMenu, ID_MODEDIT_SAVE_LIBMODULE, text,
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "Save footprint in active library" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( save_library_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Save module in new lib
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( fileMenu, ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART,
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "S&ave Footprint in New Library" ),
|
2015-11-17 16:18:00 +00:00
|
|
|
_( "Create a new library and save current footprint into it" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( new_library_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Export module
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( fileMenu, ID_MODEDIT_EXPORT_PART,
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "&Export Footprint" ),
|
|
|
|
_( "Save currently loaded footprint into file" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( export_module_xpm ) );
|
2014-07-09 13:02:56 +00:00
|
|
|
|
|
|
|
// Import DXF File
|
|
|
|
AddMenuItem( fileMenu, ID_GEN_IMPORT_DXF_FILE,
|
|
|
|
_( "&Import DXF File" ),
|
|
|
|
_( "Import a 2D Drawing DXF file to Pcbnew on the Drawings layer" ),
|
|
|
|
KiBitmap( import_xpm ) );
|
|
|
|
|
2010-08-24 17:26:51 +00:00
|
|
|
fileMenu->AppendSeparator();
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Print
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( fileMenu, wxID_PRINT,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "&Print" ),
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "Print current footprint" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( plot_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Separator
|
2010-08-24 17:26:51 +00:00
|
|
|
fileMenu->AppendSeparator();
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Close editor
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( fileMenu, wxID_EXIT,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "Cl&ose" ),
|
2014-02-28 17:31:00 +00:00
|
|
|
_( "Close footprint editor" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( exit_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2015-01-30 18:42:46 +00:00
|
|
|
//----- Edit menu ------------------
|
2010-08-24 17:26:51 +00:00
|
|
|
wxMenu* editMenu = new wxMenu;
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Undo
|
2015-05-19 16:39:05 +00:00
|
|
|
text = AddHotkeyName( _( "&Undo" ), m_hotkeysDescrList, HK_UNDO );
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( editMenu, wxID_UNDO,
|
2014-02-28 17:31:00 +00:00
|
|
|
text, _( "Undo last action" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( undo_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Redo
|
2015-05-19 16:39:05 +00:00
|
|
|
text = AddHotkeyName( _( "&Redo" ), m_hotkeysDescrList, HK_REDO );
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( editMenu, wxID_REDO,
|
2014-02-28 17:31:00 +00:00
|
|
|
text, _( "Redo last action" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( redo_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Delete items
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( editMenu, ID_MODEDIT_DELETE_TOOL,
|
2014-02-28 17:31:00 +00:00
|
|
|
_( "&Delete" ), _( "Delete objects with eraser" ),
|
2012-03-20 14:17:58 +00:00
|
|
|
KiBitmap( delete_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Separator
|
2010-08-24 17:26:51 +00:00
|
|
|
editMenu->AppendSeparator();
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Properties
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( editMenu, ID_MODEDIT_EDIT_MODULE_PROPERTIES,
|
2014-02-28 17:31:00 +00:00
|
|
|
_( "Edit &Properties" ),
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "Edit footprint properties" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( module_options_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Dimensions submenu
|
2010-08-24 17:26:51 +00:00
|
|
|
wxMenu* dimensions_Submenu = new wxMenu;
|
|
|
|
|
2015-07-03 08:15:37 +00:00
|
|
|
// User grid size
|
|
|
|
AddMenuItem( dimensions_Submenu, ID_PCB_USER_GRID_SETUP,
|
|
|
|
_( "&User Grid Size" ), _( "Adjust user grid" ),
|
|
|
|
KiBitmap( grid_xpm ) );
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Sizes and Widths
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( dimensions_Submenu, ID_PCB_DRAWINGS_WIDTHS_SETUP,
|
2014-02-28 17:31:00 +00:00
|
|
|
_( "&Size and Width" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "Adjust width for texts and drawings" ),
|
|
|
|
KiBitmap( options_text_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Pad settings
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( dimensions_Submenu, ID_MODEDIT_PAD_SETTINGS,
|
2014-02-28 17:31:00 +00:00
|
|
|
_( "&Pad Setting" ), _( "Edit settings for new pads" ),
|
2012-11-05 20:20:34 +00:00
|
|
|
KiBitmap( pad_dimensions_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2015-01-30 18:42:46 +00:00
|
|
|
//--------- View menu ----------------
|
2010-08-24 17:26:51 +00:00
|
|
|
wxMenu* viewMenu = new wxMenu;
|
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
/* Important Note for ZOOM IN and ZOOM OUT commands from menubar:
|
|
|
|
* we cannot add hotkey info here, because the hotkey HK_ZOOM_IN and HK_ZOOM_OUT
|
|
|
|
* 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
|
|
|
|
* 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)
|
|
|
|
*
|
|
|
|
* in other words HK_ZOOM_IN and HK_ZOOM_OUT *are NOT* accelerators
|
|
|
|
* for Zoom in and Zoom out sub menus
|
|
|
|
*/
|
2015-05-19 16:39:05 +00:00
|
|
|
text = AddHotkeyName( _( "Zoom &In" ), m_hotkeysDescrList,
|
2014-10-15 11:40:38 +00:00
|
|
|
HK_ZOOM_IN, IS_ACCELERATOR );
|
|
|
|
AddMenuItem( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, KiBitmap( zoom_in_xpm ) );
|
|
|
|
|
2015-05-19 16:39:05 +00:00
|
|
|
text = AddHotkeyName( _( "Zoom &Out" ), m_hotkeysDescrList,
|
2014-10-15 11:40:38 +00:00
|
|
|
HK_ZOOM_OUT, IS_ACCELERATOR );
|
|
|
|
AddMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, KiBitmap( zoom_out_xpm ) );
|
|
|
|
|
2015-05-19 16:39:05 +00:00
|
|
|
text = AddHotkeyName( _( "&Fit on Screen" ), m_hotkeysDescrList,
|
2014-10-15 11:40:38 +00:00
|
|
|
HK_ZOOM_AUTO );
|
|
|
|
AddMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT,
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( zoom_fit_in_page_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2015-05-19 16:39:05 +00:00
|
|
|
text = AddHotkeyName( _( "&Redraw" ), m_hotkeysDescrList, HK_ZOOM_REDRAW );
|
2014-10-15 11:40:38 +00:00
|
|
|
AddMenuItem( viewMenu, ID_ZOOM_REDRAW, text,
|
|
|
|
HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
viewMenu->AppendSeparator();
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// 3D view
|
2015-05-19 16:39:05 +00:00
|
|
|
text = AddHotkeyName( _( "&3D Viewer" ), m_hotkeysDescrList, HK_3D_VIEWER );
|
2015-03-26 19:04:52 +00:00
|
|
|
AddMenuItem( viewMenu, ID_MENU_PCB_SHOW_3D_FRAME, text, _( "Show footprint in 3D viewer" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( three_d_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2015-05-19 16:39:05 +00:00
|
|
|
// Add canvas selection
|
|
|
|
viewMenu->AppendSeparator();
|
|
|
|
|
2015-10-08 13:52:03 +00:00
|
|
|
text = AddHotkeyName( _( "&Switch Canvas to Default" ), m_hotkeysDescrList,
|
2015-05-19 16:39:05 +00:00
|
|
|
HK_CANVAS_DEFAULT );
|
|
|
|
|
|
|
|
AddMenuItem( viewMenu, ID_MENU_CANVAS_DEFAULT,
|
|
|
|
text, _( "Switch the canvas implementation to default" ),
|
|
|
|
KiBitmap( tools_xpm ) );
|
|
|
|
|
2015-10-08 13:52:03 +00:00
|
|
|
text = AddHotkeyName( _( "Switch Canvas to Open&GL" ), m_hotkeysDescrList,
|
2015-05-19 16:39:05 +00:00
|
|
|
HK_CANVAS_OPENGL );
|
|
|
|
|
|
|
|
AddMenuItem( viewMenu, ID_MENU_CANVAS_OPENGL,
|
|
|
|
text, _( "Switch the canvas implementation to OpenGL" ),
|
|
|
|
KiBitmap( tools_xpm ) );
|
|
|
|
|
2015-10-08 13:52:03 +00:00
|
|
|
text = AddHotkeyName( _( "Switch Canvas to &Cairo" ), m_hotkeysDescrList,
|
2015-05-19 16:39:05 +00:00
|
|
|
HK_CANVAS_CAIRO );
|
|
|
|
|
|
|
|
AddMenuItem( viewMenu, ID_MENU_CANVAS_CAIRO,
|
|
|
|
text, _( "Switch the canvas implementation to Cairo" ),
|
|
|
|
KiBitmap( tools_xpm ) );
|
|
|
|
|
2015-01-30 18:42:46 +00:00
|
|
|
//-------- Place menu --------------------
|
2010-08-24 17:26:51 +00:00
|
|
|
wxMenu* placeMenu = new wxMenu;
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Pad
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( placeMenu, ID_MODEDIT_PAD_TOOL,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "&Pad" ), _( "Add pad" ),
|
|
|
|
KiBitmap( pad_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
|
|
|
placeMenu->AppendSeparator();
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Circle
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( placeMenu, ID_MODEDIT_CIRCLE_TOOL,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "&Circle" ), _( "Add graphic circle" ),
|
|
|
|
KiBitmap( add_circle_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Line or Polygon
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( placeMenu, ID_MODEDIT_LINE_TOOL,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "&Line or Polygon" ),
|
|
|
|
_( "Add graphic line or polygon" ),
|
|
|
|
KiBitmap( add_polygon_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Arc
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( placeMenu, ID_MODEDIT_ARC_TOOL,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "&Arc" ), _( "Add graphic arc" ),
|
|
|
|
KiBitmap( add_arc_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Text
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( placeMenu, ID_MODEDIT_TEXT_TOOL,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "&Text" ), _( "Add graphic text" ),
|
|
|
|
KiBitmap( add_text_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
|
|
|
placeMenu->AppendSeparator();
|
2011-10-18 19:59:19 +00:00
|
|
|
|
|
|
|
// Anchor
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( placeMenu, ID_MODEDIT_ANCHOR_TOOL,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "A&nchor" ),
|
2014-10-30 17:31:56 +00:00
|
|
|
_( "Place footprint reference anchor" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( anchor_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2015-01-30 18:42:46 +00:00
|
|
|
|
|
|
|
//----- Preferences menu -----------------
|
|
|
|
wxMenu* prefs_menu = new wxMenu;
|
|
|
|
|
2015-03-30 16:42:39 +00:00
|
|
|
AddMenuItem( prefs_menu, ID_PCB_LIB_WIZARD,
|
|
|
|
_( "&Footprint Libraries Wizard" ), _( "Add footprint libraries with wizard" ),
|
|
|
|
KiBitmap( wizard_add_fplib_small_xpm ) );
|
|
|
|
|
2015-01-30 18:42:46 +00:00
|
|
|
AddMenuItem( prefs_menu, ID_PCB_LIB_TABLE_EDIT,
|
2015-03-30 16:42:39 +00:00
|
|
|
_( "Footprint Li&braries Manager" ), _( "Configure footprint libraries" ),
|
2015-01-30 18:42:46 +00:00
|
|
|
KiBitmap( library_table_xpm ) );
|
|
|
|
|
2015-03-29 21:22:53 +00:00
|
|
|
// Path configuration edit dialog.
|
|
|
|
AddMenuItem( prefs_menu,
|
|
|
|
ID_PREFERENCES_CONFIGURE_PATHS,
|
|
|
|
_( "Configure Pa&ths" ),
|
|
|
|
_( "Edit path configuration environment variables" ),
|
|
|
|
KiBitmap( editor_xpm ) );
|
|
|
|
|
2015-01-30 18:42:46 +00:00
|
|
|
// Settings
|
|
|
|
AddMenuItem( prefs_menu, wxID_PREFERENCES,
|
2015-10-08 13:52:03 +00:00
|
|
|
_( "&Settings" ), _( "Change the footprint editor settings." ),
|
2015-01-30 18:42:46 +00:00
|
|
|
KiBitmap( preference_xpm ) );
|
|
|
|
|
|
|
|
// Language submenu
|
|
|
|
Pgm().AddMenuLanguageList( prefs_menu );
|
|
|
|
|
|
|
|
// Hotkey submenu
|
|
|
|
AddHotkeyConfigMenu( prefs_menu );
|
|
|
|
|
|
|
|
//----- Help menu --------------------
|
2010-08-24 17:26:51 +00:00
|
|
|
wxMenu* helpMenu = new wxMenu;
|
|
|
|
|
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-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( helpMenu, wxID_HELP,
|
2015-09-23 18:45:24 +00:00
|
|
|
_( "Pcbnew &Manual" ),
|
2015-09-23 18:29:21 +00:00
|
|
|
_( "Open the Pcbnew Manual" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( online_help_xpm ) );
|
|
|
|
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( helpMenu, wxID_INDEX,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "&Getting Started in KiCad" ),
|
|
|
|
_( "Open the \"Getting Started in KiCad\" guide for beginners" ),
|
|
|
|
KiBitmap( help_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2011-09-30 18:15:37 +00:00
|
|
|
// About Pcbnew
|
2011-08-04 18:03:26 +00:00
|
|
|
helpMenu->AppendSeparator();
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( helpMenu, 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 ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Append menus to the menubar
|
2011-10-18 17:28:49 +00:00
|
|
|
menuBar->Append( fileMenu, _( "&File" ) );
|
|
|
|
menuBar->Append( editMenu, _( "&Edit" ) );
|
|
|
|
menuBar->Append( viewMenu, _( "&View" ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
menuBar->Append( placeMenu, _( "&Place" ) );
|
2015-01-30 18:42:46 +00:00
|
|
|
menuBar->Append( prefs_menu, _( "P&references" ) );
|
|
|
|
menuBar->Append( dimensions_Submenu, _( "Di&mensions" ) );
|
2011-10-18 17:28:49 +00:00
|
|
|
menuBar->Append( helpMenu, _( "&Help" ) );
|
2010-08-24 17:26:51 +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
|
|
|
}
|