Drag & Drop Support
You can now define a Widget as the target of a drag & drop operation.
Note: Screen shots and more detailed information will be provided as these details are finalized.
Overview:
You can now define certain Widget types (Buttons, Labels, others?) as targets of a drag & drop operation. This means the user can drag a file or other object to an Appx Widget & drop it.
Creating Drop Target
Define a field on your image, then use the GUI Attributes to set the Control type to 'BUTTON'. Fill in the other attributes as desired (including which Option to fire), and at the end of the Tooltip, add the string
@SDND=dir or
@SDND=file. The 'dir' option will allow the user to drop a file or directory. If they drop a directory, Appx will recursively populate the --- DROP* files with all the files in that directory. If they drop a file, it will populate --- DROP* with just that file's info. Note that Email messages and attachments in Emails can also be dropped.
The
@SDND technique will be replaced with Widget attributes in the final release.
Drop Target at Runtime
When the user drops an object (file/folder/email message/etc) on the drop target, Appx will populate 2 files and then fire the specified --- OPTION. The files are: --- DROPINFO which will contain one record for every object dropped and --- DROPPROP which will contain multiple records for each object dropped. Both of these files are keyed by the --- WIDGET IMAGE KEY, so if you have more than one drop target on your image, you can differeniate them. Alternatively, you can have the different drop targets fire different Option Numbers.
The --- DROPINFO PATHNAME contains the full path to the object the user dropped. The --- DROPPROP file is a child file of --- DROPINFO and contains multiple records for each object. The specific data varies depending on the type of object dropped. The --- DROPPROP KEYWORD identifies a specific property, and --- DROPPROP VALUE contains the value of that property.
For example, if a file from the users desktop is dropped, --- DROPINFO PATHNAME might contain something like "C:\Documents and Settings\jean\Desktop\VolumeC.txt" and --- DROPPROP might contain the following keywords and values:
Keyword |
Value |
file |
VolumeC.txt |
size |
4242 |
type |
File |
An Email message might have the following ---- DROPPROP keywords and values:
Keyword |
Value |
Categories |
Blue Category (controlled by user's Outlook settings) |
From |
Microsoft Office Outlook (human readable 'from' address) |
Received |
Tue 12:40 PM |
Size |
6 KB |
Subject |
*SPAM* Microsoft Office Outlook Test Message |
file |
SPAM Microsoft Office Outlook Test Message.msg |
size |
18944 |
type |
OutlookMsgItem |
Note that these keywords vary depending on the user's desktop language.
DROPINFO PATHNAME would contain the path to open and read the dropped item. You could also use this to open the file via .CLIENT LOAD URL:
SET --- TEMP 512 = "
APPEND --- TEMP 512 0 --- DROPINFO PATHNAME
APPEND --- TEMP 512 0 "
PASS --- TEMP 512 FIELD SHARE? N
GOSUB --- .CLIENT LOAD URL
We enclose the name in quotes in case it contains a space.
Note that these files are cleared every time the image is displayed to the user. If you do not process or save the information each time, the previous data will be lost.
Comments:
Read what other users have said about this page or add your own comments.
--
JeanNeron - 2012-06-14