getDefaultValue

[ Function ]

public static getDefaultValue (
    control: TcHmi.Controls.System.baseTcHmiControl,
    propertyName: string
): TcHmi.Theme.Resource;

Returns the current default value (determined by the theme) of a control property.

Parameter

Name

Type

Description

control

TcHmi.Controls.System.baseTcHmiControl

 

propertyName

string

 

Return value

Type

Description

TcHmi.Theme.Resource

Currently active default value.

getDefaultValue 1:

Available from version 1.10

Sample - JavaScript

var themeValue = TcHmi.Theme.Properties.getDefaultValue(this, 'Value'); 
if(themeValue.origin === 'project'){
    // Value was set in a project theme
}
if(themeValue.value !== null){
    // use themeValue.value
    // Is for example false if this was set in the Theme or defaultValueInternal of its Description.json
}