svghmi/widget_switch.ysl2
branchsvghmi
changeset 3220 ec365ef396b1
parent 2969 88988edb2e93
child 3232 7bdb766c2a4d
equal deleted inserted replaced
3219:cc0ecc5e918f 3220:ec365ef396b1
    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 "$result_svg_ns//*[@id = $hmi_element/@id]//*[regexp:test(@inkscape:label,$regex)]" {
    23 
       
    24     const "subelts", "$result_widgets[@id = $hmi_element/@id]//*";
       
    25     const "subwidgets", "$subelts//*[@id = $hmi_widgets/@id]";
       
    26     const "accepted", "$subelts[not(ancestor-or-self::*/@id = $subwidgets/@id)]";
       
    27 
       
    28     foreach "$accepted[regexp:test(@inkscape:label,$regex)]" {
    24         const "literal", "regexp:match(@inkscape:label,$regex)[2]";
    29         const "literal", "regexp:match(@inkscape:label,$regex)[2]";
    25     |         {
    30     |         {
    26     |             elt:id("«@id»"),
    31     |             elt:id("«@id»"),
    27     |             style:"«@style»",
    32     |             style:"«@style»",
    28     |             value:«$literal»
    33     |             value:«$literal»