Page 1 of 1

Drag and drop

PostPosted: Sun Dec 01, 2013 8:03 am
by HackinHoodLogicsTm
Please i would like to know if there is any script for your application to accept object dragged from desktop. The project is a media player and i want it to accept and play music dragged from desktop. Any help will be appreciated. Thanx :P

Re: Drag and drop

PostPosted: Sun Dec 01, 2013 8:34 am
by dec
Hello,

A possible (and easy) way to do it is using my npDrop plugin.

This plugin allow you to drop files from Windows Explorer onto various NeoBook publication objects, like rectangles, polygons, pictures and more. Also allow you to drop files onto the entire publication.

The plugin allow you to put one or more target objects in the same publication, activate or deactivate this Drop objects, allow or disallow the dropped files, and get all the files and directories finally dropped.


Take a look if you liked. ;)

Re: Drag and drop

PostPosted: Sun Dec 01, 2013 12:14 pm
by HackinHoodLogicsTm
Yeah, thanx for the reply. It helps

Re: Drag and drop

PostPosted: Wed Dec 04, 2013 8:40 am
by dpayer
HackinHoodLogicsTm wrote:Please i would like to know if there is any script for your application to accept object dragged from desktop. The project is a media player and i want it to accept and play music dragged from desktop. Any help will be appreciated. Thanx :P



David's plugin is more specific to your need but you can also do a drag/drop using WebBrowser windows.

If you set the URL for the window to be: c:\myfolder\files*.mp3 for example it will display a list of mp3 files in that folder. You can drag/drop or cut/paste from another MSIE window (used as a file explorer window) or from the desktop or from a Windows Explorer window.

I was going to paste a sample but I think you can create it faster. Make a new pub with two WebBrowser objects on it. For the URL of each, browse on one to a file on the desktop and select it. Once selected, remove the file name and leave the remaining folder name with the slash. Neobook doesn't like to select folders for this purpose. On the other browser object, select another folder using the same method.

When you run this app, you can drag files from one window to the other.

NOTE: this will MOVE the file between the two locations, not just grab the file name for use or copy the file.

This method is dependent on how the individual user has set up their folder options in windows explorer so some will have list as default, others will have large icons by default.

Still, it is a useful process using built in NB objects for dragging/dropping of files.

David P.

Re: Drag and drop

PostPosted: Wed Dec 04, 2013 6:25 pm
by mishem

Re: Drag and drop

PostPosted: Thu Dec 05, 2013 7:51 am
by dpayer
mishem wrote:http://neobooker.ru/_fr/31/ksDrop.rar



Mishem,

I downloaded this and installed the plugin. It appears the plugin is supposed to populate a listbox but it doesn't seem to work. I only get a grey listbox rectangle and a grey picturebox that attempts to dislay a picture named by a variable: [ksDropFile0]

I can drag/drop files into the listbox and their name/path do display but nothing happens after that when I click.

Is that what it is supposed to do?

I can't translate the buttons as they get mangled in NB due to character set issues. (Ðàçðåøèòü ïðè¸ì âíåøíèõ ôàéëîâ) & (Çàïðåòèòü ïðè¸ì âíåøíèõ ôàéëîâ)

David P.

Re: Drag and drop

PostPosted: Thu Dec 05, 2013 9:03 am
by mishem
Hello!

The first button:
Allow receiving external files

The second button:
Disable receiving external files

Push Allow receiving external files

And dragging the image file to Picture1.
In ListBox1 is the full path to the image.
You can drag and drop multiple files. In ListBox1 is a list of paths to these files.