From: Vadim Zeitlin Date: Wed, 28 Nov 2012 23:56:16 +0000 (+0000) Subject: Select the entire spin control contents when changing its value. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6ceeeafd563ff120631f3bb26ee2a2978a46d583 Select the entire spin control contents when changing its value. Selecting the entire contents makes it more convenient for the user to enter the new value. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73055 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/spinctlg.cpp b/src/generic/spinctlg.cpp index f5495046f2..d703bb566b 100644 --- a/src/generic/spinctlg.cpp +++ b/src/generic/spinctlg.cpp @@ -527,8 +527,7 @@ void wxSpinCtrlGenericBase::SetValue(const wxString& text) else // not a number at all or out of range { m_textCtrl->SetValue(text); - m_textCtrl->SetSelection(0, -1); - m_textCtrl->SetInsertionPointEnd(); + m_textCtrl->SelectAll(); } } @@ -559,7 +558,7 @@ bool wxSpinCtrlGenericBase::DoSetValue(double val) if ( !DoTextToValue(str, &m_value ) ) // wysiwyg for textctrl m_value = val; m_textCtrl->SetValue( str ); - m_textCtrl->SetInsertionPointEnd(); + m_textCtrl->SelectAll(); m_textCtrl->DiscardEdits(); return true; }