On Mon, Sep 14, 2020 at 12:35 AM Keith Goebel via 4D_Tech
<[email protected]> wrote:
>
> So, if I am understanding you correctly, we need to replace the command with:
> - create an object during On Begin Drag Over (source object)
> - store the source listbox variable (pointer/name?) and its current
> element in the object (will test if dragged element is known at this point)
> - store the stringified object onto text pasteboard
> - trap On Drop event for target listbox and extract source info from text
> pasteboard
> - load JSON object back from text pasteboard
> - extract source listbox (pointer/name?) and dragged element from object
> - continue process as usual
It seems complex, but it is not. Pseudocode would look like this:
In sourcce object:
: (Form event code=On Begin Drag Over)
C_BLOB($x)
CLEAR PASTEBOARD
... pack data you want to move to $x
APPEND DATA TO PASTEBOARD("my.unique.signature";$x)
: (Form event code=On Drag Over)
GET PASTEBOARD DATA TYPE($signatures;$nativeTypes;$formatNames)
If (Find in array($nativeTypes;"my.unique.signature")#-1)
$0:=0 //The drop is accepted
Else
$0:=-1 //The drag is refused
End if
In target object:
: (Form event code=On Drop)
GET PASTEBOARD DATA TYPE($signatures;$nativeTypes;$formatNames)
If (Find in
array($nativeTypes;"ch.prozessTeam.dentalProzess.Mitarbeiter.unused")#-1)
GET PASTEBOARD DATA("my.unique.signature";$x)
... unpack $x into data and insert / do whatever is needed
End if
This is, in fact, much simpler approach - you do not need to care
about process / interprocess D&D, with command SET FILE TO PASTEBOARD
you can D&D to system or other application etc. You can decide from /
to which object data can me dragged by selecting your own signatures,
or do a generic D&D by putting text / files to pasteboard.
--
Peter Bozek
**********************************************************************
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive: http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************