LayerOptions class (Gauge)

LayerOptions()

new LayerOptions()

The LayerOptions type holds all options a Layer object can display or own. The LayerOptions type is used to set or get the multiple options of a layer at once, through the Layer.Options property or Layers.Add() method.

Every option of the LayerOptions type has associated a property of the Layer object. For instance, the option:

back {string}, specifies the background image of the layer or the color to fill the layer's area
is associated with the property:
Back {string}, specifies the background image of the layer or the color to fill the layer's area
which means that the following statements are equivalent:
oLayer.Options = {back: "gauge_back"}
oLayer.SetOptions({back: "gauge_back"})
oLayer.Back = "gauge_back"
oLayer.SetBack("gauge_back")
where oLayer is an object of Layer type
Since:
  • 5.4

Members

(static) back :any

The back field specifies the layer's background as a HTML picture or a CSS color (corresponds to the [back] flag used in layers field). If the back field is a string that matches the name of a HTML picture, the layer's background is the HTML picture with that name. The exontrol.HTMLPicture.Add method is used to add a HTML picture with a name to the control. If the back field is a string that does not match the name of any HTML picture, but is a valid CSS color, the layer's background is filled with that color. If the back field is null, no background is shown for the layer. For instance, if you set the back field of a layer to "gauge_back", and there is a HTML picture with name "gauge_back", the layer's background is that HTML picture. If you set the back field of a layer to "red", and there is no HTML picture with name "red", but "red" is a valid CSS color, the layer's background is filled with red color. The fore field specifies the layer's caption to be shown on the layer's foreground. By default, the back field is null, which means that no background is shown for the layer.

The back field is mapped to the Back property, which means that the following statements are equivalent:

oLayer.Options = {back: "gauge_back"}
oLayer.SetOptions({back: "gauge_back"})
oLayer.Back = "gauge_back"
oLayer.SetBack("gauge_back")
Type:
  • any
Example
null {any}, no background is shown for the layer
"gauge_back" {string}, if there is a HTML picture with name "gauge_back", the layer's background is that HTML picture
"red" {string}, if there is no HTML picture with name "red", but "red" is a valid CSS color, the layer's background is filled with red color
back

(static) brightness :LayerColorAdjustmentOptions

The brightness field specifies the brightness of the layer as an object of LayerColorAdjustmentOptions type (corresponding to the [brightness.red], [brightness.green], [brightness.blue] flags in the layers field) , which defines the brightness adjustment for each color channel, while the contrast field specifies the contrast of the layer as an object of LayerColorAdjustmentOptions type, which defines the contrast adjustment for each color channel. The brightness and contrast fields can be used to link the layer's brightness and contrast to its value, so when the layer's value changes, its brightness and contrast change according to the expressions set in the brightness and contrast fields. For instance, if you set the brightness field to {red: "value", green: "value", blue: "value"}, when the layer's value is 100, it is displayed with 100% of its red, green, and blue colors (full brightness), and when the layer's value is 0, it is displayed with 0% of its red, green, and blue colors (completely dark).

The brightness field is mapped to the Brightness property, which means that the following statements are equivalent:

oLayer.Options = {brightness: {red: "value", green: "value"}}
oLayer.SetOptions({brightness: {red: "value", green: "value"}})
oLayer.Brightness = {red: "value", green: "value"}
oLayer.SetBrightness({red: "value", green: "value"})
Type:
Example
{red: "value", green: "value", blue: "value"} {object}, complete darkness to full brightness as the layer's value increases from 0 to 100
{red: "value/2", green: "value/2", blue: "value/2"} {object}, the brightness of the layer is half of layer's value
{red: 0, green: 0, blue: 0} {object}, the layer is completely dark regardless of its value
brightness

(static) clip :LayerClipOptions

The clip field defines the layer's clipping region as an object of LayerClipOptions type (corresponding to the [clip] flag used in layers field), which restricts the visible area of the layer to a specific region. The rotateClip field determines whether the clipping region rotates along with the layer. By default, the clip field is null, which means that there is no clipping region and the whole layer is visible. The clip field can be used to set a clipping region for the layer, which limits the visible area of the layer to a specific shape or region. For instance, you can set the clip field to {type: "ellipse", radiusX: 50, radiusY: 50} to clip the layer to a circle with a radius of 50 pixels, so only the part of the layer that falls within that circle is visible.

The clip field is mapped to the Clip property, which means that the following statements are equivalent:

oLayer.Options = {clip: {type: "ellipse", radiusX: 50, radiusY: 50}}
oLayer.SetOptions({clip: {type: "ellipse", radiusX: 50, radiusY: 50}})
oLayer.Clip = {type: "ellipse", radiusX: 50, radiusY: 50}
oLayer.SetClip({type: "ellipse", radiusX: 50, radiusY: 50})
Type:
Example
null {null}, there is no clipping region and the whole layer is visible
{type: "ellipse", radiusX: 50, radiusY: 50} {object}, the layer is clipped to a circle with a radius of 50 pixels
clip

(static) contrast :LayerColorAdjustmentOptions

The contrast field specifies the contrast of the layer as an object of LayerColorAdjustmentOptions type (corresponding to the [contrast.red], [contrast.green], [contrast.blue] flags in the layers field) , which defines the contrast adjustment for each color channel, while the brightness field specifies the brightness of the layer as an object of LayerColorAdjustmentOptions type, which defines the brightness adjustment for each color channel. The brightness and contrast fields can be used to link the layer's brightness and contrast to its value, so when the layer's value changes, its brightness and contrast change according to the expressions set in the brightness and contrast fields. For instance, if you set the contrast field to {red: "value", green: "value", blue: "value"}, when the layer's value is 100, it is displayed with 100% of its red, green, and blue colors (full contrast), and when the layer's value is 0, it is displayed with 0% of its red, green, and blue colors (completely gray).

The contrast field is mapped to the Contrast property, which means that the following statements are equivalent:

oLayer.Options = {contrast: {red: "value", green: "value"}}
oLayer.SetOptions({contrast: {red: "value", green: "value"}})
oLayer.Contrast = {red: "value", green: "value"}
oLayer.SetContrast({red: "value", green: "value"})
Type:
Example
{red: "value", green: "value", blue: "value"} {object}, complete gray to full contrast as the layer's value increases from 0 to 100
{red: "value/2", green: "value/2", blue: "value/2"} {object}, the contrast of the layer is half of layer's value
{red: 0, green: 0, blue: 0} {object}, the layer is completely gray regardless of its value
contrast

(static) defaultOffsetX :number

The defaultOffsetX field indicates the default x-offset of the layer (corresponds to the [defX] flag used in layers field), while the defaultOffsetY field indicates the default y-offset of the layer. The layer's actual x-offset is the sum of left, defaultOffsetX, and offsetX, while the actual y-offset is the sum of top, defaultOffsetY, and offsetY. For instance, if you set the defaultOffsetX field to 10, the offsetX field to 5, the layer is shown with a total x-offset of 15 pixels from the position specified by the left field.

Any of the following fields can be used to move the layer:

Any of the following fields can be used to move or resize the layer:

  • left and top fields, specifies the format-expression relative to the view, to determine the x- and y-position to show the current layer on the control
  • width and height fields, specifies the format-expression relative to the view, to determine the width and height to show the current layer on the control

The defaultOffsetX field is mapped to the DefaultOffsetX property, which means that the following statements are equivalent:

oLayer.Options = {defaultOffsetX: 10}
oLayer.SetOptions({defaultOffsetX: 10})
oLayer.DefaultOffsetX = 10
oLayer.SetDefaultOffsetX(10)
Type:
  • number
Example
0 {number}, the layer is shown at the position specified by the left and offsetX fields
10 {number}, the layer is shown with a total x-offset of 10 pixels from the position specified by the left field
defaultOffsetX

(static) defaultOffsetY :number

The defaultOffsetY field indicates the default y-offset of the layer (corresponds to the [defY] flag used in layers field), while the defaultOffsetX field indicates the default x-offset of the layer. The layer's actual y-offset is the sum of top, defaultOffsetY, and offsetY, while the actual x-offset is the sum of left, defaultOffsetX, and offsetX. For instance, if you set the defaultOffsetY field to 10, the offsetY field to 5, the layer is shown with a total y-offset of 15 pixels from the position specified by the top field.

Any of the following fields can be used to move the layer:

Any of the following fields can be used to move or resize the layer:

  • left and top fields, specifies the format-expression relative to the view, to determine the x- and y-position to show the current layer on the control
  • width and height fields, specifies the format-expression relative to the view, to determine the width and height to show the current layer on the control

The defaultOffsetY field is mapped to the DefaultOffsetY property, which means that the following statements are equivalent:

oLayer.Options = {defaultOffsetY: 10}
oLayer.SetOptions({defaultOffsetY: 10})
oLayer.DefaultOffsetY = 10
oLayer.SetDefaultOffsetY(10)
Type:
  • number
