svghmi/widget_textlist.ysl2
author Edouard Tisserant <edouard.tisserant@gmail.com>
Thu, 21 Oct 2021 20:56:05 +0200
changeset 3370 3c31dce1a661
parent 3354 819b0bdfa705
child 3556 5d73bed497de
permissions -rw-r--r--
Make OPC-UA client compatible with wxPython3, util wxPython4 branch deserve to be merged
// widget_textlist.ysl2

widget_desc("TextList") {
    longdesc
    ||
    TextList widget is a svg:group, list items are labeled elements
    in that group.

    To use a TextList, clone (svg:use) one of the items inside the widget 
    that expects a TextList.

    In this list, (translated) text content is what matters. Nevertheless
    text style of the cloned item will be applied in client widget.
    ||

    shortdesc > A named list of ordered texts 

    arg name="listname"
}

widget_defs("TextList") {
    |     texts: [
    foreach "func:refered_elements($hmi_element/*[@inkscape:label])[self::svg:text]" {
    |         id("«@id»"),
    }
    // could find a proper way in xpath to reverse()
    |     ].reverse(),
}