Finish editing on Enter in cells in the last shown row of wxGrid
Previously, pressing Enter in a cell of a row which wasn't the last one, but was the last shown one, didn't do anything because we explicitly checked whether the cell was in the last row and not in the last visible row, but MoveCursorDown() doesn't move the cursor for the latter, and not just for the former. Fix this by avoiding any row checks at all and just calling MoveCursorDown() in any case and DisableCellEditControl() if it didn't do anything. Closes #18754.
This commit is contained in:
@@ -5707,13 +5707,11 @@ void wxGrid::OnKeyDown( wxKeyEvent& event )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( GetGridCursorRow() < GetNumberRows()-1 )
|
if ( !MoveCursorDown( event.ShiftDown() ) )
|
||||||
{
|
{
|
||||||
MoveCursorDown( event.ShiftDown() );
|
// Normally this would be done by MoveCursorDown(), but
|
||||||
}
|
// if it failed to move the cursor, e.g. because we're
|
||||||
else
|
// at the bottom of a column, do it here.
|
||||||
{
|
|
||||||
// at the bottom of a column
|
|
||||||
DisableCellEditControl();
|
DisableCellEditControl();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user