]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/spinbutt.cpp
missing commit, see #10269
[wxWidgets.git] / src / osx / carbon / spinbutt.cpp
index 2f6fc34266e0c3d2d0fde9d640da72e84623c04e..6b7a522a349f42001d6ecce61cfb0cae99c673e8 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
-// Name:        spinbutt.cpp
+// Name:        src/osx/carbon/spinbutt.cpp
 // Purpose:     wxSpinButton
 // Author:      Stefan Csomor
 // Modified by:
 // Purpose:     wxSpinButton
 // Author:      Stefan Csomor
 // Modified by:
 #include "wx/osx/private.h"
 
 
 #include "wx/osx/private.h"
 
 
-wxWidgetImplType* wxWidgetImpl::CreateSpinButton( wxWindowMac* wxpeer, 
-                                    wxWindowMac* parent, 
-                                    wxWindowID id, 
+wxWidgetImplType* wxWidgetImpl::CreateSpinButton( wxWindowMac* wxpeer,
+                                    wxWindowMac* parent,
+                                    wxWindowID WXUNUSED(id),
                                     wxInt32 value,
                                     wxInt32 minimum,
                                     wxInt32 maximum,
                                     wxInt32 value,
                                     wxInt32 minimum,
                                     wxInt32 maximum,
-                                    const wxPoint& pos, 
+                                    const wxPoint& pos,
                                     const wxSize& size,
                                     const wxSize& size,
-                                    long style, 
-                                    long extraStyle)
+                                    long WXUNUSED(style),
+                                    long WXUNUSED(extraStyle))
 {
     Rect bounds = wxMacGetBoundsForControl( wxpeer , pos , size );
 
     wxMacControl* peer = new wxMacControl( wxpeer );
     OSStatus err = CreateLittleArrowsControl(
 {
     Rect bounds = wxMacGetBoundsForControl( wxpeer , pos , size );
 
     wxMacControl* peer = new wxMacControl( wxpeer );
     OSStatus err = CreateLittleArrowsControl(
-        MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds, value, 
+        MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds, value,
         minimum, maximum, 1, peer->GetControlRefAddr() );
     verify_noerr( err );
 
         minimum, maximum, 1, peer->GetControlRefAddr() );
     verify_noerr( err );
 
@@ -40,75 +40,4 @@ wxWidgetImplType* wxWidgetImpl::CreateSpinButton( wxWindowMac* wxpeer,
     return peer ;
 }
 
     return peer ;
 }
 
-void wxSpinButton::MacHandleControlClick(WXWidget WXUNUSED(control),
-                                         wxInt16 controlpart,
-                                         bool WXUNUSED(mouseStillDown))
-{
-    int inc = 0;
-
-    switch ( controlpart )
-    {
-    case kControlUpButtonPart :
-        inc = 1;
-        break;
-
-    case kControlDownButtonPart :
-        inc = -1;
-        break;
-
-    default:
-        break;
-    }
-    
-    // trigger scroll events
-    
-    wxEventType scrollEvent = wxEVT_NULL;
-    int oldValue = GetValue() ;
-
-    int newValue = oldValue + inc;
-
-    if (newValue < m_min)
-    {
-        if ( m_windowStyle & wxSP_WRAP )
-            newValue = m_max;
-        else
-            newValue = m_min;
-    }
-
-    if (newValue > m_max)
-    {
-        if ( m_windowStyle & wxSP_WRAP )
-            newValue = m_min;
-        else
-            newValue = m_max;
-    }
-
-    if ( newValue - oldValue == -1 )
-        scrollEvent = wxEVT_SCROLL_LINEDOWN;
-    else if ( newValue - oldValue == 1 )
-        scrollEvent = wxEVT_SCROLL_LINEUP;
-    else
-        scrollEvent = wxEVT_SCROLL_THUMBTRACK;
-
-    // Do not send an event if the value has not actually changed
-    // (Also works for wxSpinCtrl)
-    if ( newValue == oldValue )
-        return;
-
-    if ( scrollEvent != wxEVT_SCROLL_THUMBTRACK )
-    {
-        wxSpinEvent event( scrollEvent, m_windowId );
-
-        event.SetPosition( newValue );
-        event.SetEventObject( this );
-        if ((HandleWindowEvent( event )) && !event.IsAllowed())
-            newValue = oldValue;
-    }
-
-    m_peer->SetValue( newValue );
-
-    // always send a thumbtrack event
-    SendThumbTrackEvent() ;
-}
-
 #endif // wxUSE_SPINBTN
 #endif // wxUSE_SPINBTN