The commands of the “Pasteboard” theme can be used both for managing copy/paste actions (Clipboard management), as well as inter-application drag and drop actions.
4D uses two data pasteboards: one for copied (or cut) data, which is the actual clipboard that was already present in previous versions, and the other for data being dragged and dropped.
These two pasteboards are managed using the same commands. You access one or the other depending on the context:
- The drag and drop pasteboard can only be accessed within the On Begin Drag Over, On Drag over or On Drop form events and in the On Drop database method. Outside of these contexts, the drag and drop pasteboard is not available.
- The copy/paste pasteboard can be accessed in all other cases. Unlike the drag and drop pasteboard, it keeps the data that are placed in it during the entire session. so long as they are not cleared or reused.
During drag and drop actions, different types of data can be placed on and read from the pasteboard. You can access a data type in several ways:
- Via its 4D signature: The 4D signature is a character string indicating a data type referenced by the 4D application. The use of 4D signatures facilitates the development of multi-platform applications since these signatures are identical under Mac OS and Windows. You will find the list of 4D signatures below.
- Via a UTI (Uniform Type Identifier, Mac OS only): The UTI standard, specified by Apple, associates a character string with each type of native object. For example, GIF pictures have the UTI type “com.apple.gif”. UTI types are published in Apple documentations as well as by the editors concerned.
- Via its number or its format name (Windows only): Under Windows, each native data type is referenced by its number (“3”, “12”, and so on) and a name (“Rich Text Edit”). By default, Microsoft specifies several native types called standard data formats. In addition, third-party editors can “save” format names in the system, which then attributes them a number in return. For more information about this and about native types, please refer to the Microsoft developer documentation (more particularly at http://msdn2.microsoft.com/en-us/library/ms649013.aspx).
Note: In 4D commands, the Windows format numbers are handled as text.
All the commands of the “Pasteboard” theme can work with each one of these data types. You can find out which data types are present in the pasteboard in each of these formats using the GET PASTEBOARD DATA TYPE command.
Note: The 4-character types (TEXT, PICT or custom types) are kept for compatibility with prior versions of 4D.
Here is the list of standard 4D signatures as well as their description:
Signature | Description |
"com.4d.private.text.native" | Text in native character set |
"com.4d.private.text.utf16" | Text in Unicode character set |
"com.4d.private.text.rtf" | Enriched text |
"com.4d.private.picture.pict" | PICT picture format |
"com.4d.private.picture.png" | PNG picture format |
"com.4d.private.picture.gif" | GIF picture format |
"com.4d.private.picture.jfif" | JPEG picture format |
"com.4d.private.picture.emf" | EMF picture format |
"com.4d.private.picture.bitmap" | BITMAP picture format |
"com.4d.private.picture.tiff" | TIFF picture format |
"com.4d.private.picture.pdf" | PDF document |
"com.4d.private.file.url" | File pathname |