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
This commit is contained in:
@@ -527,8 +527,7 @@ void wxSpinCtrlGenericBase::SetValue(const wxString& text)
|
|||||||
else // not a number at all or out of range
|
else // not a number at all or out of range
|
||||||
{
|
{
|
||||||
m_textCtrl->SetValue(text);
|
m_textCtrl->SetValue(text);
|
||||||
m_textCtrl->SetSelection(0, -1);
|
m_textCtrl->SelectAll();
|
||||||
m_textCtrl->SetInsertionPointEnd();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -559,7 +558,7 @@ bool wxSpinCtrlGenericBase::DoSetValue(double val)
|
|||||||
if ( !DoTextToValue(str, &m_value ) ) // wysiwyg for textctrl
|
if ( !DoTextToValue(str, &m_value ) ) // wysiwyg for textctrl
|
||||||
m_value = val;
|
m_value = val;
|
||||||
m_textCtrl->SetValue( str );
|
m_textCtrl->SetValue( str );
|
||||||
m_textCtrl->SetInsertionPointEnd();
|
m_textCtrl->SelectAll();
|
||||||
m_textCtrl->DiscardEdits();
|
m_textCtrl->DiscardEdits();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user