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 a Control type, such as BUTTON, LABEL, etc, depending on your requirements. In Pre-Display, set --- WIDGET DROP TARGET to "Y" and set --- WIDGET FI CHOOSE MODE to one of the following:
- ANY. Accepts a file, folder, or Email message/Attachment.
- FILE. Accepts files only.
- FOLDER. Accepts Folder names only
- TREE. Same as ANY, except if the user drops a folder name, the folder will be parsed and all file names will be returned in the DROPINFO/DROPPROP files.
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 set --- OPTION to <DROP/OPTION DROP/or something> (numeric value 335). 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 differentiate them.
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.
Email messages and attachments are copied to the location specified by 'dropCachePath', and then that path is returned to your program. 'dropCachePath' defaults to $(cachePath)\Drop.
Comments:
Read what other users have said about this page or add your own comments.
--
JeanNeron - 2012-06-14