GMSymbolSlider:
Filter:
GraphicalModule/Classes (extension) | GUI > Graphical Module

GMSymbolSlider
ExtensionExtension

A simple slider for creating graphical interfaces.

Description

GMSymbolSlider is an easy to use customisable slider.

It inherits from the GMZZSlider class, and is only responsible for graphical specifications. See GMZZSlider for non-graphical properties settings.

Its handle can either be a circle, a square or a diamond.

By default, the slider will display its value, truncated to a certain number.

In some certain cases, the built-in slider scales won't suit your usage, and you will need to post-process the slider value within its action function. In this case, you should also modify the displayFunction of the slider so that the displayed value is updated accordingly :

Class Methods

.new

Creates a new instance of GMSymbolSlider.

By default, its graphical properties are defined by its associated GMStyle. This means that creating sliders with different colors implies creating multiples GMStyle. The font color of the displayed value corresponds to the valueFontColor property.

Returns:

a GMSymbolSlider instance.

Instance Methods

Graphical settings

.symbol

Sets or gets the handle type. Can be either \circle, \square or \diamond.

.symbolRatio

Sets or gets the size of the handle relative to the widget size.

Arguments:

aNumber

A Float that should be between 0 and 1.

.symbolMinSize

Sets or gets the minimum size of the handle, in pixels.

.symbolMaxSize

Sets or gets the maximum size of the handle, in pixels.

.displayLine

Sets or gets the line drawing policy. \none will disable it, \full will draw a line along the full selected axis, \value will draw a line between min and the handle.

.drawLine

Deprecated. Use displayLine instead.

.displayValue

Sets or gets wether the value should be displayed.

.centerValue

Sets or gets wether the value should be centered on the widget.

.roundValue

Sets or gets the number the displayed value is truncated to.

.displayFunction

Sets or gets the Function that will be used to adapt the displayed value if needed (see above). Set to nil to disable.

.fontRatio

Sets or gets the size of the displayed value font relative to the widget size.

Arguments:

aFloat

A Float that should be between 0 and 1.

.displayHelpers

Sets or gets wether helpers should be displayed.

.drawHelpers

Deprecated. Use displayHelpers instead.

.helpersRatio

Sets or gets the size of the displayed helpers relative to the widget size. The value will be clipped if this would cause the dots to overlap.

Arguments:

aNumber

A Float that should be between 0 and 1.

Internal Methods

.draw

The Function associated to the View drawFunc. Shouldn't be modified.

.prDrawSlider

.prDrawValue

Examples

Here's an example of some different graphical configurations :