[mcclim-cvs] CVS mcclim

thenriksen thenriksen at common-lisp.net
Fri May 9 21:24:28 UTC 2008


Update of /project/mcclim/cvsroot/mcclim
In directory clnet:/tmp/cvs-serv31790

Modified Files:
	gadgets.lisp 
Log Message:
Fix list panes with multi-element-selection.


--- /project/mcclim/cvsroot/mcclim/gadgets.lisp	2008/05/09 19:12:14	1.109
+++ /project/mcclim/cvsroot/mcclim/gadgets.lisp	2008/05/09 21:24:28	1.110
@@ -1976,15 +1976,18 @@
              (> (length (gadget-value gadget)) 1))
     (error "An 'exclusive' list-pane cannot be initialized with more than one item selected.")))
 
-(defmethod value-changed-callback
-    :before
+(defmethod value-changed-callback :before
     ((gadget generic-list-pane) client gadget-id value)
   (declare (ignore client gadget-id))
-  (let* ((i (position value (generic-list-pane-item-values gadget)))
-	 (item (elt (list-pane-items gadget) i))
-	 (ptype (funcall (list-pane-presentation-type-key gadget) item)))
-    (when ptype
-      (throw-object-ptype value ptype))))
+  ;; Maybe act as if a presentation was clicked on, but only if the
+  ;; list pane only allows single-selection.
+  (when (or (eq (list-pane-mode gadget) :one-of)
+            (eq (list-pane-mode gadget) :exclusive))
+    (let* ((i (position value (generic-list-pane-item-values gadget)))
+           (item (elt (list-pane-items gadget) i))
+           (ptype (funcall (list-pane-presentation-type-key gadget) item)))
+      (when ptype
+        (throw-object-ptype value ptype)))))
 
 (defun list-pane-exclusive-p (pane)
   (or (eql (list-pane-mode pane) :exclusive)




More information about the Mcclim-cvs mailing list