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

GMZZ2DSlider
ExtensionExtension

An abstract class for 2D sliders (Graphical Module)

Description

GMZZ2DSlider is an abstract class that defines 2D sliders behavior within the scope of the Graphical Module. The class name begins with "GMZZ" so it is displayed last in the autocompletion API.

A note about this documentation

This class is an extension of the GMZZSlider class. It retains the same principle, but for two axis at once instead of one. As such, you should read the GMZZSlider class documentation first, as only differences between those two classes are documented here.

2D logic

A 2D slider is the concatenation of an horizontal and a vertical slider. As such, most of its properties must be set using an array of two values. The first value defines the horizontal property, the second value defines the vertical property :

One of the exceptions are displayFunctions which are configured using either .xDisplayFunction or .yDisplayFunction (please note that those methods are not defined in GMZZ2DSlider, but within its child classes).

Key modifiers

The way ALT, CTRL and SHIFT will alter the interaction with the widget differs from GMZZSlider.

The ALT modifier behaves the same, storing the current values, allowing to jump back to them when the mouse button is released.

When CTRL is held and SHIFT is not, interactions with the slider will only affect the horizontal axis (but the action will still be evaluated with the two values as argument).

When SHIFT is held and CTRL is not, interactions with the slider will only affect the vertical axis (but the action will still be evaluated with the two values as argument).

Therefore, the only available key modifier left is CTRL + SHIFT. This modifier can be set to snap values to closest helpers, or to modify the values using modSteps, but not both :

Class Methods

.new

Creates a new instance of GMZZMultiSlider.

Returns:

a GMZZMultiSlider instance. This method is implicitely internal.

Instance Methods

.action

Sets or gets the Function to be evaluated when at least one of the values has been changed. This function will be passed two arguments : the value associated to the horizontal axis, and the value associated to the vertical axis.

.ctrlShiftBehavior

Sets or gets how the widget should behave when both CTRL and SHIFT are held down. Can be either \helper or \modStep. See the documentation above for further explanations.

GMZZSlider Methods

See the GMZZSlider class documentation for those methods.

Those methods takes an array of two values as argument in the context of GMZZ2DSlider.

.values

.min

.max

.scales

.expMins

.polarities

.modSteps

.modStepsOperators

.modStepsPixelRanges

.helpersNumbers

.helperSubdivisions

Internal Methods

.prUpdateValue

.prCheckMod

.prGetClosestHelpers

.prGetModStepValues

Examples

See the GMSymbol2DSlider documentation for examples.