ui.DragDrop.SetMimeType()

It is possible to use drag-and-drop not only to move data within one and the same 4GL application or between two 4GL applications running at once. It is also possible to move the dragged objects from and to an external application.

When the drag-and-drop is performed between different applications, it is necessary to identify the type of data passed to the drag-and-drop buffer in order to provide the proper data manipulation. The type of the data stored in the drag-and-drop buffer is defined by the MIME (Multiple Internet Mail Extensions) type, a widely used internet standard specification.

In 4GL applications, only text data can be involved in drag-and-drop operations. The MIME type check is intended to see whether the format of the dragged object allows it to be inserted to the drop target.

There are some standard MIME types, such as:

setMimeType() is used to set the MIME type that will be used during the drag-and-drop operations performance. The method does not return any values and needs a string value specifying the new MIME type as an argument. The method is usually called within the ON DRAG_START control block and is used together with setBuffer().

If the MIME type is not specified before the start of the drag operation, the text/plain type is taken as the default one, and the selected rows will automatically be passed to drag-and-drop buffer. If you want to prohibit drag and drop between applications, you should specify a MIME type unique for the current application so that the other applications do not recognize it.

The MIME type defined in this way should not be in conflict with standard MIME types:

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.