# 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)

  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()

    A reimplemented initialization handler.

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

  parent_changed(old, new)

    Handle the parent changed event for the transform.

  get_minimum()

    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()

    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()

    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)

    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)

  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()

    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()

    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()

    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)

    Set the value of the transform from an int.

    Parameters:

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