svghmi/widget_button.ysl2
author Edouard Tisserant
Wed, 13 May 2020 14:47:17 +0200
branchsvghmi
changeset 2964 a7b11c9f468e
parent 2944 2a20038fbea9
child 2961 00825316ed00
permissions -rw-r--r--
Added FatalError call to Libraries code gen, so that they can emit messages addressed like config tree nodes do.
// widget_button.ysl2

template "widget[@type='Button']", mode="widget_defs" {
    param "hmi_element";
    | frequency: 5,
    | init: function() {
    |     this.element.addEventListener(
    |       "mousedown",
    |       evt => {
    |           change_hmi_value(this.indexes[0], "=1");
    |       });
    |     this.element.addEventListener(
    |       "mouseup",
    |       evt => {
    |           change_hmi_value(this.indexes[0], "=0");
    |       });
    | },
}