svghmi/widget_switch.ysl2
branchsvghmi
changeset 2969 88988edb2e93
parent 2962 02ea529fd08c
child 3220 ec365ef396b1
equal deleted inserted replaced
2968:556ef07a7e31 2969:88988edb2e93
    18 
    18 
    19 template "widget[@type='Switch']", mode="widget_defs" {
    19 template "widget[@type='Switch']", mode="widget_defs" {
    20     param "hmi_element";
    20     param "hmi_element";
    21     |     choices: [
    21     |     choices: [
    22     const "regex",!"'^(\"[^\"].*\"|\-?[0-9]+|false|true)(#.*)?$'"!;
    22     const "regex",!"'^(\"[^\"].*\"|\-?[0-9]+|false|true)(#.*)?$'"!;
    23     foreach "$hmi_element/*[regexp:test(@inkscape:label,$regex)]" {
    23     foreach "$result_svg_ns//*[@id = $hmi_element/@id]//*[regexp:test(@inkscape:label,$regex)]" {
    24         const "literal", "regexp:match(@inkscape:label,$regex)[2]";
    24         const "literal", "regexp:match(@inkscape:label,$regex)[2]";
    25     |         {
    25     |         {
    26     |             elt:id("«@id»"),
    26     |             elt:id("«@id»"),
    27     |             style:"«@style»",
    27     |             style:"«@style»",
    28     |             value:«$literal»
    28     |             value:«$literal»