]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/scrolbar.cpp
check that the version of __sync_sub_and_fetch that returns a value is supported...
[wxWidgets.git] / src / mac / carbon / scrolbar.cpp
index f6f9bc4cfc5aace39b6cbb397235e9e237fd7e11..c7c1263451387280267f40ea5cfe4fdc9071b4c7 100644 (file)
 
 #include "wx/wxprec.h"
 
+#include "wx/scrolbar.h"
+
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/settings.h"
 #endif
 
-#include "wx/scrolbar.h"
 #include "wx/mac/uma.h"
 
 IMPLEMENT_DYNAMIC_CLASS(wxScrollBar, wxControl)
@@ -67,7 +69,11 @@ int wxScrollBar::GetThumbPosition() const
     return m_peer->GetValue();
 }
 
-void wxScrollBar::SetScrollbar( int position, int thumbSize, int range, int pageSize, bool refresh )
+void wxScrollBar::SetScrollbar( int position,
+                                int thumbSize,
+                                int range,
+                                int pageSize,
+                                bool WXUNUSED(refresh) )
 {
     m_pageSize = pageSize;
     m_viewSize = thumbSize;
@@ -87,7 +93,7 @@ void wxScrollBar::Command( wxCommandEvent& event )
     ProcessCommand( event );
 }
 
-void wxScrollBar::MacHandleControlClick( WXWidget control, wxInt16 controlpart, bool mouseStillDown )
+void wxScrollBar::MacHandleControlClick( WXWidget WXUNUSED(control), wxInt16 controlpart, bool mouseStillDown )
 {
     int position = m_peer->GetValue();
     int minPos = m_peer->GetMinimum();
@@ -159,10 +165,10 @@ void wxScrollBar::MacHandleControlClick( WXWidget control, wxInt16 controlpart,
         // this is hardcoded
         window->MacOnScroll( event );
     else
-        GetEventHandler()->ProcessEvent( event );
+        HandleWindowEvent( event );
 }
 
-wxInt32 wxScrollBar::MacControlHit( WXEVENTHANDLERREF handler, WXEVENTREF mevent )
+wxInt32 wxScrollBar::MacControlHit( WXEVENTHANDLERREF WXUNUSED(handler), WXEVENTREF mevent )
 {
     int position = m_peer->GetValue();
     int minPos = m_peer->GetMinimum();
@@ -215,7 +221,27 @@ wxInt32 wxScrollBar::MacControlHit( WXEVENTHANDLERREF handler, WXEVENTREF mevent
         // this is hardcoded
         window->MacOnScroll( event );
     else
-        GetEventHandler()->ProcessEvent( event );
+        HandleWindowEvent( event );
 
     return noErr;
 }
+
+
+wxSize wxScrollBar::DoGetBestSize() const
+{
+    int w = 100;
+    int h = 100;
+
+    if ( IsVertical() )
+    {
+        w = wxSystemSettings::GetMetric(wxSYS_VSCROLL_X);
+    }
+    else
+    {
+        h = wxSystemSettings::GetMetric(wxSYS_HSCROLL_Y);
+    }
+
+    wxSize best(w, h);
+    CacheBestSize(best);
+    return best;
+}