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.

108 lines
3.4 KiB

  1. /**
  2. * @file menubar.cpp
  3. * (Re)Create the CvPCB main MenuBar
  4. */
  5. #include "fctsys.h"
  6. #include "appl_wxstruct.h"
  7. #include "common.h"
  8. #include "confirm.h"
  9. #include "gestfich.h"
  10. #include "cvpcb.h"
  11. #include "cvstruct.h"
  12. #include "bitmaps.h"
  13. void WinEDA_CvpcbFrame::ReCreateMenuBar()
  14. {
  15. wxMenuItem* item;
  16. wxMenuBar* menuBar;
  17. menuBar = new wxMenuBar();
  18. wxMenu* filesMenu = new wxMenu;
  19. item = new wxMenuItem( filesMenu, ID_LOAD_PROJECT,
  20. _( "&Open" ),
  21. _( "Open a net list file" ) );
  22. item->SetBitmap( open_xpm );
  23. filesMenu->Append( item );
  24. /* Open Recent submenu */
  25. wxMenu* openRecentMenu = new wxMenu();
  26. wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
  27. ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu, -1, _( "Open &Recent" ),
  28. _("Open a recent opened netlist document" ),
  29. open_project_xpm );
  30. filesMenu->AppendSeparator();
  31. item = new wxMenuItem( filesMenu, ID_SAVE_PROJECT,
  32. _( "&Save As..." ),
  33. _( "Save new net list and footprint list files" ) );
  34. item->SetBitmap( save_xpm );
  35. filesMenu->Append( item );
  36. /* Quit on all platforms except WXMAC */
  37. #if !defined(__WXMAC__)
  38. filesMenu->AppendSeparator();
  39. item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ), _( "Quit CvPCB" ) );
  40. filesMenu->Append( item );
  41. #endif /* !defined( __WXMAC__) */
  42. // Menu Configuration:
  43. wxMenu* configmenu = new wxMenu;
  44. item = new wxMenuItem( configmenu, ID_CONFIG_REQ, _( "&Configuration" ),
  45. _( "Set libraries and library search paths" ) );
  46. item->SetBitmap( config_xpm );
  47. configmenu->Append( item );
  48. wxGetApp().AddMenuLanguageList( configmenu );
  49. item = new wxMenuItem( configmenu, ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE,
  50. _( "Keep Open On Save" ),
  51. _( "Prevent CVPcb from exiting after saving netlist file" ),
  52. wxITEM_CHECK );
  53. configmenu->Append( item );
  54. configmenu->AppendSeparator();
  55. item = new wxMenuItem( configmenu, ID_CONFIG_SAVE,
  56. _( "&Save Project File" ),
  57. _( "Save changes to the project file" ) );
  58. item->SetBitmap( save_setup_xpm );
  59. configmenu->Append( item );
  60. // Menu Help:
  61. wxMenu* helpMenu = new wxMenu;
  62. AddHelpVersionInfoMenuEntry( helpMenu );
  63. item = new wxMenuItem( helpMenu, ID_GENERAL_HELP, _( "&Contents" ),
  64. _( "Open the cvpcb manual" ) );
  65. item->SetBitmap( online_help_xpm );
  66. helpMenu->Append( item );
  67. /* About on all platforms except WXMAC */
  68. #if !defined(__WXMAC__)
  69. item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT,
  70. _( "&About" ),
  71. _( "About cvpcb schematic to pcb converter" ) );
  72. item->SetBitmap( info_xpm );
  73. helpMenu->Append( item );
  74. #endif /* !defined(__WXMAC__) */
  75. /**
  76. * Create the menubar and append all submenus
  77. */
  78. menuBar->Append( filesMenu, _( "&File" ) );
  79. menuBar->Append( configmenu, _( "&Preferences" ) );
  80. menuBar->Append( helpMenu, _( "&Help" ) );
  81. /* Calling SetMenuBar() will Destroy the existing menu bar so it can be
  82. * rebuilt. This allows language changes of the menu text on the fly. */
  83. SetMenuBar( menuBar );
  84. }