Drag-Drop & delete files using a webbrowser object

NeoBook tips, tricks, code samples and more...

Moderator: Neosoft Support

Locked
User avatar
dpayer
Posts: 1394
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Drag-Drop & delete files using a webbrowser object

Post by dpayer »

I was looking for a way to allow a user to rename a file so they would think how to do it in their real-work environment.

I discovered (again - I seem to recall doing this before) that you can point a web browser object to a folder and it will give you a file list of that folder. Put two of those web browsers together and you can drag files between them. You can also do a copy / paste or a file delete. It appears file renaming is not possible. The display is based on how you have explorer set up on your system. Some show entire file names, others hide the extension, etc.

Here is a little demo. Create a new publication in Neobook (640x480 is what this was for me). Copy the following code and paste it into the blank publication. You can select your folders and act on the files as you would in any explorer window.

NOTE: this was tested only on a Win7 machine with full admin rights. Your mileage may vary.

Code: Select all

{NeoBook 5 Objects}
NeoBookVer=5.80
ObjectType=14
Name=WebBrowser1
X=19
Y=85
W=292
H=299
Anchor=0
FileName=about:blank
VarName=[WebBrowser1Status]
TitleVarName=[WebBrowser1Title]
URLVarName=[WebBrowser1Addr]
SilentMode=Yes
TrapPopups=Yes
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=1
Font=Arial Rounded MT Bold
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=2
ObjectType=14
Name=WebBrowser2
X=331
Y=85
W=292
H=299
Anchor=0
FileName=about:blank
VarName=[WebBrowser1Status]
TitleVarName=[WebBrowser1Title]
URLVarName=[WebBrowser1Addr]
SilentMode=Yes
TrapPopups=Yes
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=1
Font=Arial Rounded MT Bold
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=3
ObjectType=3
Name=PushButton1
X=188
Y=391
W=122
H=40
Anchor=0
Text=Select
Align=2
ImageStyle=0
XPTheme=Yes
ObjAction=FolderBox "Select a Folder:" "[Folder1]"¶BrowserGoTo "WebBrowser1" "[folder1]"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=1
FillMode=Yes
Font=Arial Rounded MT Bold
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=4
ObjectType=3
Name=PushButton2
X=502
Y=391
W=122
H=40
Anchor=0
Text=Select
Align=2
ImageStyle=0
XPTheme=Yes
ObjAction=FolderBox "Select a Folder:" "[Folder2]"¶BrowserGoTo "WebBrowser2" "[Folder2]"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=1
FillMode=Yes
Font=Arial Rounded MT Bold
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=5
ObjectType=8
Name=Text1
X=333
Y=61
W=291
H=19
Anchor=0
Font=Arial Rounded MT Bold
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial Rounded MT Bold;}}{\pard{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs16\cf0 [Folder2]}}}
HMargin=0
VMargin=0
LineColor=0
LineWidth=0
LineStyle=0
FillColor=12632256
FillPattern=1
TabOrder=6
ObjectType=8
Name=Text2
X=17
Y=61
W=291
H=19
Anchor=0
Font=Arial Rounded MT Bold
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial Rounded MT Bold;}}{\pard{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs16\cf0 [Folder1]}}}
HMargin=0
VMargin=0
LineColor=0
LineWidth=0
LineStyle=0
FillColor=12632256
FillPattern=1
TabOrder=7
ObjectType=8
Name=Text3
X=21
Y=10
W=613
H=33
Anchor=0
Font=Arial Rounded MT Bold
FontSize=16
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial Rounded MT Bold;}}{\pard{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs32\cf0 Drag-n-Drop files using only webbrowser object}}¶}
HMargin=0
VMargin=0
LineColor=0
LineWidth=0
LineStyle=0
FillColor=12632256
FillPattern=1
TabOrder=8
Image

David Payer
David Payer
Des Moines, Iowa
USA
Neosoft Support
NeoSoft Team
Posts: 5628
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA
Contact:

Re: Drag-Drop & delete files using a webbrowser object

Post by Neosoft Support »

Nice demo! Thanks for sharing it with us.
NeoSoft Support
User avatar
CN_Iceman
Posts: 300
Joined: Tue Mar 01, 2011 11:04 am
Location: España
Contact:

Re: Drag-Drop & delete files using a webbrowser object

Post by CN_Iceman »

Very interesting... Thank´s.
Greetings/Saludos, Jose.
www.icemansoft.es
Locked