Drag and drop in tab-layouts
Hi,It appears that drag and drop doesn't work in tab-layouts on linux 32-bit. Code below demonstrates the problem. It is based on a CAPI example. In this code you can switch between a tab-layout and column-layout (currently commented out).
Best regards,
Peter
;; To try it, compile and load this file and then execute:
;;
;; (CL-USER::TEST-CHOICE-DRAG-AND-DROP)
;;
;; The exchangeable list allow their items to be dragged from one list
;; to the other.
;;----------------------------------------------------------------------------
;; Copyright (c) 1987--2012 LispWorks Ltd. All rights reserved.
;;----------------------------------------------------------------------------
(in-package "CL-USER")
(capi:define-interface drag-and-drop-choices ()
()
(:panes
(source-list
capi:list-panel
:items '(:item-1 :item-2
:item-3 :item-4)
:interaction :extended-selection
:drag-callback 'drag-callback
:visible-min-height '(character 8)
:visible-max-width nil
:vertical-scroll nil
:horizontal-scroll nil)
(target-list
capi:list-panel
:items '(:item-5 :item-6
:item-7 :item-8)
:interaction :extended-selection
:drop-callback 'drop-callback
:visible-min-height '(character 8)
:visible-max-width nil
:vertical-scroll nil
:horizontal-scroll nil))
(:layouts
(exchangeable-lists-layout
capi:row-layout
'(source-list target-list)
:title "Drag items from one pane to the other"
:title-position :frame
:internal-border 10
:gap 10)
(main-layout
capi:tab-layout ()
:items '(("Layout" exchangeable-lists-layout))
:visible-child-function 'second
:combine-child-constraints (:initarg :combine-child-constraints)
:print-function 'car))
; ;capi:column-layout
; '(exchangeable-lists-layout)))
(:default-initargs
:layout 'main-layout
:title "Drag And Drop Choices"))
(defun drag-callback (pane indices)
(declare (ignore pane))
(and indices (list :items-1 indices)))
(defun drop-callback (pane drop-object stage)
(case stage
(:formats
(capi:set-drop-object-supported-formats drop-object '(:items-1)))
((:enter :drag)
(when (and (capi:drop-object-provides-format drop-object :items-1)
(capi:drop-object-allows-drop-effect-p drop-object :copy))
(setf (capi:drop-object-drop-effect drop-object) :copy)))
(:drop
(when (and (capi:drop-object-provides-format drop-object :items-1)
(capi:drop-object-allows-drop-effect-p drop-object :copy))
(capi:append-items pane '(:foo))
(setf (capi:drop-object-drop-effect drop-object) :copy)))))
(defun test-choice-drag-and-drop ()
(capi:display (make-instance 'drag-and-drop-choices)))