NathanH Valued Newbie
Joined: 05 Sep 2001 Posts: 32
|
Posted: Thu Jul 31, 2003 8:54 pm Post subject: Add Drag and Drop to VDSExplorer sample |
|
|
Just for fun, here is some code to add Drag and Drop (IE Shortcuts and HTML files) to the VDSExplorer sample that came with VDS5.
| Code: | TITLE DragDrop Example
#DEFINE COMMAND,BROWSER
#DEFINE FUNCTION,BROWSER
external vdsbrw50
DIALOG CREATE,Demo DragDrop,-1,0,560,400,DRAGDROP
DIALOG ADD,BROWSER,BROWSER1,2,2,555,395,about:Drag and Drop HTML files and IE Shortcuts here...
DIALOG SHOW
:EVLoop
WAIT EVENT
GOTO @event()
:DRAGDROP
list CREATE,1
list DROPFILES,1
IF @EQUAL(@UPPER(@EXT(@ITEM(1))),URL)
GOSUB URL
END
IF @EQUAL(@UPPER(@EXT(@ITEM(1))),HTM)
GOSUB HTML
END
IF @EQUAL(@UPPER(@EXT(@ITEM(1))),HTML)
GOSUB HTML
END
LIST CLOSE,1
GOTO EVLoop
:URL
INIFILE OPEN,@ITEM(1)
%%URL = @INIREAD(InternetShortcut,URL)
INIFILE CLOSE
IF @NOT(@NULL(%%URL))
DIALOG SET,BROWSER1,%%URL
ELSE
WARN Shortcut did not contain a valid URL
END
EXIT
:HTML
dialog set,BROWSER1,@ITEM(1)
EXIT
:CLOSE |
Nathan |
|