+ event.Skip();
+
+ // Sync the textctrl since the user expects that the button will modify
+ // what they see in the textctrl.
+ if ( m_textCtrl && m_textCtrl->IsModified() )
+ SyncSpinToText();
+
+ int spin_value = event.GetPosition();
+ double step = (event.GetEventType() == wxEVT_SCROLL_LINEUP) ? 1 : -1;
+
+ // Use the spinbutton's acceleration, if any, but not if wrapping around
+ if (((spin_value >= 0) && (m_spin_value >= 0)) || ((spin_value <= 0) && (m_spin_value <= 0)))
+ step *= abs(spin_value - m_spin_value);
+
+ double value = m_value + step*m_increment;
+
+ // we can always reach the ends using the spinbutton
+ if (value < m_min) value = m_min;
+ if (value > m_max) value = m_max;