Commit adf2fc83 authored by unknown's avatar unknown Committed by jean-pierre charras

Pcbnew, legacy mode: add Hotkey for editing module with module editor (Ctrl-E)

parent cbb0e2ad
......@@ -848,6 +848,11 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break;
case ID_POPUP_PCB_EDIT_MODULE_WITH_MODEDIT:
// If we don't have a current item, there's nothing we can do here
if( !GetCurItem() )
break;
// If the current Item is a pad, text module ...: Get its parent
if( GetCurItem()->Type() != PCB_MODULE_T )
SetCurItem( GetCurItem()->GetParent() );
......
......@@ -105,6 +105,7 @@ static EDA_HOTKEY HkSwitchTrackPosture( wxT( "Switch Track Posture" ), HK_SWITC
static EDA_HOTKEY HkDragTrackKeepSlope( wxT( "Drag Track Keep Slope" ), HK_DRAG_TRACK_KEEP_SLOPE, 'D' );
static EDA_HOTKEY HkPlaceItem( wxT( "Place Item" ), HK_PLACE_ITEM, 'P' );
static EDA_HOTKEY HkEditBoardItem( wxT( "Edit Item" ), HK_EDIT_ITEM, 'E' );
static EDA_HOTKEY HkEditWithModedit( wxT( "Edit with Footprint Editor" ), HK_EDIT_MODULE_WITH_MODEDIT, 'E' + GR_KB_CTRL );
static EDA_HOTKEY HkFlipItem( wxT( "Flip Item" ), HK_FLIP_ITEM, 'F' );
static EDA_HOTKEY HkRotateItem( wxT( "Rotate Item" ), HK_ROTATE_ITEM, 'R' );
static EDA_HOTKEY HkMoveItem( wxT( "Move Item" ), HK_MOVE_ITEM, 'M' );
......@@ -287,6 +288,7 @@ EDA_HOTKEY* board_edit_Hotkey_List[] =
&HkDragFootprint,
&HkGetAndMoveFootprint, &HkLock_Unlock_Footprint, &HkSavefile, &HkSavefileAs,
&HkLoadfile, &HkFindItem, &HkEditBoardItem,
&HkEditWithModedit,
&HkSwitch2CopperLayer, &HkSwitch2InnerLayer1,
&HkSwitch2InnerLayer2, &HkSwitch2InnerLayer3, &HkSwitch2InnerLayer4,
&HkSwitch2InnerLayer5, &HkSwitch2InnerLayer6, &HkSwitch2ComponentLayer,
......
......@@ -61,6 +61,7 @@ enum hotkey_id_commnand {
HK_SWITCH_TRACK_DISPLAY_MODE,
HK_FIND_ITEM,
HK_EDIT_ITEM,
HK_EDIT_MODULE_WITH_MODEDIT,
HK_DUPLICATE_ITEM,
HK_DUPLICATE_ITEM_AND_INCREMENT,
HK_CREATE_ARRAY,
......
......@@ -508,6 +508,10 @@ bool PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
OnHotkeyEditItem( HK_EDIT_ITEM );
break;
case HK_EDIT_MODULE_WITH_MODEDIT: // Edit module with module editor
OnHotkeyEditItem( HK_EDIT_MODULE_WITH_MODEDIT );
break;
// Footprint edition:
case HK_LOCK_UNLOCK_FOOTPRINT: // toggle module "MODULE_is_LOCKED" status:
// get any module, locked or not locked and toggle its locked status
......@@ -699,6 +703,8 @@ bool PCB_EDIT_FRAME::OnHotkeyEditItem( int aIdCommand )
case PCB_MODULE_T:
if( aIdCommand == HK_EDIT_ITEM )
evt_type = ID_POPUP_PCB_EDIT_MODULE_PRMS;
else if( aIdCommand == HK_EDIT_MODULE_WITH_MODEDIT )
evt_type = ID_POPUP_PCB_EDIT_MODULE_WITH_MODEDIT;
break;
......
......@@ -864,10 +864,14 @@ void PCB_EDIT_FRAME::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* menu
g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM );
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_EDIT_MODULE_PRMS, msg,
KiBitmap( edit_module_xpm ) );
msg = AddHotkeyName( _( "Edit with Footprint Editor" ),
g_Board_Editor_Hokeys_Descr, HK_EDIT_MODULE_WITH_MODEDIT );
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_EDIT_MODULE_WITH_MODEDIT,
_( "Edit with Footprint Editor" ),
KiBitmap( module_editor_xpm ) );
msg, KiBitmap( module_editor_xpm ) );
sub_menu_footprint->AppendSeparator();
msg = AddHotkeyName( _( "Delete Footprint" ),
g_Board_Editor_Hokeys_Descr, HK_DELETE );
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_DELETE_MODULE,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment