4D v17.4On Drop Database Method |
||||||||||||||
|
4D v17.4
On Drop Database Method
|
Action | Platform(s) | Comment |
Drop in an empty area of the MDI window | Windows | Not available when the database is executed in SDI mode since there is no MDI window in this context (see SDI mode on Windows section). |
Drop on the 4D icon in the Dock | macOS | |
Drop on the 4D icon in the system desktop | Windows(*) & macOS | The On Drop Database Method is only called when the application is already launched, except in the case of applications merged with 4D Desktop. In this case, the database method is called even when the application is not launched. This means that it is possible to define custom document signatures. |
(*) Not supported with 4D Developer 64-bit on Windows because this action launches a new application instance (system feature).
On Mac, you need to hold down the Option+Command keys during the drop in order for the database method to be called.
This example can be used to open a 4D Write document that is dropped outside of any form:
`On Drop database method
droppedFile:=Get file from pasteboard(1)
If(Position(".4W7";droppedFile)=Length(droppedFile)-3)
externalArea:=Open external window(100;100;500;500;0;droppedFile;"_4D Write")
WR OPEN DOCUMENT(externalArea;droppedFile)
End if
Product: 4D
Theme: Drag and Drop
4D Language Reference ( 4D v17)
4D Language Reference ( 4D v17.1)
4D Language Reference ( 4D v17.2)
4D Language Reference ( 4D v17.3)
4D Language Reference ( 4D v17.4)