2011-12-16 20:12:49 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
2021-05-29 16:09:49 +00:00
|
|
|
* Copyright (C) 2004-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
2011-12-16 20:12:49 +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
|
|
|
|
*/
|
|
|
|
|
2019-06-10 22:17:45 +00:00
|
|
|
#include <bitmaps.h>
|
2019-07-18 21:47:01 +00:00
|
|
|
#include <menus_helpers.h>
|
2019-06-02 18:58:09 +00:00
|
|
|
#include <tool/actions.h>
|
2019-06-10 22:17:45 +00:00
|
|
|
#include <tool/common_control.h>
|
2019-07-18 21:47:01 +00:00
|
|
|
#include <tool/conditional_menu.h>
|
|
|
|
#include <tool/tool_manager.h>
|
|
|
|
|
|
|
|
#include <cvpcb_mainframe.h>
|
|
|
|
#include <tools/cvpcb_actions.h>
|
2020-06-06 17:42:04 +00:00
|
|
|
#include <widgets/wx_menubar.h>
|
2012-02-01 19:49:37 +00:00
|
|
|
|
2008-12-08 15:27:13 +00:00
|
|
|
|
2011-02-05 16:15:48 +00:00
|
|
|
void CVPCB_MAINFRAME::ReCreateMenuBar()
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2019-06-10 22:17:45 +00:00
|
|
|
COMMON_CONTROL* tool = m_toolManager->GetTool<COMMON_CONTROL>();
|
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();
|
2020-06-06 17:42:04 +00:00
|
|
|
WX_MENUBAR* menuBar = new WX_MENUBAR();
|
2010-12-17 20:34:29 +00:00
|
|
|
|
2019-06-10 22:17:45 +00:00
|
|
|
//-- File menu -----------------------------------------------------------
|
|
|
|
//
|
2020-07-29 23:50:25 +00:00
|
|
|
ACTION_MENU* fileMenu = new ACTION_MENU( false, tool );
|
2009-04-21 17:56:27 +00:00
|
|
|
|
2020-07-29 23:50:25 +00:00
|
|
|
fileMenu->Add( CVPCB_ACTIONS::saveAssociations );
|
|
|
|
fileMenu->AppendSeparator();
|
2019-08-13 23:34:05 +00:00
|
|
|
fileMenu->AddClose( _( "Assign Footprints" ) );
|
2019-06-16 18:35:32 +00:00
|
|
|
|
2020-12-01 00:27:33 +00:00
|
|
|
//-- Edit menu -----------------------------------------------------------
|
2019-07-26 18:58:20 +00:00
|
|
|
//
|
2020-07-29 23:50:25 +00:00
|
|
|
ACTION_MENU* editMenu = new ACTION_MENU( false, tool );
|
2019-07-26 18:58:20 +00:00
|
|
|
|
2020-07-29 23:50:25 +00:00
|
|
|
editMenu->Add( ACTIONS::undo );
|
|
|
|
editMenu->Add( ACTIONS::redo );
|
2019-07-26 18:58:20 +00:00
|
|
|
|
2020-07-29 23:50:25 +00:00
|
|
|
editMenu->AppendSeparator();
|
|
|
|
editMenu->Add( ACTIONS::cut );
|
|
|
|
editMenu->Add( ACTIONS::copy );
|
|
|
|
editMenu->Add( ACTIONS::paste );
|
2019-07-26 18:58:20 +00:00
|
|
|
|
2020-12-01 00:27:33 +00:00
|
|
|
//-- Preferences menu ----------------------------------------------------
|
2019-06-10 22:17:45 +00:00
|
|
|
//
|
2020-07-29 23:50:25 +00:00
|
|
|
ACTION_MENU* prefsMenu = new ACTION_MENU( false, tool );
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2020-07-29 23:50:25 +00:00
|
|
|
prefsMenu->Add( ACTIONS::configurePaths );
|
|
|
|
prefsMenu->Add( ACTIONS::showFootprintLibTable );
|
2021-05-29 16:09:49 +00:00
|
|
|
prefsMenu->Add( ACTIONS::openPreferences );
|
2015-03-29 21:22:53 +00:00
|
|
|
|
2020-07-29 23:50:25 +00:00
|
|
|
prefsMenu->AppendSeparator();
|
|
|
|
prefsMenu->Add( CVPCB_ACTIONS::showEquFileTable);
|
2018-05-01 20:46:05 +00:00
|
|
|
|
2020-07-29 23:50:25 +00:00
|
|
|
prefsMenu->AppendSeparator();
|
|
|
|
AddMenuLanguageList( prefsMenu, tool );
|
2015-01-11 17:22:45 +00:00
|
|
|
|
2019-06-10 22:17:45 +00:00
|
|
|
//-- Menubar -------------------------------------------------------------
|
|
|
|
//
|
|
|
|
menuBar->Append( fileMenu, _( "&File" ) );
|
2019-07-26 18:58:20 +00:00
|
|
|
menuBar->Append( editMenu, _( "&Edit" ) );
|
2019-06-10 22:17:45 +00:00
|
|
|
menuBar->Append( prefsMenu, _( "&Preferences" ) );
|
2019-05-18 10:27:36 +00:00
|
|
|
AddStandardHelpMenu( menuBar );
|
2009-04-21 17:56:27 +00:00
|
|
|
|
2018-04-07 13:13:38 +00:00
|
|
|
SetMenuBar( menuBar );
|
|
|
|
delete oldMenuBar;
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|