Layers class (Gauge)

Layers(Specifies)

new Layers(Specifies)

Creates a collection of layers for the gauge control.
Parameters:
Name Type Description
Specifies Gauge an object of Gauge type
Layers

Methods

Add(key) → {Layer}

The Add() method creates and adds/gets a Layer object to the collection and returns a reference to the newly created object.
Parameters:
Name Type Description
key any Specifies the layer's key (ignored if missing)
Returns:
Returns an object of Layer type
Type
Layer
Add

Clear()

The Clear() method removes all layers within the collection
Clear

GetCount() → {number}

The GetCount() method specifies the number of layers.
Returns:
Indicates the number of layers
Type
number
GetCount

GetValue() → {number}

The GetValue() method specifies the control's value. Generally, the control's value gets the value (offset or its rotation angle) of the layer based on the OnDrag property.
Returns:
Returns the control's value.
Type
number
GetValue

Item(key) → {Layer}

The Item() method returns a specific Layer of the Layers collection
Parameters:
Name Type Description
key any Specifies a integer expression that indicates the index of the layer to be requested, or any other value that indicates the key of the layer (layer's key or back).
Returns:
Returns an object of Layer type associated with the giving index/key
Type
Layer
Item

Load(value)

The Load() method loads the layers from a string-representation
Parameters:
Name Type Description
value string Specifies the string-representation to get the control's layers from
Load

Remove(key)

The Remove() method removes a specific member from the Layers collection.
Parameters:
Name Type Description
key any Specifies a integer expression that specifies the index of the layer to be removed, or any other value to specify the key of the layer to be removed.
Remove

Save() → {string}

The Save() method saves the layers into a string-representation
Returns:
Returns the string-representation of the control's layers
Type
string
Save

SetCount(value)

The GetCount() method specifies the number of layers.
Parameters:
Name Type Description
value number Specifies the number of layers
SetCount

SetValue(value)

The SetValue() method changes the control's value.
Parameters:
Name Type Description
value number Specifies the index or the key of the layer whose value determines the control's Value property.
SetValue

forEach(mask)

The forEach() method enumerates the layers that matches the mask (visible/selectable)
Parameters:
Name Type Description
mask number Specifies the type or order of the layers to get enumerated as follows (Gauge.ViewableLObjEnum type):
  • 0/null/undefined/missing, enumerates all layers by position
  • -1, enumerates all layers by index
  • 1 (Gauge.ViewableLObjEnum.exVisible), enumerates visible-layers only, by position
  • 2 (Gauge.ViewableLObjEnum.exSelectable), enumerates selectable-layers only, by position
The mask can combine the value of 1 and 2 as (1 + 2 = 3) to enumerate all visible and selectable layers.
forEach