--- 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")
--- 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;