Intercepting drag and drop files in to the webgadget?

Just starting out? Need help? Post your questions and find answers here.
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Intercepting drag and drop files in to the webgadget?

Post 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)
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

Its not even possible to cancel that webgadget accepts drag and drop of files?
freak
PureBasic Team
PureBasic Team
Posts: 5944
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post 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
quidquid Latine dictum sit altum videtur
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

Thanks, i will try it. :)
JCV
Enthusiast
Enthusiast
Posts: 580
Joined: Fri Jun 30, 2006 4:30 pm
Location: Philippines

Post by JCV »

It works. Thanks for the code freak. ;)

[Registered PB User since 2006]
[PureBasic 6.20][SpiderBasic 2.2]
[RP4 x64][Win 11 x64][Ubuntu x64]
quasiperfect
Enthusiast
Enthusiast
Posts: 157
Joined: Tue Feb 13, 2007 6:16 pm
Location: Romania
Contact:

Post 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 ?
Registered user of PureBasic
User avatar
utopiomania
Addict
Addict
Posts: 1655
Joined: Tue May 10, 2005 10:00 pm
Location: Norway

Post 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 :?:
freak
PureBasic Team
PureBasic Team
Posts: 5944
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post 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.
quidquid Latine dictum sit altum videtur
Post Reply