+void wxSpinCtrlGenericBase::SetSnapToTicks(bool snap_to_ticks)
+{
+ m_snap_to_ticks = snap_to_ticks;
+ DoSetValue(m_value);
+}
+
+void wxSpinCtrlGenericBase::SetSelection(long from, long to)
+{
+ wxCHECK_RET( m_textCtrl, wxT("invalid call to wxSpinCtrl::SetSelection") );
+
+ m_textCtrl->SetSelection(from, to);
+}
+
+#ifndef wxHAS_NATIVE_SPINCTRL
+
+//-----------------------------------------------------------------------------
+// wxSpinCtrl
+//-----------------------------------------------------------------------------
+
+void wxSpinCtrl::DoSendEvent()
+{
+ wxSpinEvent event( wxEVT_COMMAND_SPINCTRL_UPDATED, GetId());
+ event.SetEventObject( this );
+ event.SetPosition((int)(m_value + 0.5)); // FIXME should be SetValue
+ event.SetString(m_textCtrl->GetValue());
+ GetEventHandler()->ProcessEvent( event );
+}
+
+#endif // !wxHAS_NATIVE_SPINCTRL
+
+//-----------------------------------------------------------------------------
+// wxSpinCtrlDouble
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrlDouble, wxSpinCtrlGenericBase)
+
+void wxSpinCtrlDouble::DoSendEvent()
+{
+ wxSpinDoubleEvent event( wxEVT_COMMAND_SPINCTRLDOUBLE_UPDATED, GetId());
+ event.SetEventObject( this );
+ event.SetValue(m_value);
+ event.SetString(m_textCtrl->GetValue());
+ GetEventHandler()->ProcessEvent( event );
+}
+
+void wxSpinCtrlDouble::SetDigits(unsigned digits)
+{
+ wxCHECK_RET( digits <= 20, "too many digits for wxSpinCtrlDouble" );
+
+ if ( digits == m_digits )
+ return;
+
+ m_digits = digits;
+
+ m_format.Printf(wxT("%%0.%ulf"), digits);
+
+ DoSetValue(m_value);
+}
+
+#endif // wxUSE_SPINBTN
+