Commit 39ba3608 authored by Marco Mattila's avatar Marco Mattila

Fix eeschema component drawing issue during copy. Add hotkey for block save.

parent 4154af55
......@@ -35,7 +35,7 @@ void SCH_EDIT_FRAME::OnCopySchematicItemRequest( wxCommandEvent& event )
MoveItem( (SCH_ITEM*) newitem, &dc );
// Redraw the original part, because StartMovePart() erased it from screen.
curr_item->Draw( m_canvas, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
curr_item->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode );
}
break;
......
......@@ -177,6 +177,7 @@ static EDA_HOTKEY HkCopyComponentOrText( wxT( "Copy Component or Label" ),
ID_POPUP_SCH_COPY_ITEM );
static EDA_HOTKEY HkDrag( wxT( "Drag Schematic Item" ), HK_DRAG, 'G', ID_SCH_DRAG_ITEM );
static EDA_HOTKEY HkSaveBlock( wxT( "Save Block" ), HK_SAVE_BLOCK, 'C' + GR_KB_CTRL );
static EDA_HOTKEY HkMove2Drag( wxT( "Move Block -> Drag Block" ),
HK_MOVEBLOCK_TO_DRAGBLOCK, '\t' );
static EDA_HOTKEY HkInsert( wxT( "Repeat Last Item" ), HK_REPEAT_LAST, WXK_INSERT );
......@@ -218,6 +219,7 @@ EDA_HOTKEY* s_Schematic_Hotkey_List[] =
&HkDelete,
&HkInsert,
&HkMove2Drag,
&HkSaveBlock,
&HkMove,
&HkCopyComponentOrText,
&HkDrag,
......@@ -357,6 +359,10 @@ void SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
HandleBlockEndByPopUp( BLOCK_DRAG, aDC );
break;
case HK_SAVE_BLOCK:
HandleBlockEndByPopUp( BLOCK_SAVE, aDC );
break;
case HK_DELETE:
if( notBusy )
DeleteItemAtCrossHair( aDC );
......
......@@ -17,6 +17,7 @@ enum hotkey_id_commnand {
HK_REPEAT_LAST,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM,
HK_MOVEBLOCK_TO_DRAGBLOCK,
HK_SAVE_BLOCK,
HK_LIBEDIT_CREATE_PIN,
HK_DELETE_PIN,
HK_ROTATE,
......
......@@ -682,14 +682,20 @@ void AddMenusForBlock( wxMenu* PopMenu, SCH_EDIT_FRAME* frame )
// a block function.
if( frame->GetScreen()->m_BlockLocate.m_Command == BLOCK_MOVE )
{
AddMenuItem( PopMenu, wxID_COPY, _( "Save Block" ), KiBitmap( copy_button_xpm ) );
msg = AddHotkeyName( _( "Save Block" ), s_Schematic_Hokeys_Descr,
HK_SAVE_BLOCK );
AddMenuItem( PopMenu, wxID_COPY, msg, KiBitmap( copy_button_xpm ) );
AddMenuItem( PopMenu, ID_POPUP_COPY_BLOCK, _( "Copy Block" ), KiBitmap( copyblock_xpm ) );
msg = AddHotkeyName( _( "Drag Block" ), s_Schematic_Hokeys_Descr,
HK_MOVEBLOCK_TO_DRAGBLOCK );
AddMenuItem( PopMenu, ID_POPUP_DRAG_BLOCK, msg, KiBitmap( move_xpm ) );
AddMenuItem( PopMenu, ID_POPUP_DELETE_BLOCK, _( "Delete Block" ), KiBitmap( delete_xpm ) );
AddMenuItem( PopMenu, ID_SCH_MIRROR_Y, _( "Mirror Block ||" ), KiBitmap( mirror_h_xpm ) );
AddMenuItem( PopMenu, ID_SCH_MIRROR_X, _( "Mirror Block --" ), KiBitmap( mirror_v_xpm ) );
msg = AddHotkeyName( _( "Mirror Block ||" ), s_Schematic_Hokeys_Descr,
HK_MIRROR_Y_COMPONENT );
AddMenuItem( PopMenu, ID_SCH_MIRROR_Y, msg, KiBitmap( mirror_h_xpm ) );
msg = AddHotkeyName( _( "Mirror Block --" ), s_Schematic_Hokeys_Descr,
HK_MIRROR_X_COMPONENT );
AddMenuItem( PopMenu, ID_SCH_MIRROR_X, msg, KiBitmap( mirror_v_xpm ) );
AddMenuItem( PopMenu, ID_SCH_ROTATE_CLOCKWISE, _( "Rotate Block ccw" ),
KiBitmap( rotate_ccw_xpm ) );
......
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