Example
0 {number}, the layer is shown at the position specified by the top and offsetY fields
10 {number}, the layer is shown with a total y-offset of 10 pixels from the position specified by the top field
defaultOffsetY

(static) defaultRotateAngle :number

The defaultRotateAngle field specifies the default angle to rotate the layer (corresponds to the [defA] flag used in layers field). The rotateAngle field defines addionally the angle to rotate the layer, so the layer's rotation angle is defaultRotateAngle plus rotateAngle, which means that if you set the defaultRotateAngle field to 90 and the rotateAngle field to 45, the layer is rotated 135 degrees. The defaultRotateAngle field is used to specify a default angle to rotate the layer, while the rotateAngle field is used to specify an additional angle to rotate the layer. Angle 0 is considered the 12 o'clock direction, and it increases clockwise, so 90 degrees is considered the 3 o'clock direction, 180 degrees the 6 o'clock direction, and 270 degrees (or -90 degrees) the 9 o'clock direction. A positive value rotates the layer clockwise, while a negative value rotates it counter-clockwise.

Any of the following fields can be used to rotate the layer:

  • defaultRotateAngle field, specifies the default angle to rotate the layer
  • rotateAngle field, specifies the angle to rotate the layer.
  • rotateAngleValid field, validates / limits the rotation angle of the layer.
  • value and valueToRotateAngle fields, specifies the expression to convert the value to rotating angle. The rotateAngleToValue field converts the current rotation angle to a value.

The following fields can be used to specify a different rotation center:

  • rotateCenterLayer field, indicates the index of the layer the rotation is around.
  • rotateCenterX field, indicates the expression that determines the x-origin of the rotation point relative to the rotateCenterLayer layer.
  • rotateCenterY field, indicates the expression that determines the y-origin of the rotation point relative to the rotateCenterLayer layer.

The following fields can be used to change the rotation center, while the onDrag field is exDoRotamove:

  • rotamoveCenterX field, gets the x-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveCenterY field, gets the y-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveOffsetX field, gets the x-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate..
  • rotamoveOffsetY field, gets the y-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate.

The defaultRotateAngle field is mapped to the DefaultRotateAngle property, which means that the following statements are equivalent:

oLayer.Options = {defaultRotateAngle: -90}
oLayer.SetOptions({defaultRotateAngle: -90})
oLayer.DefaultRotateAngle = -90
oLayer.SetDefaultRotateAngle(-90)
Type:
  • number
Example
0 {number}, no rotation applied to the layer
-90 {number}, the layer is rotated 90 degrees counter-clockwise
90 {number}, the layer is rotated 90 degrees clockwise
defaultRotateAngle

(static) fore :string

The fore field defines a format expression to display the layer's ex-HTML caption in the foreground (corresponding to the [fore] flag in the layers field), or the ex-HTML caption if the expression is invalid. The fore field is used to show a caption on the layer's foreground, which can be used to show information about the layer. For instance, if you set the fore field of a layer to "value", the layer's caption is the value of the layer, which is specified in the value field. If you set the fore field of a layer to "value + ` km/h`", and the value field of the layer is 50, the layer's caption is "50 km/h". The foreOpt field specifies the options to format the layer's caption, which is used in association with the fore field. By default, the fore field is null, which means that the layer's caption is not shown on the layer's foreground.

The expression supports the following keywords:

"value", gets the value of the Layer.Value property

The fore field is mapped to the Fore property, which means that the following statements are equivalent:

oLayer.Options = {fore: "value + ` km/h`"}
oLayer.SetOptions({fore: "value + ` km/h`"})
oLayer.Fore = "value + ` km/h`"
oLayer.SetFore("value + ` km/h`")
Type:
  • string
Example
null or "" {string}, the layer's caption is not shown on the layer's foreground
"value" {string}, the layer's caption is the value of the layer
"`<outline white><b><font ;20>` + (value format `0`)" {string}, shows the layer's value formatted as integer with white outlined bold font of size 20
fore

(static) foreOpt :LayerForeOptions

The foreOpt field specifies the options to format the layer's caption, which is used in association with the fore field. For instance, you can set the foreOpt field to {tfi: " Arial 20", front: false} to show the layer's caption with red color Arial font of size 20, showing the caption behind the layer's background. By default, the foreOpt field is null, which means that the layer's caption is shown on the layer's foreground with the default formatting options.

The foreOpt field is mapped to the ForeOpt property, which means that the following statements are equivalent:

oLayer.Options = {foreOpt: {tfi: " Arial 20", front: false}}
oLayer.SetOptions({foreOpt: {tfi: " Arial 20", front: false}})
oLayer.ForeOpt = {tfi: " Arial 20", front: false}
oLayer.SetForeOpt({tfi: " Arial 20", front: false})
Type:
Since:
  • 5.4
Example
null {any}, the layer's caption is shown on the layer's foreground with the default formatting options
{tfi: "<fgcolor red> Arial 20", front: false} {object}, the layer's caption is shown with red color Arial font of size 20, behind the layer's background
{formatText: "wrap"} {object}, the layer's caption is shown with text wrapped within the layer's area
foreOpt

(static) grayscale :number|string

The grayscale field specifies the grayscale level of the layer, as a percent value or a format-expression (corresponding to the [grayscale] flag in the layers field). The grayscale field can be used to link the layer's grayscale level to its value, so when the layer's value changes, its grayscale level changes according to the expression set in the grayscale field. For instance, if you want the layer to become more grayscale as its value increases, you can set the grayscale field to "value/2", which means that when the layer's value is 100, it is displayed with 50% grayscale, and when the layer's value is 0, it is displayed with 0% grayscale (full color). If you set it to "100 - value/2", it becomes more colorful as its value increases. If you set it to a constant number like 30, it is displayed with 30% grayscale regardless of its value.

The expression supports the following keywords:

"value", indicates the Layer.Value property of the layer, which is the value displayed by the layer and can be linked to the layer's rotation angle or offset though the rotateAngleToValue, offsetToValue fields, so when the layer is rotated or moved, its value changes accordingly.

The grayscale field is mapped to the Grayscale property, which means that the following statements are equivalent:

oLayer.Options = {grayscale: "value/2"}
oLayer.SetOptions({grayscale: "value/2"})
oLayer.Grayscale = "value/2"
oLayer.SetGrayscale("value/2")
Type:
  • number | string
Example
50 {number}, the layer is displayed with 50% grayscale regardless of its value
"value/2" {string}, the grayscale level of the layer is half of its value
"100 - value" {string}, the grayscale level of the layer decreases as its value increases
grayscale

(static) height :number|string

The height field specifies the format-expression relative to the view, to determine the height to show the current layer on the control (corresponds to the [height] flag used in layers field), while the width field specifies the expression relative to the view, to determine the width to show the current layer on the control. The field is ignored if the expression is invalid. For instance, if you set the width field to "width/2", and the height field to "height/2", the layer is shown with a width and height of half of the control's width and height respectively.

The expression supports the following keywords:

"width", indicates the width of the control
"height", indicates the height of the control

Any of the following fields can be used to move the layer:

Any of the following fields can be used to move or resize the layer:

  • left and top fields, specifies the format-expression relative to the view, to determine the x- and y-position to show the current layer on the control
  • width and height fields, specifies the format-expression relative to the view, to determine the width and height to show the current layer on the control

The height field is mapped to the Layer.Height property, which means that the following statements are equivalent:

oLayer.Options = {height: "height/2"}
oLayer.SetOptions({height: "height/2"})
oLayer.Height = "height/2"
oLayer.SetHeight("height/2")
Type:
  • number | string
Example
"" {string} or {null} or {undefined}, the layer is shown with its original width and height
12 {number}, the layer is shown with a height of 12 pixels
"height/2" {string}, the layer is shown with a height of half of the control's height
height

(static) idem :any

The idem field specifies a list of layer keys, separated by comma character, to ensure that the layer's offset and rotation-angle is equal for all idem layers (corresponds to the [idem] flag used in layers field). For instance, you can use the Idem property to rotate or move multiple-layers once a layer is moved or rotated. The field is ignored if no layers with the specified key are. For instance, "knob,knob2", once you move or rotate one of the layers with key "knob" or "knob2", the other layer is moved or rotated as well, to ensure that both layers have the same offset and rotation angle. The rotateAngle, offsetX, and offsetY fields of all layers included in the idem group are set to the same value, which is the value of the layer that is moved or rotated.

The idem field is mapped to the Idem property, which means that the following statements are equivalent:

oLayer.Options = {idem: "knob,knob2"}
oLayer.SetOptions({idem: "knob,knob2"})
oLayer.Idem = "knob,knob2"
oLayer.SetIdem("knob,knob2")
Type:
  • any
