XferData
Object List Next Object
Definition:
Data transfers within Phoenix and between Phoenix and other applications are
done via the XferData object, which incorporates the clipboard as well as
drag-and-drop mechanisms.
Specialized Features:
The following tables list and describe the properties and methods added by XferData. There are no added events.
Properties Use to...
Aspect Determine the available aspect for the exchange format at Index.
DragMode Determine whether an XferData object is used for drag-and-drop operations or
clipboard operations.
FileName Indicate the FileName format available to the XferData.
Format Retrieve the name or number of the format at the Index property.
Index Determine whether a format exists at this index.
Medium Determine the media on which the exchange format at Index is available.
NumAccepted Determine the number of setable formats in the XferData.
NumOffered Determine the number of getable formats in the XferData.
ObjectRef Reference an Phoenix object in the same process, if available.
Selected Determine whether or not the format at Index is available for exchange.
Text Access text from the CF_TEXT format, if available.
Methods Use to...
Copy Copy an XferData's selected formats to a new XferData.
Drag Begin a drag-and-drop operation.
GetData Get an XferData object containing the data formats of an object.
GetPicture Get an XferData object containing pictorial formats.
IndexFromFormat Search for matching format and set Index if found.
IndexFromFormatEtc Search for matching format, aspect, and medium and set Index if found.
SetData Set an object's data formats from an XferData object.
SetPicture Set the pictorial formats.
TextUnload Write a text representation of a window.
Copied Features:
None
this is a top-level object.
Details:
The Windows Clipboard, the Windows File Manager, Visual Basic, and OLE 2 have
each defined somewhat disparate mechanisms for data exchange.
The Windows Clipboard allows applications to transfer data by placing it on a
system “clipboard,” from which other applications may access it. Data is presented by using
shared memory or a global handle and tagging it with one of several system or user
defined formats, such as text, bitmap, metafile, etc.
The File Manager provides more direct manipulation of data transfer, so-called “drag-and-drop,” by which data is visually “grabbed” by the mouse, dragged from its source location and dropped at some
destination, or target. However, file names are the only kind of data that can be
transferred by this mechanism.
Visual Basic also implements drag-and-drop to transfer arbitrary data, by
allowing a reference to a VB Form or Control to be transferred, and through the
reference, access any properties or methods of the drag source. VB also provides
clipboard access, but object references cannot be passed on the clipboard, and
clipboard formats cannot be dragged-and-dropped. Moreover, drag-and-drop only
works within the confines of the VB application. Data from other programs, even
other VB programs, cannot be exchanged by drag-and-drop.
OLE 2 generalizes the clipboard and drag-and-drop mechanisms, and extends them
to allow exchange of embedded or linked OLE objects as well. The format concept is extended to include the notion of aspect - a particular role or view of the data. Exchange can take place on media other than shared memory, such as files, or OLE structured storage. Multiple
combinations of format, aspect and media can be placed on the clipboard, or
dragged-and-dropped to the same application or another.
The XferData object unifies all these into a single abstraction. The XferData
object can be used to access the clipboard or to do drag-and-drop. OLE 2
extended clipboard formats are used by XferData, including a user-defined format for
transferring Phoenix object references.
The XferData object has properties and methods that describe the data
transfer, such as: the number of formats offered or accepted; an Index to iterate
through the formats; methods to search for specific formats or combinations of
format, aspect, and media. Individual formats may be selected for inclusion or
exclusion from a transfer.
The XferData object has properties and methods that simplify getting or
setting often used formats, such as: text, object reference, pictorials, and file
names. When pictorial formats such as bitmap, metafile, enhanced metafile, and DIB
are transferred, XferData provides conversion from any one format to all the
others, using the SetPicture and GetPicture methods. Multiple formats may be
transferred in a single operation, using the Copy, SetData, and GetData methods.
Phoenix Forms and Controls can act as drag-and-drop targets by implementing a
DragAndDrop event handler. An XferData is passed with the event, providing
access to and description of the data offered for transfer. Files dragged from the
File Manager will also raise DragAndDrop events.