Page 1 of 1

Intercepting drag and drop files in to the webgadget?

Posted: Wed Feb 28, 2007 8:14 pm
by ricardo
Hello

Im coding some listview in the webgadget because im adding some additional features like animation, etc.

It works fine now, i can add files to my webgadget listview from openfilerequester, etc. I mean, its interacting with my PB code as its was more or less a gadget.

The problem im facing is that if user try to drag a file into this webgadget based listview it could do one of 2 things: navigate to the file (if its possible like if its an image) or try to open it if its another kind of file.

Im looking for a way to avoid this, trying to intercept the drag and drop of files into webgadget to know which file was dragged and stop webgadget to doing anything about.

Any help is welcome.

*Additional comment:
I am trying to use webgadget adn AJAX to make the GUI of my app, but using those webgadget gadgets as it was more or less PB gadgets, and im finding very nice results (specially visual ones)

Posted: Fri Mar 02, 2007 3:44 pm
by ricardo
Its not even possible to cancel that webgadget accepts drag and drop of files?

Posted: Thu Apr 05, 2007 10:22 pm
by freak
I know this comes very late, but i just stumbled over the solution by accident.

This prevents Drag & Drop to the WebGadget:

Code: Select all

    Browser.IWebBrowser2 = GetWindowLong_(GadgetID(#WebGadget), #GWL_USERDATA)
    If Browser
      Browser\put_RegisterAsDropTarget(#VARIANT_FALSE)
    EndIf

Posted: Fri Apr 06, 2007 5:41 pm
by ricardo
Thanks, i will try it. :)

Posted: Fri Apr 06, 2007 6:41 pm
by JCV
It works. Thanks for the code freak. ;)

Posted: Sat Mar 08, 2008 10:54 am
by quasiperfect
hmm i tried to use freak code but doesn't seams to work
dose anyone have a solution for disable drag and drop on a web gadget ?
i use the Mozilla flag

another question will the web gadget work with Mozilla flag if the user doesn't have FireFox installed ?

Posted: Sat Mar 15, 2008 1:47 am
by utopiomania
dose anyone have a solution for disable drag and drop on a web gadget ?
http://www.purebasic.fr/english/viewtopic.php?t=30659 :?:

Posted: Sat Mar 15, 2008 4:18 am
by freak
I don't think the callback solution proposed by utopiomania will work with the
Mozilla flag. The Mozilla ActiveX control is very limited, sorry.

> another question will the web gadget work with Mozilla flag if the user doesn't have FireFox installed ?

The user has to install the Mozilla ActiveX control. Thats a separate download,
and not directly related to Firefox iirc.