-
- else {
- m_macMinimumStatic = NULL ;
- m_macMaximumStatic = NULL ;
- m_macValueStatic = NULL ;
- }
-
- if(style & wxSL_VERTICAL) {
+
+ wxASSERT_MSG( !(style & wxSL_VERTICAL) || !(style & wxSL_HORIZONTAL),
+ _T("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
+ // is not as many ticks as there are values
+ //
+ UInt16 tickMarks = 0 ;
+ if ( style & wxSL_AUTOTICKS )
+ tickMarks = (maxValue - minValue) + 1; //+1 for the 0 value
+
+ // keep the number of tickmarks from becoming unwieldly
+ while (tickMarks > 20)
+ tickMarks /= 5;
+
+ m_peer = new wxMacControl( this );
+ verify_noerr ( CreateSliderControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds ,
+ value , minValue , maxValue , kControlSliderPointsDownOrRight , tickMarks , true /* liveTracking */ ,
+ GetwxMacLiveScrollbarActionProc() , m_peer->GetControlRefAddr() ) );
+
+ if (style & wxSL_VERTICAL)