From 9447181a0872873a45d0c69b860e26f93781d118 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Tue, 15 Aug 2017 11:56:05 +0200 Subject: [PATCH] Handle block selection removal of libraries in FP_LIB_TABLE dialog --- pcbnew/dialogs/dialog_fp_lib_table.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pcbnew/dialogs/dialog_fp_lib_table.cpp b/pcbnew/dialogs/dialog_fp_lib_table.cpp index 08d981b569..fc8e9d747e 100644 --- a/pcbnew/dialogs/dialog_fp_lib_table.cpp +++ b/pcbnew/dialogs/dialog_fp_lib_table.cpp @@ -413,11 +413,20 @@ private: // If no candidate, just delete the row with the grid cursor. wxArrayInt selectedRows = m_cur_grid->GetSelectedRows(); wxGridCellCoordsArray cells = m_cur_grid->GetSelectedCells(); + wxGridCellCoordsArray blockTopLeft = m_cur_grid->GetSelectionBlockTopLeft(); + wxGridCellCoordsArray blockBotRight = m_cur_grid->GetSelectionBlockBottomRight(); // Add all row having cell selected to list: for( unsigned ii = 0; ii < cells.GetCount(); ii++ ) selectedRows.Add( cells[ii].GetRow() ); + // Handle block selection + if( !blockTopLeft.IsEmpty() && !blockBotRight.IsEmpty() ) + { + for( int i = blockTopLeft[0].GetRow(); i <= blockBotRight[0].GetRow(); ++i ) + selectedRows.Add( i ); + } + // Use the row having the grid cursor only if we have no candidate: if( selectedRows.size() == 0 && getCursorRow() >= 0 ) selectedRows.Add( getCursorRow() );