> On Jun 29, 2017, at 3:56 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> the primary file that 4D should open is always the structure file, not the 
> data file.

> 
> that said, if you insist on drag and drop of a data file (which is wrong),

Sorry Keisuke, I am really grateful for your help.  I am just struggling to 
understand what you mean.

In an app created with 4D Desktop, my understanding is that 4D and the 
structure file are merged together as one application.  At least that is how it 
appears to the user.  So I believe the user will naturally think of the .4DD 
file as a document to be opened by the application, and want to drag it on top 
of the application icon to launch it.

> you can use the On Drop database method.
> 
> http://doc.4d.com/4Dv15/4D/15.4/On-Drop-Database-Method.300-3274338.en.html
> 
> and
> 
> $0:=-1
> 
> to filter the default behaviour, and use OPEN DATA FILE as you see fit.
> 
> http://doc.4d.com/4Dv15/4D/15.4/OPEN-DATA-FILE.301-3274411.en.html
> 
> obviously "Prevent drop of data not coming from 4D" must not be set.
> 
> http://doc.4d.com/4Dv15/4D/15.4/Compatibility-page.300-3285389.en.html

This is a great tip, but I can’t seem to get it to work (in 4D v16 R2).  I made 
sure “Prevent drop of data not coming from 4D” was unchecked.  But how do I 
filter the default behavior?  When I add $0:=-1 to the end of my On Drop 
method, the compiler gags.  It says the parameter $0 has not been explicitly 
declared in the typing methods, and I can’t add a parameter declaration in 
COMPILER_ALL_METHODS for On Drop (I can’t find anything in the documentation 
that says I should return a value from this method anyway).

Also I don’t understand this paragraph in the documentation:

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

Does this mean that in the case of a merged app that is not running, On Drop is 
called before On Startup when you drag something on to the app's icon?  I can’t 
seem to get On Drop to trigger at all during app launch.

Again, I appreciate your help.  I’m sure I’m just being stupid with something 
that is straightforward.


> 
>> 2017/06/30 4:23、Steve Slanec via 4D_Tech <4d_tech@lists.4d.com> のメール:
>> Am I still missing something?
> 
> 
> 
> 
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **********************************************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to