Symbol Editor: handle delete hotkey in block edit mode

This commit is contained in:
Maciej Suminski 2018-04-09 14:04:06 +02:00
parent 9bd6d5e97c
commit 4b0d477c76
1 changed files with 13 additions and 5 deletions

View File

@ -793,14 +793,22 @@ bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
break; break;
case HK_DELETE: case HK_DELETE:
if ( !itemInEdit ) if( blocInProgress )
SetDrawItem( LocateItemUsingCursor( aPosition ) );
if( GetDrawItem() )
{ {
cmd.SetId( ID_POPUP_LIBEDIT_DELETE_ITEM ); cmd.SetId( ID_POPUP_DELETE_BLOCK );
Process_Special_Functions( cmd ); Process_Special_Functions( cmd );
} }
else
{
if( !itemInEdit )
SetDrawItem( LocateItemUsingCursor( aPosition ) );
if( GetDrawItem() )
{
cmd.SetId( ID_POPUP_LIBEDIT_DELETE_ITEM );
Process_Special_Functions( cmd );
}
}
break; break;
case HK_LIBEDIT_MOVE_GRAPHIC_ITEM: case HK_LIBEDIT_MOVE_GRAPHIC_ITEM: