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:

  1. Draw the picture or tree widget in an entity on a form.
  2. In the Properties Inspector, click the FRM Widget Properties to open the properties dialog.
  3. 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.
  4. For either widget, define the accepted drag and drop formats.
    1. In the Define Properties form, click Drag & Drop.

      The Define Drag and Drop Properties form for the selected item opens.

    2. In the Library list, select a format and add it to the Supported Drag Formats.
    3. 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.

    4. 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.

    5. 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.
    6. Click OK twice to save and return to the Component Editor.
  5. 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"

Related Topics