svghmi/widget_list.ysl2
author Edouard Tisserant <edouard.tisserant@gmail.com>
Thu, 25 Mar 2021 13:07:52 +0100
branchsvghmi
changeset 3201 6dadc1690284
parent 3185 9038655c1b18
child 3232 7bdb766c2a4d
permissions -rw-r--r--
SVGHMI: split svghmi.py into svghmi.py (Config Tree Node + code gen) and ui.py (UI for HMI tree and Widget picking)
// widget_list.ysl2

template "widget[@type='List']", mode="widget_defs" {
    param "hmi_element";
    |     items: {
    foreach "$hmi_element/*[@inkscape:label]" {
    |         «@inkscape:label»: "«@id»",
    }
    |     },
}

template "widget[@type='TextStyleList']", mode="widget_defs" {
    param "hmi_element";
    |     styles: {
    foreach "$hmi_element/*[@inkscape:label]" {
        const "style", "func:refered_elements(.)[self::svg:text]/@style";
    |         «@inkscape:label»: "«$style»",
    }
    |     },
}