svghmi/widget_foreach.ysl2
author Edouard Tisserant <edouard.tisserant@gmail.com>
Mon, 18 Nov 2024 13:55:51 +0100
changeset 4040 ea2db66b185f
parent 4025 92b3701fceed
child 4048 b3ea419a4d47
permissions -rw-r--r--
Cosmetic changes
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
     1
// widget_foreach.ysl2
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
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("ForEach") {
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
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
     5
    longdesc
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
     6
    ||
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
     7
    ForEach widget is used to span a small set of widget over a larger set of
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
     8
    repeated HMI_NODEs. 
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
     9
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
    10
    Idea is somewhat similar to relative page, but it all happens inside the
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
    11
    ForEach widget, no page involved.
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
    12
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
    13
    Together with relative Jump widgets it can be used to build a menu to reach
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
    14
    relative pages covering many identical HMI_NODES siblings.
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
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
    ForEach widget takes a HMI_CLASS name as argument and a HMI_NODE path as
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
    variable.
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
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
    19
    Direct sub-elements can be either groups of widget to be spanned, labeled
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
    "ClassName:offset", or buttons to control the spanning, labeled
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
    21
    "ClassName:+/-number".
4025
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
    22
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
    23
    In case of "ClassName:offset", offset for first element is 1.
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
    24
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
    25
    ||
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
    26
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
    27
    shortdesc > span widgets over a set of repeated HMI_NODEs
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
    28
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
    29
    arg name="class_name" accepts="string" > HMI_CLASS name
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
    30
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
    31
    path name="root" accepts="HMI_NODE" >  where to find HMI_NODEs whose HMI_CLASS is class_name
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
    32
}
2891
8927ae8326b2 SVGHMI: add widget_foreach.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    33
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: 3005
diff changeset
    34
