diff --git a/Button/button.json b/Button/button.json index 7cd2f2b2f8fb06dd6ca64eed501f8549e383419f..70ae321e4655e27254911dae109444c69a66a74d 100644 --- a/Button/button.json +++ b/Button/button.json @@ -9,7 +9,8 @@ { "id": "button", "attr": "stroke-width", - "value": "IF ENABLED(\"press_button\") THEN 6 ELSE 1 END" + "value": "IF ENABLED(\"press_button\") THEN 6 ELSE 1 END", + "ignore": "is now used in hover below" }, { "id": "button_%0", @@ -21,15 +22,19 @@ "events": [ { "id": "button", - "event": "toggle_button" + "event": "toggle_button", + "hover": { "attr":"stroke-width", "enter":"6", "leave":"1"} }, { "id": "button_TRUE", - "event": "toggle_button" + "event": "toggle_button", + "hover": { "attr":"stroke-width", "enter":"3", "leave":"1", "id":"button"} }, { "id": "button_FALSE", - "event": "press_button" + "event": "set_button", + "predicates" : ["newVal = bool(%shiftKey=FALSE)"], + "hover": { "attr":"stroke-width", "enter":"5", "leave":"1", "id":"button"} } ] } diff --git a/Button/button.mch b/Button/button.mch index f3c893103e7c91aeaa8114cf6c140a3b3646d083..eb871880a1e57dac9f6b907623743c5787576318 100644 --- a/Button/button.mch +++ b/Button/button.mch @@ -12,5 +12,8 @@ OPERATIONS END; toggle_button = BEGIN button:= bool(button=FALSE) + END; + set_button(newVal) = PRE newVal:BOOL THEN + button := bool(newVal=TRUE) END END \ No newline at end of file diff --git a/Button/button.svg b/Button/button.svg index 829601b91e0a041c452b842b52942e72161e4724..6278f446059b00b17bccbcf5837425627d4822fc 100644 --- a/Button/button.svg +++ b/Button/button.svg @@ -1,4 +1,4 @@ -<svg height="230" width="200"> +<svg height="240" width="200"> <circle id="button" cx="100" cy="100" r="80" stroke="black" stroke-width="3" fill="green" /> <text text-align="left" x="50" y="190"