X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/80fdcdb90ef779185492dab676d461fc34933312..538f284a44001ff8285eaafebcc384bf638b5d66:/src/osx/carbon/slider.cpp?ds=inline diff --git a/src/osx/carbon/slider.cpp b/src/osx/carbon/slider.cpp index 60beb5b99d..3076376622 100644 --- a/src/osx/carbon/slider.cpp +++ b/src/osx/carbon/slider.cpp @@ -16,6 +16,22 @@ #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), @@ -38,7 +54,7 @@ wxWidgetImplType* wxWidgetImpl::CreateSlider( wxWindowMac* wxpeer, tickMarks /= 5; - wxMacControl* peer = new wxMacControl( wxpeer ); + wxMacControl* peer = new wxMacSliderCarbonControl( wxpeer ); OSStatus err = CreateSliderControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds, value, minimum, maximum,