Select the number in the ranged number grid editor on edit start

Select the value of the ranged number grid editor when starting to edit
it, as is done for plain text and other editors, because this makes it
more convenient to replace the old value with the new one.

Closes https://github.com/wxWidgets/wxWidgets/pull/1626
This commit is contained in:
Ilya Sinitsyn
2019-10-31 19:47:12 +07:00
committed by Vadim Zeitlin
parent 9d24a13c4b
commit 58c302448f

View File

@@ -772,6 +772,9 @@ void wxGridCellNumberEditor::BeginEdit(int row, int col, wxGrid* grid)
if ( HasRange() )
{
Spin()->SetValue((int)m_value);
// Select all the text for convenience of editing and for compatibility
// with the plain text editor.
Spin()->SetSelection(-1, -1);
Spin()->SetFocus();
}
else