svghmi/widget_textlist.ysl2
author etisserant <edouard.tisserant@gmail.com>
Tue, 25 Jan 2022 16:37:16 +0100
changeset 3415 c270b6c8162b
parent 3354 819b0bdfa705
child 3556 5d73bed497de
permissions -rw-r--r--
Create README.md in tests
3354
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
     1
// widget_textlist.ysl2
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
     2
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
     3
widget_desc("TextList") {
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
     4
    longdesc
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
     5
    ||
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
     6
    TextList widget is a svg:group, list items are labeled elements
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
     7
    in that group.
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
     8
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
     9
    To use a TextList, clone (svg:use) one of the items inside the widget 
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
    10
    that expects a TextList.
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
    11
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
    12
    In this list, (translated) text content is what matters. Nevertheless
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
    13
    text style of the cloned item will be applied in client widget.
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
    14
    ||
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
    15
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
    16
    shortdesc > A named list of ordered texts 
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
    17
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
    18
    arg name="listname"
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
    19
}
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
    20
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
    21
widget_defs("TextList") {
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
    22
    |     texts: [
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
    23
    foreach "func:refered_elements($hmi_element/*[@inkscape:label])[self::svg:text]" {
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
    24
    |         id("«@id»"),
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
    25
    }
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
    26
    // could find a proper way in xpath to reverse()
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
    27
    |     ].reverse(),
819b0bdfa705 SVGHMI: add files missing in ee9e98c856a : 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:
diff changeset
    28
}