2010-01-18 19:33:45 +00:00
|
|
|
/**
|
|
|
|
* @file menubar.cpp
|
|
|
|
* @brief Create the main menubar for the schematic frame
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "fctsys.h"
|
|
|
|
#include "common.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
#include "appl_wxstruct.h"
|
2009-09-25 18:49:04 +00:00
|
|
|
#include "bitmaps.h"
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "program.h"
|
|
|
|
#include "general.h"
|
|
|
|
#include "protos.h"
|
2009-09-22 12:27:57 +00:00
|
|
|
#include "eeschema_id.h"
|
2007-09-19 15:29:50 +00:00
|
|
|
#include "hotkeys.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2010-06-30 11:15:34 +00:00
|
|
|
#include "help_common_strings.h"
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/**
|
|
|
|
* @brief Create or update the menubar for the schematic frame
|
2008-02-15 22:50:52 +00:00
|
|
|
*/
|
2010-01-18 19:33:45 +00:00
|
|
|
void WinEDA_SchematicFrame::ReCreateMenuBar()
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2010-07-26 17:06:36 +00:00
|
|
|
wxString text;
|
|
|
|
wxMenuItem* item;
|
|
|
|
wxMenuBar* menuBar = GetMenuBar();
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/**
|
|
|
|
* Destroy the existing menu bar so it can be rebuilt. This allows
|
|
|
|
* language changes of the menu text on the fly.
|
|
|
|
*/
|
2009-01-17 20:31:19 +00:00
|
|
|
if( menuBar )
|
|
|
|
SetMenuBar( NULL );
|
|
|
|
|
|
|
|
menuBar = new wxMenuBar();
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/**
|
|
|
|
* File menu
|
|
|
|
*/
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* filesMenu = new wxMenu;
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* New */
|
|
|
|
item = new wxMenuItem( filesMenu, ID_NEW_PROJECT, _( "&New\tCtrl+N" ),
|
2010-08-24 17:26:51 +00:00
|
|
|
_( "New schematic project" ) );
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( new_xpm );
|
|
|
|
filesMenu->Append( item );
|
|
|
|
|
2010-07-26 17:06:36 +00:00
|
|
|
/* Open */
|
2010-01-18 19:33:45 +00:00
|
|
|
item = new wxMenuItem( filesMenu, ID_LOAD_PROJECT, _( "&Open\tCtrl+O" ),
|
2010-08-24 17:26:51 +00:00
|
|
|
_( "Open an existing schematic project" ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( open_xpm );
|
|
|
|
filesMenu->Append( item );
|
|
|
|
|
2010-01-17 20:25:10 +00:00
|
|
|
/* Open Recent submenu */
|
|
|
|
wxMenu* openRecentMenu = new wxMenu();
|
|
|
|
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
|
2010-01-18 12:37:53 +00:00
|
|
|
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu,
|
2010-02-02 15:01:09 +00:00
|
|
|
-1, _( "Open &Recent" ),
|
2010-07-26 17:06:36 +00:00
|
|
|
_( "Open a recent opened schematic project" ),
|
2010-02-02 15:01:09 +00:00
|
|
|
open_project_xpm );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Separator */
|
2010-01-18 12:37:53 +00:00
|
|
|
filesMenu->AppendSeparator();
|
2010-01-19 20:43:44 +00:00
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Save */
|
2010-01-19 20:43:44 +00:00
|
|
|
/* Save Project */
|
2010-02-02 15:01:09 +00:00
|
|
|
item = new wxMenuItem( filesMenu, ID_SAVE_PROJECT,
|
2010-08-24 17:26:51 +00:00
|
|
|
_( "&Save Whole Schematic Project\tCtrl+S" ),
|
|
|
|
_( "Save all sheets in the schematic project" ) );
|
2010-01-19 20:43:44 +00:00
|
|
|
item->SetBitmap( save_project_xpm );
|
|
|
|
filesMenu->Append( item );
|
|
|
|
|
2010-02-02 15:01:09 +00:00
|
|
|
item = new wxMenuItem( filesMenu, ID_SAVE_ONE_SHEET, _( "Save &Current Sheet Only" ),
|
2010-08-24 17:26:51 +00:00
|
|
|
_( "Save only current schematic sheet" ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( save_xpm );
|
|
|
|
filesMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Save as... */
|
|
|
|
item = new wxMenuItem( filesMenu, ID_SAVE_ONE_SHEET_AS,
|
2010-08-24 17:26:51 +00:00
|
|
|
_( "Save Current Sheet &as" ),
|
|
|
|
_( "Save current schematic sheet as..." ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( save_as_xpm );
|
|
|
|
filesMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Separator */
|
2010-01-17 20:25:10 +00:00
|
|
|
filesMenu->AppendSeparator();
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Print */
|
2010-08-24 17:26:51 +00:00
|
|
|
item = new wxMenuItem( filesMenu, wxID_PRINT, _( "P&rint" ), _( "Print schematic" ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( print_button );
|
|
|
|
filesMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Plot submenu */
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* choice_plot_fmt = new wxMenu;
|
|
|
|
item = new wxMenuItem( choice_plot_fmt, ID_GEN_PLOT_PS,
|
2010-08-24 17:26:51 +00:00
|
|
|
_( "Plot PostScript" ),
|
|
|
|
_( "Plot schematic sheet in PostScript format" ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( plot_PS_xpm );
|
|
|
|
choice_plot_fmt->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Plot HPGL */
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( choice_plot_fmt, ID_GEN_PLOT_HPGL, _( "Plot HPGL" ),
|
2010-08-24 17:26:51 +00:00
|
|
|
_( "Plot schematic sheet in HPGL format" ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( plot_HPG_xpm );
|
|
|
|
choice_plot_fmt->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Plot SVG */
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( choice_plot_fmt, ID_GEN_PLOT_SVG, _( "Plot SVG" ),
|
2010-08-24 17:26:51 +00:00
|
|
|
_( "Plot schematic sheet in SVG format" ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( plot_xpm );
|
|
|
|
choice_plot_fmt->Append( item );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Plot DXF */
|
2009-06-30 10:43:20 +00:00
|
|
|
item = new wxMenuItem( choice_plot_fmt, ID_GEN_PLOT_DXF, _( "Plot DXF" ),
|
2010-08-24 17:26:51 +00:00
|
|
|
_( "Plot schematic sheet in DXF format" ) );
|
2009-06-30 10:43:20 +00:00
|
|
|
item->SetBitmap( plot_xpm );
|
|
|
|
choice_plot_fmt->Append( item );
|
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
/* Under windows, one can draw to the clipboard */
|
2010-01-18 19:33:45 +00:00
|
|
|
#ifdef __WINDOWS__
|
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( choice_plot_fmt, ID_GEN_COPY_SHEET_TO_CLIPBOARD,
|
2010-08-24 17:26:51 +00:00
|
|
|
_( "Plot to Clipboard" ),
|
|
|
|
_( "Export drawings to clipboard" ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( copy_button );
|
|
|
|
choice_plot_fmt->Append( item );
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
#endif
|
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, choice_plot_fmt,
|
|
|
|
ID_GEN_PLOT, _( "&Plot" ),
|
2010-08-24 17:26:51 +00:00
|
|
|
_( "Plot schematic sheet in HPGL, PostScript or SVG format" ),
|
2010-02-02 15:01:09 +00:00
|
|
|
plot_xpm );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Quit on all platforms except WXMAC */
|
|
|
|
#if !defined(__WXMAC__)
|
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
filesMenu->AppendSeparator();
|
2010-08-24 17:26:51 +00:00
|
|
|
item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ), _( "Quit EESchema" ) );
|
2010-07-29 20:00:24 +00:00
|
|
|
item->SetBitmap( exit_xpm );
|
2009-01-17 20:31:19 +00:00
|
|
|
filesMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
#endif /* !defined( __WXMAC__) */
|
2010-01-17 20:25:10 +00:00
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/**
|
|
|
|
* Edit menu
|
|
|
|
*/
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* editMenu = new wxMenu;
|
2010-01-18 19:33:45 +00:00
|
|
|
|
|
|
|
/* Undo */
|
2010-07-26 17:06:36 +00:00
|
|
|
text = AddHotkeyName( _( "Undo" ), s_Schematic_Hokeys_Descr, HK_UNDO );
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2010-08-24 17:26:51 +00:00
|
|
|
item = new wxMenuItem( editMenu, wxID_UNDO, text, HELP_UNDO, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( undo_xpm );
|
|
|
|
editMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Redo */
|
2010-07-26 17:06:36 +00:00
|
|
|
text = AddHotkeyName( _( "Redo" ), s_Schematic_Hokeys_Descr, HK_REDO );
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2010-08-24 17:26:51 +00:00
|
|
|
item = new wxMenuItem( editMenu, wxID_REDO, text, HELP_REDO, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( redo_xpm );
|
|
|
|
editMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Separator */
|
2009-01-17 20:31:19 +00:00
|
|
|
editMenu->AppendSeparator();
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Delete */
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( editMenu, ID_SCHEMATIC_DELETE_ITEM_BUTT,
|
2010-06-30 11:15:34 +00:00
|
|
|
_( "Delete" ), HELP_DELETE_ITEMS, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( delete_body_xpm );
|
|
|
|
editMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Separator */
|
2009-01-17 20:31:19 +00:00
|
|
|
editMenu->AppendSeparator();
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Find */
|
2010-02-16 10:42:57 +00:00
|
|
|
text = AddHotkeyName( _( "&Find" ), s_Schematic_Hokeys_Descr, HK_FIND_ITEM );
|
2010-08-24 17:26:51 +00:00
|
|
|
item = new wxMenuItem( editMenu, ID_FIND_ITEMS, text, HELP_FIND, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( find_xpm );
|
|
|
|
editMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Separator */
|
2009-01-17 20:31:19 +00:00
|
|
|
editMenu->AppendSeparator();
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Backannotate */
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( editMenu, ID_BACKANNO_ITEMS, _( "Backannotate" ),
|
|
|
|
_( "Back annotated footprint fields" ),
|
|
|
|
wxITEM_NORMAL );
|
|
|
|
item->SetBitmap( backanno_xpm );
|
|
|
|
editMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* View menu
|
|
|
|
*/
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* viewMenu = new wxMenu;
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2010-02-13 18:38:26 +00:00
|
|
|
/* Important Note for ZOOM IN and ZOOM OUT commands from menubar:
|
2010-07-27 09:01:26 +00:00
|
|
|
* we cannot add hotkey shortcut here, because the hotkey HK_ZOOM_IN and HK_ZOOM_OUT
|
2010-02-13 18:38:26 +00:00
|
|
|
* 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
|
2010-08-24 17:26:51 +00:00
|
|
|
* 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)
|
2010-02-13 18:38:26 +00:00
|
|
|
*
|
|
|
|
* in others words HK_ZOOM_IN and HK_ZOOM_OUT *are NOT* accelerators
|
|
|
|
* for Zoom in and Zoom out sub menus
|
2010-07-27 09:01:26 +00:00
|
|
|
* SO WE ADD THE NAME OF THE CORRESPONDING HOTKEY AS A COMMENT, NOT AS A SHORTCUT
|
|
|
|
* using in AddHotkeyName call the option "false" (not a shortcut)
|
2010-02-13 18:38:26 +00:00
|
|
|
*/
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Zoom in */
|
2010-07-27 09:01:26 +00:00
|
|
|
text = AddHotkeyName( _( "Zoom In" ), s_Schematic_Hokeys_Descr,
|
|
|
|
ID_ZOOM_IN, false ); // add comment, not a shortcut
|
2010-08-24 17:26:51 +00:00
|
|
|
item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( zoom_in_xpm );
|
|
|
|
viewMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Zoom out */
|
2010-07-27 09:01:26 +00:00
|
|
|
text = AddHotkeyName( _( "Zoom Out" ), s_Schematic_Hokeys_Descr,
|
|
|
|
ID_ZOOM_OUT, false ); // add comment, not a shortcut
|
2010-08-24 17:26:51 +00:00
|
|
|
item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( zoom_out_xpm );
|
|
|
|
viewMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Fit on screen */
|
2010-08-24 17:26:51 +00:00
|
|
|
text = AddHotkeyName( _( "Fit on Screen" ), s_Schematic_Hokeys_Descr, HK_ZOOM_AUTO );
|
|
|
|
item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( zoom_auto_xpm );
|
|
|
|
viewMenu->Append( item );
|
|
|
|
|
|
|
|
viewMenu->AppendSeparator();
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Redraw view */
|
2010-08-24 17:26:51 +00:00
|
|
|
text = AddHotkeyName( _( "Redraw" ), s_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
|
|
|
|
item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( zoom_redraw_xpm );
|
|
|
|
viewMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Place menu
|
|
|
|
* TODO: Unify the ID names!
|
|
|
|
*/
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* placeMenu = new wxMenu;
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Component */
|
2010-07-26 17:06:36 +00:00
|
|
|
text = AddHotkeyName( _( "&Component" ), s_Schematic_Hokeys_Descr,
|
2010-07-27 09:01:26 +00:00
|
|
|
HK_ADD_NEW_COMPONENT, false ); // add comment, not a shortcut
|
2010-07-26 17:06:36 +00:00
|
|
|
item = new wxMenuItem( placeMenu, ID_COMPONENT_BUTT, text,
|
2010-06-30 11:15:34 +00:00
|
|
|
HELP_PLACE_COMPONENTS, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( add_component_xpm );
|
|
|
|
placeMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Power port */
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( placeMenu, ID_PLACE_POWER_BUTT, _( "&Power port" ),
|
2010-06-30 11:15:34 +00:00
|
|
|
HELP_PLACE_POWERPORT, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( add_power_xpm );
|
|
|
|
placeMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Wire */
|
2010-07-26 17:06:36 +00:00
|
|
|
text = AddHotkeyName( _( "&Wire" ), s_Schematic_Hokeys_Descr,
|
2010-07-27 09:01:26 +00:00
|
|
|
HK_BEGIN_WIRE, false ); // add comment, not a shortcut
|
2010-07-26 17:06:36 +00:00
|
|
|
item = new wxMenuItem( placeMenu, ID_WIRE_BUTT, text,
|
2010-06-30 11:15:34 +00:00
|
|
|
HELP_PLACE_WIRE, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( add_line_xpm );
|
|
|
|
placeMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Bus */
|
2010-07-26 17:06:36 +00:00
|
|
|
item = new wxMenuItem( placeMenu, ID_BUS_BUTT, _( "&Bus" ),
|
2010-06-30 11:15:34 +00:00
|
|
|
HELP_PLACE_BUS, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( add_bus_xpm );
|
|
|
|
placeMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Wire to Bus */
|
2010-08-24 17:26:51 +00:00
|
|
|
item = new wxMenuItem( placeMenu, ID_WIRETOBUS_ENTRY_BUTT, _( "W&ire to bus entry" ),
|
2010-06-30 11:15:34 +00:00
|
|
|
HELP_PLACE_WIRE2BUS_ENTRY, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( add_line2bus_xpm );
|
|
|
|
placeMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Bus to Bus */
|
2010-08-24 17:26:51 +00:00
|
|
|
item = new wxMenuItem( placeMenu, ID_BUSTOBUS_ENTRY_BUTT, _( "B&us to bus entry" ),
|
2010-06-30 11:15:34 +00:00
|
|
|
HELP_PLACE_BUS2BUS_ENTRY, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( add_bus2bus_xpm );
|
|
|
|
placeMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* No connect flag */
|
2010-07-26 17:06:36 +00:00
|
|
|
text = AddHotkeyName( _( "No connect flag" ), s_Schematic_Hokeys_Descr,
|
2010-07-27 09:01:26 +00:00
|
|
|
HK_ADD_NOCONN_FLAG, false ); // add comment, not a shortcut
|
2010-08-24 17:26:51 +00:00
|
|
|
item = new wxMenuItem( placeMenu, ID_NOCONN_BUTT, text, HELP_PLACE_NC_FLAG, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( noconn_button );
|
|
|
|
placeMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Net name */
|
2010-07-26 17:06:36 +00:00
|
|
|
text = AddHotkeyName( _( "Label" ), s_Schematic_Hokeys_Descr,
|
2010-07-27 09:01:26 +00:00
|
|
|
HK_ADD_LABEL, false ); // add comment, not a shortcut
|
2010-07-26 17:06:36 +00:00
|
|
|
item = new wxMenuItem( placeMenu, ID_LABEL_BUTT, text,
|
2010-06-30 11:15:34 +00:00
|
|
|
HELP_PLACE_NETLABEL, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( add_line_label_xpm );
|
|
|
|
placeMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Global label */
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( placeMenu, ID_GLABEL_BUTT, _( "Global label" ),
|
2010-08-24 17:26:51 +00:00
|
|
|
_( "Place a global label. Warning: all global labels with the same name are connected in whole hierarchy" ),
|
2009-01-17 20:31:19 +00:00
|
|
|
wxITEM_NORMAL );
|
|
|
|
item->SetBitmap( add_glabel_xpm );
|
|
|
|
placeMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Junction */
|
2009-02-21 15:12:26 +00:00
|
|
|
item = new wxMenuItem( placeMenu, ID_JUNCTION_BUTT, _( "Junction" ),
|
2010-06-30 11:15:34 +00:00
|
|
|
HELP_PLACE_JUNCTION, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( add_junction_xpm );
|
|
|
|
placeMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Separator */
|
2009-01-17 20:31:19 +00:00
|
|
|
placeMenu->AppendSeparator();
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Hierarchical label */
|
2010-08-24 17:26:51 +00:00
|
|
|
item = new wxMenuItem( placeMenu, ID_HIERLABEL_BUTT, _( "Hierarchical label" ),
|
2010-06-30 11:15:34 +00:00
|
|
|
HELP_PLACE_HIER_LABEL, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( add_hierarchical_label_xpm );
|
|
|
|
placeMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Hierarchical sheet */
|
2010-08-24 17:26:51 +00:00
|
|
|
item = new wxMenuItem( placeMenu, ID_SHEET_SYMBOL_BUTT, _( "Hierarchical sheet" ),
|
2010-06-30 11:15:34 +00:00
|
|
|
HELP_PLACE_SHEET, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( add_hierarchical_subsheet_xpm );
|
|
|
|
placeMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Import hierarchical sheet */
|
2010-08-24 17:26:51 +00:00
|
|
|
item = new wxMenuItem( placeMenu, ID_IMPORT_HLABEL_BUTT, _( "Import Hierarchical Label" ),
|
2010-06-30 11:15:34 +00:00
|
|
|
HELP_IMPORT_PINSHEET, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( import_hierarchical_label_xpm );
|
|
|
|
placeMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Add hierarchical Pin to Sheet */
|
2010-08-24 17:26:51 +00:00
|
|
|
item = new wxMenuItem( placeMenu, ID_SHEET_LABEL_BUTT, _( "Add Hierarchical Pin to Sheet" ),
|
2010-06-30 11:15:34 +00:00
|
|
|
HELP_PLACE_PINSHEET, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( add_hierar_pin_xpm );
|
|
|
|
placeMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Separator */
|
2009-01-17 20:31:19 +00:00
|
|
|
placeMenu->AppendSeparator();
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Graphic line or polygon */
|
2010-08-24 17:26:51 +00:00
|
|
|
item = new wxMenuItem( placeMenu, ID_LINE_COMMENT_BUTT, _( "Graphic line or polygon" ),
|
2010-06-30 11:15:34 +00:00
|
|
|
HELP_PLACE_GRAPHICLINES, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( add_dashed_line_xpm );
|
|
|
|
placeMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Graphic text */
|
2010-08-24 17:26:51 +00:00
|
|
|
item = new wxMenuItem( placeMenu, ID_TEXT_COMMENT_BUTT, _( "Graphic text" ),
|
2010-06-30 11:15:34 +00:00
|
|
|
HELP_PLACE_GRAPHICTEXTS, wxITEM_NORMAL );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( add_text_xpm );
|
|
|
|
placeMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Preferences Menu
|
|
|
|
*/
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* configmenu = new wxMenu;
|
2010-01-18 19:33:45 +00:00
|
|
|
|
|
|
|
/* Library */
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( configmenu, ID_CONFIG_REQ, _( "&Library" ),
|
2010-08-24 17:26:51 +00:00
|
|
|
_( "Library preferences" ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( library_xpm );
|
|
|
|
configmenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Colors */
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( configmenu, ID_COLORS_SETUP, _( "&Colors" ),
|
2010-08-24 17:26:51 +00:00
|
|
|
_( "Color preferences" ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( palette_xpm );
|
|
|
|
configmenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Options */
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( configmenu, ID_OPTIONS_SETUP, _( "&Options" ),
|
2010-08-24 17:26:51 +00:00
|
|
|
_( "Eeschema general options and preferences" ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( preference_xpm );
|
|
|
|
configmenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Language submenu */
|
2009-01-18 10:15:10 +00:00
|
|
|
wxGetApp().AddMenuLanguageList( configmenu );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Hotkey submenu */
|
2009-10-27 13:48:24 +00:00
|
|
|
AddHotkeyConfigMenu( configmenu );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Separator */
|
2009-01-17 20:31:19 +00:00
|
|
|
configmenu->AppendSeparator();
|
2010-01-18 19:33:45 +00:00
|
|
|
|
|
|
|
/* Save preferences */
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( configmenu, ID_CONFIG_SAVE, _( "&Save preferences" ),
|
2010-08-24 17:26:51 +00:00
|
|
|
_( "Save application preferences" ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( save_setup_xpm );
|
|
|
|
configmenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Read preferences */
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( configmenu, ID_CONFIG_READ, _( "&Read preferences" ),
|
2010-08-24 17:26:51 +00:00
|
|
|
_( "Read application preferences" ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( read_setup_xpm );
|
|
|
|
configmenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Help Menu
|
|
|
|
*/
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* helpMenu = new wxMenu;
|
2010-08-24 17:26:51 +00:00
|
|
|
|
|
|
|
AddHelpVersionInfoMenuEntry( helpMenu );
|
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( helpMenu, ID_GENERAL_HELP, _( "&Contents" ),
|
2010-08-24 17:26:51 +00:00
|
|
|
_( "Open the eeschema manual" ) );
|
2010-04-20 11:23:59 +00:00
|
|
|
item->SetBitmap( online_help_xpm );
|
2009-01-17 20:31:19 +00:00
|
|
|
helpMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* About on all platforms except WXMAC */
|
|
|
|
#if !defined(__WXMAC__)
|
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT, _( "&About" ),
|
2010-08-24 17:26:51 +00:00
|
|
|
_( "About eeschema schematic designer" ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( info_xpm );
|
|
|
|
helpMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
#endif /* !defined(__WXMAC__) */
|
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/**
|
|
|
|
* Create the menubar and append all submenus
|
|
|
|
*/
|
2009-01-17 20:31:19 +00:00
|
|
|
menuBar->Append( filesMenu, _( "&File" ) );
|
|
|
|
menuBar->Append( editMenu, _( "&Edit" ) );
|
|
|
|
menuBar->Append( viewMenu, _( "&View" ) );
|
|
|
|
menuBar->Append( placeMenu, _( "&Place" ) );
|
|
|
|
menuBar->Append( configmenu, _( "&Preferences" ) );
|
|
|
|
menuBar->Append( helpMenu, _( "&Help" ) );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Associate the menu bar with the frame */
|
2009-01-17 20:31:19 +00:00
|
|
|
SetMenuBar( menuBar );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|