Example
null or "" {string}, the layer is not idem with any other layer
"knob,knob2" {string}, the knob,knob2 layers share the same offset and rotation-angle
idem

(static) key

The key field gets or sets the layer's key, which is used to identify the layer (corresponds to the [key] flag used in layers field). The key is used in association with the layers field to specify the layer to show or hide, or to specify the layer to rotate or move once a drag operation occurs. For instance, if you set the key field of a layer to "needle", you can use the "needle" keyword in the layers field to specify that the layer is shown or hidden, or to specify that the layer is rotated or moved once a drag operation occurs. The Gauge.Layer property returns the layer with the specified key. You can use the index of the layer if no key is specified. If multiple layers have the same key, the first layer with the specified key is used.

The key field is mapped to the Key property, which means that the following statements are equivalent:

oLayer.Options = {key: "needle"}
oLayer.SetOptions({key: "needle"})
oLayer.Key = "needle"
oLayer.SetKey("needle")
Example
null or "" {string}, the layer has no key
"needle" {string}, the layer's key is "needle"
key

(static) left :number|string

The left field specifies the format-expression relative to the view, to determine the x-position to show the current layer on the control (corresponds to the [left] flag used in layers field), while the top field specifies the expression relative to the view, to determine the y-position to show the current layer on the control. The layer's actual x-position is the sum of left, defaultOffsetX, and offsetX, while the actual y-position is the sum of top, defaultOffsetY, and offsetY. The field is ignored if the expression is invalid. For instance, if you set the left field to "width/2", the defaultOffsetX field to 10, and the offsetX field to 5, the layer is shown with a total x-position of width/2 + 15 pixels from the left edge of the control.

The expression supports the following keywords:

"width", indicates the width of the control
"height", indicates the height of the control

Any of the following fields can be used to move the layer:

Any of the following fields can be used to move or resize the layer:

  • left and top fields, specifies the format-expression relative to the view, to determine the x- and y-position to show the current layer on the control
  • width and height fields, specifies the format-expression relative to the view, to determine the width and height to show the current layer on the control

The left field is mapped to the Layer.Left property, which means that the following statements are equivalent:

oLayer.Options = {left: "width/2"}
oLayer.SetOptions({left: "width/2"})
oLayer.Left = "width/2"
oLayer.SetLeft("width/2")
Type:
  • number | string
Example
"0" or "" {string} or {null} or {undefined}, the layer is shown at the position specified by the offsetX field from the left edge of the control.
"width/2+10" {string}, the layer is shown at the horizontal center of the control, plus 10 pixels and any additional x-offset specified in defaultOffsetX and offsetX fields
left

(static) offsetToValue :number|string

The offsetToValue field specifies the format-expression to convert the current x- and y-offset to a value (corresponds to the [o2v] flag used in layers field), while the valueToOffsetX and valueToOffsetY fields specify the expression to convert the value to x- and y-offset respectively. In other words, when the layer is moved and its offsetX and offsetY fields change, the value field of the layer is updated based on the offsetToValue expression. If the expression is invalid, the field is ignored. For instance, if you set the offsetToValue field to "x/2 + 4", when the layer's x-offset is 12 pixels the Layer.Value property of the layer is set to 10.

The expression supports the following keywords:

"value", "x" or "offsetx", indicates the Layer.OffsetX property
"y" or "offsety", indicates the Layer.OffsetY property

Any of the following fields can be used to move the layer:

  • defaultOffsetX and defaultOffsetY fields, indicates the default x- and y-offset of the layer
  • offsetX and offsetY fields, indicates additional x- and y-offset of the layer
  • offsetXValid and offsetYValid fields, validates / limits the x- and y-offset value of the layer
  • value, valueToOffsetX and valueToOffsetY fields, specifies the format-expression to convert the value to x- and y-offset. The offsetToValue field converts the current x- and y-offset to a value.

Any of the following fields can be used to move or resize the layer:

  • left and top fields, specifies the format-expression relative to the view, to determine the x- and y-position to show the current layer on the control
  • width and height fields, specifies the format-expression relative to the view, to determine the width and height to show the current layer on the control

The offsetToValue field is mapped to the OffsetToValue property, which means that the following statements are equivalent:

oLayer.Options = {offsetToValue: "x/2 + 4"}
oLayer.SetOptions({offsetToValue: "x/2 + 4"})
oLayer.OffsetToValue = "x/2 + 4"
oLayer.SetOffsetToValue("x/2 + 4")
Type:
  • number | string
Example
0 {number}, the value is always 0 regardless of the offsetX and offsetY fields
"x/2 + 4" {string}, converts the current x-offset to a value by dividing the x-offset by 2 and then adding 4
"value = 0 ? 0 : 1" {string}, converts the current x-offset to a value of 0 if the x-offset is 0 or 1 if the x-offset is not 0
offsetToValue

(static) offsetX :number

The offsetX field indicates additional x-offset of the layer (corresponds to the [x] flag used in layers field), while the offsetY field indicates additional y-offset of the layer. The layer's actual x-offset is the sum of left, defaultOffsetX, and offsetX, while the actual y-offset is the sum of top, defaultOffsetY, and offsetY. For instance, if you set the defaultOffsetX field to 10, the offsetX field to 5, the layer is shown with a total x-offset of 15 pixels from the position specified by the left field.

Any of the following fields can be used to move the layer:

Any of the following fields can be used to move or resize the layer:

  • left and top fields, specifies the format-expression relative to the view, to determine the x- and y-position to show the current layer on the control
  • width and height fields, specifies the format-expression relative to the view, to determine the width and height to show the current layer on the control

The offsetX field is mapped to the Layer.OffsetX property, which means that the following statements are equivalent:

oLayer.Options = {offsetX: 10}
oLayer.SetOptions({offsetX: 10})
oLayer.OffsetX = 10
oLayer.SetOffsetX(10)
Type:
  • number
Example
0 {number}, the layer is shown at the position specified by the left and defaultOffsetX fields
10 {number}, the layer is shown with a total x-offset of 10 pixels from the position specified by the left and defaultOffsetX fields
offsetX

(static) offsetXValid :number|string

The offsetXValid field validates, limits or spans the x-offset value of the layer (offsetX field), using a format-expression (corresponds to the [xValid] flag used in layers field), while the offsetYValid field validates the y-offset value of the layer. If the field is invalid, the field is ignored. The offsetXValid and offsetYValid fields specify an expression to validate the offsetX and offsetY fields respectively. For instance, if you set the offsetXValid field to "x MIN 0 MAX 48", the offsetX field is validated to be between 0 and 48 pixels, while "round(x/8)*8" expression spans the offsetX value to the closest multiple of 8 pixels.

The expression supports the following keywords:

"value", specifies the x-offset/y-offset of the layer, or 0 if not specified
"x", specifies the x-offset of the layer, equivalent of Layer.OffsetX property
"y", specifies the y-offset of the layer, equivalent of Layer.OffsetY property
"lwidth" specifies the width in pixels of the layer's view
"lheight", specifies the height in pixels of the layer's view
"width" specifies the width in pixels of the control
"height", specifies the height in pixels of the control

Any of the following fields can be used to move the layer:

  • defaultOffsetX and defaultOffsetY fields, indicates the default x- and y-offset of the layer
  • offsetX and offsetY fields, indicates additional x- and y-offset of the layer
  • offsetXValid and offsetYValid fields, validates / limits the x- and y-offset value of the layer
  • value, valueToOffsetX and valueToOffsetY fields, specifies the format-expression to convert the value to x- and y-offset. The offsetToValue field converts the current x- and y-offset to a value.

Any of the following fields can be used to move or resize the layer:

  • left and top fields, specifies the format-expression relative to the view, to determine the x- and y-position to show the current layer on the control
  • width and height fields, specifies the format-expression relative to the view, to determine the width and height to show the current layer on the control

The offsetXValid field is mapped to the OffsetXValid property, which means that the following statements are equivalent:

oLayer.Options = {offsetXValid: "value MIN 0 MAX 48"}
oLayer.SetOptions({offsetXValid: "value MIN 0 MAX 48"})
oLayer.OffsetXValid = "value MIN 0 MAX 48"
oLayer.SetOffsetXValid("value MIN 0 MAX 48")
Type:
  • number | string
Example
"" {string} or {null} or {undefined}, the offsetX field is not validated (offsetXValid field is ignored)
0 {number}, the offsetX field is alwyays 0
"x MIN 0 MAX 48" {string}, the offsetX field is validated to be between 0 and 48 pixels
"round(x/8)*8" {string}, the offsetX field is spanned to the closest multiple of 8 pixels
offsetXValid

(static) offsetY :number

