Added 'Paste' to eeschema context menus

Fixes: lp:1754891
* https://bugs.launchpad.net/kicad/+bug/1754891
This commit is contained in:
Maciej Suminski 2018-03-13 17:26:17 +01:00
parent d906acc0eb
commit 83efd6b8a3
2 changed files with 19 additions and 2 deletions

View File

@ -51,6 +51,7 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{
LIB_ITEM* item = GetDrawItem();
bool blockActive = GetScreen()->IsBlockActive();
wxString msg;
if( blockActive )
{
@ -59,7 +60,7 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
return true;
}
LIB_PART* part = GetCurPart();
LIB_PART* part = GetCurPart();
if( !part )
return true;
@ -99,12 +100,19 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
}
else
{
if( GetToolId() == ID_NO_TOOL_SELECTED )
{
msg = AddHotkeyName( _( "&Paste" ), g_Libedit_Hokeys_Descr, HK_EDIT_PASTE );
AddMenuItem( PopMenu, wxID_PASTE, msg,
_( "Pastes item(s) from the Clipboard" ),
KiBitmap( paste_xpm ) );
}
return true;
}
SetDrawItem( item );
bool not_edited = !item->InEditMode();
wxString msg;
switch( item->Type() )
{

View File

@ -192,6 +192,14 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
if( item == NULL )
{
if( GetToolId() == ID_NO_TOOL_SELECTED )
{
msg = AddHotkeyName( _( "&Paste" ), g_Schematic_Hokeys_Descr, HK_EDIT_PASTE );
AddMenuItem( PopMenu, wxID_PASTE, msg,
_( "Pastes item(s) from the Clipboard" ),
KiBitmap( paste_xpm ) );
}
if( m_CurrentSheet->Last() != g_RootSheet )
{
msg = AddHotkeyName( _( "Leave Sheet" ), g_Schematic_Hokeys_Descr, HK_LEAVE_SHEET );
@ -199,6 +207,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
KiBitmap( leave_sheet_xpm ) );
PopMenu->AppendSeparator();
}
return true;
}