From 58c302448f9a3a88c6ee8661d088b18e352a0fbf Mon Sep 17 00:00:00 2001 From: Ilya Sinitsyn Date: Thu, 31 Oct 2019 19:47:12 +0700 Subject: [PATCH] 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 --- src/generic/grideditors.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/generic/grideditors.cpp b/src/generic/grideditors.cpp index c773f68dce..f8799997e3 100644 --- a/src/generic/grideditors.cpp +++ b/src/generic/grideditors.cpp @@ -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