From ce892d8f0d3f2b0a2a0840361515ec60efc85f8a Mon Sep 17 00:00:00 2001 From: Michael Kavanagh Date: Thu, 25 Apr 2019 18:49:54 +0100 Subject: [PATCH] PL editor: fix delete hotkey behaviour MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.20.1 (Apple Git-117)" This is a multi-part message in MIME format. --------------2.20.1 (Apple Git-117) Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit Fixes: lp:1819419 * https://bugs.launchpad.net/kicad/+bug/1819419 --- pagelayout_editor/events_functions.cpp | 4 ++-- pagelayout_editor/hotkeys.cpp | 3 +-- pagelayout_editor/menubar.cpp | 3 ++- pagelayout_editor/toolbars_pl_editor.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) --------------2.20.1 (Apple Git-117) Content-Type: text/x-patch; name="0001-PL-editor-fix-delete-hotkey-behaviour.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0001-PL-editor-fix-delete-hotkey-behaviour.patch" diff --git a/pagelayout_editor/events_functions.cpp b/pagelayout_editor/events_functions.cpp index 093b6c580..92d94fca6 100644 --- a/pagelayout_editor/events_functions.cpp +++ b/pagelayout_editor/events_functions.cpp @@ -82,7 +82,7 @@ BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME ) EVT_MENU( ID_HELP_GET_INVOLVED, EDA_DRAW_FRAME::GetKicadContribute ) EVT_MENU( wxID_ABOUT, EDA_DRAW_FRAME::GetKicadAbout ) - EVT_TOOL( wxID_CUT, PL_EDITOR_FRAME::Process_Special_Functions ) + EVT_TOOL( wxID_DELETE, PL_EDITOR_FRAME::Process_Special_Functions ) EVT_TOOL( wxID_UNDO, PL_EDITOR_FRAME::GetLayoutFromUndoList ) EVT_TOOL( wxID_REDO, PL_EDITOR_FRAME::GetLayoutFromRedoList ) EVT_TOOL( wxID_PRINT, PL_EDITOR_FRAME::ToPrinter ) @@ -169,7 +169,7 @@ void PL_EDITOR_FRAME::Process_Special_Functions( wxCommandEvent& event ) case ID_POPUP_DESIGN_TREE_ITEM_DELETE: case ID_POPUP_ITEM_DELETE: - case wxID_CUT: + case wxID_DELETE: // Delete item, and select the previous item item = m_treePagelayout->GetPageLayoutSelectedItem(); diff --git a/pagelayout_editor/hotkeys.cpp b/pagelayout_editor/hotkeys.cpp index 81e626a9f..646d320cb 100644 --- a/pagelayout_editor/hotkeys.cpp +++ b/pagelayout_editor/hotkeys.cpp @@ -87,8 +87,7 @@ static EDA_HOTKEY HkMoveStartPoint( _HKI( "Move Start Point" ), HK_MOVE_START ID_POPUP_ITEM_MOVE_START_POINT ); static EDA_HOTKEY HkMoveEndPoint( _HKI( "Move End Point" ), HK_MOVE_END_POINT, 'E', ID_POPUP_ITEM_MOVE_END_POINT ); -static EDA_HOTKEY HkDeleteItem( _HKI( "Delete Item" ), HK_DELETE_ITEM, WXK_DELETE, - ID_POPUP_ITEM_DELETE ); +static EDA_HOTKEY HkDeleteItem( _HKI( "Delete Item" ), HK_DELETE_ITEM, WXK_DELETE, (int) wxID_DELETE ); // Common: hotkeys_basic.h static EDA_HOTKEY HkUndo( _HKI( "Undo" ), HK_UNDO, GR_KB_CTRL + 'Z', (int) wxID_UNDO ); diff --git a/pagelayout_editor/menubar.cpp b/pagelayout_editor/menubar.cpp index d3e28d3cc..166a40345 100644 --- a/pagelayout_editor/menubar.cpp +++ b/pagelayout_editor/menubar.cpp @@ -113,7 +113,8 @@ void PL_EDITOR_FRAME::ReCreateMenuBar() editMenu->AppendSeparator(); - AddMenuItem( editMenu, wxID_CUT, _( "Delete" ), wxEmptyString, KiBitmap( delete_xpm ) ); + msg = AddHotkeyName( _( "Delete" ), PlEditorHotkeysDescr, HK_DELETE_ITEM ); + AddMenuItem( editMenu, wxID_DELETE, msg, wxEmptyString, KiBitmap( delete_xpm ) ); // View Menu: diff --git a/pagelayout_editor/toolbars_pl_editor.cpp b/pagelayout_editor/toolbars_pl_editor.cpp index 2bb054e97..a6f84ed16 100644 --- a/pagelayout_editor/toolbars_pl_editor.cpp +++ b/pagelayout_editor/toolbars_pl_editor.cpp @@ -66,7 +66,7 @@ void PL_EDITOR_FRAME::ReCreateHToolbar( void ) KiScaledSeparator( m_mainToolBar, this ); - m_mainToolBar->AddTool( wxID_CUT, wxEmptyString, KiScaledBitmap( delete_xpm, this ), + m_mainToolBar->AddTool( wxID_DELETE, wxEmptyString, KiScaledBitmap( delete_xpm, this ), _( "Delete selected item" ) ); KiScaledSeparator( m_mainToolBar, this ); --------------2.20.1 (Apple Git-117)--