X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..3c5487b14442ddbc6e43ee2f4475b5a6ba251fb1:/src/mac/carbon/spinbutt.cpp diff --git a/src/mac/carbon/spinbutt.cpp b/src/mac/carbon/spinbutt.cpp index 5ee91f60f3..7e8de83b09 100644 --- a/src/mac/carbon/spinbutt.cpp +++ b/src/mac/carbon/spinbutt.cpp @@ -6,7 +6,7 @@ // Created: 1998-01-01 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWidgets licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -30,6 +30,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxScrollEvent) #endif +extern ControlActionUPP wxMacLiveScrollbarActionUPP ; + wxSpinButton::wxSpinButton() : wxSpinButtonBase() { @@ -54,7 +56,7 @@ bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, c verify_noerr ( CreateLittleArrowsControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , 0 , m_min , m_max , 1 , (ControlRef*) &m_macControl ) ) ; - + SetControlAction( (ControlRef) m_macControl , wxMacLiveScrollbarActionUPP ) ; MacPostControlCreate(pos,size) ; return TRUE; @@ -148,8 +150,26 @@ void wxSpinButton::MacHandleValueChanged( int inc ) } } +void wxSpinButton::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) +{ + int nScrollInc = 0; + + switch( controlpart ) + { + case kControlUpButtonPart : + nScrollInc = 1; + break ; + case kControlDownButtonPart : + nScrollInc = -1; + break ; + } + MacHandleValueChanged( nScrollInc ) ; +} + wxInt32 wxSpinButton::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTREF event ) { + /* + // these have been handled by the live action proc already int nScrollInc = 0; wxMacCarbonEvent cEvent( (EventRef) event ) ; @@ -163,6 +183,7 @@ wxInt32 wxSpinButton::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVEN break ; } MacHandleValueChanged( nScrollInc ) ; + */ return noErr ; }