Difference between revisions of "Drop files event"
From Free Pascal wiki
Jump to navigationJump to search (→GTK1/2) |
(→Carbon) |
||
Line 26: | Line 26: | ||
===Carbon=== | ===Carbon=== | ||
* respond to kAECoreSuite/kAEOpenDocuments event to open application associated files | * respond to kAECoreSuite/kAEOpenDocuments event to open application associated files | ||
− | * respond to kAECoreSuite/kAEOpenContents event, where content format is typeFSRef | + | * maybe respond to kAECoreSuite/kAEOpenContents event, where content format is typeFSRef |
+ | * maybe use kEventClassService | ||
== Related bug reports == | == Related bug reports == |
Revision as of 16:14, 28 June 2007
The drop files 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 IntfDropFiles 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
- enable: gtk_drag_dest_set
- respond to drag_data_received signal
Qt
Carbon
- respond to kAECoreSuite/kAEOpenDocuments event to open application associated files
- maybe respond to kAECoreSuite/kAEOpenContents event, where content format is typeFSRef
- maybe use kEventClassService
Related bug reports
TODO
- implement for widgetsets
- documentation
- Lazarus should open dropped files