Difference between revisions of "Drop files event"
From Free Pascal wiki
Jump to navigationJump to searchLine 3: | Line 3: | ||
First this event should be fired for target form (or main form if drop target is unknown), then for the application. | 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= | + | == Possible implementation for LCL == |
TFilesDropEvent = procedure (Sender: TObject; const FileNames: Array of String) of Object; | TFilesDropEvent = procedure (Sender: TObject; const FileNames: Array of String) of Object; | ||
Line 12: | Line 12: | ||
The widgetsets should call method IntfFilesDrop of target form, which would invoke the OnFilesDrop event of the form and also of the application. | The widgetsets should call method IntfFilesDrop of target form, which would invoke the OnFilesDrop event of the form and also of the application. | ||
− | =Possible implementation per widgetsets= | + | ==Possible implementation per widgetsets== |
− | ==Win32/64== | + | ===Win32/64=== |
* set DragAcceptFiles for every form | * set DragAcceptFiles for every form | ||
* respond to WM_DROPFILES message | * respond to WM_DROPFILES message | ||
− | ==GTK1/2== | + | ===GTK1/2=== |
− | ==Qt== | + | ===Qt=== |
− | ==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 | * respond to kAECoreSuite/kAEOpenContents event, where content format is typeFSRef | ||
− | =TODO= | + | == Related bug reports == |
+ | * [http://www.freepascal.org/mantis/view.php?id=8976 bug 8976] | ||
+ | |||
+ | ==TODO== | ||
# agree on details | # agree on details | ||
# implement for LCL/widgetsets | # implement for LCL/widgetsets | ||
# example application and documentation | # example application and documentation |
Revision as of 20:00, 22 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
TFilesDropEvent = procedure (Sender: TObject; const FileNames: Array of String) of Object; TFilesDropEvent = procedure (Sender: TObject; const FileNames: TStrings) of Object;
Add OnFilesDrop: TFilesDropEvent to TCustomForm, TApplication and TApplicationProperties.
The widgetsets should call method IntfFilesDrop of target form, which would invoke the OnFilesDrop event of the form and also of the application.
Possible implementation per widgetsets
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
- agree on details
- implement for LCL/widgetsets
- example application and documentation