svghmi/widget_list.ysl2
author Edouard Tisserant <edouard.tisserant@gmail.com>
Tue, 30 Nov 2021 18:43:10 +0100
branchwxPython4
changeset 3391 0ae5a15efa18
parent 3320 9fe5b4a04acc
child 3386 608f48ad3dfc
permissions -rw-r--r--
OPC-UA client: generated code now take UA_Variants on the stack directly, avoid useless allocation on write, and unalloc implicitely allocated data on read
2997
2f298089e32e SVGHMI: JsonTable now picks items from HMI:List, and update texts, all according to Json data. Still miss scrolling.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     1
// widget_list.ysl2
3320
9fe5b4a04acc SVGHMI: Add TextList widget, add support for TextList in DropDown widget, move List, TextStyleList and TextList widget code in dedicated file with documentation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3241
diff changeset
     2
3241
fe945f1f48b7 SVGHMI: WIP on Widget DnD UI : Added documentation to widgets, that is injected in widget parse tree during widget analysis
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3232
diff changeset
     3
widget_desc("List") {
3320
9fe5b4a04acc SVGHMI: Add TextList widget, add support for TextList in DropDown widget, move List, TextStyleList and TextList widget code in dedicated file with documentation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3241
diff changeset
     4
    longdesc
9fe5b4a04acc SVGHMI: Add TextList widget, add support for TextList in DropDown widget, move List, TextStyleList and TextList widget code in dedicated file with documentation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3241
diff changeset
     5
    ||
9fe5b4a04acc SVGHMI: Add TextList widget, add support for TextList in DropDown widget, move List, TextStyleList and TextList widget code in dedicated file with documentation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3241
diff changeset
     6
    List widget is a svg:group, list items are labeled elements
9fe5b4a04acc SVGHMI: Add TextList widget, add support for TextList in DropDown widget, move List, TextStyleList and TextList widget code in dedicated file with documentation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3241
diff changeset
     7
    in that group.
9fe5b4a04acc SVGHMI: Add TextList widget, add support for TextList in DropDown widget, move List, TextStyleList and TextList widget code in dedicated file with documentation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3241
diff changeset
     8
9fe5b4a04acc SVGHMI: Add TextList widget, add support for TextList in DropDown widget, move List, TextStyleList and TextList widget code in dedicated file with documentation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3241
diff changeset
     9
    To use a List, clone (svg:use) one of the items inside the widget that
9fe5b4a04acc SVGHMI: Add TextList widget, add support for TextList in DropDown widget, move List, TextStyleList and TextList widget code in dedicated file with documentation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3241
diff changeset
    10
    expects a List.
9fe5b4a04acc SVGHMI: Add TextList widget, add support for TextList in DropDown widget, move List, TextStyleList and TextList widget code in dedicated file with documentation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3241
diff changeset
    11
9fe5b4a04acc SVGHMI: Add TextList widget, add support for TextList in DropDown widget, move List, TextStyleList and TextList widget code in dedicated file with documentation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3241
diff changeset
    12
    Positions of items are relative to each other, and they must all be in the
9fe5b4a04acc SVGHMI: Add TextList widget, add support for TextList in DropDown widget, move List, TextStyleList and TextList widget code in dedicated file with documentation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3241
diff changeset
    13
    same place. In order to make editing easier it is therefore recommanded to
9fe5b4a04acc SVGHMI: Add TextList widget, add support for TextList in DropDown widget, move List, TextStyleList and TextList widget code in dedicated file with documentation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3241
diff changeset
    14
    make stacked clones of svg elements spread nearby the list.
9fe5b4a04acc SVGHMI: Add TextList widget, add support for TextList in DropDown widget, move List, TextStyleList and TextList widget code in dedicated file with documentation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3241
diff changeset
    15
    ||
9fe5b4a04acc SVGHMI: Add TextList widget, add support for TextList in DropDown widget, move List, TextStyleList and TextList widget code in dedicated file with documentation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3241
diff changeset
    16
9fe5b4a04acc SVGHMI: Add TextList widget, add support for TextList in DropDown widget, move List, TextStyleList and TextList widget code in dedicated file with documentation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3241
diff changeset
    17
    shortdesc > A named list of named graphical elements
9fe5b4a04acc SVGHMI: Add TextList widget, add support for TextList in DropDown widget, move List, TextStyleList and TextList widget code in dedicated file with documentation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3241
diff changeset
    18
9fe5b4a04acc SVGHMI: Add TextList widget, add support for TextList in DropDown widget, move List, TextStyleList and TextList widget code in dedicated file with documentation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3241
diff changeset
    19
    arg name="listname"
3241
fe945f1f48b7 SVGHMI: WIP on Widget DnD UI : Added documentation to widgets, that is injected in widget parse tree during widget analysis
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3232
diff changeset
    20
}
2997
2f298089e32e SVGHMI: JsonTable now picks items from HMI:List, and update texts, all according to Json data. Still miss scrolling.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    21
3232
7bdb766c2a4d SVGHMI: In order to allow widget signature and description to coexist in same ysl2 file, introduced widget_class, widget_defs to declare widget codegen templates and gen_index_xhtml to mark templates that are only usefull in gen_index_xhtml.xslt.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3185
diff changeset
    22
widget_defs("List") {
2997
2f298089e32e SVGHMI: JsonTable now picks items from HMI:List, and update texts, all according to Json data. Still miss scrolling.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    23
    |     items: {
2f298089e32e SVGHMI: JsonTable now picks items from HMI:List, and update texts, all according to Json data. Still miss scrolling.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    24
    foreach "$hmi_element/*[@inkscape:label]" {
3031
440d74319a74 SVGHMI: Refactor the way JsonTable generate javascript code to access json data. Now support multiple assignments, used in the case of text to change both content and style on the same element.
Edouard Tisserant
parents: 3028
diff changeset
    25
    |         «@inkscape:label»: "«@id»",
2997
2f298089e32e SVGHMI: JsonTable now picks items from HMI:List, and update texts, all according to Json data. Still miss scrolling.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    26
    }
2f298089e32e SVGHMI: JsonTable now picks items from HMI:List, and update texts, all according to Json data. Still miss scrolling.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    27
    |     },
2f298089e32e SVGHMI: JsonTable now picks items from HMI:List, and update texts, all according to Json data. Still miss scrolling.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    28
}
3031
440d74319a74 SVGHMI: Refactor the way JsonTable generate javascript code to access json data. Now support multiple assignments, used in the case of text to change both content and style on the same element.
Edouard Tisserant
parents: 3028
diff changeset
    29