X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/facd6764872eede45605ba7c9dfa0e1d0c708fa2..30e0b1c9720fcef5fb2fa0969ef4cc12a168cf97:/src/mac/carbon/spinbutt.cpp diff --git a/src/mac/carbon/spinbutt.cpp b/src/mac/carbon/spinbutt.cpp index c9140dc626..30d3076417 100644 --- a/src/mac/carbon/spinbutt.cpp +++ b/src/mac/carbon/spinbutt.cpp @@ -51,11 +51,9 @@ bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, c return FALSE; Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ; - - m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , "\p" , true , 0 , 0 , 100, - kControlLittleArrowsProc , (long) this ) ; - - wxASSERT_MSG( (ControlRef) m_macControl != NULL , wxT("No valid mac control") ) ; + + verify_noerr ( CreateLittleArrowsControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , 0 , m_min , m_max , 1 , + (ControlRef*) &m_macControl ) ) ; MacPostControlCreate(pos,size) ; @@ -150,14 +148,12 @@ void wxSpinButton::MacHandleValueChanged( int inc ) } } -void wxSpinButton::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED(mouseStillDown)) +wxInt32 wxSpinButton::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTREF event ) { - if ( (ControlRef) m_macControl == NULL ) - return ; - int nScrollInc = 0; + wxMacCarbonEvent cEvent( (EventRef) event ) ; - switch( controlpart ) + switch( cEvent.GetParameter(kEventParamControlPart,typeControlPartCode) ) { case kControlUpButtonPart : nScrollInc = 1; @@ -167,7 +163,7 @@ void wxSpinButton::MacHandleControlClick( WXWidget control , wxInt16 controlpart break ; } MacHandleValueChanged( nScrollInc ) ; - + return noErr ; } // ----------------------------------------------------------------------------