Sign in Join
Wiki copytemporary

Drop files event: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11The drop files event will be invoked when the user drops one or multiple dragged files on one of application's forms.
22
33First this event should be fired for target form (or main form if drop target is unknown), then for the application.
44
55## Possible implementation for LCL
66
77`TDropFilesEvent = procedure (Sender: TObject; const FileNames: Array of String) of Object;`
88
99Add OnDropFiles: TDropFilesEvent to TCustomForm, TApplication and TApplicationProperties. Each form will have property AllowDropFiles: Boolean, which enables this event.
1010
1111## Possible implementation per widgetsets
1212
1313The widgetsets should call method IntfDropFiles of target form (or main form if drop target is unknown) and the application.
1414
1515### Win32/64
1616
1717- set DragAcceptFiles for every form
1818- respond to WM_DROPFILES message
1919
2020### GTK1/2
2121
2222- enable: gtk_drag_dest_set
2323- respond to drag_data_received signal
2424
2525### Qt
2626
2727- enable widget by setAcceptDrops(true)
2828- respond to dragEnterEvent by event-\>acceptProposedAction for mime-type text/uri-list
2929- respond to dropEvent
3030- docs: [1](http://doc.trolltech.com/4.2/dnd.html#dropping)
3131
3232### Carbon
3333
3434- respond to kAECoreSuite/kAEOpenDocuments event to open application associated files
3535- modify Application Bundle
3636
3737## Related bug reports
3838
39-- <s>[bug 1772](http://www.freepascal.org/mantis/view.php?id=1772)</s>
40-- <s>[bug 8976](http://www.freepascal.org/mantis/view.php?id=8976)</s>
39+- [bug 1772](http://www.freepascal.org/mantis/view.php?id=1772)
40+- [bug 8976](http://www.freepascal.org/mantis/view.php?id=8976)
4141
4242## TODO
4343
44-1. <s>implement for Qt</s> already implemented (during 0.9.27)
44+1. implement for Qt already implemented (during 0.9.27)
4545
4646---
4747*From the Free Pascal wiki, page "Drop files event", as it stood on 2017-04-05 after a change by Bart, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
4848Category: Event-driven programming

Back to history