2 (in-package :lineal.webui
)
6 (with-html-output-to-string
13 (defun htm-input-button (name id tosend
)
16 (concatenate 'string
"uinput(\"" tosend
"\")")))
19 (name infixp
&key
(id "fn1") (input name
))
24 'string
"(" input
" "))))
27 (name id infix multi-param-p
28 &optional
(fntext name
))
34 (if multi-param-p
"(" " "))
36 'string
"(" fntext
" "))))
38 (defun htm-linalg-buttons (infix)
42 nil
"transpose" "inverse"
45 nil
("cat") ("vcat") ("crop") ("vcrop"))))
46 (with-output-to-string (strm)
55 (format nil
"fn~A" (length args
))
57 (t (destructuring-bind
58 (name &optional id
) args
62 (format nil
"fn~A" (length name
)))
68 ; (show-a-button "ok" elem "sendCalc()" 25 "white" "green"))
69 ;(show-a-button "clear" elem "cleartext()" 45 "white" "darkred"))
71 ;-- BEGIN SPECIAL BUTTON CREATORS --
73 ;V Use the button operation as a name.V
74 (defun simple-input-button (name &optional
(id "fn1"))
75 (htm-input-button name id name
))
77 (defun clear-button ()
78 (htm-button "clear" "clear" "cleartext()"))
82 (htm-button "ok" "ok" "sendCalc()"))
85 (defun memory-buttons (infix)
90 (if infix
"recall(\\\"" "(recall \\\""))
93 (if infix
"store(\\\"" "(store \\\""))))
95 ;-- END SPECIAL BUTTON CREATORS --
97 (defun htm-standard-math-buttons (infixp)
101 (with-output-to-string (strm)
105 (princ-to-string (+ i x
))
112 (opern-button "!" nil
:input
"factorial"))
114 (htm-fnbut "√" "fn1" infixp nil
"sqrt")
117 (opern-button "^" nil
:input
"expt"))
118 (simple-input-button "(")
119 (simple-input-button ")")
120 "<br />" (htm-3digits 7)
121 (opern-button "/" infixp
)
122 "<br />" (htm-3digits 4)
123 (opern-button "×" infixp
:input
"*")
124 "<br />" (htm-3digits 1)
125 (opern-button "-" infixp
)
127 (simple-input-button "0" "zerodigit")
128 (simple-input-button "." "digit")
129 (opern-button "+" infixp
)
131 (memory-buttons infixp
))))