[ 1035247 ] fix the number of ticks in slider (with annotations)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29452 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -81,12 +81,16 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
|
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 ;
|
UInt16 tickMarks = 0 ;
|
||||||
if ( style & wxSL_AUTOTICKS )
|
if ( style & wxSL_AUTOTICKS )
|
||||||
tickMarks = (maxValue - minValue);
|
tickMarks = (maxValue - minValue) + 1; //+1 for the 0 value
|
||||||
|
|
||||||
if (tickMarks > 20)
|
while (tickMarks > 20)
|
||||||
tickMarks = tickMarks/5; //keep the number of tickmarks from becoming unwieldly
|
tickMarks /= 5; //keep the number of tickmarks from becoming unwieldly
|
||||||
|
|
||||||
m_peer = new wxMacControl() ;
|
m_peer = new wxMacControl() ;
|
||||||
verify_noerr ( CreateSliderControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds ,
|
verify_noerr ( CreateSliderControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds ,
|
||||||
|
Reference in New Issue
Block a user