Discussion:
DnD progress report
Cees De Groot
2006-07-19 15:18:02 UTC
Permalink
Source widget:

handleMouseEventInList: aMouseEvent
aMouseEvent dragging
ifTrue: [
| data src result |
selectedFile ifNil: [^self].
data := WxFileDataObject new addFile: selectedFile qualifiedReference.
src := WxDropSource data: data.
result := src doDragDrop.
]
ifFalse: [
aMouseEvent skip]

Target widget:

initialize
[...]
self setDropTarget: (DGVMainTreeDropTarget new tree: self).

DGVMainTreeDropTarget is a subclass of WxFileDropTarget.

This results in:
- drags can be started from the widget, but the whole application
shows the 'forbidden' icon. I can drag onto a Windows file explorer
window, however;
- drags of a Windows file show that the #setDropTarget: works ok,
because files can be dropped on the widget that set the drop target
but nowhere else (and the drop target's callback is called back).

Any idea what could be wrong?
Rob Gayvert
2006-07-19 15:18:02 UTC
Permalink
Post by Cees De Groot
handleMouseEventInList: aMouseEvent
aMouseEvent dragging
ifTrue: [
| data src result |
selectedFile ifNil: [^self].
data := WxFileDataObject new addFile: selectedFile qualifiedReference.
src := WxDropSource data: data.
result := src doDragDrop.
]
ifFalse: [
aMouseEvent skip]
initialize
[...]
self setDropTarget: (DGVMainTreeDropTarget new tree: self).
DGVMainTreeDropTarget is a subclass of WxFileDropTarget.
- drags can be started from the widget, but the whole application
shows the 'forbidden' icon. I can drag onto a Windows file explorer
window, however;
- drags of a Windows file show that the #setDropTarget: works ok,
because files can be dropped on the widget that set the drop target
but nowhere else (and the drop target's callback is called back).
Any idea what could be wrong?
I haven't done much with dnd beyond the drag image sample and the built-in
support in wxGrid. In fact, given that some of the constructors of the
source
and target classes are missing or wrong, I'm a bit surprised it works at
all.

I worked up a simplified version of the C++ dnd sample application using
only
file sources and targets, and I'm seeing results similar to yours.
Dragging to
or from the desktop works fine, but between two widgets doesn't. Very
odd. At
this point I don't see an easy fix.

.. Rob

Loading...