Add zoom to selection menu entry to all editors.

Fixes lp:1753339

https://bugs.launchpad.net/kicad/+bug/1753339
This commit is contained in:
Wayne Stambaugh 2018-03-25 11:02:53 -04:00
parent 33f795be4f
commit 8d8c422a19
9 changed files with 36 additions and 13 deletions

View File

@ -278,13 +278,13 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu )
AddMenuItem( MasterMenu, ID_POPUP_ZOOM_OUT, msg, KiBitmap( zoom_out_xpm ) );
msg = AddHotkeyName( _( "Redraw View" ), m_hotkeysDescrList, HK_ZOOM_REDRAW );
AddMenuItem( MasterMenu, ID_POPUP_ZOOM_REDRAW, msg, KiBitmap( zoom_redraw_xpm ) );
msg = AddHotkeyName( _( "Zoom Auto" ), m_hotkeysDescrList, HK_ZOOM_AUTO );
msg = AddHotkeyName( _( "Zoom to Fit" ), m_hotkeysDescrList, HK_ZOOM_AUTO );
AddMenuItem( MasterMenu, ID_POPUP_ZOOM_PAGE, msg, KiBitmap( zoom_fit_in_page_xpm ) );
wxMenu* zoom_choice = new wxMenu;
AddMenuItem( MasterMenu, zoom_choice,
ID_POPUP_ZOOM_SELECT, _( "Zoom Select" ),
ID_POPUP_ZOOM_SELECT, _( "Zoom to Selection" ),
KiBitmap( zoom_selection_xpm ) );
zoom = screen->GetZoom();

View File

@ -196,7 +196,8 @@ static EDA_HOTKEY HkFindReplace( _HKI( "Find and Replace" ), HK_FIND_REPLACE,
'F' + GR_KB_CTRL + GR_KB_ALT, wxID_REPLACE );
static EDA_HOTKEY HkFindNextDrcMarker( _HKI( "Find Next DRC Marker" ), HK_FIND_NEXT_DRC_MARKER,
WXK_F5 + GR_KB_SHIFT, EVT_COMMAND_FIND_DRC_MARKER );
static EDA_HOTKEY HkZoomSelection( _HKI( "Zoom to Selection" ), HK_ZOOM_SELECTION, '@', ID_ZOOM_SELECTION );
static EDA_HOTKEY HkZoomSelection( _HKI( "Zoom to Selection" ), HK_ZOOM_SELECTION,
GR_KB_CTRL + WXK_F5, ID_ZOOM_SELECTION );
// Special keys for library editor:
static EDA_HOTKEY HkCreatePin( _HKI( "Create Pin" ), HK_LIBEDIT_CREATE_PIN, 'P' );
@ -204,7 +205,8 @@ static EDA_HOTKEY HkInsertPin( _HKI( "Repeat Pin" ), HK_REPEAT_LAST, WXK_INSERT
static EDA_HOTKEY HkMoveLibItem( _HKI( "Move Library Item" ), HK_LIBEDIT_MOVE_GRAPHIC_ITEM, 'M' );
// 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 HkSaveAllLib( _HKI( "Save All Libraries" ), HK_SAVE_ALL_LIBS, 'S' + GR_KB_CTRL,
ID_LIBEDIT_SAVE_ALL_LIBS );
// Autoplace fields
static EDA_HOTKEY HkAutoplaceFields( _HKI( "Autoplace Fields" ), HK_AUTOPLACE_FIELDS, 'O',
@ -217,12 +219,12 @@ 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 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 );

View File

