From 946157cf8cb92b433626ea52142015dc62af8cf8 Mon Sep 17 00:00:00 2001
From: Michael Leuschel <leuschel@uni-duesseldorf.de>
Date: Wed, 13 Apr 2022 18:56:10 +0200
Subject: [PATCH] add button2 with new multiple events per ID

Signed-off-by: Michael Leuschel <leuschel@uni-duesseldorf.de>
---
 Button/button2.json | 29 +++++++++++++++++++++++++++++
 Button/button2.mch  | 19 +++++++++++++++++++
 2 files changed, 48 insertions(+)
 create mode 100644 Button/button2.json
 create mode 100644 Button/button2.mch

diff --git a/Button/button2.json b/Button/button2.json
new file mode 100644
index 0000000..515f61f
--- /dev/null
+++ b/Button/button2.json
@@ -0,0 +1,29 @@
+{
+  "svg": "button.svg",
+  
+  "items": [
+    {
+      "id": "button_%0",
+      "attr": "visibility",
+      "value": "IF button=%0 THEN \"visible\" ELSE \"hidden\" END",
+      "repeat": [ "TRUE", "FALSE" ]
+    },
+    {
+      "id": "button",
+      "attr": "fill",
+      "value": "IF button=TRUE THEN \"green\" ELSE \"red\" END"
+    }
+  ],
+  "events": [
+    {
+      "id": "button",
+      "event": "press_button",
+      "hovers": [{ "attr":"stroke-width", "enter":"6", "leave":"1"}]
+    },
+    {
+      "id": "button",
+      "event": "release_button",
+      "hovers": [ { "attr":"opacity", "enter":"0.8", "leave":"1.0"}]
+    }
+  ]
+}
diff --git a/Button/button2.mch b/Button/button2.mch
new file mode 100644
index 0000000..19ba020
--- /dev/null
+++ b/Button/button2.mch
@@ -0,0 +1,19 @@
+MACHINE button2
+// a version of button with just two events
+DEFINITIONS 
+     "LibraryMeta.def";
+      VISB_JSON_FILE == "button2.json"
+VARIABLES
+  button
+INVARIANT
+  button:BOOL
+INITIALISATION
+  button := FALSE
+OPERATIONS
+  press_button = PRE button=FALSE THEN
+    button:=TRUE
+  END;
+  release_button = PRE button=TRUE THEN
+    button:=FALSE
+  END
+END
\ No newline at end of file
-- 
GitLab