diff --git a/Button/button2.json b/Button/button2.json new file mode 100644 index 0000000000000000000000000000000000000000..515f61f9d7f034ed7e128ea1870c7f836f20ecac --- /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 0000000000000000000000000000000000000000..19ba020993dd70c00da824d01bd50be4ad078cf8 --- /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