svghmi/widget_list.ysl2
author Edouard Tisserant <edouard.tisserant@gmail.com>
Tue, 18 May 2021 09:22:17 +0200
branchsvghmi
changeset 3241 fe945f1f48b7
parent 3232 7bdb766c2a4d
child 3320 9fe5b4a04acc
permissions -rw-r--r--
SVGHMI: WIP on Widget DnD UI : Added documentation to widgets, that is injected in widget parse tree during widget analysis
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
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
     2
widget_desc("List") {
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
    // TODO
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
     4
}
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
     5
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
     6
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
     7
    |     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
     8
    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
     9
    |         «@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
    10
    }
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
    11
    |     },
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
    12
}
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
    13
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
    14
widget_defs("TextStyleList") {
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
    15
    // TODO
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
    16
}
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
    17
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
    18
widget_defs("TextStyleList") {
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
    19
    |     styles: {
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
    20
    foreach "$hmi_element/*[@inkscape:label]" {
3185
9038655c1b18 Backed out changeset b2ba6eeb61ec. Users reported text styling being messed in some cases.
Edouard Tisserant
parents: 3175
diff changeset
    21
        const "style", "func:refered_elements(.)[self::svg:text]/@style";
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
    22
    |         «@inkscape:label»: "«$style»",
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
    23
    }
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
    24
    |     },
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
}