You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
3.1 KiB

6 years ago
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
  5. * Copyright (C) 2004-2021 KiCad Developers, see AUTHORS.txt for contributors.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version 2
  10. * of the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, you may find one here:
  19. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  20. * or you may search the http://www.gnu.org website for the version 2 license,
  21. * or you may write to the Free Software Foundation, Inc.,
  22. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  23. */
  24. #include <bitmaps.h>
  25. #include <tool/actions.h>
  26. #include <tool/common_control.h>
  27. #include <tool/conditional_menu.h>
  28. #include <tool/tool_manager.h>
  29. #include <cvpcb_mainframe.h>
  30. #include <tools/cvpcb_actions.h>
  31. #include <widgets/wx_menubar.h>
  32. void CVPCB_MAINFRAME::doReCreateMenuBar()
  33. {
  34. COMMON_CONTROL* tool = m_toolManager->GetTool<COMMON_CONTROL>();
  35. // wxWidgets handles the Mac Application menu behind the scenes, but that means
  36. // we always have to start from scratch with a new wxMenuBar.
  37. wxMenuBar* oldMenuBar = GetMenuBar();
  38. WX_MENUBAR* menuBar = new WX_MENUBAR();
  39. //-- File menu -----------------------------------------------------------
  40. //
  41. ACTION_MENU* fileMenu = new ACTION_MENU( false, tool );
  42. fileMenu->Add( CVPCB_ACTIONS::saveAssociationsToSchematic );
  43. fileMenu->AppendSeparator();
  44. fileMenu->AddClose( _( "Assign Footprints" ) );
  45. //-- Edit menu -----------------------------------------------------------
  46. //
  47. ACTION_MENU* editMenu = new ACTION_MENU( false, tool );
  48. editMenu->Add( ACTIONS::undo );
  49. editMenu->Add( ACTIONS::redo );
  50. editMenu->AppendSeparator();
  51. editMenu->Add( ACTIONS::cut );
  52. editMenu->Add( ACTIONS::copy );
  53. editMenu->Add( ACTIONS::paste );
  54. //-- Preferences menu ----------------------------------------------------
  55. //
  56. ACTION_MENU* prefsMenu = new ACTION_MENU( false, tool );
  57. prefsMenu->Add( ACTIONS::configurePaths );
  58. prefsMenu->Add( ACTIONS::showFootprintLibTable );
  59. prefsMenu->Add( CVPCB_ACTIONS::showEquFileTable);
  60. prefsMenu->Add( ACTIONS::openPreferences);
  61. prefsMenu->AppendSeparator();
  62. AddMenuLanguageList( prefsMenu, tool );
  63. //-- Menubar -------------------------------------------------------------
  64. //
  65. menuBar->Append( fileMenu, _( "&File" ) );
  66. menuBar->Append( editMenu, _( "&Edit" ) );
  67. menuBar->Append( prefsMenu, _( "&Preferences" ) );
  68. AddStandardHelpMenu( menuBar );
  69. SetMenuBar( menuBar );
  70. delete oldMenuBar;
  71. }