# HG changeset patch # User Edouard Tisserant # Date 1619990123 -7200 # Node ID 315f17e74ef5f5150b471b6760e32921f0221a91 # Parent 7bdb766c2a4d9df8bb40f52831c4b871e8b7fbdc SVGHMI: Added widget_desc to declare widget signature and description diff -r 7bdb766c2a4d -r 315f17e74ef5 svghmi/widget_input.ysl2 --- a/svghmi/widget_input.ysl2 Sun May 02 23:01:08 2021 +0200 +++ b/svghmi/widget_input.ysl2 Sun May 02 23:15:23 2021 +0200 @@ -1,8 +1,21 @@ // widget_input.ysl2 +widget_desc("Input") { + longdesc + || + Input widget takes one variable path, and displays current value in + optional "value" labeled sub-element. Click on optional "edit" labeled + element opens keypad to edit value. Operation on current value is + performed when click on sub-elements with label starting with '=', '+' + or '-' sign. Value after sign is used as operand. + || + shortdesc > Input field with predefined operation buttons + arg accepts="string" > optional printf-like format + path accepts="HMI_INT, HMI_REAL, HMI_STRING" > single variable to edit + } widget_class("Input") diff -r 7bdb766c2a4d -r 315f17e74ef5 svghmi/widgets_common.ysl2 --- a/svghmi/widgets_common.ysl2 Sun May 02 23:01:08 2021 +0200 +++ b/svghmi/widgets_common.ysl2 Sun May 02 23:15:23 2021 +0200 @@ -21,6 +21,11 @@ } }; +in xsl decl widget_desc(%name, match="widget[@type='%name']", mode="widget_desc") alias template { + type > «@type» + content; +}; + in xsl decl widget_class(%name, *clsname="%nameWidget", match="widget[@type='%name']", mode="widget_class") alias template { | class `text **clsname` extends Widget{ content;