Skip to content
Snippets Groups Projects
Commit fcfb467d authored by Michael Leuschel's avatar Michael Leuschel
Browse files

add example JSON file with disabled/enabled items

parent d3b6a07e
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ MACHINE button2 ...@@ -3,6 +3,7 @@ MACHINE button2
DEFINITIONS DEFINITIONS
"LibraryMeta.def"; "LibraryMeta.def";
VISB_JSON_FILE == "button2.json"; VISB_JSON_FILE == "button2.json";
VISB_JSON_FILE1 == "button3.json";
VISB_JSON_FILE2 == "button2_3d.json" VISB_JSON_FILE2 == "button2_3d.json"
VARIABLES VARIABLES
button button
......
{
"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"}]
}
]
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment