4D v14.3

On Drop Database Method

Home

 
4D v14.3
On Drop Database Method

On Drop Database Method  


 

 

The On Drop Database Method is available in local or remote 4D applications.

This database method is automatically executed in the case of objects being dropped in the 4D application outside of any form or windows, i.e.:

  • In an empty area of the MDI window (Windows),
  • On the 4D icon in the Dock (Mac OS) or on the system desktop.

Under Mac OS, you need to hold down the Option+Command keys during the drop in order for the database method to be called.

When a drop occurs on the 4D application icon on the destktop, 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.

Example  

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

 
PROPERTIES 

Product: 4D
Theme: Drag and Drop

 
SEE ALSO 

Database Methods

 
ARTICLE USAGE

4D Language Reference ( 4D v11 SQL Release 6)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)