X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/524c47aa3adf2af11a3069fd5da035a604f08f66..ec2df34e27ba41f202ecbf096cdfed082a9ddb8f:/src/osx/carbon/scrolbar.cpp diff --git a/src/osx/carbon/scrolbar.cpp b/src/osx/carbon/scrolbar.cpp index 7fc53b8ae5..53487b5e8e 100644 --- a/src/osx/carbon/scrolbar.cpp +++ b/src/osx/carbon/scrolbar.cpp @@ -27,8 +27,8 @@ public : wxOSXScrollBarCarbonImpl( wxWindowMac* peer) : wxMacControl( peer ) { } - - void SetScrollThumb( wxInt32 value, wxInt32 thumbSize ) + + void SetScrollThumb( wxInt32 value, wxInt32 thumbSize ) { SetValue( value ); SetControlViewSize(m_controlRef , thumbSize ); @@ -36,13 +36,13 @@ public : protected: }; -wxWidgetImplType* wxWidgetImpl::CreateScrollBar( wxWindowMac* wxpeer, - wxWindowMac* parent, - wxWindowID id, - const wxPoint& pos, +wxWidgetImplType* wxWidgetImpl::CreateScrollBar( wxWindowMac* wxpeer, + wxWindowMac* parent, + wxWindowID WXUNUSED(id), + const wxPoint& pos, const wxSize& size, - long style, - long extraStyle) + long WXUNUSED(style), + long WXUNUSED(extraStyle)) { Rect bounds = wxMacGetBoundsForControl( wxpeer, pos, size ); @@ -55,81 +55,3 @@ wxWidgetImplType* wxWidgetImpl::CreateScrollBar( wxWindowMac* wxpeer, verify_noerr( err ); return peer; } - -void wxScrollBar::MacHandleControlClick( WXWidget WXUNUSED(control), wxInt16 controlpart, bool mouseStillDown ) -{ -#if wxOSX_USE_CARBON - - int position = m_peer->GetValue(); - int minPos = 0 ; - int maxPos = m_peer->GetMaximum(); - - wxEventType scrollEvent = wxEVT_NULL; - int nScrollInc = 0; - - // all events have already been reported during mouse down, except for THUMBRELEASE - if ( !mouseStillDown && controlpart != kControlIndicatorPart ) - return; - - switch ( controlpart ) - { - case kControlUpButtonPart: - nScrollInc = -1; - scrollEvent = wxEVT_SCROLL_LINEUP; - break; - - case kControlDownButtonPart: - nScrollInc = 1; - scrollEvent = wxEVT_SCROLL_LINEDOWN; - break; - - case kControlPageUpPart: - nScrollInc = -m_pageSize; - scrollEvent = wxEVT_SCROLL_PAGEUP; - break; - - case kControlPageDownPart: - nScrollInc = m_pageSize; - scrollEvent = wxEVT_SCROLL_PAGEDOWN; - break; - - case kControlIndicatorPart: - nScrollInc = 0; - if ( mouseStillDown ) - scrollEvent = wxEVT_SCROLL_THUMBTRACK; - else - scrollEvent = wxEVT_SCROLL_THUMBRELEASE; - break; - - default: - wxFAIL_MSG(wxT("unknown scrollbar selector")); - break; - } - - int new_pos = position + nScrollInc; - - if (new_pos < minPos) - new_pos = minPos; - else if (new_pos > maxPos) - new_pos = maxPos; - - if ( nScrollInc ) - SetThumbPosition( new_pos ); - - wxScrollEvent event( scrollEvent, m_windowId ); - if ( m_windowStyle & wxHORIZONTAL ) - event.SetOrientation( wxHORIZONTAL ); - else - event.SetOrientation( wxVERTICAL ); - - event.SetPosition( new_pos ); - event.SetEventObject( this ); - - wxWindow* window = GetParent(); - if (window && window->MacIsWindowScrollbar( this )) - // this is hardcoded - window->MacOnScroll( event ); - else - HandleWindowEvent( event ); -#endif -} \ No newline at end of file