|
|
|
|
@ -25,6 +25,10 @@ class _Float(DOMWidget):
|
|
|
|
|
disabled = Bool(False, help="Enable or disable user changes", sync=True)
|
|
|
|
|
description = Unicode(help="Description of the value this widget represents", sync=True)
|
|
|
|
|
|
|
|
|
|
def __init__(self, value=None, **kwargs):
|
|
|
|
|
if value is not None:
|
|
|
|
|
kwargs['value'] = value
|
|
|
|
|
super(_Float, self).__init__(**kwargs)
|
|
|
|
|
|
|
|
|
|
class _BoundedFloat(_Float):
|
|
|
|
|
max = CFloat(100.0, help="Max value", sync=True)
|
|
|
|
|
@ -33,7 +37,7 @@ class _BoundedFloat(_Float):
|
|
|
|
|
|
|
|
|
|
def __init__(self, *pargs, **kwargs):
|
|
|
|
|
"""Constructor"""
|
|
|
|
|
DOMWidget.__init__(self, *pargs, **kwargs)
|
|
|
|
|
super(_BoundedFloat, self).__init__(*pargs, **kwargs)
|
|
|
|
|
self._validate('value', None, self.value)
|
|
|
|
|
self.on_trait_change(self._validate, ['value', 'min', 'max'])
|
|
|
|
|
|
|
|
|
|
|