2010-01-18 19:33:45 +00:00
|
|
|
/**
|
|
|
|
* @file menubar.cpp
|
|
|
|
* (Re)Create the CvPCB main MenuBar
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "fctsys.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
#include "appl_wxstruct.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "common.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
#include "confirm.h"
|
|
|
|
#include "gestfich.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#include "cvpcb.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
#include "cvstruct.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
#include "bitmaps.h"
|
2008-12-08 15:27:13 +00:00
|
|
|
|
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
void WinEDA_CvpcbFrame::ReCreateMenuBar()
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2009-04-21 17:56:27 +00:00
|
|
|
wxMenuItem* item;
|
2009-05-21 17:42:42 +00:00
|
|
|
wxMenuBar* menuBar;
|
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
menuBar = new wxMenuBar();
|
|
|
|
|
|
|
|
wxMenu* filesMenu = new wxMenu;
|
|
|
|
item = new wxMenuItem( filesMenu, ID_LOAD_PROJECT,
|
|
|
|
_( "&Open" ),
|
2009-11-05 19:26:52 +00:00
|
|
|
_( "Open a net list file" ) );
|
2009-04-21 17:56:27 +00:00
|
|
|
item->SetBitmap( open_xpm );
|
|
|
|
filesMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Open Recent submenu */
|
|
|
|
wxMenu* openRecentMenu = new wxMenu();
|
|
|
|
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
|
|
|
|
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu,
|
|
|
|
-1, _( "Open &Recent" ),
|
|
|
|
_("Open a recent opened netlist document" ),
|
|
|
|
open_project_xpm );
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
filesMenu->AppendSeparator();
|
|
|
|
item = new wxMenuItem( filesMenu, ID_SAVE_PROJECT,
|
|
|
|
_( "&Save As..." ),
|
2009-11-05 19:26:52 +00:00
|
|
|
_( "Save new net list and footprint list files" ) );
|
2009-04-21 17:56:27 +00:00
|
|
|
item->SetBitmap( save_xpm );
|
|
|
|
filesMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Quit on all platforms except WXMAC */
|
|
|
|
#if !defined(__WXMAC__)
|
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
filesMenu->AppendSeparator();
|
2010-01-18 19:33:45 +00:00
|
|
|
item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ),
|
|
|
|
_( "Quit CvPCB" ) );
|
2009-04-21 17:56:27 +00:00
|
|
|
filesMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
#endif /* !defined( __WXMAC__) */
|
2009-04-21 17:56:27 +00:00
|
|
|
|
|
|
|
// Menu Configuration:
|
|
|
|
wxMenu* configmenu = new wxMenu;
|
|
|
|
item = new wxMenuItem( configmenu, ID_CONFIG_REQ, _( "&Configuration" ),
|
2009-11-05 19:26:52 +00:00
|
|
|
_( "Set libraries and library search paths" ) );
|
2009-04-21 17:56:27 +00:00
|
|
|
item->SetBitmap( config_xpm );
|
|
|
|
configmenu->Append( item );
|
|
|
|
|
|
|
|
wxGetApp().AddMenuLanguageList( configmenu );
|
|
|
|
|
2009-04-23 15:02:18 +00:00
|
|
|
item = new wxMenuItem( configmenu, ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE,
|
|
|
|
_( "Keep Open On Save" ),
|
2009-05-21 17:42:42 +00:00
|
|
|
_( "Prevent CVPcb from exiting after saving netlist file" ),
|
2009-04-23 15:02:18 +00:00
|
|
|
wxITEM_CHECK );
|
|
|
|
configmenu->Append( item );
|
2009-04-21 17:56:27 +00:00
|
|
|
configmenu->AppendSeparator();
|
|
|
|
item = new wxMenuItem( configmenu, ID_CONFIG_SAVE,
|
2009-04-23 15:02:18 +00:00
|
|
|
_( "&Save Project File" ),
|
|
|
|
_( "Save changes to the project file" ) );
|
2009-04-21 17:56:27 +00:00
|
|
|
item->SetBitmap( save_setup_xpm );
|
|
|
|
configmenu->Append( item );
|
|
|
|
|
|
|
|
// Menu Help:
|
|
|
|
wxMenu* helpMenu = new wxMenu;
|
2009-08-12 10:40:01 +00:00
|
|
|
item = new wxMenuItem( helpMenu, ID_GENERAL_HELP, _( "&Contents" ),
|
2009-04-21 17:56:27 +00:00
|
|
|
_( "Open the cvpcb manual" ) );
|
2010-04-20 11:23:59 +00:00
|
|
|
item->SetBitmap( online_help_xpm );
|
2009-04-21 17:56:27 +00:00
|
|
|
helpMenu->Append( item );
|
2010-01-18 19:33:45 +00:00
|
|
|
|
|
|
|
/* About on all platforms except WXMAC */
|
|
|
|
#if !defined(__WXMAC__)
|
|
|
|
|
2009-08-12 10:40:01 +00:00
|
|
|
item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT,
|
2010-01-18 19:33:45 +00:00
|
|
|
_( "&About" ),
|
2009-04-21 17:56:27 +00:00
|
|
|
_( "About cvpcb schematic to pcb converter" ) );
|
|
|
|
item->SetBitmap( info_xpm );
|
|
|
|
helpMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
#endif /* !defined(__WXMAC__) */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create the menubar and append all submenus
|
|
|
|
*/
|
2009-04-21 17:56:27 +00:00
|
|
|
menuBar->Append( filesMenu, _( "&File" ) );
|
|
|
|
menuBar->Append( configmenu, _( "&Preferences" ) );
|
|
|
|
menuBar->Append( helpMenu, _( "&Help" ) );
|
|
|
|
|
2009-11-05 19:26:52 +00:00
|
|
|
/* Calling SetMenuBar() will Destroy the existing menu bar so it can be
|
|
|
|
* rebuilt. This allows language changes of the menu text on the fly. */
|
2009-04-21 17:56:27 +00:00
|
|
|
SetMenuBar( menuBar );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
2010-01-18 19:33:45 +00:00
|
|
|
|