Recent

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

six1

  • Full Member
  • ***
  • Posts: 104
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

  • Sr. Member
  • ****
  • Posts: 309
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
Lazarus 2.0.8 FPC 3.0.4
Win7 64bit
Playing and learning - strictly for my own pleasure.

Birger52

  • Sr. Member
  • ****
  • Posts: 309
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));
Lazarus 2.0.8 FPC 3.0.4
Win7 64bit
Playing and learning - strictly for my own pleasure.

Giorgio Tani

  • New Member
  • *
  • Posts: 21
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

  • Sr. Member
  • ****
  • Posts: 309
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 »
Lazarus 2.0.8 FPC 3.0.4
Win7 64bit
Playing and learning - strictly for my own pleasure.

Birger52

  • Sr. Member
  • ****
  • Posts: 309
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.
Lazarus 2.0.8 FPC 3.0.4
Win7 64bit
Playing and learning - strictly for my own pleasure.

Birger52

  • Sr. Member
  • ****
  • Posts: 309
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
Lazarus 2.0.8 FPC 3.0.4
Win7 64bit
Playing and learning - strictly for my own pleasure.

Giorgio Tani

  • New Member
  • *
  • Posts: 21
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: 21
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.

wp

  • Hero Member
  • *****
  • Posts: 8567
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2" (WIN only!)
« Reply #39 on: November 03, 2020, 12:42:49 pm »
I checked out this package with Laz 2.0.10 and found that it does compile but the sample project for drag and drop onto the Explorer crash with an unspecified exception.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

six1

  • Full Member
  • ***
  • Posts: 104
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2" (WIN only!)
« Reply #40 on: November 04, 2020, 08:18:20 am »
I fixed the Drag&Drop Suite and sent it to GetMem for update.

"Mixed Demo" is updated, now working with LCL scaling.
Testet with Lazarus 2.0.10 FPC 3.20
« Last Edit: November 04, 2020, 02:30:13 pm by six1 »

Giorgio Tani

  • New Member
  • *
  • Posts: 21
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2" (WIN only!)
« Reply #41 on: March 20, 2021, 07:05:34 pm »
Hello, I've published 0.12 version of dragdropfilesdll
http://www.peazip.org/peazip-add-ons.html#sfx_modules_spinoff_utilities

I've improved the dodropvfiles procedure, which waits for files being created before finalizing the drag and drop operation, i.e. waiting for extraction, ftp transfer etc.
The procedure now pass the list of files as an array of strings as expected by most of the Windows applications, so it works fine dropping files into for example 7-Zip or WinRar while previously worked only dropping files to Windows file explorer.

The other procedure dodropfiles, which works on files already existing on the filesystem, always passed the list of file this way so never had this issue.

robertkondner

  • New member
  • *
  • Posts: 5
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2" (WIN only!)
« Reply #42 on: June 19, 2021, 10:20:43 pm »
Hi,

I need to copy a file to the clipboard and I understand there are such tools in the Suite.

Can anyone give me a pointer to a source file or maybe even an example?

Thanks,
Bob K.

six1

  • Full Member
  • ***
  • Posts: 104
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2" (WIN only!)
« Reply #43 on: June 20, 2021, 04:02:29 pm »
That's easy:

    DropFileSource1.EmptyClipboard;
    DropFileSource1.Files.Clear;
    DropFileSource1.Files.Add( [Your File with Path]);
// more Files, if needed...     DropFileSource1.Files.Add( [Your File with Path]);
    DropFileSource1.CopyToClipboard;
« Last Edit: June 20, 2021, 04:04:02 pm by six1 »

 

TinyPortal © 2005-2018