X-Git-Url: https://git.hcoop.net/clinton/lisp-on-lines.git/blobdiff_plain/19531fbd947da15a17f8e5557a1a1492eab2bca3..38a016c7ea89d37ea32cfeb8d1e30033c9e3d614:/src/mewa/slot-presentations.lisp diff --git a/src/mewa/slot-presentations.lisp b/src/mewa/slot-presentations.lisp index 4d89895..bbbc1a9 100644 --- a/src/mewa/slot-presentations.lisp +++ b/src/mewa/slot-presentations.lisp @@ -1,7 +1,72 @@ -(in-package :it.bese.ucw) +(in-package :mewa) +(defun multiple-value-funcall->list (function &rest args) + "The function to be called by m-v-bf" + (multiple-value-call #'list (apply function args))) -(defslot-presentation clsql-wall-time-slot-presentation () +(defmacro multiple-value-bindf (vars form &body body) + "Like M-V-B, only it works in actions. form must be a function call" + `(destructuring-bind ,vars + (multiple-value-funcall->list #',(car form) ,@(cdr form)) + ,@body)) + + +;;;; ** Textarea Slot Presentation + +(defslot-presentation text-slot-presentation () + ((rows :initarg :rows :accessor rows :initform nil) + (columns :initarg :columns :accessor columns :initform nil) + (html-contentp :initarg :escape-html-p :accessor escape-html-p :initform nil)) + (:type-name text)) + +(defmethod present-slot ((slot text-slot-presentation) instance) + (if (editablep slot) + ( " (foreign-instance slot) " from " instance ) (let* ((i (foreign-instance slot)) @@ -45,18 +166,11 @@ :initargs (list :global-properties (list :editablep nil :linkedp nil))))) - (when (ucw::parent slot) (setf (component.place pres) (component.place (ucw::parent slot)))) - (flet ((render () (when i (>")) - (call-next-method) - (<:as-html "total :" (len slot))) + (if (slot-boundp slot 'ucw::place) + (progn + (>")) + (call-next-method) + (<:as-html "total :" (len slot))) + (call-next-method))) (defmethod get-foreign-instances :around ((slot has-very-many-slot-presentation) instance) (let ((f (call-next-method))) @@ -150,4 +309,11 @@ (progn (setf (instance (presentation slot)) (presentation-slot-value slot instance)) (present (presentation slot))) - (<:as-html "--")))) \ No newline at end of file + (<:as-html "--")))) + + + + + + +