diff --git a/eeschema/libeditframe.cpp b/eeschema/libeditframe.cpp index 560c60d521..3e2d5c832d 100644 --- a/eeschema/libeditframe.cpp +++ b/eeschema/libeditframe.cpp @@ -169,6 +169,7 @@ BEGIN_EVENT_TABLE( LIB_EDIT_FRAME, EDA_DRAW_FRAME ) LIB_EDIT_FRAME::OnOrient ) // Update user interface elements. + EVT_UPDATE_UI( wxID_PASTE, LIB_EDIT_FRAME::OnUpdatePaste ) EVT_UPDATE_UI( ID_LIBEDIT_REVERT_LIBRARY, LIB_EDIT_FRAME::OnUpdateLibModified ) EVT_UPDATE_UI( ID_LIBEDIT_EXPORT_PART, LIB_EDIT_FRAME::OnUpdateEditingPart ) EVT_UPDATE_UI( ID_LIBEDIT_SAVE_PART, LIB_EDIT_FRAME::OnUpdatePartModified ) @@ -539,6 +540,12 @@ void LIB_EDIT_FRAME::OnUpdatePartModified( wxUpdateUIEvent& aEvent ) } +void LIB_EDIT_FRAME::OnUpdatePaste( wxUpdateUIEvent& event ) +{ + event.Enable( m_clipboard.GetCount() > 0 ); +} + + void LIB_EDIT_FRAME::OnUpdateLibModified( wxUpdateUIEvent& aEvent ) { aEvent.Enable( m_libMgr->IsLibraryModified( getTargetLib() ) ); diff --git a/eeschema/libeditframe.h b/eeschema/libeditframe.h index cb48d8da65..07ff983b26 100644 --- a/eeschema/libeditframe.h +++ b/eeschema/libeditframe.h @@ -317,6 +317,7 @@ public: void OnOpenPinTable( wxCommandEvent& aEvent ); + void OnUpdatePaste( wxUpdateUIEvent& event ); void OnUpdateSelectTool( wxUpdateUIEvent& aEvent ); void OnUpdateEditingPart( wxUpdateUIEvent& event ); void OnUpdatePartModified( wxUpdateUIEvent& aEvent ); diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index 9800551956..0cc8f0d86a 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -322,8 +322,6 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME ) EVT_MENU_RANGE( ID_SELECT_ITEM_START, ID_SELECT_ITEM_END, SCH_EDIT_FRAME::OnSelectItem ) /* Handle user interface update events. */ - EVT_UPDATE_UI( wxID_CUT, SCH_EDIT_FRAME::OnUpdateBlockSelected ) - EVT_UPDATE_UI( wxID_COPY, SCH_EDIT_FRAME::OnUpdateBlockSelected ) EVT_UPDATE_UI( wxID_PASTE, SCH_EDIT_FRAME::OnUpdatePaste ) EVT_UPDATE_UI( ID_TB_OPTIONS_HIDDEN_PINS, SCH_EDIT_FRAME::OnUpdateHiddenPins ) EVT_UPDATE_UI( ID_TB_OPTIONS_BUS_WIRES_ORIENT, SCH_EDIT_FRAME::OnUpdateBusOrientation ) @@ -783,14 +781,6 @@ void SCH_EDIT_FRAME::OnModify() } -void SCH_EDIT_FRAME::OnUpdateBlockSelected( wxUpdateUIEvent& event ) -{ - bool enable = ( GetScreen() && GetScreen()->m_BlockLocate.GetCommand() == BLOCK_MOVE ); - - event.Enable( enable ); -} - - void SCH_EDIT_FRAME::OnUpdatePaste( wxUpdateUIEvent& event ) { event.Enable( m_blockItems.GetCount() > 0 ); diff --git a/eeschema/schframe.h b/eeschema/schframe.h index 86abc4a063..e80e9bbeba 100644 --- a/eeschema/schframe.h +++ b/eeschema/schframe.h @@ -869,7 +869,6 @@ private: void OnCopySchematicItemRequest( wxCommandEvent& event ); /* User interface update event handlers. */ - void OnUpdateBlockSelected( wxUpdateUIEvent& event ); void OnUpdatePaste( wxUpdateUIEvent& event ); void OnUpdateHiddenPins( wxUpdateUIEvent& event ); void OnUpdateBusOrientation( wxUpdateUIEvent& event ); diff --git a/eeschema/tool_lib.cpp b/eeschema/tool_lib.cpp index fb922421b9..de4f46c8dd 100644 --- a/eeschema/tool_lib.cpp +++ b/eeschema/tool_lib.cpp @@ -130,13 +130,20 @@ void LIB_EDIT_FRAME::ReCreateHToolbar() _( "Export part" ) ); m_mainToolBar->AddSeparator(); - msg = AddHotkeyName( _( "Undo last command" ), g_Libedit_Hokeys_Descr, HK_UNDO, IS_COMMENT ); + + m_mainToolBar->AddTool( wxID_PASTE, wxEmptyString, KiBitmap( paste_xpm ), + _( "Paste" ) ); + + m_mainToolBar->AddSeparator(); + + msg = AddHotkeyName( HELP_UNDO, g_Libedit_Hokeys_Descr, HK_UNDO, IS_COMMENT ); m_mainToolBar->AddTool( wxID_UNDO, wxEmptyString, KiBitmap( undo_xpm ), msg ); - msg = AddHotkeyName( _( "Redo last command" ), g_Libedit_Hokeys_Descr, HK_REDO, - IS_COMMENT ); + + msg = AddHotkeyName( HELP_REDO, g_Libedit_Hokeys_Descr, HK_REDO, IS_COMMENT ); m_mainToolBar->AddTool( wxID_REDO, wxEmptyString, KiBitmap( redo_xpm ), msg ); m_mainToolBar->AddSeparator(); + m_mainToolBar->AddTool( ID_LIBEDIT_GET_FRAME_EDIT_PART, wxEmptyString, KiBitmap( part_properties_xpm ), _( "Edit part properties" ) ); diff --git a/eeschema/tool_sch.cpp b/eeschema/tool_sch.cpp index a622db49d4..0ede8eead5 100644 --- a/eeschema/tool_sch.cpp +++ b/eeschema/tool_sch.cpp @@ -80,12 +80,6 @@ void SCH_EDIT_FRAME::ReCreateHToolbar() m_mainToolBar->AddSeparator(); - m_mainToolBar->AddTool( wxID_CUT, wxEmptyString, KiBitmap( cut_xpm ), - _( "Cut selected item" ) ); - - m_mainToolBar->AddTool( wxID_COPY, wxEmptyString, KiBitmap( copy_xpm ), - _( "Copy selected item" ) ); - m_mainToolBar->AddTool( wxID_PASTE, wxEmptyString, KiBitmap( paste_xpm ), _( "Paste" ) );