Perspective Numeric Input

Hello All,

Has anyone found a way to use Bounds on a numeric entry similiar to vision where is warns user that input was out of range. All I can find so far is the invalid style where you can apply a style to the numeric input when the input is invalid.

Thanks,

Frank

props.inputBounds.minimum
props.inputBounds.maximum
these set a minimum/maximum to the input field, doesnt really give a warning tho

Hi victordcq,

Thanks for your reply. Yes, you are correct these do limit the input but I am looking to use the error bounds to warn them similiar to what is available in vision module.

sorry i havent used vision yet.
i suppose you can run a script that adds in a border or even a popup if the value is out of bounds or something

The minimum/maximum bounds will preclude a user from entering a value outside the defined range, but the only way to hook into what a user is supplying is as part of a property changeScript.

userValue = currentValue.value
min = self.custom.min
max = self.custom.max
if (userValue < min) or (userValue > max):
    self.props.value = previousValue.value
    system.perspective.openPopup(id="inv_nef_val", view="Popups/InvalidNEFValue", params={"min": min, "max": max}, title="Value out-of-bounds") 

Note that this is not preventing the user from supplying their invalid value - it is allowing it and then overriding it. Due to this, bindings on this value will receive the invalid value before it is immediately replaced with the previous valid value.

Is there any request in to add use bounds similiar to Vision as a feature in Perspective?

Not that I’m aware of.