svghmi/widget_textlist.ysl2
author Edouard Tisserant
Wed, 29 Nov 2023 11:54:56 +0100
changeset 3861 7e17f7e02a2b
parent 3556 5d73bed497de
permissions -rw-r--r--
Runtime: add GetVersions() call to PLCObject, use it in web settings and expose it in WAMP and Pyro.

Note: WAMP changes are untested
// 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(),
}

widget_class("TextList");