+ wxCHECK_RET( m_textCtrl, wxT("invalid call to wxSpinCtrl::SetValue") );
+
+ double val;
+ if ( text.ToDouble(&val) && InRange(val) )
+ {
+ DoSetValue(val);
+ }
+ else // not a number at all or out of range
+ {
+ m_textCtrl->SetValue(text);
+ m_textCtrl->SetSelection(0, -1);
+ m_textCtrl->SetInsertionPointEnd();
+ }
+}
+
+bool wxSpinCtrlGenericBase::DoSetValue(double val)
+{
+ wxCHECK_MSG( m_textCtrl, false, wxT("invalid call to wxSpinCtrl::SetValue") );
+
+ if (!InRange(val))
+ return false;
+
+ if ( m_snap_to_ticks && (m_increment != 0) )
+ {
+ double snap_value = val / m_increment;