Handle block selection removal of libraries in FP_LIB_TABLE dialog

This commit is contained in:
Maciej Suminski 2017-08-15 11:56:05 +02:00
parent 0e41632105
commit 9447181a08
1 changed files with 9 additions and 0 deletions

View File

@ -413,11 +413,20 @@ private:
// If no candidate, just delete the row with the grid cursor. // If no candidate, just delete the row with the grid cursor.
wxArrayInt selectedRows = m_cur_grid->GetSelectedRows(); wxArrayInt selectedRows = m_cur_grid->GetSelectedRows();
wxGridCellCoordsArray cells = m_cur_grid->GetSelectedCells(); 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: // Add all row having cell selected to list:
for( unsigned ii = 0; ii < cells.GetCount(); ii++ ) for( unsigned ii = 0; ii < cells.GetCount(); ii++ )
selectedRows.Add( cells[ii].GetRow() ); 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: // Use the row having the grid cursor only if we have no candidate:
if( selectedRows.size() == 0 && getCursorRow() >= 0 ) if( selectedRows.size() == 0 && getCursorRow() >= 0 )
selectedRows.Add( getCursorRow() ); selectedRows.Add( getCursorRow() );