The offsetY field indicates additional y-offset of the layer (corresponds to the [y] flag used in layers field), while the offsetX field indicates additional x-offset of the layer. The layer's actual y-offset is the sum of top, defaultOffsetY, and offsetY, while the actual x-offset is the sum of left, defaultOffsetX, and offsetX. For instance, if you set the defaultOffsetY field to 10, the offsetY field to 5, the layer is shown with a total y-offset of 15 pixels from the position specified by the top field.

Any of the following fields can be used to move the layer:

Any of the following fields can be used to move or resize the layer:

  • left and top fields, specifies the format-expression relative to the view, to determine the x- and y-position to show the current layer on the control
  • width and height fields, specifies the format-expression relative to the view, to determine the width and height to show the current layer on the control

The offsetY field is mapped to the Layer.OffsetY property, which means that the following statements are equivalent:

oLayer.Options = {offsetY: 10}
oLayer.SetOptions({offsetY: 10})
oLayer.OffsetY = 10
oLayer.SetOffsetY(10)
Type:
  • number
Example
0 {number}, the layer is shown at the position specified by the top and defaultOffsetY fields
10 {number}, the layer is shown with a total y-offset of 10 pixels from the position specified by the top and defaultOffsetY fields
offsetY

(static) offsetYValid :number|string

The offsetYValid field validates, limits or spans the y-offset value of the layer (offsetY field), using a format-expression (corresponds to the [yValid] flag used in layers field), while the offsetXValid field validates the x-offset value of the layer. If the field is invalid, the field is ignored. The offsetYValid and offsetXValid fields specify an expression to validate the offsetY and offsetX fields respectively. For instance, if you set the offsetYValid field to "y MIN 0 MAX 48", the offsetY field is validated to be between 0 and 48 pixels, while "round(y/8)*8" expression spans the offsetY value to the closest multiple of 8 pixels.

The expression supports the following keywords:

"value", specifies the x-offset/y-offset of the layer, or 0 if not specified
"x", specifies the x-offset of the layer, equivalent of Layer.OffsetX property
"y", specifies the y-offset of the layer, equivalent of Layer.OffsetY property
"lwidth" specifies the width in pixels of the layer's view
"lheight", specifies the height in pixels of the layer's view
"width" specifies the width in pixels of the control
"height", specifies the height in pixels of the control

Any of the following fields can be used to move the layer:

  • defaultOffsetX and defaultOffsetY fields, indicates the default x- and y-offset of the layer
  • offsetX and offsetY fields, indicates additional x- and y-offset of the layer
  • offsetXValid and offsetYValid fields, validates / limits the x- and y-offset value of the layer
  • value, valueToOffsetX and valueToOffsetY fields, specifies the format-expression to convert the value to x- and y-offset. The offsetToValue field converts the current x- and y-offset to a value.

Any of the following fields can be used to move or resize the layer:

  • left and top fields, specifies the format-expression relative to the view, to determine the x- and y-position to show the current layer on the control
  • width and height fields, specifies the format-expression relative to the view, to determine the width and height to show the current layer on the control

The offsetYValid field is mapped to the OffsetYValid property, which means that the following statements are equivalent:

oLayer.Options = {offsetYValid: "value MIN 0 MAX 48"}
oLayer.SetOptions({offsetYValid: "value MIN 0 MAX 48"})
oLayer.OffsetYValid = "value MIN 0 MAX 48"
oLayer.SetOffsetYValid("value MIN 0 MAX 48")
Type:
  • number | string
Example
"" {string} or {null} or {undefined}, the offsetY field is not validated (offsetYValid field is ignored)
0 {number}, the offsetY field is alwyays 0
"y MIN 0 MAX 48" {string}, the offsetY field is validated to be between 0 and 48 pixels
"round(y/8)*8" {string}, the offsetY field is spanned to the closest multiple of 8 pixels
offsetYValid

(static) onDrag :Gauge.OnDragLayerEnum

The onDrag field indicates the transformation of the layer once the user drags it (corresponds to the [drag] flag used in layers field). The onDrag field can be set to one of the following values of OnDragLayerEnum type:
  • exDoMove, the layer is moved according to the mouse movement once the user drags it, so the offsetX and offsetY fields of the layer are changed according to the mouse movement, while the rotateAngle field is not changed once the user drags the layer.
  • exDoRotate, the layer is rotated according to the mouse movement once the user drags it, so the rotateAngle field of the layer is changed according to the mouse movement, while the offsetX and offsetY fields are not changed once the user drags the layer.
  • exDoRotamove, the layer is moved by rotation according to the mouse movement once the user drags it, but only rotateAngle field of the layer is changed according to the mouse movement once the user drags the layer.

The selectable field must be true for the onDrag field to have effect, which means that the user can move or rotate the layer by dragging it only if the onDrag field is set and the selectable field is true. By default, the onDrag field is null (equivalent of exDoNothing), which means that the layer is not dragged (the user cannot move or rotate the layer by dragging it).

The onDrag field is mapped to the OnDrag property, which means that the following statements are equivalent:

oLayer.Options = {onDrag: "rotate"}
oLayer.SetOptions({onDrag: "rotate"})
oLayer.OnDrag = "rotate"
oLayer.SetOnDrag("rotate")
Type:
Example
null {any}, the layer is not dragged (the user cannot move or rotate the layer by dragging it)
"move" {string}, 1 {number} or exontrol.Gauge.OnDragLayerEnum.exDoMove {Gauge.OnDragLayerEnum}, the layer is moved according to the mouse movement once the user drags it
onDrag

(static) position :number

The position field gets or sets the layer's position (0-based), which is the position of the layer within the layers collection (corresponds to the [pos] flag used in layers field). The position of the layer is used to determine the z-order of the layer, which is the order in which layers are drawn on the control. The layer with position 0 is drawn first, then the layer with position 1 is drawn over it, and so on. The visible field indicates whether the layer is visible or hidden. The Layer.Index property specifies the index of the layer within the layers collection. The index is defined at adding time and is not changed, while the position can be changed at any time. For instance, if you set the position of a layer to 0, the layer is drawn at the bottom of all layers, while if you set the position of a layer to a value greater than the current position of the layer, the layer is drawn over more layers.

The position field is mapped to the Position property, which means that the following statements are equivalent:

oLayer.Options = {position: 0}
oLayer.SetOptions({position: 0})
oLayer.Position = 0
oLayer.SetPosition(0)
Type:
  • number
Example
0 {number}, the layer is the bottom layer, which is drawn first
1 {number}, the layer is drawn over the layer with position 0
position

(static) rotamoveCenterX :number

