69325df0e3fc3706f71ef4bccf38fbec280b6098
1 (in-package :lineal.webui
)
5 (with-html-output-to-string
12 (defun htm-input-button (name id tosend
)
15 (concatenate 'string
"uinput(\"" tosend
"\")")))
18 (name infixp
&key
(id "fn1") (input name
))
23 'string
"(" input
" "))))
26 (name id infix multi-param-p
27 &optional
(fntext name
))
33 (if multi-param-p
"(" " "))
35 'string
"(" fntext
" "))))
37 (defun htm-linalg-buttons (infix)
41 nil
"transpose" "inverse"
44 nil
("cat") ("vcat") ("crop") ("vcrop"))))
45 (with-output-to-string (strm)
54 (format nil
"fn~A" (length args
))
56 (t (destructuring-bind
57 (name &optional id
) args
61 (format nil
"fn~A" (length name
)))
67 ; (show-a-button "ok" elem "sendCalc()" 25 "white" "green"))
68 ;(show-a-button "clear" elem "cleartext()" 45 "white" "darkred"))
70 ;-- BEGIN SPECIAL BUTTON CREATORS --
72 ;V Use the button operation as a name.V
73 (defun simple-input-button (name &optional
(id "fn1"))
74 (htm-input-button name id name
))
76 (defun clear-button ()
77 (htm-button "clear" "clear" "cleartext()"))
81 (htm-button "ok" "ok" "sendCalc()"))
84 (defun memory-buttons (infix)
89 (if infix
"recall(\\\"" "(recall \\\""))
92 (if infix
"store(\\\"" "(store \\\""))))
94 ;-- END SPECIAL BUTTON CREATORS --
96 (defun htm-standard-math-buttons (infixp)
100 (with-output-to-string (strm)
104 (princ-to-string (+ i x
))
109 (htm-fnbut "√" "fn1" infixp nil
"sqrt")
112 (opern-button "^" nil
:input
"expt"))
113 (simple-input-button "(")
114 (simple-input-button ")")
115 "<br/>" (htm-3digits 7)
116 (opern-button "/" infixp
)
117 "<br/>" (htm-3digits 4)
118 (opern-button "×" infixp
:input
"*")
119 "<br/>" (htm-3digits 1)
120 (opern-button "-" infixp
)
122 (simple-input-button "0" "zerodigit")
123 (simple-input-button "." "digit")
124 (opern-button "+" infixp
)
126 (memory-buttons infixp
))))