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>
|
2017-01-15 12:12:02 +00:00
|
|
|
* Copyright (C) 1992-2017 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
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2016-03-11 16:40:24 +00:00
|
|
|
|
2012-04-09 09:16:47 +00:00
|
|
|
#include <menus_helpers.h>
|
2016-03-11 16:40:24 +00:00
|
|
|
#include <pgm_base.h>
|
|
|
|
#include <wxPcbStruct.h>
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2017-02-20 12:20:39 +00:00
|
|
|
|
2016-03-11 16:40:24 +00:00
|
|
|
#include "help_common_strings.h"
|
|
|
|
#include "hotkeys.h"
|
|
|
|
#include "module_editor_frame.h"
|
|
|
|
#include "pcbnew.h"
|
|
|
|
#include "pcbnew_id.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" ),
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "Open 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" ),
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "Load footprint from 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..." ),
|
2017-06-02 09:51:11 +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,
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "S&ave Footprint in New Library" ),
|
|
|
|
_( "Create new library and save current footprint in 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,
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "&Export Footprint" ),
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "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" ),
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "Import 2D Drawing DXF file to Pcbnew on Drawings layer" ),
|
2014-07-09 13:02:56 +00:00
|
|
|
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,
|
2017-06-02 09:51:11 +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();
|
|
|
|
|
2017-09-29 08:58:05 +00:00
|
|
|
if( IsGalCanvasActive() )
|
|
|
|
{
|
|
|
|
text = AddHotkeyName( _( "&Cut" ), g_Module_Viewer_Hokeys_Descr, HK_EDIT_CUT );
|
|
|
|
AddMenuItem( editMenu, ID_EDIT_CUT, text, _(
|
|
|
|
"Cuts the selected item(s) to the Clipboard" ), KiBitmap( cut_xpm ) );
|
|
|
|
text = AddHotkeyName( _( "&Copy" ), g_Module_Viewer_Hokeys_Descr, HK_EDIT_COPY );
|
|
|
|
AddMenuItem( editMenu, ID_EDIT_COPY, text, _(
|
|
|
|
"Copies the selected item(s) to the Clipboard" ), KiBitmap( copy_xpm ) );
|
|
|
|
text = AddHotkeyName( _( "&Paste" ), g_Module_Viewer_Hokeys_Descr, HK_EDIT_PASTE );
|
|
|
|
AddMenuItem( editMenu, ID_EDIT_PASTE, text, _(
|
|
|
|
"Pastes item(s) from the Clipboard" ), KiBitmap( paste_xpm ) );
|
|
|
|
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,
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "Footprint &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,
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "Set Custom &User Grid" ), _( "Set custom user grid size" ),
|
2015-07-03 08:15:37 +00:00
|
|
|
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,
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "Text &Size and Width" ),
|
|
|
|
_( "Adjust width for text and drawing" ),
|
|
|
|
KiBitmap( 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,
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "&Pad Properties" ), _( "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();
|
|
|
|
|
2018-01-04 14:28:02 +00:00
|
|
|
text = AddHotkeyName( _( "Legacy graphic&s" ), m_hotkeysDescrList,
|
2015-12-22 21:25:59 +00:00
|
|
|
HK_CANVAS_LEGACY );
|
2015-05-19 16:39:05 +00:00
|
|
|
|
2017-01-15 12:12:02 +00:00
|
|
|
viewMenu->Append(
|
|
|
|
new wxMenuItem( viewMenu, ID_MENU_CANVAS_LEGACY,
|
2018-01-06 09:57:46 +00:00
|
|
|
text, _( "Use legacy graphics mode (not all features will be available)" ),
|
2017-01-15 12:12:02 +00:00
|
|
|
wxITEM_RADIO ) );
|
2015-05-19 16:39:05 +00:00
|
|
|
|
2018-01-04 14:28:02 +00:00
|
|
|
text = AddHotkeyName( _( "Modern (&Accelerated)" ), m_hotkeysDescrList,
|
2015-05-19 16:39:05 +00:00
|
|
|
HK_CANVAS_OPENGL );
|
|
|
|
|
2017-01-15 12:12:02 +00:00
|
|
|
viewMenu->Append(
|
|
|
|
new wxMenuItem( viewMenu, ID_MENU_CANVAS_OPENGL,
|
2018-01-04 14:28:02 +00:00
|
|
|
text, _( "Use modern hardware-accelerated (OpenGL) graphics mode (recommended)" ),
|
2017-01-15 12:12:02 +00:00
|
|
|
wxITEM_RADIO ) );
|
2015-05-19 16:39:05 +00:00
|
|
|
|
2018-01-04 14:28:02 +00:00
|
|
|
text = AddHotkeyName( _( "Modern (Fallba&ck)" ), m_hotkeysDescrList,
|
2015-05-19 16:39:05 +00:00
|
|
|
HK_CANVAS_CAIRO );
|
|
|
|
|
2017-01-15 12:12:02 +00:00
|
|
|
viewMenu->Append(
|
|
|
|
new wxMenuItem( viewMenu, ID_MENU_CANVAS_CAIRO,
|
2018-01-04 14:28:02 +00:00
|
|
|
text, _( "Use modern fallback (Cairo) graphics mode" ),
|
2017-01-15 12:12:02 +00:00
|
|
|
wxITEM_RADIO ) );
|
2015-05-19 16:39:05 +00:00
|
|
|
|
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" ),
|
2017-06-02 09:51:11 +00:00
|
|
|
KiBitmap( 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,
|
2017-08-17 14:39:11 +00:00
|
|
|
_( "&Footprint Library Wizard" ), _( "Add footprint libraries with wizard" ),
|
2015-03-30 16:42:39 +00:00
|
|
|
KiBitmap( wizard_add_fplib_small_xpm ) );
|
|
|
|
|
2015-01-30 18:42:46 +00:00
|
|
|
AddMenuItem( prefs_menu, ID_PCB_LIB_TABLE_EDIT,
|
2017-08-17 14:39:11 +00:00
|
|
|
_( "Footprint Li&brary Table" ), _( "Configure footprint library table" ),
|
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" ),
|
2017-06-02 09:51:11 +00:00
|
|
|
KiBitmap( path_xpm ) );
|
2015-03-29 21:22:53 +00:00
|
|
|
|
2015-01-30 18:42:46 +00:00
|
|
|
// Settings
|
|
|
|
AddMenuItem( prefs_menu, wxID_PREFERENCES,
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "General &Settings" ), _( "Change footprint editor settings." ),
|
2015-01-30 18:42:46 +00:00
|
|
|
KiBitmap( preference_xpm ) );
|
|
|
|
|
2017-03-13 15:18:30 +00:00
|
|
|
AddMenuItem( prefs_menu, ID_PCB_DISPLAY_OPTIONS_SETUP,
|
2017-11-28 13:46:37 +00:00
|
|
|
_( "&Display Settings" ),
|
2017-03-13 15:18:30 +00:00
|
|
|
_( "Change footprint editor display settings" ),
|
|
|
|
KiBitmap( display_options_xpm ) );
|
|
|
|
|
2015-01-30 18:42:46 +00:00
|
|
|
// 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
|
|
|
// 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
|
|
|
|
2016-06-12 01:22:13 +00:00
|
|
|
AddMenuItem( helpMenu, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
|
|
|
|
_( "&List Hotkeys" ),
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "Displays current hotkeys table and corresponding commands" ),
|
2016-06-12 01:22:13 +00:00
|
|
|
KiBitmap( hotkeys_xpm ) );
|
|
|
|
|
2016-09-24 00:44:52 +00:00
|
|
|
helpMenu->AppendSeparator();
|
|
|
|
|
|
|
|
AddMenuItem( helpMenu, ID_HELP_GET_INVOLVED,
|
|
|
|
_( "Get &Involved" ),
|
2017-06-07 10:56:20 +00:00
|
|
|
_( "Contribute to KiCad (open web browser)" ),
|
2016-09-24 00:44:52 +00:00
|
|
|
KiBitmap( info_xpm ) );
|
|
|
|
|
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" ),
|
2017-06-02 09:51:11 +00:00
|
|
|
KiBitmap( about_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
|
|
|
}
|