svghmi/widget_multistate.ysl2
branchsvghmi
changeset 3232 7bdb766c2a4d
parent 3018 22b969b409b0
child 3241 fe945f1f48b7
--- a/svghmi/widget_multistate.ysl2	Thu Apr 15 09:15:23 2021 +0200
+++ b/svghmi/widget_multistate.ysl2	Sun May 02 23:01:08 2021 +0200
@@ -1,8 +1,7 @@
 // widget_multistate.ysl2
 
-template "widget[@type='MultiState']", mode="widget_class"
+widget_class("MultiState")
     ||
-    class MultiStateWidget extends Widget{
         frequency = 5;
         state = 0;
         dispatch(value) {
@@ -41,10 +40,9 @@
         init() {
             this.element.setAttribute("onclick", "hmi_widgets['"+this.element_id+"'].on_click(evt)");
         }
-    }
     ||
 
-template "widget[@type='MultiState']", mode="widget_defs" {
+widget_defs("MultiState") {
     param "hmi_element";
     |     choices: [
     const "regex",!"'^(\"[^\"].*\"|\-?[0-9]+|false|true)(#.*)?$'"!;