]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/slider.cpp
re-enable using our own resize grip with GTK3, themes can (and do) disable the native...
[wxWidgets.git] / src / osx / carbon / slider.cpp
index b471a01680f00e17d844ffca1656ce18a95b46c7..ad2bc14334f2e7230bd4feb106772570e976a095 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        slider.cpp
+// Name:        src/osx/carbon/slider.cpp
 // Purpose:     wxSlider
 // Author:      Stefan Csomor
 // Modified by:
 #include "wx/slider.h"
 #include "wx/osx/private.h"
 
+class wxMacSliderCarbonControl : public wxMacControl
+{
+public :
+    wxMacSliderCarbonControl( wxWindowMac* peer ) : wxMacControl( peer )
+    {
+    }
+    
+    // work around an OSX bug : if the control is having the keyboard focus it cannot
+    // be set to the full max/min values by dragging
+    virtual bool CanFocus() const
+    { 
+        return false; 
+    }
+};
+
+
 wxWidgetImplType* wxWidgetImpl::CreateSlider( wxWindowMac* wxpeer,
                                     wxWindowMac* parent,
                                     wxWindowID WXUNUSED(id),
@@ -32,13 +48,13 @@ wxWidgetImplType* wxWidgetImpl::CreateSlider( wxWindowMac* wxpeer,
     if ( style & wxSL_AUTOTICKS )
         tickMarks = (maximum - minimum) + 1; // +1 for the 0 value
 
-    // keep the number of tickmarks from becoming unwieldly, therefore below it is ok to cast
+    // keep the number of tickmarks from becoming unwieldy, therefore below it is ok to cast
     // it to a UInt16
     while (tickMarks > 20)
         tickMarks /= 5;
 
 
-    wxMacControl* peer = new wxMacControl( wxpeer );
+    wxMacControl* peer = new wxMacSliderCarbonControl( wxpeer );
     OSStatus err = CreateSliderControl(
         MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds,
         value, minimum, maximum,