svghmi/widget_customhtml.ysl2
author Edouard Tisserant <edouard.tisserant@gmail.com>
Mon, 03 May 2021 00:14:11 +0200
branchsvghmi
changeset 3237 d000a91d1e95
parent 3232 7bdb766c2a4d
child 3241 fe945f1f48b7
permissions -rw-r--r--
SVGHMI: Intermediate state while updating UI, preparing for displaying widget description and multiple variables selections
// widget_customhtml.ysl2

widget_class("CustomHtml"){
    ||
        frequency = 5;
        widget_size = undefined;

        dispatch(value) {
            this.request_animate();
        }

        animate(){
        }

        init() {
            this.widget_size = this.container_elt.getBBox();
            this.element.innerHTML ='<foreignObject x="'+
                this.widget_size.x+'" y="'+this.widget_size.y+
                '" width="'+this.widget_size.width+'" height="'+this.widget_size.height+'"> '+
                this.code_elt.textContent+
                ' </foreignObject>';
        }
    ||
}


widget_defs("CustomHtml") {
    param "hmi_element";
    labels("container code");
}