enaml.stdlib.slider_transform

Classes

SliderTransform

A base class for creating declarative slider transforms.

FloatTransform

A concreted SliderTransform for floating point values.

class enaml.stdlib.slider_transform.SliderTransform(parent=None, **kwargs)[source]

Bases: Declarative

A base class for creating declarative slider transforms.

A SliderTransform must be subclassed to be useful. The abstract api defined below must be implemented by the subclass.

When using a transform with a slider, the transform takes complete ownership of the slider range. No effort is made to observe outside changes to the slider range, so all changes should be made on the transform.

minimum

The data-space minimum for the transform. This may be redefined by a subclass to enforce stronger typing.

maximum

The data-space maximum for the transform. This may be redefined by a subclass to enforce stronger typing.

value

The data-space value for the transform. This may be redefined by a subclass to enforce stronger typing.

initialize()[source]

A reimplemented initialization handler.

The parent slider values are initialized during the transform initialization pass.

parent_changed(old, new)[source]

Handle the parent changed event for the transform.

get_minimum()[source]

Get the minimum value of the transform as an int.

Returns:

result – The minimum value of the transform converted to an int.

Return type:

int

get_maximum()[source]

Get the maximum value of the transform as an int.

Returns:

result – The maximum value of the transform converted to an int.

Return type:

int

get_value()[source]

Get the value of the transform as an int.

Returns:

result – The value of the transform converted to an int.

Return type:

int

set_value(value)[source]

Set the value of the transform from an int.

Parameters:

value (int) – The integer value of the slider.

class enaml.stdlib.slider_transform.FloatTransform(parent=None, **kwargs)[source]

Bases: SliderTransform

A concreted SliderTransform for floating point values.

minimum

A redeclared parent class member which enforces float values.

maximum

A redeclared parent class member which enforces float values.

value

A redeclared parent class member which enforces float values.

precision

The number of stops to use between the minimum and maximum.

get_minimum()[source]

Get the minimum value of the transform as an int.

Returns:

result – The minimum value of the transform converted to an int.

Return type:

int

get_maximum()[source]

Get the maximum value of the transform as an int.

Returns:

result – The maximum value of the transform converted to an int.

Return type:

int

get_value()[source]

Get the value of the transform as an int.

Returns:

result – The value of the transform converted to an int.

Return type:

int

set_value(val)[source]

Set the value of the transform from an int.

Parameters:

value (int) – The integer value of the slider.