Defining Drag and Drop Behavior for Picture and Tree Widgets
Drag and drop properties are supported by picture widgets and items in the tree widget.
Before setting drag and drop properties, ensure that drag and drop formats are defined. For more information, see Create and Maintain Drag-and-Drop Formats.
To define drag and drop properties declaratively:
- Draw the picture or tree widget in an entity on a form.
- In the Properties Inspector, click the FRM Widget Properties to open the properties dialog.
- If you are defining a Tree widget, click Types, and select an item in the Name list for which you want to define drag and drop properties.
-
For either widget, define the accepted drag
and drop formats.
-
In the Define Properties form, click Drag
& Drop.
The Define Drag and Drop Properties form for the selected item opens.
- In the Library list, select a format and add it to the Supported Drag Formats.
-
In the Library list, select a
format and add it to the Accepted Drop Formats.
The sequence of accepted drop formats is important; you can change the sequence with up and down arrows.
-
Optionally, select Use Field Actions for all
Drop Formats.
This enables you to set the actions that will be applicable for all items dropped on the current drop target. By default, the format of the selected item determines the drop actions.
-
If you have checked the Use Field Actions for
all Drop Formats, define the popup menu that is shown when the right mouse button is
used to drag an item over a drop target:
- Indicate the default action for the format—Move, Copy or Create Shortcut is the default drop action for this format. The default drop action is shown in bold, together with the other enabled actions, when the popup menu is shown. Extended triggers are called when an action is selected from the popup menu.
- Indicate at least one drop actions to be enabled in the popup menu. You must check at least one. (Cancel is always enabled. )
- Optionally, redefine the texts for the actions in the popup menu.
- Click OK twice to save and return to the Component Editor.
-
In the Define Properties form, click Drag
& Drop.
- For each selected action, implement the desired behavior in the appropriate drag-and-drop triggers:
You can also define drag and drop properties dynamically using $properties to define the widget properties Supported Drag Formats, Accepted Drop Formats, and Accepted Drop Formats.
For example:
$properties(FIELD1) = "DRAGFORMAT=QUEEN;DROPFORMAT=Triangle;DROPACTIONS=1!;Move!;Copy!;!;Cancel"