@ -189,6 +189,10 @@ void prepareViewMenu( wxMenu* aParentMenu )
AddMenuItem( aParentMenu, ID_ZOOM_PAGE, text,
HELP_ZOOM_FIT, KiBitmap( zoom_fit_in_page_xpm ) );
text = AddHotkeyName( _( "Zoom to Selection" ), g_Eeschema_Hokeys_Descr, HK_ZOOM_SELECTION );
AddMenuItem( aParentMenu, ID_ZOOM_SELECTION, text, KiBitmap( zoom_area_xpm ) );
text = AddHotkeyName( _( "&Redraw" ), g_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
AddMenuItem( aParentMenu, ID_ZOOM_REDRAW, text,

View File

@ -171,6 +171,9 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
AddMenuItem( viewMenu, ID_ZOOM_PAGE, text, _( "Zoom to fit symbol" ),
KiBitmap( zoom_fit_in_page_xpm ) );
text = AddHotkeyName( _( "Zoom to Selection" ), g_Schematic_Hokeys_Descr, HK_ZOOM_SELECTION );
AddMenuItem( viewMenu, ID_ZOOM_SELECTION, text, KiBitmap( zoom_area_xpm ) );
// Redraw
text = AddHotkeyName( _( "&Redraw" ), g_Libedit_Hokeys_Descr, HK_ZOOM_REDRAW );
AddMenuItem( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );

View File

@ -208,10 +208,13 @@ void GERBVIEW_FRAME::ReCreateMenuBar()
HK_ZOOM_OUT, IS_ACCELERATOR );
AddMenuItem( viewMenu, ID_ZOOM_OUT, text, _( "Zoom out" ), KiBitmap( zoom_out_xpm ) );
text = AddHotkeyName( _( "&Fit on Screen" ), GerbviewHokeysDescr, HK_ZOOM_AUTO );
text = AddHotkeyName( _( "Zoom to &Fit" ), GerbviewHokeysDescr, HK_ZOOM_AUTO );
AddMenuItem( viewMenu, ID_ZOOM_PAGE, text, _( "Zoom to fit" ),
KiBitmap( zoom_fit_in_page_xpm ) );
AddMenuItem( viewMenu, ID_ZOOM_SELECTION, _( "Zoom to Selection" ),
KiBitmap( zoom_area_xpm ) );
text = AddHotkeyName( _( "&Redraw" ), GerbviewHokeysDescr, HK_ZOOM_REDRAW );
AddMenuItem( viewMenu, ID_ZOOM_REDRAW, text,
_( "Refresh screen" ), KiBitmap( zoom_redraw_xpm ) );

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2016-2018 KiCad Developers, see AUTHORS.txt for contributors.
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
@ -67,7 +67,8 @@
// 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 );
static EDA_HOTKEY HkMouseLeftDClick( _HKI( "Mouse Left Double Click" ), HK_LEFT_DCLICK,
WXK_END, 0 );
static EDA_HOTKEY HkResetLocalCoord( _HKI( "Reset Local Coordinates" ),
HK_RESET_LOCAL_COORD, ' ' );
@ -77,7 +78,8 @@ static EDA_HOTKEY HkZoomCenter( _HKI( "Zoom Center" ), HK_ZOOM_CENTER, WXK_F4
static EDA_HOTKEY HkZoomRedraw( _HKI( "Zoom Redraw" ), HK_ZOOM_REDRAW, WXK_F3, ID_ZOOM_REDRAW );
static EDA_HOTKEY HkZoomOut( _HKI( "Zoom Out" ), HK_ZOOM_OUT, WXK_F2, ID_KEY_ZOOM_OUT );
static EDA_HOTKEY HkZoomIn( _HKI( "Zoom In" ), HK_ZOOM_IN, WXK_F1, ID_KEY_ZOOM_IN );
static EDA_HOTKEY HkZoomSelection( _HKI( "Zoom to Selection" ), HK_ZOOM_SELECTION, WXK_F5, ID_ZOOM_SELECTION );
static EDA_HOTKEY HkZoomSelection( _HKI( "Zoom to Selection" ), HK_ZOOM_SELECTION,
GR_KB_CTRL + WXK_F5, ID_ZOOM_SELECTION );
static EDA_HOTKEY HkHelp( _HKI( "Help (this window)" ), HK_HELP, '?' );
static EDA_HOTKEY HkMoveItem( _HKI( "Move Item" ), HK_MOVE_ITEM, 'M', ID_POPUP_ITEM_MOVE );
static EDA_HOTKEY HkPlaceItem( _HKI( "Place Item" ), HK_PLACE_ITEM, 'P', ID_POPUP_ITEM_PLACE );
@ -94,7 +96,8 @@ static EDA_HOTKEY HkRedo( _HKI( "Redo" ), HK_REDO, GR_KB_CTRL + 'Y', (int) wxID_
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_CTRL + GR_KB_SHIFT + 'S', (int) wxID_SAVEAS );
static EDA_HOTKEY HkSaveAs( _HKI( "Save As" ), HK_SAVEAS, GR_KB_CTRL + GR_KB_SHIFT + 'S',
(int) wxID_SAVEAS );
static EDA_HOTKEY HkPrint( _HKI( "Print" ), HK_PRINT, GR_KB_CTRL + 'P', (int) wxID_PRINT );
// List of common hotkey descriptors

View File

@ -194,7 +194,7 @@ static EDA_HOTKEY HkZoomOut( _HKI( "Zoom Out" ), HK_ZOOM_OUT, GR_KB_CTRL + '-' )
#endif
static EDA_HOTKEY HkZoomSelection( _HKI( "Zoom to Selection" ), HK_ZOOM_SELECTION,
'@', ID_ZOOM_SELECTION );
GR_KB_CTRL + WXK_F5, ID_ZOOM_SELECTION );
static EDA_HOTKEY Hk3DViewer( _HKI( "3D Viewer" ), HK_3D_VIEWER, GR_KB_ALT + '3' );

View File

@ -236,6 +236,10 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
AddMenuItem( viewMenu, ID_ZOOM_PAGE, text, _( "Zoom to fit footprint" ),
KiBitmap( zoom_fit_in_page_xpm ) );
text = AddHotkeyName( _( "Zoom to Selection" ), m_hotkeysDescrList, HK_ZOOM_SELECTION );
AddMenuItem( viewMenu, ID_ZOOM_SELECTION, text, KiBitmap( zoom_area_xpm ) );
text = AddHotkeyName( _( "&Redraw" ), m_hotkeysDescrList, HK_ZOOM_REDRAW );
AddMenuItem( viewMenu, ID_ZOOM_REDRAW, text,
HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );

View File

@ -636,11 +636,15 @@ void prepareViewMenu( wxMenu* aParentMenu, bool aUseGal )
HK_ZOOM_OUT, IS_ACCELERATOR );
AddMenuItem( aParentMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, KiBitmap( zoom_out_xpm ) );
text = AddHotkeyName( _( "&Fit on Screen" ), g_Pcbnew_Editor_Hotkeys_Descr,
text = AddHotkeyName( _( "Zoom to &Fit" ), g_Pcbnew_Editor_Hotkeys_Descr,
HK_ZOOM_AUTO );
AddMenuItem( aParentMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT,
KiBitmap( zoom_fit_in_page_xpm ) );
text = AddHotkeyName( _( "Zoom to Selection" ), g_Pcbnew_Editor_Hotkeys_Descr,
HK_ZOOM_SELECTION );
AddMenuItem( aParentMenu, ID_ZOOM_SELECTION, text, KiBitmap( zoom_area_xpm ) );
text = AddHotkeyName( _( "&Redraw" ), g_Pcbnew_Editor_Hotkeys_Descr, HK_ZOOM_REDRAW );
AddMenuItem( aParentMenu, ID_ZOOM_REDRAW, text,
HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );