From 2571080ef27d5c6c0b92361ca2b43bc4d67c9563 Mon Sep 17 00:00:00 2001 From: Andrey Fedorushkov Date: Tue, 30 Aug 2011 13:42:42 +0400 Subject: [PATCH] pcbnew: add hotkey 'D' - drag track segment keep slope --- pcbnew/hotkeys.cpp | 3 +++ pcbnew/hotkeys.h | 1 + pcbnew/hotkeys_board_editor.cpp | 6 ++++++ pcbnew/onrightclick.cpp | 4 +++- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/pcbnew/hotkeys.cpp b/pcbnew/hotkeys.cpp index 6a6b4b3da6..42778de3ab 100644 --- a/pcbnew/hotkeys.cpp +++ b/pcbnew/hotkeys.cpp @@ -65,6 +65,8 @@ static Ki_HotkeyInfo HkAddNewTrack( wxT( "Add new track" ), HK_ADD_NEW_TRACK, 'X static Ki_HotkeyInfo HkAddVia( wxT( "Add Via" ), HK_ADD_VIA, 'V' ); static Ki_HotkeyInfo HkSwitchTrackPosture( wxT( "Switch Track Posture" ), HK_SWITCH_TRACK_POSTURE, '/' ); +static Ki_HotkeyInfo HkDragTrackKeepSlope( wxT( "Drag track keep slope" ), + HK_DRAG_TRACK_KEEP_SLOPE, 'D' ); static Ki_HotkeyInfo HkAddMicroVia( wxT( "Add MicroVia" ), HK_ADD_MICROVIA, 'V' + GR_KB_CTRL ); static Ki_HotkeyInfo HkEndTrack( wxT( "End Track" ), HK_END_TRACK, WXK_END ); @@ -154,6 +156,7 @@ Ki_HotkeyInfo* board_edit_Hotkey_List[] = &HkBackspace, &HkAddNewTrack, &HkAddVia, &HkAddMicroVia, &HkSwitchTrackPosture, + &HkDragTrackKeepSlope, &HkEndTrack, &HkMoveItem, &HkFlipFootprint, &HkRotateItem, &HkDragFootprint, &HkGetAndMoveFootprint, &HkLock_Unlock_Footprint, &HkSavefile, diff --git a/pcbnew/hotkeys.h b/pcbnew/hotkeys.h index 1ae9641830..ce22cabbdb 100644 --- a/pcbnew/hotkeys.h +++ b/pcbnew/hotkeys.h @@ -23,6 +23,7 @@ enum hotkey_id_commnand { HK_ADD_VIA, HK_ADD_MICROVIA, HK_SWITCH_TRACK_POSTURE, + HK_DRAG_TRACK_KEEP_SLOPE, HK_END_TRACK, HK_SAVE_BOARD, HK_LOAD_BOARD, HK_SWITCH_UNITS, diff --git a/pcbnew/hotkeys_board_editor.cpp b/pcbnew/hotkeys_board_editor.cpp index 0b4729f6d0..f10311b29a 100644 --- a/pcbnew/hotkeys_board_editor.cpp +++ b/pcbnew/hotkeys_board_editor.cpp @@ -279,6 +279,10 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit evt_type = ID_POPUP_PCB_SWITCH_TRACK_POSTURE ; break; + case HK_DRAG_TRACK_KEEP_SLOPE: + OnHotkeyMoveItem( HK_DRAG_TRACK_KEEP_SLOPE ); + break; + case HK_ADD_NEW_TRACK: // Start new track if( getActiveLayer() > LAYER_N_FRONT ) break; @@ -558,6 +562,8 @@ bool PCB_EDIT_FRAME::OnHotkeyMoveItem( int aIdCommand ) evt_type = ID_POPUP_PCB_MOVE_TRACK_NODE; if( aIdCommand == HK_DRAG_ITEM ) evt_type = ID_POPUP_PCB_DRAG_TRACK_SEGMENT; + if( aIdCommand == HK_DRAG_TRACK_KEEP_SLOPE ) + evt_type = ID_POPUP_PCB_DRAG_TRACK_SEGMENT_KEEP_SLOPE; break; case TYPE_MODULE: diff --git a/pcbnew/onrightclick.cpp b/pcbnew/onrightclick.cpp index 0ed2db505b..c34d316a5a 100644 --- a/pcbnew/onrightclick.cpp +++ b/pcbnew/onrightclick.cpp @@ -414,8 +414,10 @@ void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu ) } else { + msg = AddHotkeyName( _( "Drag Segments, Keep Slope" ), g_Board_Editor_Hokeys_Descr, + HK_DRAG_TRACK_KEEP_SLOPE ); ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DRAG_TRACK_SEGMENT_KEEP_SLOPE, - _( "Drag Segments, Keep Slope" ), drag_segment_withslope_xpm ); + msg, drag_segment_withslope_xpm ); msg = AddHotkeyName( _( "Drag Segment" ), g_Board_Editor_Hokeys_Descr, HK_DRAG_ITEM ); ADD_MENUITEM( PopMenu, ID_POPUP_PCB_DRAG_TRACK_SEGMENT,