From 64be92e214af53f719e447f961f37e5e5ad5bf0f Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Mon, 31 May 2004 15:54:59 +0000 Subject: [PATCH] continued spinning committed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27535 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/mac/carbon/spinbutt.h | 1 + src/mac/carbon/spinbutt.cpp | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/include/wx/mac/carbon/spinbutt.h b/include/wx/mac/carbon/spinbutt.h index 8c9295a5d2..e7a85f5f0f 100644 --- a/include/wx/mac/carbon/spinbutt.h +++ b/include/wx/mac/carbon/spinbutt.h @@ -64,6 +64,7 @@ public: // implementation + virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ; protected: diff --git a/src/mac/carbon/spinbutt.cpp b/src/mac/carbon/spinbutt.cpp index 30d3076417..7e8de83b09 100644 --- a/src/mac/carbon/spinbutt.cpp +++ b/src/mac/carbon/spinbutt.cpp @@ -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 ; } -- 2.45.2