Eeschema: New menubar structure

Update menubar to new structure and use common hotkeys.
This commit is contained in:
Michael 2018-02-22 19:05:10 +00:00 committed by Wayne Stambaugh
parent 1e7275c712
commit afd4710045
6 changed files with 249 additions and 158 deletions

View File

@ -120,17 +120,6 @@ static EDA_HOTKEY HkResetLocalCoord( _HKI( "Reset Local Coordinates" ), HK_RESET
static EDA_HOTKEY HkLeaveSheet( _HKI( "Leave Sheet" ), HK_LEAVE_SHEET, GR_KB_ALT + WXK_BACK,
ID_POPUP_SCH_LEAVE_SHEET );
// Undo
static EDA_HOTKEY HkUndo( _HKI( "Undo" ), HK_UNDO, GR_KB_CTRL + 'Z', (int) wxID_UNDO );
// Redo
#if !defined( __WXMAC__ )
static EDA_HOTKEY HkRedo( _HKI( "Redo" ), HK_REDO, GR_KB_CTRL + 'Y', (int) wxID_REDO );
#else
static EDA_HOTKEY HkRedo( _HKI( "Redo" ), HK_REDO, GR_KB_SHIFT + GR_KB_CTRL + 'Z',
(int) wxID_REDO );
#endif
// mouse click command:
static EDA_HOTKEY HkMouseLeftClick( _HKI( "Mouse Left Click" ), HK_LEFT_CLICK, WXK_RETURN, 0 );
static EDA_HOTKEY HkMouseLeftDClick( _HKI( "Mouse Left Double Click" ), HK_LEFT_DCLICK, WXK_END, 0 );
@ -193,9 +182,6 @@ static EDA_HOTKEY HkDuplicateItem( _HKI( "Duplicate Symbol or Label" ),
ID_POPUP_SCH_DUPLICATE_ITEM );
static EDA_HOTKEY HkDrag( _HKI( "Drag Item" ), HK_DRAG, 'G', ID_SCH_DRAG_ITEM );
static EDA_HOTKEY HkCopyBlock( _HKI( "Copy Block" ), HK_COPY_BLOCK, 'C' + GR_KB_CTRL, wxID_COPY );
static EDA_HOTKEY HkPasteBlock( _HKI( "Paste Block" ), HK_PASTE_BLOCK, 'V' + GR_KB_CTRL, wxID_PASTE );
static EDA_HOTKEY HkCutBlock( _HKI( "Cut Block" ), HK_CUT_BLOCK, 'X' + GR_KB_CTRL, wxID_CUT );
static EDA_HOTKEY HkMove2Drag( _HKI( "Move Block -> Drag Block" ),
HK_MOVEBLOCK_TO_DRAGBLOCK, '\t', ID_POPUP_DRAG_BLOCK );
static EDA_HOTKEY HkInsert( _HKI( "Repeat Last Item" ), HK_REPEAT_LAST, WXK_INSERT );
@ -219,8 +205,6 @@ static EDA_HOTKEY HkMoveLibItem( _HKI( "Move Library Item" ), HK_LIBEDIT_MOVE_GR
// Load/save files
static EDA_HOTKEY HkSaveAllLib( _HKI( "Save All Libraries" ), HK_SAVE_ALL_LIBS, 'S' + GR_KB_CTRL, ID_LIBEDIT_SAVE_ALL_LIBS );
static EDA_HOTKEY HkSaveSchematic( _HKI( "Save Schematic" ), HK_SAVE_SCH, 'S' + GR_KB_CTRL );
static EDA_HOTKEY HkLoadSchematic( _HKI( "Load Schematic" ), HK_LOAD_SCH, 'L' + GR_KB_CTRL );
// Autoplace fields
static EDA_HOTKEY HkAutoplaceFields( _HKI( "Autoplace Fields" ), HK_AUTOPLACE_FIELDS, 'O',
@ -233,9 +217,35 @@ static EDA_HOTKEY HkUpdatePcbFromSch( _HKI( "Update PCB from Schematic" ), HK_UP
static EDA_HOTKEY HkHighlightConnection( _HKI( "Highlight Connection" ), ID_HOTKEY_HIGHLIGHT,
'B' + GR_KB_CTRL );
// Common: hotkeys_basic.h
static EDA_HOTKEY HkNew( _HKI( "New" ), HK_NEW, GR_KB_CTRL + 'N', (int) wxID_NEW );
static EDA_HOTKEY HkOpen( _HKI( "Open" ), HK_OPEN, GR_KB_CTRL + 'O', (int) wxID_OPEN );
static EDA_HOTKEY HkSave( _HKI( "Save" ), HK_SAVE, GR_KB_CTRL + 'S', (int) wxID_SAVE );
static EDA_HOTKEY HkSaveAs( _HKI( "Save As" ), HK_SAVEAS, GR_KB_SHIFT + GR_KB_CTRL + 'S', (int) wxID_SAVEAS );
static EDA_HOTKEY HkPrint( _HKI( "Print" ), HK_PRINT, GR_KB_CTRL + 'P', (int) wxID_PRINT );
static EDA_HOTKEY HkUndo( _HKI( "Undo" ), HK_UNDO, GR_KB_CTRL + 'Z', (int) wxID_UNDO );
#if !defined( __WXMAC__ )
static EDA_HOTKEY HkRedo( _HKI( "Redo" ), HK_REDO, GR_KB_CTRL + 'Y', (int) wxID_REDO );
#else
static EDA_HOTKEY HkRedo( _HKI( "Redo" ), HK_REDO,
GR_KB_SHIFT + GR_KB_CTRL + 'Z',
(int) wxID_REDO );
#endif
static EDA_HOTKEY HkEditCut( _HKI( "Cut" ), HK_EDIT_CUT, GR_KB_CTRL + 'X', (int) wxID_CUT );
static EDA_HOTKEY HkEditCopy( _HKI( "Copy" ), HK_EDIT_COPY, GR_KB_CTRL + 'C', (int) wxID_COPY );
static EDA_HOTKEY HkEditPaste( _HKI( "Paste" ), HK_EDIT_PASTE, GR_KB_CTRL + 'V', (int) wxID_PASTE );
// List of common hotkey descriptors
static EDA_HOTKEY* common_Hotkey_List[] =
{
&HkNew, &HkOpen, &HkSave, &HkSaveAs, &HkPrint,
&HkUndo, &HkRedo,
&HkEditCut, &HkEditCopy, &HkEditPaste,
&HkHelp,
&HkZoomIn,
&HkZoomOut,
@ -248,8 +258,6 @@ static EDA_HOTKEY* common_Hotkey_List[] =
&HkDelete,
&HkRotate,
&HkDrag,
&HkUndo,
&HkRedo,
&HkMouseLeftClick,
&HkMouseLeftDClick,
NULL
@ -273,17 +281,12 @@ static EDA_HOTKEY* common_basic_Hotkey_List[] =
// List of hotkey descriptors for schematic
static EDA_HOTKEY* schematic_Hotkey_List[] =
{
&HkSaveSchematic,
&HkLoadSchematic,
&HkFindItem,
&HkFindNextItem,
&HkFindNextDrcMarker,
&HkFindReplace,
&HkInsert,
&HkMove2Drag,
&HkCopyBlock,
&HkPasteBlock,
&HkCutBlock,
&HkMove,
&HkDuplicateItem,
&HkAddComponent,
@ -325,9 +328,6 @@ static EDA_HOTKEY* libEdit_Hotkey_List[] =
&HkMoveLibItem,
&HkMirrorX,
&HkMirrorY,
&HkCopyBlock,
&HkPasteBlock,
&HkCutBlock,
NULL
};
@ -476,9 +476,9 @@ bool SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
case HK_ZOOM_AUTO:
case HK_ZOOM_SELECTION:
case HK_MOVEBLOCK_TO_DRAGBLOCK: // Switch to drag mode, when block moving
case HK_PASTE_BLOCK:
case HK_COPY_BLOCK: // Copy block to paste buffer.
case HK_CUT_BLOCK:
case HK_EDIT_PASTE:
case HK_EDIT_COPY: // Copy block to paste buffer.
case HK_EDIT_CUT:
cmd.SetId( hotKey->m_IdMenuEvent );
GetEventHandler()->ProcessEvent( cmd );
break;
@ -705,9 +705,9 @@ bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
case HK_ZOOM_REDRAW:
case HK_ZOOM_CENTER:
case HK_ZOOM_AUTO:
case HK_PASTE_BLOCK:
case HK_COPY_BLOCK:
case HK_CUT_BLOCK:
case HK_EDIT_PASTE:
case HK_EDIT_COPY:
case HK_EDIT_CUT:
cmd.SetId( hotKey->m_IdMenuEvent );
GetEventHandler()->ProcessEvent( cmd );
break;

View File

@ -42,9 +42,6 @@ enum hotkey_id_commnand {
HK_REPEAT_LAST,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM,
HK_MOVEBLOCK_TO_DRAGBLOCK,
HK_COPY_BLOCK,
HK_PASTE_BLOCK,
HK_CUT_BLOCK,
HK_LIBEDIT_CREATE_PIN,
HK_DELETE_PIN,
HK_ROTATE,
@ -75,8 +72,6 @@ enum hotkey_id_commnand {
HK_ADD_GRAPHIC_POLYLINE,
HK_ADD_NOCONN_FLAG,
HK_SAVE_ALL_LIBS,
HK_SAVE_SCH,
HK_LOAD_SCH,
HK_LEFT_CLICK,
HK_LEFT_DCLICK,
HK_LEAVE_SHEET,

View File

@ -338,10 +338,10 @@ void AddMenusForBlock( wxMenu* PopMenu, LIB_EDIT_FRAME* frame )
AddMenuItem( PopMenu, ID_POPUP_SELECT_ITEMS_BLOCK, _( "Select Items" ),
KiBitmap( green_xpm ) );
msg = AddHotkeyName( _( "Cut Block" ), g_Schematic_Hokeys_Descr,
HK_CUT_BLOCK );
HK_EDIT_CUT );
AddMenuItem( PopMenu, wxID_CUT, msg, KiBitmap( cut_xpm ) );
msg = AddHotkeyName( _( "Copy Block" ), g_Schematic_Hokeys_Descr,
HK_COPY_BLOCK );
HK_EDIT_COPY );
AddMenuItem( PopMenu, wxID_COPY, msg, KiBitmap( copy_xpm ) );
AddMenuItem( PopMenu, ID_POPUP_DUPLICATE_BLOCK, _( "Duplicate Block" ),
KiBitmap( duplicate_xpm ) );

View File

@ -49,6 +49,9 @@ static void preparePlaceMenu( wxMenu* aParentMenu );
// when Eeschema is run from Kicad manager, and true is run as stand alone app.
static void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject );
// Build the inspect menu
static void prepareInspectMenu( wxMenu* aParentMenu );
// Build the tools menu
static void prepareToolsMenu( wxMenu* aParentMenu );
@ -99,14 +102,18 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
wxMenu* placeMenu = new wxMenu;
preparePlaceMenu( placeMenu );
// Menu Preferences:
wxMenu* preferencesMenu = new wxMenu;
preparePreferencesMenu( this, preferencesMenu );
// Menu Inspect:
wxMenu* inspectMenu = new wxMenu;
prepareInspectMenu( inspectMenu );
// Menu Tools:
wxMenu* toolsMenu = new wxMenu;
prepareToolsMenu( toolsMenu );
// Menu Preferences:
wxMenu* preferencesMenu = new wxMenu;
preparePreferencesMenu( this, preferencesMenu );
// Help Menu:
wxMenu* helpMenu = new wxMenu;
prepareHelpMenu( helpMenu );
@ -116,8 +123,9 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
menuBar->Append( editMenu, _( "&Edit" ) );
menuBar->Append( viewMenu, _( "&View" ) );
menuBar->Append( placeMenu, _( "&Place" ) );
menuBar->Append( preferencesMenu, _( "P&references" ) );
menuBar->Append( inspectMenu, _( "&Inspect" ) );
menuBar->Append( toolsMenu, _( "&Tools" ) );
menuBar->Append( preferencesMenu, _( "P&references" ) );
menuBar->Append( helpMenu, _( "&Help" ) );
menuBar->Thaw();
@ -134,6 +142,25 @@ void prepareViewMenu( wxMenu* aParentMenu )
{
wxString text;
AddMenuItem( aParentMenu,
ID_TO_LIBVIEW,
_( "&Library Browser" ), HELP_RUN_LIB_VIEWER,
KiBitmap( library_browse_xpm ) );
AddMenuItem( aParentMenu,
ID_HIERARCHY,
_( "Show &Hierarchical Navigator" ),
_( "Navigate hierarchical sheets" ),
KiBitmap( hierarchy_nav_xpm ) );
text = AddHotkeyName( _( "&Leave Sheet" ), g_Schematic_Hokeys_Descr, HK_LEAVE_SHEET );
AddMenuItem( aParentMenu,
ID_POPUP_SCH_LEAVE_SHEET, text,
_( "Leave Sheet" ),
KiBitmap( leave_sheet_xpm ) );
aParentMenu->AppendSeparator();
/**
* Important Note for ZOOM IN and ZOOM OUT commands from menubar:
* we cannot add hotkey shortcut here, because the hotkey HK_ZOOM_IN and HK_ZOOM_OUT
@ -159,27 +186,58 @@ void prepareViewMenu( wxMenu* aParentMenu )
text = AddHotkeyName( _( "&Fit on Screen" ), g_Schematic_Hokeys_Descr, HK_ZOOM_AUTO );
AddMenuItem( aParentMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, KiBitmap( zoom_fit_in_page_xpm ) );
AddMenuItem( aParentMenu, ID_ZOOM_PAGE, text,
HELP_ZOOM_FIT, KiBitmap( zoom_fit_in_page_xpm ) );
text = AddHotkeyName( _( "&Redraw" ), g_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
AddMenuItem( aParentMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );
AddMenuItem( aParentMenu, ID_ZOOM_REDRAW, text,
HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );
aParentMenu->AppendSeparator();
AddMenuItem( aParentMenu,
ID_HIERARCHY,
_( "Show &Hierarchical Navigator" ),
_( "Navigate hierarchical sheets" ),
KiBitmap( hierarchy_nav_xpm ) );
AddMenuItem( aParentMenu, ID_TB_OPTIONS_SHOW_GRID,
_( "Show &Grid" ), wxEmptyString,
KiBitmap( grid_xpm ), wxITEM_CHECK );
text = AddHotkeyName( _( "&Leave Sheet" ), g_Schematic_Hokeys_Descr, HK_LEAVE_SHEET );
// Units submenu
wxMenu* unitsSubMenu = new wxMenu;
AddMenuItem( unitsSubMenu, ID_TB_OPTIONS_SELECT_UNIT_INCH,
_( "&Imperial" ), _( "Use imperial units" ),
KiBitmap( unit_inch_xpm ), wxITEM_RADIO );
AddMenuItem( aParentMenu,
ID_POPUP_SCH_LEAVE_SHEET,
text,
_( "Leave Sheet" ),
KiBitmap( leave_sheet_xpm ) );
AddMenuItem( unitsSubMenu, ID_TB_OPTIONS_SELECT_UNIT_MM,
_( "&Metric" ), _( "Use metric units" ),
KiBitmap( unit_mm_xpm ), wxITEM_RADIO );
AddMenuItem( aParentMenu, unitsSubMenu,
-1, _( "&Units" ),
_( "Select which units are displayed" ),
KiBitmap( unit_mm_xpm ) );
#ifndef __APPLE__
AddMenuItem( aParentMenu, ID_TB_OPTIONS_SELECT_CURSOR,
_( "Full Window Crosshair" ),
_( "Change cursor shape" ),
KiBitmap( cursor_shape_xpm ), wxITEM_CHECK );
#else
AddMenuItem( aParentMenu, ID_TB_OPTIONS_SELECT_CURSOR,
_( "Full Window Crosshair" ),
_( "Change cursor shape (not supported in Legacy graphics)" ),
KiBitmap( cursor_shape_xpm ), wxITEM_CHECK );
#endif
aParentMenu->AppendSeparator();
AddMenuItem( aParentMenu, ID_TB_OPTIONS_HIDDEN_PINS,
_( "Show hidden pins" ),
wxEmptyString,
KiBitmap( hidden_pin_xpm ), wxITEM_CHECK );
#ifdef __APPLE__
aParentMenu->AppendSeparator();
#endif
}
@ -297,21 +355,6 @@ void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject )
{
wxString text;
if( aIsOutsideProject ) // not when under a project mgr
{
AddMenuItem( aParentMenu,
ID_NEW_PROJECT,
_( "&New..." ),
_( "Clear current schematic hierarchy and start new schematic root sheet" ),
KiBitmap( new_document_xpm ) );
text = AddHotkeyName( _( "&Open..." ), g_Schematic_Hokeys_Descr, HK_LOAD_SCH );
AddMenuItem( aParentMenu,
ID_LOAD_PROJECT, text,
_( "Open existing schematic" ),
KiBitmap( open_document_xpm ) );
}
// @todo: static probably not OK in multiple open projects.
// Open Recent submenu
static wxMenu* openRecentMenu;
@ -326,28 +369,27 @@ void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject )
Kiface().GetFileHistory().UseMenu( openRecentMenu );
Kiface().GetFileHistory().AddFilesToMenu( openRecentMenu );
if( Kiface().IsSingle() ) // not when under a project mgr
if( aIsOutsideProject ) // not when under a project mgr
{
text = AddHotkeyName( _( "&New..." ), g_Schematic_Hokeys_Descr, HK_NEW );
AddMenuItem( aParentMenu, ID_NEW_PROJECT, text,
_( "Clear current schematic hierarchy and start new schematic root sheet" ),
KiBitmap( new_document_xpm ) );
text = AddHotkeyName( _( "&Open..." ), g_Schematic_Hokeys_Descr, HK_OPEN );
AddMenuItem( aParentMenu, ID_LOAD_PROJECT, text,
_( "Open existing schematic" ),
KiBitmap( open_document_xpm ) );
AddMenuItem( aParentMenu, openRecentMenu,
wxID_ANY, _( "Open &Recent" ),
-1, _( "Open &Recent" ),
_( "Open recently opened schematic" ),
KiBitmap( recent_xpm ) );
}
AddMenuItem( aParentMenu,
ID_APPEND_PROJECT, _( "App&end Schematic Sheet..." ),
_( "Import schematic sheet content from another project to current sheet" ),
KiBitmap( add_document_xpm ) );
AddMenuItem( aParentMenu,
ID_IMPORT_NON_KICAD_SCH, _( "&Import Non-Kicad Schematic File..." ),
_( "Import schematic file from other applications" ),
KiBitmap( import_document_xpm ) ); // TODO needs a different icon
aParentMenu->AppendSeparator();
}
text = AddHotkeyName( _( "&Save" ),
g_Schematic_Hokeys_Descr, HK_SAVE_SCH );
text = AddHotkeyName( _( "&Save" ), g_Schematic_Hokeys_Descr, HK_SAVE );
AddMenuItem( aParentMenu,
ID_SAVE_PROJECT, text,
_( "Save all sheets in schematic" ),
@ -361,40 +403,78 @@ void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject )
if( aIsOutsideProject ) // not when under a project mgr
{
text = AddHotkeyName( _( "Save C&urrent Sheet As..." ),
g_Schematic_Hokeys_Descr, HK_SAVEAS );
AddMenuItem( aParentMenu,
ID_SAVE_ONE_SHEET_UNDER_NEW_NAME,
_( "Save C&urrent Sheet As..." ),
ID_SAVE_ONE_SHEET_UNDER_NEW_NAME, text,
_( "Save current schematic sheet with new name" ),
KiBitmap( save_as_xpm ) );
}
aParentMenu->AppendSeparator();
// Edit page layout:
AddMenuItem( aParentMenu, ID_SHEET_SET,
_( "Pa&ge Settings..." ),
_( "Settings for sheet size and frame references" ),
KiBitmap( sheetset_xpm ) );
AddMenuItem( aParentMenu, ID_APPEND_PROJECT,
_( "App&end Schematic Sheet..." ),
_( "Import schematic sheet content from another project to current sheet" ),
KiBitmap( add_document_xpm ) );
AddMenuItem( aParentMenu,
wxID_PRINT,
_( "Pri&nt..." ),
_( "Print schematic sheet" ),
KiBitmap( print_button_xpm ) );
AddMenuItem( aParentMenu, ID_IMPORT_NON_KICAD_SCH,
_( "&Import Non-Kicad Schematic File..." ),
_( "Import schematic file from other applications" ),
KiBitmap( import_document_xpm ) ); // TODO needs a different icon
AddMenuItem( aParentMenu, ID_GEN_PLOT_SCHEMATIC, _( "&Plot..." ),
_( "Plot schematic sheet in PostScript, PDF, SVG, DXF or HPGL format" ),
KiBitmap( plot_xpm ) );
aParentMenu->AppendSeparator();
// Plot to Clipboard
AddMenuItem( aParentMenu, ID_GEN_COPY_SHEET_TO_CLIPBOARD,
_( "Plot to C&lipboard" ),
// Import submenu
wxMenu* submenuImport = new wxMenu();
AddMenuItem( submenuImport, ID_BACKANNO_ITEMS,
_( "&Footprint Association File..." ),
HELP_IMPORT_FOOTPRINTS,
KiBitmap( import_footprint_names_xpm ) );
AddMenuItem( aParentMenu, submenuImport,
ID_GEN_IMPORT_FILE,
_( "&Import" ),
_( "Import files" ),
KiBitmap( import_xpm ) );
// Export submenu
wxMenu* submenuExport = new wxMenu();
AddMenuItem( submenuExport, ID_GEN_COPY_SHEET_TO_CLIPBOARD,
_( "Drawing to C&lipboard" ),
_( "Export drawings to clipboard" ),
KiBitmap( copy_xpm ) );
// Quit
AddMenuItem( aParentMenu, submenuExport,
ID_GEN_EXPORT_FILE,
_( "E&xport" ),
_( "Export files" ),
KiBitmap( export_xpm ) );
aParentMenu->AppendSeparator();
AddMenuItem( aParentMenu, wxID_EXIT, _( "&Close" ), _( "Close Eeschema" ),
// Edit page layout:
AddMenuItem( aParentMenu, ID_SHEET_SET,
_( "Page S&ettings..." ),
_( "Settings for sheet size and frame references" ),
KiBitmap( sheetset_xpm ) );
text = AddHotkeyName( _( "&Print..." ), g_Schematic_Hokeys_Descr, HK_PRINT );
AddMenuItem( aParentMenu, wxID_PRINT, text,
_( "Print schematic sheet" ),
KiBitmap( print_button_xpm ) );
AddMenuItem( aParentMenu, ID_GEN_PLOT_SCHEMATIC, _( "P&lot..." ),
_( "Plot schematic sheet in PostScript, PDF, SVG, DXF or HPGL format" ),
KiBitmap( plot_xpm ) );
aParentMenu->AppendSeparator();
// Quit
AddMenuItem( aParentMenu, wxID_EXIT, _( "&Exit" ), _( "Close Eeschema" ),
KiBitmap( exit_xpm ) );
}
@ -413,12 +493,30 @@ void prepareEditMenu( wxMenu* aParentMenu )
AddMenuItem( aParentMenu, wxID_REDO, text, HELP_REDO, KiBitmap( redo_xpm ) );
// Delete
aParentMenu->AppendSeparator();
text = AddHotkeyName( _( "&Cut" ), g_Schematic_Hokeys_Descr, HK_EDIT_CUT );
AddMenuItem( aParentMenu, wxID_CUT, text,
_( "Cuts the selected item(s) to the Clipboard" ),
KiBitmap( cut_xpm ) );
text = AddHotkeyName( _( "&Copy" ), g_Schematic_Hokeys_Descr, HK_EDIT_COPY );
AddMenuItem( aParentMenu, wxID_COPY, text,
_( "Copies the selected item(s) to the Clipboard" ),
KiBitmap( copy_xpm ) );
text = AddHotkeyName( _( "&Paste" ), g_Schematic_Hokeys_Descr, HK_EDIT_PASTE );
AddMenuItem( aParentMenu, wxID_PASTE, text,
_( "Pastes item(s) from the Clipboard" ),
KiBitmap( paste_xpm ) );
// Delete
AddMenuItem( aParentMenu, ID_SCHEMATIC_DELETE_ITEM_BUTT,
_( "&Delete" ), HELP_DELETE_ITEMS,
KiBitmap( delete_xpm ) );
aParentMenu->AppendSeparator();
// Find
aParentMenu->AppendSeparator();
text = AddHotkeyName( _( "&Find..." ), g_Schematic_Hokeys_Descr, HK_FIND_ITEM );
@ -430,25 +528,22 @@ void prepareEditMenu( wxMenu* aParentMenu )
AddMenuItem( aParentMenu, wxID_REPLACE, text, HELP_REPLACE,
KiBitmap( find_replace_xpm ) );
// Import footprint association .cmp file which can be created by Pcbnew:
aParentMenu->AppendSeparator();
AddMenuItem( aParentMenu, ID_BACKANNO_ITEMS,
_( "Import Footprint Association File..." ),
HELP_IMPORT_FOOTPRINTS,
KiBitmap( import_footprint_names_xpm ) );
// Update field values
AddMenuItem( aParentMenu, ID_UPDATE_FIELDS,
_( "Update Field Values..." ),
_( "Sets symbol fields to original library values" ),
KiBitmap( update_fields_xpm ) );
}
// Edit components to symbols library links (change LIB_ID values)
aParentMenu->AppendSeparator();
AddMenuItem( aParentMenu, ID_EDIT_COMPONENTS_TO_SYMBOLS_LIB_ID,
_( "Edit Symbol Library Links..." ),
_( "Edit schematic symbol's symbol library links" ),
KiBitmap( edit_cmp_symb_links_xpm ) );
void prepareInspectMenu( wxMenu* aParentMenu )
{
AddMenuItem( aParentMenu, ID_GET_ERC,
_( "Electrical Rules &Checker" ),
_( "Perform electrical rules check" ),
KiBitmap( erc_xpm ) );
}
@ -478,11 +573,6 @@ void prepareToolsMenu( wxMenu* aParentMenu )
_( "Library &Editor" ), HELP_RUN_LIB_EDITOR,
KiBitmap( libedit_xpm ) );
AddMenuItem( aParentMenu,
ID_TO_LIBVIEW,
_( "Library &Browser" ), HELP_RUN_LIB_VIEWER,
KiBitmap( library_browse_xpm ) );
AddMenuItem( aParentMenu,
ID_RESCUE_CACHED,
_( "&Rescue Symbols..." ),
@ -495,39 +585,36 @@ void prepareToolsMenu( wxMenu* aParentMenu )
_( "Remap legacy library symbols to symbol library table" ),
KiBitmap( rescue_xpm ) );
AddMenuItem( aParentMenu,
ID_EDIT_COMPONENTS_TO_SYMBOLS_LIB_ID,
_( "Edit Symbol Library Links..." ),
_( "Edit schematic symbol's symbol library links" ),
KiBitmap( edit_cmp_symb_links_xpm ) );
aParentMenu->AppendSeparator();
AddMenuItem( aParentMenu,
ID_OPEN_CMP_TABLE,
_( "S&ymbol Table..." ),
KiBitmap( spreadsheet_xpm ) );
AddMenuItem( aParentMenu,
ID_GET_ANNOTATE,
_( "&Annotate Schematic..." ), HELP_ANNOTATE,
KiBitmap( annotate_xpm ) );
// ERC
AddMenuItem( aParentMenu,
ID_GET_ERC,
_( "Electrical Rules &Checker" ),
_( "Perform electrical rules check" ),
KiBitmap( erc_xpm ) );
AddMenuItem( aParentMenu,
ID_GET_NETLIST,
_( "Generate &Netlist File..." ),
_( "Generate netlist file" ),
KiBitmap( netlist_xpm ) );
AddMenuItem( aParentMenu,
ID_OPEN_CMP_TABLE,
_( "S&ymbol Table..." ),
KiBitmap( spreadsheet_xpm ) );
AddMenuItem( aParentMenu,
ID_GET_TOOLS,
_( "Generate Bill of &Materials..." ),
HELP_GENERATE_BOM,
KiBitmap( bom_xpm ) );
aParentMenu->AppendSeparator();
// Run CvPcb
@ -613,15 +700,38 @@ static void preparePreferencesMenu( SCH_EDIT_FRAME* aFrame, wxMenu* aParentMenu
KiBitmap( preference_xpm ) );
#endif // __WXMAC__
// Language submenu
aParentMenu->AppendSeparator();
Pgm().AddMenuLanguageList( aParentMenu );
// Icons options submenu
aFrame->AddMenuIconsOptions( aParentMenu );
// Import/export
aParentMenu->AppendSeparator();
// Language submenu
Pgm().AddMenuLanguageList( aParentMenu );
// Hotkeys submenu
wxMenu* HotkeySubmenu = new wxMenu;
AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_EXPORT_CONFIG,
_( "E&xport Hotkeys..." ),
_( "Export current hotkeys into configuration file" ),
KiBitmap( hotkeys_export_xpm ) );
// Reload hotkey file
AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_IMPORT_CONFIG,
_( "&Import Hotkeys..." ),
_( "Load existing hotkey configuration file" ),
KiBitmap( hotkeys_import_xpm ) );
AddMenuItem( aParentMenu, HotkeySubmenu, -1,
_( "&Hotkeys Options" ),
_( "Edit hotkeys configuration and preferences" ),
KiBitmap( hotkeys_xpm ) );
aParentMenu->AppendSeparator();
// Import/export
AddMenuItem( aParentMenu,
ID_CONFIG_SAVE,
_( "&Save Preferences..." ),
@ -633,18 +743,4 @@ static void preparePreferencesMenu( SCH_EDIT_FRAME* aFrame, wxMenu* aParentMenu
_( "Load Prefe&rences..." ),
_( "Load application preferences" ),
KiBitmap( import_setup_xpm ) );
aParentMenu->AppendSeparator();
AddMenuItem( aParentMenu,
ID_PREFERENCES_HOTKEY_EXPORT_CONFIG,
_( "E&xport Hotkeys..." ),
_( "Create hotkey configuration file with current hotkeys" ),
KiBitmap( hotkeys_export_xpm ) );
AddMenuItem( aParentMenu,
ID_PREFERENCES_HOTKEY_IMPORT_CONFIG,
_( "&Import Hotkeys..." ),
_( "Load existing hotkey configuration file" ),
KiBitmap( hotkeys_import_xpm ) );
}

View File

@ -862,10 +862,10 @@ void AddMenusForBlock( wxMenu* PopMenu, SCH_EDIT_FRAME* frame )
if( frame->GetScreen()->m_BlockLocate.GetCommand() == BLOCK_MOVE )
{
msg = AddHotkeyName( _( "Cut Block" ), g_Schematic_Hokeys_Descr,
HK_CUT_BLOCK );
HK_EDIT_CUT );
AddMenuItem( PopMenu, ID_POPUP_CUT_BLOCK, msg, KiBitmap( cut_xpm ) );
msg = AddHotkeyName( _( "Copy Block" ), g_Schematic_Hokeys_Descr,
HK_COPY_BLOCK );
HK_EDIT_COPY );
AddMenuItem( PopMenu, ID_POPUP_COPY_BLOCK, msg, KiBitmap( copy_xpm ) );
AddMenuItem( PopMenu, ID_POPUP_DUPLICATE_BLOCK, _( "Duplicate Block" ),
KiBitmap( duplicate_xpm ) );

View File

@ -328,7 +328,7 @@ void SCH_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
switch( id )
{
case ID_TB_OPTIONS_HIDDEN_PINS:
m_showAllPins = m_optionsToolBar->GetToolToggled( id );
m_showAllPins = !m_showAllPins;
if( m_canvas )
m_canvas->Refresh();