Difference between revisions of "Drop files event"
From Lazarus wiki
Jump to navigationJump to search (→TODO) |
(→Possible implementation for LCL: renamed event to OnDropFiles) |
||
Line 5: | Line 5: | ||
== Possible implementation for LCL == | == Possible implementation for LCL == | ||
− | + | TDropFilesEvent = procedure (Sender: TObject; const FileNames: Array of String) of Object; | |
− | Add | + | Add OnDropFiles: TDropFilesEvent to TCustomForm, TApplication and TApplicationProperties. |
==Possible implementation per widgetsets== | ==Possible implementation per widgetsets== |
Revision as of 14:29, 24 June 2007
The files drop event will be invoked when the user drops one or multiple dragged files on one of application's forms.
First this event should be fired for target form (or main form if drop target is unknown), then for the application.
Possible implementation for LCL
TDropFilesEvent = procedure (Sender: TObject; const FileNames: Array of String) of Object;
Add OnDropFiles: TDropFilesEvent to TCustomForm, TApplication and TApplicationProperties.
Possible implementation per widgetsets
The widgetsets should call method IntfFilesDrop of target form (or main form if drop target is unknown) and the application.
Win32/64
- set DragAcceptFiles for every form
- respond to WM_DROPFILES message
GTK1/2
Qt
Carbon
- respond to kAECoreSuite/kAEOpenDocuments event to open application associated files
- respond to kAECoreSuite/kAEOpenContents event, where content format is typeFSRef
Related bug reports
TODO
- implement for widgetsets
- documentation
- Lazarus should open dropped files