]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/scrolbar.cpp
use correct scale when drawing
[wxWidgets.git] / src / osx / carbon / scrolbar.cpp
index 7fc53b8ae52657ddfa3b424eb7f15e6986582510..53487b5e8e20645aea6351410822e2a5a6aa1a1e 100644 (file)
@@ -27,8 +27,8 @@ public :
     wxOSXScrollBarCarbonImpl( wxWindowMac* peer) : wxMacControl( peer )
     {
     }
     wxOSXScrollBarCarbonImpl( wxWindowMac* peer) : wxMacControl( peer )
     {
     }
-    
-    void    SetScrollThumb( wxInt32 value, wxInt32 thumbSize ) 
+
+    void    SetScrollThumb( wxInt32 value, wxInt32 thumbSize )
     {
         SetValue( value );
         SetControlViewSize(m_controlRef , thumbSize );
     {
         SetValue( value );
         SetControlViewSize(m_controlRef , thumbSize );
@@ -36,13 +36,13 @@ public :
 protected:
 };
 
 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,
                                     const wxSize& size,
-                                    long style, 
-                                    long extraStyle)
+                                    long WXUNUSED(style),
+                                    long WXUNUSED(extraStyle))
 {
     Rect bounds = wxMacGetBoundsForControl( wxpeer, pos, size );
 
 {
     Rect bounds = wxMacGetBoundsForControl( wxpeer, pos, size );
 
@@ -55,81 +55,3 @@ wxWidgetImplType* wxWidgetImpl::CreateScrollBar( wxWindowMac* wxpeer,
     verify_noerr( err );
     return peer;
 }
     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