+ wxWidgetCocoaImpl::mouseEvent(event, slf, _cmd);
+}
+
+void wxSpinButtonCocoaImpl::controlAction( WXWidget WXUNUSED(slf), void *WXUNUSED(_cmd), void *WXUNUSED(sender))
+{
+ wxWindow* wxpeer = (wxWindow*) GetWXPeer();
+ if ( wxpeer )
+ {
+ // because wx expects to be able to veto
+ // a change we must revert the value change
+ // and expose it
+ int currentValue = [(NSStepper*)m_osxView intValue];
+ [(NSStepper*)m_osxView setIntValue:m_formerValue];
+ int inc = currentValue-m_formerValue;
+
+ // adjust for wrap arounds
+ if ( inc > 1 )
+ inc = -1;
+ else if (inc < -1 )
+ inc = 1;
+
+ if ( inc == 1 )
+ wxpeer->TriggerScrollEvent(wxEVT_SCROLL_LINEUP);
+ else if ( inc == -1 )
+ wxpeer->TriggerScrollEvent(wxEVT_SCROLL_LINEDOWN);
+
+ m_formerValue = [(NSStepper*)m_osxView intValue];
+ }
+}