+
+ wxASSERT_MSG( !(style & wxSL_VERTICAL) || !(style & wxSL_HORIZONTAL),
+ wxT("incompatible slider direction and orientation") );
+
+ if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
+ return false;
+
+ Rect bounds = wxMacGetBoundsForControl( this , pos , size );
+
+ // NB: (RN) Ticks here are sometimes off in the GUI if there
+ // are not as many tick marks as there are values
+ //
+ int tickMarks = 0;
+ if ( style & wxSL_AUTOTICKS )
+ tickMarks = (maxValue - minValue) + 1; // +1 for the 0 value
+
+ // keep the number of tickmarks from becoming unwieldly, therefore below it is ok to cast
+ // it to a UInt16
+ while (tickMarks > 20)
+ tickMarks /= 5;
+
+ m_peer = new wxMacControl( this );
+ OSStatus err = CreateSliderControl(
+ MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds,
+ value, minValue, maxValue,
+ kControlSliderPointsDownOrRight,
+ (UInt16) tickMarks, true /* liveTracking */,
+ GetwxMacLiveScrollbarActionProc(),
+ m_peer->GetControlRefAddr() );
+ verify_noerr( err );
+
+ if (style & wxSL_VERTICAL)
+ // Forces SetSize to use the proper width
+ SetSizeHints(10, -1, 10, -1);
+ else
+ // Forces SetSize to use the proper height
+ SetSizeHints(-1, 10, -1, 10);
+
+ // NB: SetSizeHints is overloaded by wxSlider and will substitute 10 with the