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. Such a resource must have been defined in the control definition as themedResources in Description.json.
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 |
| |
resourceName |
|
Return value
Type | Description |
---|---|
Currently active default value. |
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
}