widget_defs("ForEach") {
2894
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    35
4025
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
    36
    if "count(path) < 1" error > ForEach widget «$hmi_element/@id» must have one HMI path given.
3005
ff9ae4f4e3be SVGHMI: widgets are not anymore binary relative or absolute, but have a "relativeness".
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3003
diff changeset
    37
    if "count(arg) != 1" error > ForEach widget «$hmi_element/@id» must have one argument given : a class name.
ff9ae4f4e3be SVGHMI: widgets are not anymore binary relative or absolute, but have a "relativeness".
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3003
diff changeset
    38
2894
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    39
    const "class","arg[1]/@value";
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    40
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    41
    const "base_path","path/@value";
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    42
    const "hmi_index_base", "$indexed_hmitree/*[@hmipath = $base_path]";
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    43
    const "hmi_tree_base", "$hmitree/descendant-or-self::*[@path = $hmi_index_base/@path]";
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    44
    const "hmi_tree_items", "$hmi_tree_base/*[@class = $class]";
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    45
    const "hmi_index_items", "$indexed_hmitree/*[@path = $hmi_tree_items/@path]"; 
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    46
    const "items_paths", "$hmi_index_items/@hmipath"; 
2893
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    47
    |     index_pool: [
2894
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    48
    foreach "$hmi_index_items" {
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    49
    |       «@index»`if "position()!=last()" > ,`
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    50
    }
2893
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    51
    |     ],
2896
99c5335ed59f SVGHMI: Widget ForEach buttons now call corresponding methods.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2895
diff changeset
    52
    |     init: function() {
2893
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    53
    const "prefix","concat($class,':')";
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    54
    const "buttons_regex","concat('^',$prefix,'[+\-][0-9]+')";
2896
99c5335ed59f SVGHMI: Widget ForEach buttons now call corresponding methods.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2895
diff changeset
    55
    const "buttons", "$hmi_element/*[regexp:test(@inkscape:label, $buttons_regex)]"; 
99c5335ed59f SVGHMI: Widget ForEach buttons now call corresponding methods.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2895
diff changeset
    56
    foreach "$buttons" {
99c5335ed59f SVGHMI: Widget ForEach buttons now call corresponding methods.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2895
diff changeset
    57
        const "op","substring-after(@inkscape:label, $prefix)";
99c5335ed59f SVGHMI: Widget ForEach buttons now call corresponding methods.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2895
diff changeset
    58
    |         id("«@id»").setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_click('«$op»', evt)");
2893
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    59
    }
2896
99c5335ed59f SVGHMI: Widget ForEach buttons now call corresponding methods.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2895
diff changeset
    60
    |
2895
89c02b452717 SVGHMI: ForEach now has working (un)subscribe. Fixed PageSwitch that wasn't behaving when jumping to current page with another path.
Edouard Tisserant
parents: 2894
diff changeset
    61
    |         this.items = [
2893
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    62
    const "items_regex","concat('^',$prefix,'[0-9]+')";
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    63
    const "unordered_items","$hmi_element//*[regexp:test(@inkscape:label, $items_regex)]";
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    64
    foreach "$unordered_items" {
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    65
        const "elt_label","concat($prefix, string(position()))"; 
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    66
        const "elt","$unordered_items[@inkscape:label = $elt_label]";
2894
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    67
        const "pos","position()";
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    68
        const "item_path", "$items_paths[$pos]";
2895
89c02b452717 SVGHMI: ForEach now has working (un)subscribe. Fixed PageSwitch that wasn't behaving when jumping to current page with another path.
Edouard Tisserant
parents: 2894
diff changeset
    69
    |           [ /* item="«$elt_label»" path="«$item_path»" */
2893
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    70
        if "count($elt)=0" error > Missing item labeled «$elt_label» in ForEach widget «$hmi_element/@id»
4025
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
    71
        if "count($elt)>1" error > Duplicate item labeled «$elt_label» in ForEach widget «$hmi_element/@id»
2893
d57a12b8f5db SVGHMI: added func:get_hmi_tree_elt to match HMI tree node from path. Continue implementing ForEach widget : force order and completeness of items list. Now also collecting ForEach buttons.
Edouard Tisserant
parents: 2892
diff changeset
    72
        foreach "func:refered_elements($elt)[@id = $hmi_elements/@id][not(@id = $elt/@id)]" {
2894
4cf9ad35e6d0 SVGHMI: Easier way to match HMI tree elements to paths. ForEach widget now looks for paths and indexes of all items, and enforce path to be consistent with ForEach items sub widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2893
diff changeset
    73
            if "not(func:is_descendant_path(func:widget(@id)/path/@value, $item_path))"
2896
99c5335ed59f SVGHMI: Widget ForEach buttons now call corresponding methods.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2895
diff changeset
    74
                error > Widget id="«@id»" label="«@inkscape:label»" is having wrong path. Accroding to ForEach widget ancestor id="«$hmi_element/@id»", path should be descendant of "«$item_path»".
2895
89c02b452717 SVGHMI: ForEach now has working (un)subscribe. Fixed PageSwitch that wasn't behaving when jumping to current page with another path.
Edouard Tisserant
parents: 2894
diff changeset
    75
    |             hmi_widgets["«@id»"]`if "position()!=last()" > ,`
2892
27dd409fba1d SVGHMI: ForEach knows its own widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2891
diff changeset
    76
        }
2895
89c02b452717 SVGHMI: ForEach now has working (un)subscribe. Fixed PageSwitch that wasn't behaving when jumping to current page with another path.
Edouard Tisserant
parents: 2894
diff changeset
    77
    |           ]`if "position()!=last()" > ,`
2892
27dd409fba1d SVGHMI: ForEach knows its own widgets
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2891
diff changeset
    78
    }
2895
89c02b452717 SVGHMI: ForEach now has working (un)subscribe. Fixed PageSwitch that wasn't behaving when jumping to current page with another path.
Edouard Tisserant
parents: 2894
diff changeset
    79
    |         ]
89c02b452717 SVGHMI: ForEach now has working (un)subscribe. Fixed PageSwitch that wasn't behaving when jumping to current page with another path.
Edouard Tisserant
parents: 2894
diff changeset
    80
    |     },
4025
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
    81
    |     range: «count($hmi_index_items)»,
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
    82
    |     size: «count($unordered_items)»,
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
    83
    |     position: 0,
2891
8927ae8326b2 SVGHMI: add widget_foreach.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    84
}
8927ae8326b2 SVGHMI: add widget_foreach.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    85
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: 3005
diff changeset
    86
widget_class("ForEach")
2952
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
    87
||
4025
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
    88
    items_subscribed = false;
3005
ff9ae4f4e3be SVGHMI: widgets are not anymore binary relative or absolute, but have a "relativeness".
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3003
diff changeset
    89
