"Clamped" DzIntSlider isn't really clamped

I've got the following code:

var sld = new DzIntSlider( wDlg );sld.label = "On position";sld.min = 1;sld.max = 2;sld.value = 1;sld.clamped = true;sld.labelVisible = true;wDlg.addWidget(sld);

When I run the script, the slider starts with a value of 1 and goes up to 2, but 0 is still an option. How is that possible if the min is set to 1? Shouldn't the min be the lowest possible setting?

Comments

  • GordigGordig Posts: 10,056

    I just tried an enumslider and a floatslider, just to see how they worked. I could bypass this issue by just using an enumslider, but I'm still curious about the answer, because the floatslider didn't fully respect that clamped minimum value either.

  • Cayman StudiosCayman Studios Posts: 1,135

    If you set the min after you've set the max the minimum value is respected.  Don't ask me why! 

  • GordigGordig Posts: 10,056

    How frustratingly arbitrary. Thank you.

  • fixmypcmikefixmypcmike Posts: 19,583

    If you set a minimum which is illogical (not less than the maximum), DS assumes you made a mistake.  Set the maximum first so that the minimum makes sense.

  • Richard HaseltineRichard Haseltine Posts: 100,888

    And if you ever want a negative maximum set the minimum first, so that there's room.

Sign In or Register to comment.