diff --git a/Button/button2.mch b/Button/button2.mch index e66194d1ef807c5912c9fb604554e0eda55a0fcc..f70004e1a5f17014dd424875e6051982588d53fc 100644 --- a/Button/button2.mch +++ b/Button/button2.mch @@ -3,6 +3,7 @@ MACHINE button2 DEFINITIONS "LibraryMeta.def"; VISB_JSON_FILE == "button2.json"; + VISB_JSON_FILE1 == "button3.json"; VISB_JSON_FILE2 == "button2_3d.json" VARIABLES button diff --git a/Button/button3.json b/Button/button3.json new file mode 100644 index 0000000000000000000000000000000000000000..e07ad00c8b50c18c82b4a17cc8a131955d58c041 --- /dev/null +++ b/Button/button3.json @@ -0,0 +1,53 @@ +{ + "svg": "button.svg", + "model": "button2.mch", + "model-name": "button2", + "comment": "uses new enabled/disabled feature in events", + + "definitions": [ + {"name":"width_TRUE", + "value": "1" + }, + {"name":"width_FALSE", + "value": "2" + } + ], + "items": [ + { + "id": "button_%0", + "attr": "visibility", + "value": "IF button=%0 THEN \"visible\" ELSE \"hidden\" END", + "repeat": [ "TRUE", "FALSE" ] + }, + { + "repeat": [ "TRUE", "FALSE" ], + "for": {"from":"width_%0", "to":"width_%0"}, + "comment": "just checking nested loops", + "id": "button_%0", + "attr": "stroke-width", + "value": "%1" + } + ], + "events": [ + { + "id": "button", + "event": "press_button", + "hovers": [{ "attr":"stroke-width", "enter":"6", "leave":"1"}], + "items": [{"attr":"fill", "disabled":"\"green\"", "enabled":"\"red\""}] + }, + { + "id": "buttonx", + "event": "release_button", + "hovers": [ { "attr":"opacity", "enter":"0.8", "leave":"1.0"}] + }, + { + "id": "button_TRUE", + "event": "press_button", + "hovers": [{ "id":"hover_message", + "attr":"text", "enter":"Button=TRUE", "leave":""}, + { "id":"root", "attr": "viewBox", + "enter": "0 0 200 240" , + "leave": "0 150 200 240"}] + } + ] +}