SVGHMI: Added widget_desc to declare widget signature and description svghmi
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Sun, 02 May 2021 23:15:23 +0200
branchsvghmi
changeset 3233 315f17e74ef5
parent 3232 7bdb766c2a4d
child 3234 f2bfb047d0e6
SVGHMI: Added widget_desc to declare widget signature and description
svghmi/widget_input.ysl2
svghmi/widgets_common.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")
--- 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;