ff9ae4f4e3be SVGHMI: widgets are not anymore binary relative or absolute, but have a "relativeness".
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3003
diff changeset
    90
    unsub_items(){
4025
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
    91
        if(this.items_subscribed){
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
    92
            for(let item of this.items){
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
    93
                for(let widget of item) {
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
    94
                    widget.unsub();
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
    95
                }
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
    96
            }
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
    97
            this.items_subscribed = false;
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
    98
        }
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
    99
    }
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   100
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   101
    unsub(){
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   102
        super.unsub()
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   103
        this.unsub_items();
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   104
    }
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   105
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   106
    sub_items(){
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   107
        if(!this.items_subscribed){
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   108
            for(let i = 0; i < this.size; i++) {
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   109
                let item = this.items[i];
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   110
                let orig_item_index = this.index_pool[i];
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   111
                let item_index = this.index_pool[i+this.position];
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   112
                let item_index_offset = item_index - orig_item_index;
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   113
                if(this.relativeness[0])
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   114
                    item_index_offset += this.offset;
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   115
                for(let widget of item) {
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   116
                    /* all variables of all widgets in a ForEach are all relative. 
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   117
                       Really.
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   118
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   119
                       TODO: allow absolute variables in ForEach widgets
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   120
                    */
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   121
                    widget.sub(item_index_offset, widget.indexes.map(_=>true));
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   122
                }
2952
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
   123
            }
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
   124
        }
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
   125
    }
2891
8927ae8326b2 SVGHMI: add widget_foreach.ysl2
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   126
4025
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   127
    sub(new_offset, relativeness, container_id){
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   128
        let position_given = this.indexes.length > 2;
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   129
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   130
        // sub() will call apply_cache() and then dispatch()
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   131
        // undefining position forces dispatch() to call apply_position()
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   132
        if(position_given)
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   133
            this.position = undefined;
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   134
        
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   135
        super.sub(new_offset, relativeness, container_id);
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   136
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   137
        // if position isn't given as a variable
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   138
        // dispatch() to call apply_position() aren't called
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   139
        // and items must be subscibed now.
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   140
        if(!position_given)
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   141
            this.sub_items();
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   142
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   143
        // as soon as subribed apply range and size once for all
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   144
        this.apply_hmi_value(1, this.range);
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   145
        this.apply_hmi_value(3, this.size);
3005
ff9ae4f4e3be SVGHMI: widgets are not anymore binary relative or absolute, but have a "relativeness".
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3003
diff changeset
   146
    }
ff9ae4f4e3be SVGHMI: widgets are not anymore binary relative or absolute, but have a "relativeness".
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3003
diff changeset
   147
4025
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   148
    apply_position(new_position){
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   149
        let old_position = this.position;
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   150
        let limited_position = Math.round(Math.max(Math.min(new_position, this.range - this.size), 0));
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   151
        if(this.position == limited_position){
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   152
            return false;
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   153
        }
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   154
        this.unsub_items();
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   155
        this.position = limited_position;
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   156
        this.sub_items();
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   157
        request_subscriptions_update();
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   158
        jumps_need_update = true;
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   159
        this.request_animate();
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   160
        return true;
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   161
    }
3005
ff9ae4f4e3be SVGHMI: widgets are not anymore binary relative or absolute, but have a "relativeness".
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3003
diff changeset
   162
4025
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   163
    on_click(opstr, evt) {
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   164
        let new_position = eval(String(this.position)+opstr);
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   165
        if(new_position + this.size > this.range) {
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   166
            if(this.position + this.size == this.range)
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   167
                new_position = 0;
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   168
            else
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   169
                new_position = this.range - this.size;
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   170
        } else if(new_position < 0) {
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   171
            if(this.position == 0)
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   172
                new_position = this.range - this.size;
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   173
            else
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   174
                new_position = 0;
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   175
        }
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   176
        if(this.apply_position(new_position)){
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   177
            this.apply_hmi_value(2, this.position);
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   178
        }
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   179
    }
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   180
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   181
    dispatch(value, oldval, index) {
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   182
        // Only care about position, others are constants
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   183
        if(index == 2){
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   184
            this.apply_position(value);
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   185
            if(this.position != value){
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   186
                // widget refused or apply different value, force it back
92b3701fceed SVGHMI: Extend ForEach widget to expose range, position and size in a way comparable with ScrollBar widget.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3603
diff changeset
   187
                this.apply_hmi_value(2, this.position);
2952
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
   188
            }
2942
b07ad97e6019 SVGHMI: moved JS code of foreach and jump widget in corresponding widget_*.ysl2. To be continued.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2897
diff changeset
   189
        }
b07ad97e6019 SVGHMI: moved JS code of foreach and jump widget in corresponding widget_*.ysl2. To be continued.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2897
diff changeset
   190
    }
b07ad97e6019 SVGHMI: moved JS code of foreach and jump widget in corresponding widget_*.ysl2. To be continued.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2897
diff changeset
   191
2952
2adfce8908b4 SVGHMI: apply per class overloading of sub/unsub to ForEach widget
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2943
diff changeset
   192
||
2942
b07ad97e6019 SVGHMI: moved JS code of foreach and jump widget in corresponding widget_*.ysl2. To be continued.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2897
diff changeset
   193