1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
16 #include "wx/slider.h"
17 #include "wx/osx/private.h"
19 wxWidgetImplType
* wxWidgetImpl::CreateSlider( wxWindowMac
* wxpeer
,
30 Rect bounds
= wxMacGetBoundsForControl( wxpeer
, pos
, size
);
32 if ( style
& wxSL_AUTOTICKS
)
33 tickMarks
= (maximum
- minimum
) + 1; // +1 for the 0 value
35 // keep the number of tickmarks from becoming unwieldly, therefore below it is ok to cast
37 while (tickMarks
> 20)
41 wxMacControl
* peer
= new wxMacControl( wxpeer
);
42 OSStatus err
= CreateSliderControl(
43 MAC_WXHWND(parent
->MacGetTopLevelWindowRef()), &bounds
,
44 value
, minimum
, maximum
,
45 kControlSliderPointsDownOrRight
,
46 (UInt16
) tickMarks
, true /* liveTracking */,
47 GetwxMacLiveScrollbarActionProc(),
48 peer
->GetControlRefAddr() );
54 #endif // wxUSE_SLIDER