get

[ Function ]

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

Returns the current resource value (determined by the theme) of a control. If this value contains a path (e.g. the URL of an image), the base path (i.e. to the current control or project theme directory) must be determined via resolveBasePath.

Parameter

Name

Type

Description

control

TcHmi.Controls.System.baseTcHmiControl

 

resourceName

string

 

Return value

Type

Description

TcHmi.Theme.Resource

Currently active default value.

get 1:

Available from version 1.10

Sample - JavaScript

var themeValue = TcHmi.Theme.Resources.get(this, 'myThemedResource');
if(themeValue.origin === 'project'){
    // Value was set in a project theme
}
if(themeValue.value !== null){
    // use themeValue.value
}