The rotamoveCenterX field returns the x-coordinate of the center point of the layer's background content (the image defined in the back field). The rotamoveCenterX and rotamoveCenterY fields are read-only. The rotamoveCenterX and rotamoveCenterY fields define the exact point that is considered the center of the visible content inside the layer's background image (the image set through the back field). They don't refer to the geometric center of the whole image, but to the center of the actual meaningful content inside it (for example, a shape drawn inside a larger transparent image). For instance, if you have a 256×256 transparent image containing a solid red 32×32 square positioned in the top-right corner, rotamoveCenterX would return 240 (the x-position of the square's center), and rotamoveCenterY would return 16 (the y-position of the square's center). The rotamoveCenterX and rotamoveCenterY fields are available only after the layer's image (back field points to a picture file) is loaded and return 0 if accessed before the image is loaded.

Any of the following fields can be used to rotate the layer:

The following fields can be used to specify a different rotation center:

  • rotateCenterLayer field, indicates the index of the layer the rotation is around.
  • rotateCenterX field, indicates the expression that determines the x-origin of the rotation point relative to the rotateCenterLayer layer.
  • rotateCenterY field, indicates the expression that determines the y-origin of the rotation point relative to the rotateCenterLayer layer.

The following fields can be used to change the rotation center, while the onDrag field is exDoRotamove:

  • rotamoveCenterX field, gets the x-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveCenterY field, gets the y-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveOffsetX field, gets the x-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate..
  • rotamoveOffsetY field, gets the y-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate.

The rotamoveCenterX field is mapped to the RotamoveCenterX property, which means that the following statements are equivalent:

oLayer.Options.rotamoveCenterX
oLayer.GetOptions().rotamoveCenterX
oLayer.RotamoveCenterX
oLayer.GetRotamoveCenterX()
Type:
  • number
rotamoveCenterX

(static) rotamoveCenterY :number

The rotamoveCenterY field returns the y-coordinate of the center point of the layer's background content (the image defined in the back field). The rotamoveCenterX and rotamoveCenterY fields are read-only. The rotamoveCenterX and rotamoveCenterY fields define the exact point that is considered the center of the visible content inside the layer's background image (the image set through the back field). They don't refer to the geometric center of the whole image, but to the center of the actual meaningful content inside it (for example, a shape drawn inside a larger transparent image). For instance, if you have a 256×256 transparent image containing a solid red 32×32 square positioned in the top-right corner, rotamoveCenterX would return 240 (the x-position of the square's center), and rotamoveCenterY would return 16 (the y-position of the square's center). The rotamoveCenterX and rotamoveCenterY fields are available only after the layer's image (back field points to a picture file) is loaded and return 0 if accessed before the image is loaded.

Any of the following fields can be used to rotate the layer:

The following fields can be used to specify a different rotation center:

  • rotateCenterLayer field, indicates the index of the layer the rotation is around.
  • rotateCenterX field, indicates the expression that determines the x-origin of the rotation point relative to the rotateCenterLayer layer.
  • rotateCenterY field, indicates the expression that determines the y-origin of the rotation point relative to the rotateCenterLayer layer.

The following fields can be used to change the rotation center, while the onDrag field is exDoRotamove:

  • rotamoveCenterX field, gets the x-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveCenterY field, gets the y-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveOffsetX field, gets the x-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate.
  • rotamoveOffsetY field, gets the y-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate.

The rotamoveCenterY field is mapped to the RotamoveCenterY property, which means that the following statements are equivalent:

oLayer.Options.rotamoveCenterY
oLayer.GetOptions().rotamoveCenterY
oLayer.RotamoveCenterY
oLayer.GetRotamoveCenterY()
Type:
  • number
rotamoveCenterY

(static) rotamoveOffsetX :number

The rotamoveOffsetX field gets the x-offset of the layer's center point during rotation, while rotamoveOffsetY field gets the y-offset of the layer's center point during rotation, when the layer's onDrag field is set to exDoRotamove or exDoRotate. The rotamoveOffsetX and rotamoveOffsetY fields are read-only. The control supports moving the layer by rotation, also called rotamove. These fields can also be used to keep other layers aligned or synchronized with the rotating layer while it is being dragged.

Any of the following fields can be used to rotate the layer:

The following fields can be used to specify a different rotation center:

  • rotateCenterLayer field, indicates the index of the layer the rotation is around.
  • rotateCenterX field, indicates the expression that determines the x-origin of the rotation point relative to the rotateCenterLayer layer.
  • rotateCenterY field, indicates the expression that determines the y-origin of the rotation point relative to the rotateCenterLayer layer.

The following fields can be used to change the rotation center, while the onDrag field is exDoRotamove:

  • rotamoveCenterX field, gets the x-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveCenterY field, gets the y-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveOffsetX field, gets the x-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate.
  • rotamoveOffsetY field, gets the y-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate.

The rotamoveOffsetX field is mapped to the RotamoveOffsetX property, which means that the following statements are equivalent:

oLayer.Options.rotamoveOffsetX
oLayer.GetOptions().rotamoveOffsetX
oLayer.RotamoveOffsetX
oLayer.GetRotamoveOffsetX()
Type:
  • number
rotamoveOffsetX

(static) rotamoveOffsetY :number

The rotamoveOffsetY field gets the y-offset of the layer's center point during rotation, while rotamoveOffsetX field gets the x-offset of the layer's center point during rotation, when the layer's onDrag field is set to exDoRotamove or exDoRotate. The rotamoveOffsetX and rotamoveOffsetY fields are read-only. The control supports moving the layer by rotation, also called rotamove. These fields can also be used to keep other layers aligned or synchronized with the rotating layer while it is being dragged.

Any of the following fields can be used to rotate the layer:

The following fields can be used to specify a different rotation center:

  • rotateCenterLayer field, indicates the index of the layer the rotation is around.
  • rotateCenterX field, indicates the expression that determines the x-origin of the rotation point relative to the rotateCenterLayer layer.
  • rotateCenterY field, indicates the expression that determines the y-origin of the rotation point relative to the rotateCenterLayer layer.

The following fields can be used to change the rotation center, while the onDrag field is exDoRotamove:

  • rotamoveCenterX field, gets the x-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveCenterY field, gets the y-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveOffsetX field, gets the x-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate.
  • rotamoveOffsetY field, gets the y-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate.

The rotamoveOffsetY field is mapped to the RotamoveOffsetY property, which means that the following statements are equivalent:

oLayer.Options.rotamoveOffsetY
oLayer.GetOptions().rotamoveOffsetY
oLayer.RotamoveOffsetY
oLayer.GetRotamoveOffsetY()
Type:
  • number
rotamoveOffsetY

(static) rotateAngle :number

The rotateAngle field defines an additional angle in degrees to rotate the layer (corresponds to the [a] flag used in layers field). The defaultRotateAngle field specifies the default angle to rotate the layer. Angle 0 is considered the 12 o'clock direction, and it increases clockwise, so 90 degrees is considered the 3 o'clock direction, 180 degrees the 6 o'clock direction, and 270 degrees (or -90 degrees) the 9 o'clock direction. A positive value rotates the layer clockwise, while a negative value rotates it counter-clockwise.

Any of the following fields can be used to rotate the layer:

  • defaultRotateAngle field, specifies the default angle to rotate the layer
  • rotateAngle field, specifies the angle to rotate the layer.
  • rotateAngleValid field, validates / limits the rotation angle of the layer.
  • value and valueToRotateAngle fields, specifies the expression to convert the value to rotating angle. The rotateAngleToValue field converts the current rotation angle to a value.

The following fields can be used to specify a different rotation center:

  • rotateCenterLayer field, indicates the index of the layer the rotation is around.
  • rotateCenterX field, indicates the expression that determines the x-origin of the rotation point relative to the rotateCenterLayer layer.
  • rotateCenterY field, indicates the expression that determines the y-origin of the rotation point relative to the rotateCenterLayer layer.

The following fields can be used to change the rotation center, while the onDrag field is exDoRotamove:

  • rotamoveCenterX field, gets the x-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveCenterY field, gets the y-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveOffsetX field, gets the x-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate..
  • rotamoveOffsetY field, gets the y-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate.

The rotateAngle field is mapped to the RotateAngle property, which means that the following statements are equivalent:

oLayer.Options = {rotateAngle: 90}
oLayer.SetOptions({rotateAngle: 90})
oLayer.RotateAngle = 90
oLayer.SetRotateAngle(90)
Type:
  • number
Example
0 {number}, no rotation applied to the layer
90 {number}, the layer is rotated 90 degrees clockwise
-90 {number}, the layer is rotated 90 degrees counter-clockwise
rotateAngle

(static) rotateAngleToValue :string

The rotateAngleToValue field specifies the format-expression to convert the rotating angle (degree) to value (corresponds to the [a2v] flag used in layers field), while the valueToRotateAngle field specifies the expression to convert the value to rotating angle (corresponds to the [v2a] flag used in layers field). The rotateAngle field defines an additional angle in degrees to rotate the layer, while defaultRotateAngle field specifies the default angle to rotate the layer. The rotateAngleToValue and valueToRotateAngle fields are used to link the layer's rotation angle to its value, so when the layer is rotated, its value changes according to the rotateAngleToValue expression, and when the layer's value is changed, the layer is rotated according to the valueToRotateAngle expression. For instance, if you want to link the layer's rotation angle to its value in a way that when the layer is rotated 180 degrees, its value is 100, you can set the rotateAngleToValue field to "value/180*100" and the valueToRotateAngle field to "value/100*180". In this way, if you rotate the layer 90 degrees, its value becomes 50, and if you set the layer's value to 25, it is rotated 45 degrees. If the user drags the layer to rotate it, the layer's value changes according to the rotateAngleToValue expression

The expression supports the following keywords:

"value", indicates the value of the Layer.RotateAngle property. Angle 0 is considered the 12 o'clock direction, and it increases clockwise, so 90 degrees is considered the 3 o'clock direction, 180 degrees the 6 o'clock direction, and 270 degrees (or -90 degrees) the 9 o'clock direction.

The rotateAngleToValue field is mapped to the RotateAngleToValue property, which means that the following statements are equivalent:

oLayer.Options = {rotateAngleToValue: "value*180/100"}
oLayer.SetOptions({rotateAngleToValue: "value*180/100"})
oLayer.RotateAngleToValue = "value*180/100"
oLayer.SetRotateAngleToValue("value*180/100")
Type:
  • string
Example
"value/180*100" {string}, when the layer's rotation angle is 180 degrees, its value becomes 100
"value/360*100" {string}, when the layer's rotation angle is 90 degrees, its value becomes 25
"value >= 270 ? (value - 270)/90*50 : (value/90)*50 + 50", {string} wraps and remaps angles into a 0 - 100 range
rotateAngleToValue

(static) rotateAngleValid :string

The rotateAngleValid field validates, limits or snaps the rotation angle of the layer, using a format-expression (corresponds to the [aValid] flag used in layers field). The format-expression must return the angle to rotate the layer to, based on the "value" of the angle specified in the rotateAngle field. If the format-expression returns the same angle as specified in the rotateAngle field, the layer is rotated to that angle, otherwise it is rotated to the angle returned by the format-expression. In this way, you can use the rotateAngleValid field to limit the rotation angle of the layer within a certain range, or to snap the rotation angle to certain values. For instance, if you want to snap the rotation angle of the layer to multiples of 5 degrees, you can set the rotateAngleValid field to "round(value/5)*5". In this way, if you try to rotate the layer to an angle that is not a multiple of 5, the layer is rotated to the nearest multiple of 5. For example, if you set the rotateAngle field to 92, the layer is rotated to 90, and if you set it to 93, the layer is rotated to 95. If you want to limit the rotation angle of the layer between -90 to 90 degrees, you can set the rotateAngleValid field to "value < 90 ? value : (value < 180 ? 90 : (value < 270 ? 270 : value))". In this way, if you try to rotate the layer to an angle less than -90, it is rotated to -90, if you try to rotate it to an angle between -90 and 90, it is rotated to that angle, and if you try to rotate it to an angle greater than 90, it is rotated to 90.

The expression supports the following keywords:

"value", indicates the value of the Layer.RotateAngle property. Angle 0 is considered the 12 o'clock direction, and it increases clockwise, so 90 degrees is considered the 3 o'clock direction, 180 degrees the 6 o'clock direction, and 270 degrees (or -90 degrees) the 9 o'clock direction.

Any of the following fields can be used to rotate the layer:

  • defaultRotateAngle field, specifies the default angle to rotate the layer
  • rotateAngle field, specifies the angle to rotate the layer.
  • rotateAngleValid field, validates / limits the rotation angle of the layer.
  • value and valueToRotateAngle fields, specifies the expression to convert the value to rotating angle. The rotateAngleToValue field converts the current rotation angle to a value.

The following fields can be used to specify a different rotation center:

  • rotateCenterLayer field, indicates the index of the layer the rotation is around.
  • rotateCenterX field, indicates the expression that determines the x-origin of the rotation point relative to the rotateCenterLayer layer.
  • rotateCenterY field, indicates the expression that determines the y-origin of the rotation point relative to the rotateCenterLayer layer.

The following fields can be used to change the rotation center, while the onDrag field is exDoRotamove:

  • rotamoveCenterX field, gets the x-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveCenterY field, gets the y-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveOffsetX field, gets the x-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate..
  • rotamoveOffsetY field, gets the y-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate.

The rotateAngleValid field is mapped to the RotateAngleValid property, which means that the following statements are equivalent:

oLayer.Options = {rotateAngleValid: "value >= 0 && value <= 180"}
oLayer.SetOptions({rotateAngleValid: "value >= 0 && value <= 180"})
oLayer.RotateAngleValid = "value >= 0 && value <= 180"
oLayer.SetRotateAngleValid("value >= 0 && value <= 180")
Type:
  • string
Example
"round(value/5)*5" {string}, snaps the rotation angle of the layer to multiples of 5 degrees
"value &lt; 90 ? value : (value &lt; 180 ? 90 : (value &lt; 270 ? 270 : value))" {string}, limits the rotation angle between -90 (270) to 90 degrees
rotateAngleValid

(static) rotateCenterLayer :number

The rotateCenterLayer field indicates the index or key of the layer the rotation is around (corresponds to the [cLayer] flag used in layers field). If the rotateCenterLayer field is -1, the rotation is relative to the current layer, which means that the rotation center is determined by the rotateCenterX and rotateCenterY fields relative to the current layer. For instance, if you set the rotateCenterLayer field to 1, the layer is rotated around the center specified by the rotateCenterX and rotateCenterY fields of the layer with index 1. If you set it to -1, the layer is rotated around the center specified by the rotateCenterX and rotateCenterY fields of itself. By default, the rotateCenterLayer field is 0, which means that the layer is rotated around the center specified by the rotateCenterX and rotateCenterY fields of the layer with index 0, which is usually the background layer.

Any of the following fields can be used to rotate the layer:

The following fields can be used to specify a different rotation center:

  • rotateCenterLayer field, indicates the index of the layer the rotation is around.
  • rotateCenterX field, indicates the expression that determines the x-origin of the rotation point relative to the rotateCenterLayer layer.
  • rotateCenterY field, indicates the expression that determines the y-origin of the rotation point relative to the rotateCenterLayer layer.

The following fields can be used to change the rotation center, while the onDrag field is exDoRotamove:

  • rotamoveCenterX field, gets the x-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveCenterY field, gets the y-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveOffsetX field, gets the x-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate..
  • rotamoveOffsetY field, gets the y-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate.

The rotateCenterLayer field is mapped to the RotateCenterLayer property, which means that the following statements are equivalent:

oLayer.Options = {rotateCenterLayer: -1}
oLayer.SetOptions({rotateCenterLayer: -1})
oLayer.RotateCenterLayer = -1
oLayer.SetRotateCenterLayer(-1)
Type:
  • number
Example
-1 {number}, the layer is rotated around the center specified by the rotateCenterX and rotateCenterY fields of itself
0 {number}, the layer is rotated around the center specified by the rotateCenterX and rotateCenterY fields of the layer with index 0, which is usually the background layer (default value)
1 {number}, the layer is rotated around the center specified by the rotateCenterX and rotateCenterY fields of the layer with index 1
rotateCenterLayer

(static) rotateCenterX :string

The rotateCenterX field indicates the format-expression that determines the x-origin of the rotation point relative to the rotateCenterLayer field (corresponds to the [xCenter] flag used in layers field), while the rotateCenterY field indicates the format-expression that determines the y-origin of the rotation point relative to the rotateCenterLayer field (corresponds to the [yCenter] flag used in layers field). The rotateCenterLayer field indicates the index or key of the layer the rotation is around. For instance, "lwidth/2 + 16" expression for the rotateCenterX field means that the x-origin of the rotation point is 16 pixels to the right of the center of the layer specified in the rotateCenterLayer field. By default, the rotateCenterX field is "", which means that the rotation center is determined by the rotateCenterLayer layer's center.

The expression of the rotateCenterX and rotateCenterY fields supports the following keywords:

"lwidth", indicates the width in pixels of the layer
"width", specifies the width in pixels of the view / control
"lheight", indicates the height in pixels of the layer
"height", specifies the height in pixels of the view / control

Any of the following fields can be used to rotate the layer:

The following fields can be used to specify a different rotation center:

  • rotateCenterLayer field, indicates the index of the layer the rotation is around.
  • rotateCenterX field, indicates the expression that determines the x-origin of the rotation point relative to the rotateCenterLayer layer.
  • rotateCenterY field, indicates the expression that determines the y-origin of the rotation point relative to the rotateCenterLayer layer.

The following fields can be used to change the rotation center, while the onDrag field is exDoRotamove:

  • rotamoveCenterX field, gets the x-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveCenterY field, gets the y-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveOffsetX field, gets the x-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate..
  • rotamoveOffsetY field, gets the y-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate.

The rotateCenterX field is mapped to the RotateCenterX property, which means that the following statements are equivalent:

oLayer.Options = {rotateCenterX: "lwidth/2 + 78"}
oLayer.SetOptions({rotateCenterX: "lwidth/2 + 78"})
oLayer.RotateCenterX = "lwidth/2 + 78"
oLayer.SetRotateCenterX("lwidth/2 + 78")
Type:
  • string
Example
"" {string}, the rotation center is determined by the rotateCenterLayer layer's center (default value)
"lwidth/2 + 16" {string}, the x-origin of the rotation point is 16 pixels to the right of the center of the layer specified in the rotateCenterLayer field
rotateCenterX

(static) rotateCenterY :string

The rotateCenterY field indicates the format-expression that determines the y-origin of the rotation point relative to the rotateCenterLayer field (corresponds to the [yCenter] flag used in layers field), while the rotateCenterX field indicates the format-expression that determines the x-origin of the rotation point relative to the rotateCenterLayer field (corresponds to the [xCenter] flag used in layers field). The rotateCenterLayer field indicates the index or key of the layer the rotation is around. For instance, "lheight/2 + 16" expression for the rotateCenterY field means that the y-origin of the rotation point is 16 pixels below the center of the layer specified in the rotateCenterLayer field. By default, the rotateCenterY field is "", which means that the rotation center is determined by the rotateCenterLayer layer's center.

The expression of the rotateCenterX and rotateCenterY fields supports the following keywords:

"lwidth", indicates the width in pixels of the layer
"width", specifies the width in pixels of the view / control
"lheight", indicates the height in pixels of the layer
"height", specifies the height in pixels of the view / control

Any of the following fields can be used to rotate the layer:

The following fields can be used to specify a different rotation center:

  • rotateCenterLayer field, indicates the index of the layer the rotation is around.
  • rotateCenterX field, indicates the expression that determines the x-origin of the rotation point relative to the rotateCenterLayer layer.
  • rotateCenterY field, indicates the expression that determines the y-origin of the rotation point relative to the rotateCenterLayer layer.

The following fields can be used to change the rotation center, while the onDrag field is exDoRotamove:

  • rotamoveCenterX field, gets the x-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveCenterY field, gets the y-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveOffsetX field, gets the x-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate..
  • rotamoveOffsetY field, gets the y-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate.

The rotateCenterY field is mapped to the RotateCenterY property, which means that the following statements are equivalent:

oLayer.Options = {rotateCenterY: "lheight/2 + 78"}
oLayer.SetOptions({rotateCenterY: "lheight/2 + 78"})
oLayer.RotateCenterY = "lheight/2 + 78"
oLayer.SetRotateCenterY("lheight/2 + 78")
Type:
  • string
Example
"" {string}, the rotation center is determined by the rotateCenterLayer layer's center (default value)
"lheight/2 + 16" {string}, the y-origin of the rotation point is 16 pixels below the center of the layer specified in the rotateCenterLayer field
rotateCenterY

(static) rotateClip :boolean

The rotateClip field determines whether the layer's clipping region rotates along with the layer (corresponding to the [rotateclip] flag in the layers field). If rotateClip is true, the clipping region rotates together with the layer, preserving its position relative to the layer's content. If false, the clipping region remains fixed relative to the control, while the layer rotates within it. For instance, rotating the layer 90 degrees clockwise also rotates the clipping region when rotateClip is true, but leaves it unchanged when false. The clip field defines the clipping region itself, while rotateClip controls whether that region follows the layer's rotation. By default, rotateClip is false.

The following fields can be used to rotate the layer:

The rotateClip field is mapped to the RotateClip property, which means that the following statements are equivalent:

oLayer.Options = {rotateClip: true}
oLayer.SetOptions({rotateClip: true})
oLayer.RotateClip = true
oLayer.SetRotateClip(true)
Type:
  • boolean
Example
true {boolean}, the layer's clipping region is rotated together with the layer
false {boolean}, the layer's clipping region is not rotated with the layer
rotateClip

(static) selectable :boolean

The selectable field gets or sets the layer's selectability (corresponds to the [sel] flag used in layers field). If the layer is selectable, the user can select the layer by clicking on it, and then move or rotate it if the onDrag field is set. If the layer is un-selectable, the user cannot select the layer, and thus cannot move or rotate it even if the onDrag field is set. If layer is unselectable, the cursor is not changed when the mouse is over it, while if selectable, the cursor is changed to "dable" cursor. By default, the layer is selectable.

The selectable field is mapped to the Selectable property, which means that the following statements are equivalent:

oLayer.Options = {selectable: false}
oLayer.SetOptions({selectable: false})
oLayer.Selectable = false
oLayer.SetSelectable(false)
Type:
  • boolean
Example
true {boolean}, the layer is selectable (the user can move or rotate it if the onDrag field is set)
false {boolean}, the layer is un-selectable (the user cannot move or rotate it even if the onDrag field is set)
selectable

(static) top :number|string

The top field specifies the format-expression relative to the view, to determine the y-position to show the current layer on the control (corresponds to the [top] flag used in layers field), while the left field specifies the format-expression relative to the view, to determine the x-position to show the current layer on the control. The layer's actual y-position is the sum of top, defaultOffsetY, and offsetY, while the actual x-position is the sum of left, defaultOffsetX, and offsetX. The field is ignored if the expression is invalid. For instance, if you set the top field to "height/2", the defaultOffsetY field to 10, and the offsetY field to 5, the layer is shown with a total y-position of height/2 + 15 pixels from the top edge of the control.

The expression supports the following keywords:

"width", indicates the width of the control
"height", indicates the height of the control

Any of the following fields can be used to move the layer:

Any of the following fields can be used to move or resize the layer:

  • left and top fields, specifies the format-expression relative to the view, to determine the x- and y-position to show the current layer on the control
  • width and height fields, specifies the format-expression relative to the view, to determine the width and height to show the current layer on the control

The top field is mapped to the Layer.Top property, which means that the following statements are equivalent:

oLayer.Options = {top: "height/2"}
oLayer.SetOptions({top: "height/2"})
oLayer.Top = "height/2"
oLayer.SetTop("height/2")
Type:
  • number | string
Example
"0" or "" {string} or {null} or {undefined}, the layer is shown at the position specified by the offsetY field from the top edge of the control.
"height/2+10" {string}, the layer is shown at the vertical center of the control, plus 10 pixels and any additional y-offset specified in defaultOffsetY and offsetY fields
top

(static) transparency :number|string

The transparency field specifies the transparency of the layer, as a percent value or a format-expression (corresponding to the [transparency] flag in the layers field). The transparency field can be used to link the layer's transparency to its value, so when the layer's value changes, its transparency changes according to the expression set in the transparency field. For instance, if you want the layer to become more transparent as its value increases, you can set the transparency field to "value/2", which means that when the layer's value is 100, it is displayed with 50% transparency, and when the layer's value is 0, it is displayed with 0% transparency (fully opaque). If you set it to "100 - value/2", it becomes more opaque as its value increases. If you set it to a constant number like 30, it is displayed with 30% transparency regardless of its value.

The expression supports the following keywords:

"value", indicates the Layer.Value property of the layer, which is the value displayed by the layer and can be linked to the layer's rotation angle or offset though the rotateAngleToValue, offsetToValue fields, so when the layer is rotated or moved, its value changes accordingly.

The transparency field is mapped to the Transparency property, which means that the following statements are equivalent:

oLayer.Options = {transparency: "value/2"}
oLayer.SetOptions({transparency: "value/2"})
oLayer.Transparency = "value/2"
oLayer.SetTransparency("value/2")
Type:
  • number | string
Example
50 {number}, the layer is displayed with 50% transparency regardless of its value
"value/2" {string}, the transparency of the layer is half of its value
"100 - value" {string}, the transparency of the layer decreases as its value increases
transparency

(static) value :number

The value field represents the value of the layer, which can its offset or its rotation angle, based on the onDrag field (corresponds to the [value] flag used in layers field). The Clip.Value property associates a value with the layer's clipping region. Each layer can associate a value with it, while the Gauge.Value property can be associated through the Gauge.LayerOfValue property with the value of one of the layers within the control.

For instance:

  • the control displays a clock, the value could be the current-time
  • the control shows a switch, so the value could indicate the state of the switch
  • the control shows a thermometer, so the value could be the current temperature
  • the control displays a gauge, so the value could be the value on the gauge pointed by the needle

The onchange event occurs when the Layer.Value property is changed. During the onchange event, you can change values of other layers as well. For instance, if the second-hand of the clock is rotated, you can rotate the hour and the minute-hands of the clock as well.

The value field indicates the "value" keyword in the following properties:

  • valueToOffsetX field, specifies the format-expression to convert the value to x-offset. The offsetX field is the result of evaluating the valueToOffsetX field expression, while the onDrag field is exDoMove. The offsetToValue field converts the current offset to a value.
  • valueToOffsetY field, specifies the format-expression to convert the value to y-offset. The offsetY field is the result of evaluating the valueToOffsetY field expression, while the onDrag field is exDoMove. The offsetToValue converts the current offset to a value.
  • valueToRotateAngle field, specifies the format-expression to convert the value to rotating angle. The rotateAngle field is the result of evaluating the valueToRotateAngle field expression, while the onDrag field is exDoRotate or exDoRotamove. The rotateAngleToValue field converts the current rotation angle to a value.

The value field works in association with the layer's OnDrag property like follows:

  • If the onDrag field is exDoMove, evaluating the valueToOffsetX field indicates the layer's offsetX field.
  • If the onDrag field is exDoMove, evaluating the valueToOffsetY field indicates the layer's offsetY field.
  • If the onDrag field is exDoRotate or exDoRotamove, evaluating the valueToRotateAngle field indicates the layer's rotateAngle field.

The value field is mapped to the Layer.Value property, which means that the following statements are equivalent:

oLayer.Options = {value: 50}
oLayer.SetOptions({value: 50})
oLayer.Value = 50
oLayer.SetValue(50)
Type:
  • number
Example
0 {number}, the value of the layer is 0
50 {number}, the value of the layer is 50
value

(static) valueToOffsetX :number|string

The valueToOffsetX field specifies the format-expression to convert the value to x-offset (corresponds to the [v2x] flag used in layers field), while the valueToOffsetY field specifies the expression to convert the value to y-offset (corresponds to the [v2y] flag used in layers field). In other words, when the value field changes, the offsetX field is updated based on the valueToOffsetX expression. The offsetToValue field converts the current x- and y-offset to a value. If the expression is invalid, the field is ignored. For instance, if you set the valueToOffsetX field to "value*2", when the value is 10, the layer is shown with an x-offset of 20 pixels from the position specified by the left field and any additional x-offset specified in defaultOffsetX and offsetX fields.

The expression supports the following keywords:

"value", gets the value the Layer.Value property returns

Any of the following fields can be used to move the layer:

  • defaultOffsetX and defaultOffsetY fields, indicates the default x- and y-offset of the layer
  • offsetX and offsetY fields, indicates additional x- and y-offset of the layer
  • offsetXValid and offsetYValid fields, validates / limits the x- and y-offset value of the layer
  • value, valueToOffsetX and valueToOffsetY fields, specifies the format-expression to convert the value to x- and y-offset. The offsetToValue field converts the current x- and y-offset to a value.

Any of the following fields can be used to move or resize the layer:

  • left and top fields, specifies the format-expression relative to the view, to determine the x- and y-position to show the current layer on the control
  • width and height fields, specifies the format-expression relative to the view, to determine the width and height to show the current layer on the control

The valueToOffsetX field is mapped to the ValueToOffsetX property, which means that the following statements are equivalent:

oLayer.Options = {valueToOffsetX: "value*2"}
oLayer.SetOptions({valueToOffsetX: "value*2"})
oLayer.ValueToOffsetX = "value*2"
oLayer.SetValueToOffsetX("value*2")
Type:
  • number | string
Example
0 {number}, sets the x-offset to 0 pixels regardless of the value field
"value=0 ? 0 : 48" {string}, sets the x-offset to 0 pixels if the value is 0 or 48 pixels if the value is not 0
valueToOffsetX

(static) valueToOffsetY :number|string

The valueToOffsetY field specifies the format-expression to convert the value to y-offset (corresponds to the [v2y] flag used in layers field), while the valueToOffsetX field specifies the expression to convert the value to x-offset (corresponds to the [v2x] flag used in layers field). In other words, when the value field changes, the offsetY field is updated based on the valueToOffsetY expression. The offsetToValue field converts the current x- and y-offset to a value. If the expression is invalid, the field is ignored. For instance, if you set the valueToOffsetY field to "value*2", when the value is 10, the layer is shown with a y-offset of 20 pixels from the position specified by the top field and any additional y-offset specified in defaultOffsetY and offsetY fields.

The expression supports the following keywords:

"value", gets the value the Layer.Value property returns

Any of the following fields can be used to move the layer:

  • defaultOffsetX and defaultOffsetY fields, indicates the default x- and y-offset of the layer
  • offsetX and offsetY fields, indicates additional x- and y-offset of the layer
  • offsetXValid and offsetYValid fields, validates / limits the x- and y-offset value of the layer
  • value, valueToOffsetX and valueToOffsetY fields, specifies the format-expression to convert the value to x- and y-offset. The offsetToValue field converts the current x- and y-offset to a value.

Any of the following fields can be used to move or resize the layer:

  • left and top fields, specifies the format-expression relative to the view, to determine the x- and y-position to show the current layer on the control
  • width and height fields, specifies the format-expression relative to the view, to determine the width and height to show the current layer on the control

The valueToOffsetY field is mapped to the ValueToOffsetY property, which means that the following statements are equivalent:

oLayer.Options = {valueToOffsetY: "value*2"}
oLayer.SetOptions({valueToOffsetY: "value*2"})
oLayer.ValueToOffsetY = "value*2"
oLayer.SetValueToOffsetY("value*2")
Type:
  • number | string
Example
0 {number}, sets the y-offset to 0 pixels regardless of the value field
"value=0 ? 0 : 48" {string}, sets the y-offset to 0 pixels if the value is 0 or 48 pixels if the value is not 0
valueToOffsetY

(static) valueToRotateAngle :string

The valueToRotateAngle field specifies the format-expression to convert the value to rotating angle (corresponds to the [v2a] flag used in layers field), while the rotateAngleToValue field specifies the format-expression to convert the rotating angle (degree) to value (corresponds to the [a2v] flag used in layers field). The value field specifies the layer's value, which can be linked to the layer's rotation angle through the valueToRotateAngle and rotateAngleToValue fields. The rotateAngle field defines an additional angle in degrees to rotate the layer, while defaultRotateAngle field specifies the default angle to rotate the layer. The rotateAngleToValue and valueToRotateAngle fields are used to link the layer's rotation angle to its value, so when the layer is rotated, its value changes according to the rotateAngleToValue expression, and when the layer's value is changed, the layer is rotated according to the valueToRotateAngle expression. For instance, "value/100*360" expression remaps the layer's value in a 0 - 100 range to a rotation angle in a 0 - 360 range, so if you set the layer's value to 25, it is rotated 90 degrees, and if you rotate the layer 180 degrees, its value becomes 50. If the user changes the layer's value, the layer is rotated according to the valueToRotateAngle expression.

The expression supports the following keywords:

"value", indicates the value of the Layer.Value property

Any of the following fields can be used to rotate the layer:

  • defaultRotateAngle field, specifies the default angle to rotate the layer
  • rotateAngle field, specifies the angle to rotate the layer.
  • rotateAngleValid field, validates / limits the rotation angle of the layer.
  • value and valueToRotateAngle fields, specifies the expression to convert the value to rotating angle. The rotateAngleToValue field converts the current rotation angle to a value.

The following fields can be used to specify a different rotation center:

  • rotateCenterLayer field, indicates the index of the layer the rotation is around.
  • rotateCenterX field, indicates the expression that determines the x-origin of the rotation point relative to the rotateCenterLayer layer.
  • rotateCenterY field, indicates the expression that determines the y-origin of the rotation point relative to the rotateCenterLayer layer.

The following fields can be used to change the rotation center, while the onDrag field is exDoRotamove:

  • rotamoveCenterX field, gets the x-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveCenterY field, gets the y-coordinate of the background content's center (back field), indicating the horizontal position of the visual center of the actual content, not the full image.
  • rotamoveOffsetX field, gets the x-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate..
  • rotamoveOffsetY field, gets the y-offset of the layer's center point during rotation when the layer's onDrag field is set to exDoRotamove or exDoRotate.

The valueToRotateAngle field is mapped to the ValueToRotateAngle property, which means that the following statements are equivalent:

oLayer.Options = {valueToRotateAngle: "value/100*180"}
oLayer.SetOptions({valueToRotateAngle: "value/100*180"})
oLayer.ValueToRotateAngle = "value/100*180"
oLayer.SetValueToRotateAngle("value/100*180")
Type:
  • string
Example
"value/100*180" {string}, when the layer's value is 25, it is rotated 45 degrees
"value/100*360" {string}, when the layer's value is 25, it is rotated 90 degrees
"value &lt; 50 ? (270 + value/50*90) : (value - 50)/50 * 90", {string} wraps and remaps values into a 0 - 360 range
valueToRotateAngle

(static) visible :boolean

The visible field indicates whether the layer is visible or hidden (corresponds to the [vis] flag used in layers field). If the layer is visible, it is drawn on the control, while if the layer is hidden, it is not drawn on the control. The position field is used to determine the z-order of the layer, which is the order in which layers are drawn on the control. The layer with position 0 is drawn first, then the layer with position 1 is drawn over it, and so on. For instance, if you set the visible field of a layer to false, the layer is hidden and not drawn on the control, while if you set the visible field of a layer to true, the layer is shown and drawn on the control. By default, the layer is visible.

The visible field is mapped to the Visible property, which means that the following statements are equivalent:

oLayer.Options = {visible: false}
oLayer.SetOptions({visible: false})
oLayer.Visible = false
oLayer.SetVisible(false)
Type:
  • boolean
Example
true {boolean}, the layer is visible and drawn on the control
false {boolean}, the layer is hidden and not drawn on the control
visible

(static) width :number|string

The width field specifies the format-expression relative to the view, to determine the width to show the current layer on the control (corresponds to the [width] flag used in layers field), while the height field specifies the expression relative to the view, to determine the height to show the current layer on the control. The field is ignored if the expression is invalid. For instance, if you set the width field to "width/2", and the height field to "height/2", the layer is shown with a width and height of half of the control's width and height respectively.

The expression supports the following keywords:

"width", indicates the width of the control
"height", indicates the height of the control

Any of the following fields can be used to move the layer:

Any of the following fields can be used to move or resize the layer:

  • left and top fields, specifies the format-expression relative to the view, to determine the x- and y-position to show the current layer on the control
  • width and height fields, specifies the format-expression relative to the view, to determine the width and height to show the current layer on the control

The width field is mapped to the Layer.Width property, which means that the following statements are equivalent:

oLayer.Options = {width: "width/2"}
oLayer.SetOptions({width: "width/2"})
oLayer.Width = "width/2"
oLayer.SetWidth("width/2")
Type:
  • number | string
Example
"" {string} or {null} or {undefined}, the layer is shown with its original width and height
12 {number}, the layer is shown with a width of 12 pixels
"width/2" {string}, the layer is shown with a width of half of the control's width
width