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

add Z version of Button example

parent 6b6e496e
No related branches found
No related tags found
No related merge requests found
{
"svg": "../button.svg",
"items": [
{
"id": "button",
"attr": "fill",
"value": "IF button=True THEN \"green\" ELSE \"red\" END"
},
{
"id": "button",
"attr": "stroke-width",
"value": "IF ENABLED(\"pressButton\") THEN 6 ELSE 1 END",
"ignore": "is now used in hover below"
},
{
"id": "button_%0",
"attr": "visibility",
"value": "\"hidden\"",
"repeat": [ "TRUE", "FALSE" ]
}
],
"events": [
{
"id": "button",
"event": "toggleButton",
"hovers": [{ "attr":"stroke-width", "enter":"6", "leave":"1"},
{ "attr":"opacity", "enter":"0.8", "leave":"1.0"}]
}
]
}
\documentclass[a4paper]{article}
\usepackage{fuzz}
\begin{document}
\section*{Button}
\subsection*{Data types}
We define the type for booleans:
\begin{zed}
Bool ::= True | False\\
\end{zed}
\subsection*{State}
The current state of the button is a boolean
\begin{schema}{State}
button: Bool
\end{schema}
\subsection*{Operations}
\begin{schema}{pressButton}
\Delta State
\where
button = False\\
button' = True
\end{schema}
\begin{schema}{toggleButton}
\Delta State
\where
button' = (\IF button= True \THEN False \ELSE True)
\end{schema}
\begin{schema}{Init}
State\\
\where
button = False
\end{schema}
\end{document}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment