Re: Counters

Tristan (tristan@creative.net)
Wed, 19 Mar 1997 23:01:04 -0800

To subscribers of the xforms list from Tristan <tristan@creative.net> :

Dr. T.C. Zhao wrote:
>
> To subscribers of the xforms list from "Dr. T.C. Zhao" <zhao@bragg.phys.uwm.edu> :
>
> From: rander+@postbox.ius.cs.cmu.edu
> >I just realized that I can set a counter to a value outside its
> >valid range. For example,
> > fl_set_counter_bounds (mycounter, 0.0, 10.0);
> > fl_set_counter_value (mycounter, -1.0);
>
> > double newval = fl_get_counter_value (mycounter);
> >then newval will be set to -1 too.
>
> >Is this behavior desirable for some reason?
>
> No, not really. Unless someone violently objects
> (and convinces me it's a bad idea), I will change set_counter_value
> so value will be clamped to the bounds.

I just make sure that if you clamp counters, you also clamp
sliders (for the sake of consistency).

I know for a fact that xforms 0.81 allows setting slider
values outside of their range (and in that case, the
slider "knob" become invisible).

Personally I don't mind one way or the other (i.e. clamp
or don't clamp), but:

1) There should be consistency between counters and sliders

2) Some people may rely on the current "don't clamp" behavior.
I think that if you want to enforce clamping, it is easy to
do it in your application (as long as xforms provides
access to the bounds). So I don't think that xforms is
"broken" the way it is, and I am not sure it should be fixed.

-- 
Regards, -- Tristan Savatier (mailto:tristan@mpegtv.com)
           
MpegTV website:   /cgi-bin/exit-to?http://www.mpegtv.com
MPEG.ORG website: http://www.mpeg.org
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
Xforms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/xforms-archive/