Difference: 520DragDrop (4 vs. 5)

Revision 52012-09-12 - AlKalter

Line: 1 to 1
 
META TOPICPARENT name="APPX520Features"

Drag & Drop Support

You can now define a Widget as the target of a drag & drop operation.

Deleted:
<
<
Note: Screen shots and more detailed information will be provided as these details are finalized.
 

Overview:

Changed:
<
<
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.
>
>
You can now define certain Widget types (Buttons, Labels, etc.) 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

Changed:
<
<
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.
>
>
Define a LABEL, BUTTON, or FIELD object on your image. (NOTE: If you use a FIELD, you can select from the various normal control types, but be aware that the field value will not be automatically modified by the drag & drop operation).

On the object Properties screen, check the "Drop?" box, and set the Chooser 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.

You can also set those values, --- WIDGET DROP TARGET and --- WIDGET FI CHOOSE MODE, via ILF code.

 

Drop Target at Runtime

Changed:
<
<
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.
>
>
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. The files are: --- DROPINFO which will contain one record for every object dropped and --- DROPPROP which will contain multiple records for each object dropped, if there is additional information for the object type. Both of these files are keyed by the --- WIDGET KEY, so if you have more than one drop target on your image, you can differentiate them.
The DROPINFO file
 
Changed:
<
<
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.
>
>
The --- DROPINFO file consists of the following:
  • DROPINFO PATH contains the full path to the object the user dropped
  • DROPINFO NAME is the file name portion of the pat, including the extension
  • DROPINFO EXT has the file extension
  • DROPINFO TYPE shows the item type (file, folder, etc.)
  • DROPINFO SIZE contains the size of the object
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 PATH
      APPEND   --- TEMP 512                   0      "
      PASS     --- TEMP 512                   FIELD            SHARE? N
      GOSUB    --- .CLIENT LOAD URL
 
Changed:
<
<
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:
>
>
(We enclose the name in quotes in case it contains a space.)
The DROPPROP file
 
Changed:
<
<
Keyword Value
file VolumeC.txt
size 4242
type File
>
>
The --- DROPPROP file is a child file of --- DROPINFO and contains multiple records for each object, depending on the type of object dropped. The --- DROPPROP KEYWORD identifies a specific property, and --- DROPPROP VALUE contains the value of that property.
 
Changed:
<
<
An Email message might have the following ---- DROPPROP keywords and values:
>
>
For example, an Email message might have the following ---- DROPPROP keywords and values:
 
Keyword Value
Categories Blue Category (controlled by user's Outlook settings)
Line: 41 to 55
 
type OutlookMsgItem

Note that these keywords vary depending on the user's desktop language.

Added:
>
>
Additional Information
 
Changed:
<
<
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:
>
>
These files are cleared every time the image is displayed to the user, and every time a new object is dropped. If you do not process or save the information each time, the previous data will be lost.
 
Changed:
<
<
      SET      --- TEMP 512                   =      "
      APPEND   --- TEMP 512                   0  --- DROPINFO PATHNAME
      APPEND   --- TEMP 512                   0      "
      PASS     --- TEMP 512                   FIELD            SHARE? N
      GOSUB    --- .CLIENT LOAD URL
>
>
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.

Example:

 
Changed:
<
<
We enclose the name in quotes in case it contains a space.
>
>
This feature allows APPX designers to enhance a File Chooser field to allow a user to either browse to a desired file or drag-and-drop it.
 
Changed:
<
<
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.
>
>
If the target file chooser field is TEMP 256 and the widget name is MY-FILE-CHOOSER, insert this ILF code in Option Intercept:
      IF       --- OPTION                     EQ     DROP
T     SET      --- WIDGET KEY                 =  --- DROPINFO WIDGET KEY
T     READ     --- WIDGET                 HOLD 0 FT 0 BY WIDGET KEY
TT    IF       --- WIDGET NAME                EQ     MY-FILE-CHOOSER
TTT   SET      --- TEMP 256                   =  --- DROPINFO PATH
TTT   DISPLAY  --- TEMP 256                   (AT APPEARANCE #    )
 
Deleted:
<
<
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.

Line: 63 to 80
 
<--/commentPlugin-->

-- JeanNeron - 2012-06-14

Added:
>
>
META FILEATTACHMENT attachment="atttrib.jpg" attr="h" comment="" date="1347468492" name="atttrib.jpg" path="atttrib.jpg" size="64451" user="AlKalter" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback