When deleting pin row, show new highlight

When the user deletes a pin row, they need to see which row is now
selected for them to delete again.  Otherwise, deleting will have
unexpected consequences
This commit is contained in:
Seth Hillbrand 2021-09-28 09:29:55 -07:00
parent fda7d68243
commit 880f209563
1 changed files with 4 additions and 2 deletions

View File

@ -646,9 +646,11 @@ void DIALOG_LIB_EDIT_PIN_TABLE::OnDeleteRow( wxCommandEvent& event )
for( auto pin : removedRow )
m_pins.erase( std::find( m_pins.begin(), m_pins.end(), pin ) );
curRow = std::max( 0, curRow - 1 );
m_grid->MakeCellVisible( curRow, m_grid->GetGridCursorCol() );
curRow = std::min( curRow, m_grid->GetRows() - 1 );
m_grid->GoToCell( curRow, m_grid->GetGridCursorCol() );
m_grid->SetGridCursor( curRow, m_grid->GetGridCursorCol() );
m_grid->SelectRow( curRow );
updateSummary();
}