Cabbage Logo
Back to Cabbage Site

Encoder widget thoughts

The new encoder is looking great!

One thing to ask though, if I set increment to 0.001 I can’t see this reflected in the textbox() output as they will only show a minimum resolution of 0.01. Is there any way around this or can the textbox() adapt its resolution when initialised to the increment value defined? The other slider widgets textboxes have a similar resolution limit. Sometimes I supplant the textbox with a numberbox but typing into the numberbox won’t overwrite the encoder’s stored value.

I love the idea of having no minimum and maximum limit with the encoder but (and you’re going to hate me for this now) are there situations where it might be helpful to impose limits to prevent crashes and blow-ups depending on how the output value is used? Of course it could be limited within the Csound code but it would be nice if it were reflected in the textbox() value. I am thinking that the option of setting limits would be ideal but maybe this implies a fundamental rewrite.

This all sounds reasonable. Limits could potentially be set using the min() and max() identifiers. They are used for the new hrange and vrange sliders, and also the now deprecated hslider2, and vslider2. I’ll also take a look at the text box limitations.

I realise that fitting all the numbers into the textbox without an elliipsis ‘…’ is desirable but I think this can be left up to the user: if they need big numbers displayed without dots (as defined by range min and max) or very small fractions (as defined by incr value) then they should just create a bigger widget with a bigger textbox.

I’ve just pushed through a change that allows us to disable popuptext for sliders, even if textbox() is set to 0. This effectively lets us remove all value displays for sliders. We just pass a 0 to the popuptext() identifier. This makes it easier to use our own custom labels with sliders.