From 7c54fc9c4662678049cac9a053727735a5d2f4b4 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 1 May 2019 21:16:20 +0100 Subject: [PATCH] Cleanup. --- eeschema/sch_edit_frame.cpp | 1 - eeschema/sch_edit_frame.h | 1 - eeschema/schedit.cpp | 45 ------------------------------------- 3 files changed, 47 deletions(-) diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 100b2efde9..57af5dd8d4 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -270,7 +270,6 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME ) EVT_TOOL( ID_SIM_SHOW, SCH_EDIT_FRAME::OnSimulate ) #endif /* KICAD_SPICE */ - EVT_MENU( ID_CANCEL_CURRENT_COMMAND, SCH_EDIT_FRAME::OnCancelCurrentCommand ) EVT_MENU_RANGE( ID_POPUP_START_RANGE, ID_POPUP_END_RANGE, SCH_EDIT_FRAME::Process_Special_Functions ) EVT_MENU( ID_SCH_UNFOLD_BUS, SCH_EDIT_FRAME::OnUnfoldBusHotkey ) diff --git a/eeschema/sch_edit_frame.h b/eeschema/sch_edit_frame.h index b069ba5abc..72574ee901 100644 --- a/eeschema/sch_edit_frame.h +++ b/eeschema/sch_edit_frame.h @@ -829,7 +829,6 @@ private: // another library void OnEditComponentSymbolsId( wxCommandEvent& aEvent ); void OnPreferencesOptions( wxCommandEvent& event ); - void OnCancelCurrentCommand( wxCommandEvent& aEvent ); /** * Command event handler for duplicating the item at the current location. diff --git a/eeschema/schedit.cpp b/eeschema/schedit.cpp index 10b6a55f30..81154b702d 100644 --- a/eeschema/schedit.cpp +++ b/eeschema/schedit.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -43,7 +42,6 @@ #include #include #include -#include #include #include #include @@ -62,12 +60,9 @@ // If needed, stop the current command and deselect current tool switch( id ) { - case ID_POPUP_CANCEL_CURRENT_COMMAND: case ID_POPUP_SCH_CLEANUP_SHEET: case ID_POPUP_IMPORT_HLABEL_TO_SHEETPIN: case ID_POPUP_SCH_EDIT_CONVERT_CMP: - case ID_POPUP_SCH_ADD_JUNCTION: - case ID_POPUP_SCH_ADD_LABEL: /* At this point: Do nothing. these commands do not need to stop the * current command (mainly a block command) or reset the current state * They will be executed later, in next switch structure. @@ -80,8 +75,6 @@ break; } - item = screen->GetCurItem(); // Can be modified by previous calls. - switch( id ) { case ID_HIERARCHY: @@ -89,18 +82,6 @@ SetRepeatItem( NULL ); break; - case ID_POPUP_CANCEL_CURRENT_COMMAND: - if( m_canvas->IsMouseCaptured() ) - { - m_canvas->EndMouseCapture(); - SetToolID( GetToolId(), GetGalCanvas()->GetCurrentCursor(), wxEmptyString ); - } - else - { - SetNoToolSelected(); - } - break; - case ID_POPUP_SCH_CLEANUP_SHEET: if( item != NULL && item->Type() == SCH_SHEET_T ) { @@ -156,32 +137,6 @@ void SCH_EDIT_FRAME::OnUnfoldBus( wxCommandEvent& event ) } -void SCH_EDIT_FRAME::OnCancelCurrentCommand( wxCommandEvent& aEvent ) -{ - SCH_SCREEN* screen = GetScreen(); - - if( screen->IsBlockActive() ) - { - GetCanvas()->SetCursor( (wxStockCursor) GetGalCanvas()->GetDefaultCursor() ); - screen->ClearBlockCommand(); - - // Stop the current command (if any) but keep the current tool - m_canvas->EndMouseCapture(); - } - else - { - if( m_canvas->IsMouseCaptured() ) // Stop the current command but keep the current tool - m_canvas->EndMouseCapture(); - else // Deselect current tool - m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, GetGalCanvas()->GetDefaultCursor() ); - } - - GetCanvas()->GetView()->ClearHiddenFlags(); - GetCanvas()->GetView()->ClearPreview(); - GetCanvas()->GetView()->ShowPreview( false ); -} - - void SCH_EDIT_FRAME::OnUpdateSelectTool( wxUpdateUIEvent& aEvent ) { if( aEvent.GetEventObject() == m_drawToolBar || aEvent.GetEventObject() == m_mainToolBar )