Recent

Author Topic: Fork of Anders Melander's "Drag and Drop Suite 5.2" (WIN only!)  (Read 9335 times)

six1

  • Jr. Member
  • **
  • Posts: 74
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2" (WIN only!)
« Reply #30 on: April 18, 2019, 03:22:59 pm »
maybe you will have a look at the original Sources from Andres Melander?
http://melander.dk/delphi/dragdrop/#

...not excluded that I've installed a bug in the port  ::)
« Last Edit: April 19, 2019, 08:57:30 am by six1 »

Birger52

  • Full Member
  • ***
  • Posts: 112
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2" (WIN only!)
« Reply #31 on: April 23, 2019, 12:07:01 am »
Trying to use this, to drag text out of a TMemo.

Can't find any instructions anywhere.
So tried using TDropTextSource, as per the demo SourceDemo (SimpleSourceDemo).

It dies with
Project ... raised exception class 'External: SIGSEGV'.
At adress ....
as soon as dragging starts.

Click OK and execution is halted as in attached image.
Attempts to continue, gives the choise to continue and risk damage or cancel to exit.
No mater what, I get a turning circle, and the only way out of this is to use the Stop button in Lazarus.

Win 7 64bit Lazarus 1.8.4 FPC 3.0.4

Birger52

  • Full Member
  • ***
  • Posts: 112
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2" (WIN only!)
« Reply #32 on: April 23, 2019, 01:48:13 pm »
Tried singlestepping, through starting a drag.
Error occurs in DropSource.pas
line 925:       DropResult := DoDragDrop(Self, Self, AllowedEffects, lpdword(DropEffect));

Giorgio Tani

  • New Member
  • *
  • Posts: 13
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2" (WIN only!)
« Reply #33 on: April 27, 2019, 09:01:46 pm »
Hello, I've tested the problem again and it seems the issue is simpler than I initially thought.

I changed the call to DoDragDrop API in DropSource.pas from
DropResult := DoDragDrop(Self, Self, AllowedEffects, lpdword(DropEffect));
to
DropResult := DoDragDrop(Self, Self, AllowedEffects, lpdword(@DropEffect));

Now dropping files from application to system works without issues, both for exe compiled with Lazarus for Win32 and ones compiled with Lazarus for Win64.

Please note it may be needed to do clean and rebuild in order DropSource.pas gets compiled again and the change takes effect.

I've not tested if similar issue exists for other parts of the library as I was focusing on DropFileSource component.

Birger52

  • Full Member
  • ***
  • Posts: 112
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2" (WIN only!)
« Reply #34 on: April 29, 2019, 02:12:18 pm »
This makes the DragTextSource function for me.
(Win 7 64bit Lazarus 1.8.4 FPC 3.0.4)
« Last Edit: April 29, 2019, 09:56:44 pm by Birger52 »

Birger52

  • Full Member
  • ***
  • Posts: 112
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2" (WIN only!)
« Reply #35 on: April 29, 2019, 10:00:27 pm »
Trying to use TDropTextTarget, it is not possible to use DragTypes dtMove, however.
Symbol on dragged icon is always with the + indicating copy, and pressing Shift, Ctrl or Alt has no effect.

Birger52

  • Full Member
  • ***
  • Posts: 112
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2" (WIN only!)
« Reply #36 on: May 01, 2019, 01:59:25 pm »
dtMove does not function with TDragTextSource either

Giorgio Tani

  • New Member
  • *
  • Posts: 13
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2" (WIN only!)
« Reply #37 on: May 05, 2019, 05:25:14 pm »
Hello, I must thank you as I've successfully implemented standard Windows drag and drop (files from the application to the system) in my software PeaZip due this wonderful library.

While working on integration of the library in my project one I decided to place all the drag and drop related code in a DLL so 1) I had not to test all my existing project's code for Delphi syntax (it uses default FreePascal syntax) 2) it will be easier to re-use in other projects.

I named the DLL dragdropfilesdll, you can find the source code package in my spin-off projects page
http://www.peazip.org/peazip-add-ons.html#sfx_modules_spinoff_utilities

So far I've implemented two procedures to fit my needs, but any suggestion is welcome to improve the code and to make this more useful to third parts projects:

dodropfiles(winc:TWinControl; sarr: array of ansistring; dropmode:integer);
detects drag and drop event from the first parameter's wincontrol (i.e. a listview), and drop to the system all the files listed in second parameter (array of ansistring of full names), allowed drag&drop operations are encoded in third parameter

dodropvfiles(winc:TWinControl; vpath: ansistring; dropmode:integer);
works mostly as previous procedure, but waits for files being created in vpath - my application is a file archiver, so I used this procedure to wait for extraction of files, but can be used when files are being downloaded, or transferred thorough FTP etc - before finalizing the drag and drop operation

I hope this contribution may help other developers to use some of the potentialities of Drag and Drop Suite.

Giorgio Tani

  • New Member
  • *
  • Posts: 13
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2" (WIN only!)
« Reply #38 on: June 14, 2019, 01:50:51 pm »
Hello, I've updated the dragdropfilesdll
http://www.peazip.org/peazip-add-ons.html#sfx_modules_spinoff_utilities

dodropvfiles was improved, now it can be changed on the fly (before completing ondrop event), the "virtual" drop source location where files are created before drag and drop finalizes.