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>
|
2018-03-16 12:38:36 +00:00
|
|
|
* Copyright (C) 2015 Wayne Stambaugh <stambaughw@gmail.com>
|
|
|
|
* Copyright (C) 1992-2018 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
|
|
|
/**
|
2018-02-01 10:05:01 +00:00
|
|
|
* @file pcbnew/menubar_footprint_editor.cpp
|
|
|
|
* @brief (Re)Create the main menubar for the footprint editor
|
2011-04-06 13:52:47 +00:00
|
|
|
*/
|
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>
|
2017-02-20 12:20:39 +00:00
|
|
|
|
2016-03-11 16:40:24 +00:00
|
|
|
#include "help_common_strings.h"
|
|
|
|
#include "hotkeys.h"
|
2018-01-29 20:58:58 +00:00
|
|
|
#include "footprint_edit_frame.h"
|
2016-03-11 16:40:24 +00:00
|
|
|
#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
|
|
|
{
|
2018-04-07 13:13:38 +00:00
|
|
|
// wxWidgets handles the Mac Application menu behind the scenes, but that means
|
|
|
|
// we always have to start from scratch with a new wxMenuBar.
|
|
|
|
wxMenuBar* oldMenuBar = GetMenuBar();
|
|
|
|
wxMenuBar* menuBar = new wxMenuBar();
|
|
|
|
wxString text;
|
2010-12-17 20:34:29 +00:00
|
|
|
|
|
|
|
// Recreate all menus:
|
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
|
2018-02-19 19:26:02 +00:00
|
|
|
AddMenuItem( fileMenu, ID_MODEDIT_SELECT_CURRENT_LIB,
|
|
|
|
_("Set Acti&ve Library..."),
|
|
|
|
_( "Select active library" ),
|
|
|
|
KiBitmap( open_library_xpm ) );
|
|
|
|
|
2012-08-31 19:19:48 +00:00
|
|
|
fileMenu->AppendSeparator();
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// New module
|
2018-02-19 19:26:02 +00:00
|
|
|
text = AddHotkeyName( _( "&New Footprint..." ), m_hotkeysDescrList, HK_NEW );
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( fileMenu, ID_MODEDIT_NEW_MODULE,
|
2018-02-19 19:26:02 +00:00
|
|
|
text, _( "Create new footprint" ),
|
2011-10-18 17:28:49 +00:00
|
|
|
KiBitmap( new_footprint_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
text = AddHotkeyName( _( "&Open Footprint..." ), m_hotkeysDescrList, HK_OPEN );
|
|
|
|
AddMenuItem( fileMenu, ID_MODEDIT_LOAD_MODULE, text,
|
|
|
|
_( "Open a footprint from a library" ),
|
|
|
|
KiBitmap( module_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
fileMenu->AppendSeparator();
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
// Save module
|
|
|
|
text = AddHotkeyName( _( "&Save" ), m_hotkeysDescrList, HK_SAVE );
|
|
|
|
AddMenuItem( fileMenu, ID_MODEDIT_SAVE_LIBMODULE, text,
|
|
|
|
_( "Save footprint" ),
|
|
|
|
KiBitmap( save_library_xpm ) );
|
|
|
|
|
|
|
|
fileMenu->AppendSeparator();
|
|
|
|
|
|
|
|
|
|
|
|
wxMenu* importSubMenu = new wxMenu();
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// from current Board
|
2018-02-19 19:26:02 +00:00
|
|
|
AddMenuItem( importSubMenu, ID_MODEDIT_LOAD_MODULE_FROM_BOARD,
|
|
|
|
_( "Footprint from &Current Board..." ),
|
|
|
|
_( "Import 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
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
AddMenuItem( importSubMenu, ID_MODEDIT_IMPORT_PART,
|
|
|
|
_( "Footprint from &KiCad File..." ),
|
2018-02-21 08:36:27 +00:00
|
|
|
_( "Import a footprint from an existing footprint file" ),
|
2018-02-19 19:26:02 +00:00
|
|
|
KiBitmap( import_module_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
AddMenuItem( importSubMenu, ID_GEN_IMPORT_DXF_FILE,
|
2018-02-21 08:36:27 +00:00
|
|
|
_( "Footprint Outlines from &DXF File..." ),
|
2018-02-19 19:26:02 +00:00
|
|
|
_( "Import 2D Drawing DXF file to Footprint Editor on Drawings layer" ),
|
|
|
|
KiBitmap( import_xpm ) );
|
2012-10-07 15:37:25 +00:00
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
AddMenuItem( fileMenu, importSubMenu, -1,
|
|
|
|
_( "&Import" ),
|
|
|
|
_( "Import files" ),
|
|
|
|
KiBitmap( import_xpm ) );
|
2012-11-19 16:19:38 +00:00
|
|
|
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
wxMenu* exportSubMenu = new wxMenu();
|
|
|
|
|
|
|
|
AddMenuItem( exportSubMenu, ID_MODEDIT_SAVE_LIBRARY_AS,
|
|
|
|
_( "&Active Library..." ),
|
|
|
|
_( "Export active library" ),
|
|
|
|
KiBitmap( library_archive_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
AddMenuItem( exportSubMenu, ID_MODEDIT_EXPORT_PART,
|
|
|
|
_( "&Footprint..." ),
|
|
|
|
_( "Export current footprint to a file" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( export_module_xpm ) );
|
2014-07-09 13:02:56 +00:00
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
AddMenuItem( fileMenu, exportSubMenu, -1,
|
|
|
|
_( "E&xport" ),
|
|
|
|
_( "Export files" ),
|
|
|
|
KiBitmap( export_xpm ) );
|
|
|
|
|
|
|
|
|
2014-07-09 13:02:56 +00:00
|
|
|
|
2010-08-24 17:26:51 +00:00
|
|
|
fileMenu->AppendSeparator();
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Print
|
2018-02-19 19:26:02 +00:00
|
|
|
text = AddHotkeyName( _( "&Print..." ), m_hotkeysDescrList, HK_PRINT );
|
|
|
|
AddMenuItem( fileMenu, wxID_PRINT, text,
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "Print current footprint" ),
|
2018-02-19 19:26:02 +00:00
|
|
|
KiBitmap( print_button_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();
|
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
// Properties
|
|
|
|
AddMenuItem( fileMenu, ID_MODEDIT_EDIT_MODULE_PROPERTIES,
|
|
|
|
_( "P&roperties..." ),
|
|
|
|
_( "Edit footprint properties" ),
|
|
|
|
KiBitmap( module_options_xpm ) );
|
|
|
|
|
|
|
|
fileMenu->AppendSeparator();
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Close editor
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( fileMenu, wxID_EXIT,
|
2018-02-19 19:26:02 +00:00
|
|
|
_( "&Exit" ),
|
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
|
|
|
// Separator
|
2010-08-24 17:26:51 +00:00
|
|
|
editMenu->AppendSeparator();
|
|
|
|
|
2017-09-29 08:58:05 +00:00
|
|
|
if( IsGalCanvasActive() )
|
|
|
|
{
|
2018-02-19 19:26:02 +00:00
|
|
|
text = AddHotkeyName( _( "Cu&t" ), m_hotkeysDescrList, HK_EDIT_CUT );
|
2018-03-16 12:38:36 +00:00
|
|
|
AddMenuItem( editMenu, ID_EDIT_CUT, text,
|
|
|
|
_( "Cuts the selected item(s) to the Clipboard" ), KiBitmap( cut_xpm ) );
|
2018-02-19 19:26:02 +00:00
|
|
|
text = AddHotkeyName( _( "&Copy" ), m_hotkeysDescrList, HK_EDIT_COPY );
|
2018-03-16 12:38:36 +00:00
|
|
|
AddMenuItem( editMenu, ID_EDIT_COPY, text,
|
|
|
|
_( "Copies the selected item(s) to the Clipboard" ), KiBitmap( copy_xpm ) );
|
2018-02-19 19:26:02 +00:00
|
|
|
text = AddHotkeyName( _( "&Paste" ), m_hotkeysDescrList, HK_EDIT_PASTE );
|
2018-03-16 12:38:36 +00:00
|
|
|
AddMenuItem( editMenu, ID_EDIT_PASTE, text,
|
|
|
|
_( "Pastes item(s) from the Clipboard" ), KiBitmap( paste_xpm ) );
|
2018-04-04 11:27:18 +00:00
|
|
|
|
|
|
|
editMenu->AppendSeparator();
|
2017-09-29 08:58:05 +00:00
|
|
|
}
|
|
|
|
|
2018-04-04 11:27:18 +00:00
|
|
|
// Delete items tool
|
2018-02-19 19:26:02 +00:00
|
|
|
AddMenuItem( editMenu, ID_MODEDIT_DELETE_TOOL,
|
|
|
|
_( "&Delete" ), _( "Delete items" ),
|
|
|
|
KiBitmap( delete_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
//--------- View menu ----------------
|
|
|
|
wxMenu* viewMenu = new wxMenu;
|
2015-07-03 08:15:37 +00:00
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
AddMenuItem( viewMenu, ID_OPEN_MODULE_VIEWER,
|
|
|
|
_( "&Library Browser" ),
|
|
|
|
_( "Open the Library Browser" ),
|
|
|
|
KiBitmap( modview_icon_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
text = AddHotkeyName( _( "&3D Viewer" ), m_hotkeysDescrList, HK_3D_VIEWER );
|
|
|
|
AddMenuItem( viewMenu, ID_MENU_PCB_SHOW_3D_FRAME,
|
|
|
|
text, _( "Show footprint in 3D viewer" ),
|
|
|
|
KiBitmap( three_d_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
viewMenu->AppendSeparator();
|
2010-08-24 17:26:51 +00:00
|
|
|
|
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 ) );
|
|
|
|
|
2018-03-16 12:38:36 +00:00
|
|
|
text = AddHotkeyName( _( "&Zoom to Fit" ), m_hotkeysDescrList,
|
2014-10-15 11:40:38 +00:00
|
|
|
HK_ZOOM_AUTO );
|
2018-03-16 12:38:36 +00:00
|
|
|
AddMenuItem( viewMenu, ID_ZOOM_PAGE, text, _( "Zoom to fit footprint" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( zoom_fit_in_page_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2018-03-25 15:02:53 +00:00
|
|
|
text = AddHotkeyName( _( "Zoom to Selection" ), m_hotkeysDescrList, HK_ZOOM_SELECTION );
|
|
|
|
|
2018-03-25 20:12:56 +00:00
|
|
|
AddMenuItem( viewMenu, ID_ZOOM_SELECTION, text, KiBitmap( zoom_area_xpm ), wxITEM_CHECK );
|
2018-03-25 15:02:53 +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
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
AddMenuItem( viewMenu, ID_TB_OPTIONS_SHOW_GRID,
|
|
|
|
_( "Show &Grid" ), wxEmptyString,
|
|
|
|
KiBitmap( grid_xpm ), wxITEM_CHECK );
|
|
|
|
|
|
|
|
AddMenuItem( viewMenu, ID_PCB_USER_GRID_SETUP,
|
|
|
|
_( "Grid &Settings..." ),_( "Adjust custom user-defined grid dimensions" ),
|
|
|
|
KiBitmap( grid_xpm ) );
|
|
|
|
|
|
|
|
AddMenuItem( viewMenu, ID_TB_OPTIONS_SHOW_POLAR_COORD,
|
|
|
|
_( "Display &Polar Coordinates" ), wxEmptyString,
|
|
|
|
KiBitmap( polar_coord_xpm ), wxITEM_CHECK );
|
|
|
|
|
|
|
|
// Units submenu
|
|
|
|
wxMenu* unitsSubMenu = new wxMenu;
|
|
|
|
AddMenuItem( unitsSubMenu, ID_TB_OPTIONS_SELECT_UNIT_INCH,
|
|
|
|
_( "&Imperial" ), _( "Use imperial units" ),
|
|
|
|
KiBitmap( unit_inch_xpm ), wxITEM_RADIO );
|
|
|
|
|
|
|
|
AddMenuItem( unitsSubMenu, ID_TB_OPTIONS_SELECT_UNIT_MM,
|
|
|
|
_( "&Metric" ), _( "Use metric units" ),
|
|
|
|
KiBitmap( unit_mm_xpm ), wxITEM_RADIO );
|
|
|
|
|
|
|
|
AddMenuItem( viewMenu, unitsSubMenu,
|
|
|
|
-1, _( "&Units" ),
|
|
|
|
_( "Select which units are displayed" ),
|
|
|
|
KiBitmap( unit_mm_xpm ) );
|
|
|
|
|
|
|
|
#ifndef __APPLE__
|
|
|
|
AddMenuItem( viewMenu, ID_TB_OPTIONS_SELECT_CURSOR,
|
|
|
|
_( "Full Window Crosshair" ),
|
|
|
|
_( "Change cursor shape" ),
|
|
|
|
KiBitmap( cursor_shape_xpm ), wxITEM_CHECK );
|
|
|
|
#else
|
|
|
|
AddMenuItem( viewMenu, ID_TB_OPTIONS_SELECT_CURSOR,
|
|
|
|
_( "Full Window Crosshair" ),
|
|
|
|
_( "Change cursor shape (not supported in Legacy Toolset)" ),
|
|
|
|
KiBitmap( cursor_shape_xpm ), wxITEM_CHECK );
|
|
|
|
#endif
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2015-05-19 16:39:05 +00:00
|
|
|
viewMenu->AppendSeparator();
|
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
// Drawing Mode Submenu
|
|
|
|
wxMenu* drawingModeSubMenu = new wxMenu;
|
|
|
|
|
|
|
|
AddMenuItem( drawingModeSubMenu, ID_TB_OPTIONS_SHOW_PADS_SKETCH,
|
|
|
|
_( "Sketch &Pads" ), _( "Show pads in outline mode" ),
|
|
|
|
KiBitmap( pad_sketch_xpm ), wxITEM_CHECK );
|
2015-05-19 16:39:05 +00:00
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
AddMenuItem( drawingModeSubMenu, ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH,
|
|
|
|
_( "Sketch Footprint &Edges" ), _( "Show footprint edges in outline mode" ),
|
|
|
|
KiBitmap( show_mod_edge_xpm ), wxITEM_CHECK );
|
|
|
|
AddMenuItem( drawingModeSubMenu, ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH,
|
|
|
|
_( "Sketch Footprint Te&xt" ), _( "Show footprint text in outline mode" ),
|
|
|
|
KiBitmap( text_sketch_xpm ), wxITEM_CHECK );
|
2015-05-19 16:39:05 +00:00
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
AddMenuItem( viewMenu, drawingModeSubMenu,
|
|
|
|
-1, _( "&Drawing Mode" ),
|
|
|
|
_( "Select how items are displayed" ),
|
|
|
|
KiBitmap( add_zone_xpm ) );
|
2015-05-19 16:39:05 +00:00
|
|
|
|
2018-02-21 16:29:24 +00:00
|
|
|
// Contrast Mode Submenu
|
|
|
|
wxMenu* contrastModeSubMenu = new wxMenu;
|
2015-05-19 16:39:05 +00:00
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
text = AddHotkeyName( _( "&High Contrast Mode" ), m_hotkeysDescrList,
|
|
|
|
HK_SWITCH_HIGHCONTRAST_MODE );
|
2018-02-21 16:29:24 +00:00
|
|
|
AddMenuItem( contrastModeSubMenu, ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE, text,
|
2018-02-19 19:26:02 +00:00
|
|
|
_( "Use high contrast display mode" ),
|
|
|
|
KiBitmap( contrast_mode_xpm ), wxITEM_CHECK );
|
|
|
|
|
2018-02-21 16:29:24 +00:00
|
|
|
contrastModeSubMenu->AppendSeparator();
|
|
|
|
|
2018-02-23 13:04:07 +00:00
|
|
|
text = AddHotkeyName( _( "&Decrease Layer Opacity" ), g_Pcbnew_Editor_Hotkeys_Descr,
|
2018-02-25 18:30:59 +00:00
|
|
|
HK_DEC_LAYER_ALPHA );
|
2018-02-21 16:29:24 +00:00
|
|
|
AddMenuItem( contrastModeSubMenu, ID_DEC_LAYER_ALPHA,
|
2018-02-23 13:04:07 +00:00
|
|
|
text, _( "Make the current layer more transparent" ),
|
2018-02-21 16:29:24 +00:00
|
|
|
KiBitmap( contrast_mode_xpm ) );
|
|
|
|
|
2018-02-23 13:04:07 +00:00
|
|
|
text = AddHotkeyName( _( "&Increase Layer Opacity" ), g_Pcbnew_Editor_Hotkeys_Descr,
|
2018-02-25 18:30:59 +00:00
|
|
|
HK_INC_LAYER_ALPHA );
|
2018-02-21 16:29:24 +00:00
|
|
|
AddMenuItem( contrastModeSubMenu, ID_INC_LAYER_ALPHA,
|
2018-02-23 13:04:07 +00:00
|
|
|
text, _( "Make the current layer less transparent" ),
|
2018-02-21 16:29:24 +00:00
|
|
|
KiBitmap( contrast_mode_xpm ) );
|
|
|
|
|
|
|
|
AddMenuItem( viewMenu, contrastModeSubMenu,
|
|
|
|
-1, _( "&Contrast Mode" ),
|
|
|
|
_( "Select how items are displayed" ),
|
|
|
|
KiBitmap( contrast_mode_xpm ) );
|
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
#ifdef __APPLE__
|
|
|
|
viewMenu->AppendSeparator();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
//-------- Setup menu --------------------
|
|
|
|
wxMenu* setupMenu = new wxMenu;
|
|
|
|
|
|
|
|
// Sizes and Widths
|
|
|
|
AddMenuItem( setupMenu, ID_PCB_DRAWINGS_WIDTHS_SETUP,
|
|
|
|
_( "Te&xts and Drawings..." ),
|
|
|
|
_( "Adjust dimensions for texts and drawings" ),
|
|
|
|
KiBitmap( text_xpm ) );
|
2015-05-19 16:39:05 +00:00
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
// Pad settings
|
|
|
|
AddMenuItem( setupMenu, ID_MODEDIT_PAD_SETTINGS,
|
|
|
|
_( "Default &Pad Properties..." ),
|
|
|
|
_( "Edit settings for new pads" ),
|
|
|
|
KiBitmap( pad_dimensions_xpm ) );
|
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();
|
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
// Text
|
2018-05-14 03:22:11 +00:00
|
|
|
text = AddHotkeyName( _( "&Text" ), m_hotkeysDescrList, HK_ADD_TEXT );
|
2018-02-19 19:26:02 +00:00
|
|
|
AddMenuItem( placeMenu, ID_MODEDIT_TEXT_TOOL,
|
2018-05-14 03:22:11 +00:00
|
|
|
text, _( "Add graphic text" ),
|
2018-02-19 19:26:02 +00:00
|
|
|
KiBitmap( text_xpm ) );
|
|
|
|
|
|
|
|
// Arc
|
2018-05-14 03:22:11 +00:00
|
|
|
text = AddHotkeyName( _( "&Arc" ), m_hotkeysDescrList, HK_ADD_ARC );
|
2018-02-19 19:26:02 +00:00
|
|
|
AddMenuItem( placeMenu, ID_MODEDIT_ARC_TOOL,
|
2018-05-14 03:22:11 +00:00
|
|
|
text, _( "Add graphic arc" ),
|
2018-02-19 19:26:02 +00:00
|
|
|
KiBitmap( add_arc_xpm ) );
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Circle
|
2018-05-14 03:22:11 +00:00
|
|
|
text = AddHotkeyName( _( "&Circle" ), m_hotkeysDescrList, HK_ADD_CIRCLE );
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( placeMenu, ID_MODEDIT_CIRCLE_TOOL,
|
2018-05-14 03:22:11 +00:00
|
|
|
text, _( "Add graphic circle" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( add_circle_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
// Line
|
2018-05-14 03:22:11 +00:00
|
|
|
text = AddHotkeyName( _( "&Line" ), m_hotkeysDescrList, HK_ADD_LINE );
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( placeMenu, ID_MODEDIT_LINE_TOOL,
|
2018-05-14 03:22:11 +00:00
|
|
|
text, _( "Add graphic line" ),
|
2018-02-19 19:26:02 +00:00
|
|
|
KiBitmap( add_graphical_segments_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
// Polygon
|
2018-05-14 03:22:11 +00:00
|
|
|
text = AddHotkeyName( _( "&Polygon" ), m_hotkeysDescrList, HK_ADD_POLYGON );
|
2018-02-19 19:26:02 +00:00
|
|
|
AddMenuItem( placeMenu, ID_MODEDIT_POLYGON_TOOL,
|
2018-05-14 03:22:11 +00:00
|
|
|
text, _( "Add graphic polygon" ),
|
2018-02-19 19:26:02 +00:00
|
|
|
KiBitmap( add_graphical_polygon_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
|
|
|
placeMenu->AppendSeparator();
|
2011-10-18 19:59:19 +00:00
|
|
|
|
|
|
|
// Anchor
|
2018-05-14 03:22:11 +00:00
|
|
|
text = AddHotkeyName( _( "A&nchor" ), m_hotkeysDescrList, HK_ADD_ANCHOR );
|
2011-10-18 17:28:49 +00:00
|
|
|
AddMenuItem( placeMenu, ID_MODEDIT_ANCHOR_TOOL,
|
2018-05-14 03:22:11 +00:00
|
|
|
text, _( "Place footprint reference anchor" ),
|
2011-10-18 19:59:19 +00:00
|
|
|
KiBitmap( anchor_xpm ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
// Origin
|
|
|
|
AddMenuItem( placeMenu, ID_MODEDIT_PLACE_GRID_COORD,
|
|
|
|
_( "&Grid Origin" ),
|
|
|
|
_( "Set grid origin point" ),
|
|
|
|
KiBitmap( grid_select_axis_xpm ) );
|
|
|
|
|
|
|
|
|
|
|
|
//----- Inspect menu ---------------------
|
|
|
|
wxMenu* inspectMenu = new wxMenu;
|
|
|
|
|
2018-05-14 03:22:11 +00:00
|
|
|
|
|
|
|
text = AddHotkeyName( _( "&Measure" ), m_hotkeysDescrList, HK_MEASURE_TOOL );
|
2018-02-19 19:26:02 +00:00
|
|
|
AddMenuItem( inspectMenu, ID_MODEDIT_MEASUREMENT_TOOL,
|
2018-05-14 03:22:11 +00:00
|
|
|
text, _( "Measure distance" ),
|
2018-02-19 19:26:02 +00:00
|
|
|
KiBitmap( measurement_xpm ) );
|
|
|
|
|
|
|
|
//----- Tools menu ---------------------
|
|
|
|
wxMenu* toolsMenu = new wxMenu;
|
|
|
|
|
|
|
|
AddMenuItem( toolsMenu, ID_MODEDIT_UPDATE_MODULE_IN_BOARD,
|
|
|
|
_( "&Update Footprint on PCB" ),
|
|
|
|
_( "Push updated footprint through to current board" ),
|
|
|
|
KiBitmap( update_module_board_xpm ) );
|
|
|
|
|
|
|
|
AddMenuItem( toolsMenu, ID_MODEDIT_INSERT_MODULE_IN_BOARD,
|
|
|
|
_( "&Insert Footprint on PCB" ),
|
|
|
|
_( "Insert footprint onto current board" ),
|
|
|
|
KiBitmap( insert_module_board_xpm ) );
|
|
|
|
|
|
|
|
toolsMenu->AppendSeparator();
|
|
|
|
|
|
|
|
AddMenuItem( toolsMenu, ID_MODEDIT_DELETE_PART,
|
|
|
|
_( "&Delete a Footprint in Active Library" ),
|
|
|
|
_( "Choose and delete a footprint from the active library" ),
|
|
|
|
KiBitmap( delete_xpm ) );
|
|
|
|
|
2015-01-30 18:42:46 +00:00
|
|
|
|
|
|
|
//----- Preferences menu -----------------
|
|
|
|
wxMenu* prefs_menu = new wxMenu;
|
|
|
|
|
2015-03-29 21:22:53 +00:00
|
|
|
// Path configuration edit dialog.
|
|
|
|
AddMenuItem( prefs_menu,
|
|
|
|
ID_PREFERENCES_CONFIGURE_PATHS,
|
2018-02-09 16:28:33 +00:00
|
|
|
_( "Configure Pa&ths..." ),
|
2015-03-29 21:22:53 +00:00
|
|
|
_( "Edit path configuration environment variables" ),
|
2017-06-02 09:51:11 +00:00
|
|
|
KiBitmap( path_xpm ) );
|
2015-03-29 21:22:53 +00:00
|
|
|
|
2018-04-27 14:25:33 +00:00
|
|
|
AddMenuItem( prefs_menu, ID_PCB_LIB_TABLE_EDIT,
|
|
|
|
_( "Manage Footprint Li&braries..." ), _( "Configure footprint library table" ),
|
|
|
|
KiBitmap( library_table_xpm ) );
|
|
|
|
|
2015-01-30 18:42:46 +00:00
|
|
|
// Settings
|
|
|
|
AddMenuItem( prefs_menu, wxID_PREFERENCES,
|
2018-02-09 16:28:33 +00:00
|
|
|
_( "General &Settings..." ), _( "Change footprint editor settings." ),
|
2015-01-30 18:42:46 +00:00
|
|
|
KiBitmap( preference_xpm ) );
|
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
prefs_menu->AppendSeparator();
|
|
|
|
|
2017-03-13 15:18:30 +00:00
|
|
|
AddMenuItem( prefs_menu, ID_PCB_DISPLAY_OPTIONS_SETUP,
|
2018-02-19 19:26:02 +00:00
|
|
|
_( "&Display Options..." ),
|
|
|
|
_( "Graphics acceleration, grid and cursor settings." ),
|
|
|
|
KiBitmap( display_options_xpm ) );
|
|
|
|
|
|
|
|
text = AddHotkeyName( _( "Legacy Tool&set" ), m_hotkeysDescrList,
|
|
|
|
HK_CANVAS_LEGACY );
|
|
|
|
AddMenuItem( prefs_menu, ID_MENU_CANVAS_LEGACY, text,
|
|
|
|
_( "Use Legacy Toolset (not all features will be available)" ),
|
|
|
|
KiBitmap( tools_xpm ), wxITEM_RADIO );
|
|
|
|
|
|
|
|
text = AddHotkeyName( _( "Modern Toolset (&Accelerated)" ),
|
|
|
|
m_hotkeysDescrList, HK_CANVAS_OPENGL );
|
|
|
|
AddMenuItem( prefs_menu, ID_MENU_CANVAS_OPENGL, text,
|
|
|
|
_( "Use Modern Toolset with hardware-accelerated graphics (recommended)" ),
|
|
|
|
KiBitmap( tools_xpm ), wxITEM_RADIO );
|
|
|
|
|
|
|
|
text = AddHotkeyName( _( "Modern Toolset (&Fallback)" ),
|
|
|
|
m_hotkeysDescrList, HK_CANVAS_CAIRO );
|
|
|
|
AddMenuItem( prefs_menu, ID_MENU_CANVAS_CAIRO, text,
|
2018-02-21 08:36:27 +00:00
|
|
|
_( "Use Modern Toolset with software graphics (fall-back)" ),
|
2018-02-19 19:26:02 +00:00
|
|
|
KiBitmap( tools_xpm ), wxITEM_RADIO );
|
|
|
|
|
|
|
|
prefs_menu->AppendSeparator();
|
2017-03-13 15:18:30 +00:00
|
|
|
|
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
|
|
|
|
2018-02-19 19:26:02 +00:00
|
|
|
text = AddHotkeyName( _( "&List Hotkeys..." ), m_hotkeysDescrList, HK_HELP );
|
2016-06-12 01:22:13 +00:00
|
|
|
AddMenuItem( helpMenu, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
|
2018-02-15 08:23:06 +00:00
|
|
|
text,
|
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" ),
|
2018-03-08 05:16:54 +00:00
|
|
|
_( "Contribute to KiCad (opens a 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" ) );
|
2018-02-19 19:26:02 +00:00
|
|
|
menuBar->Append( setupMenu, _( "&Setup" ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
menuBar->Append( placeMenu, _( "&Place" ) );
|
2018-02-19 19:26:02 +00:00
|
|
|
menuBar->Append( inspectMenu, _( "&Inspect" ) );
|
|
|
|
menuBar->Append( toolsMenu, _( "&Tools" ) );
|
2015-01-30 18:42:46 +00:00
|
|
|
menuBar->Append( prefs_menu, _( "P&references" ) );
|
2011-10-18 17:28:49 +00:00
|
|
|
menuBar->Append( helpMenu, _( "&Help" ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2018-04-07 13:13:38 +00:00
|
|
|
SetMenuBar( menuBar );
|
|
|
|
delete oldMenuBar;
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|