Graphisoft®

Dialog ManagerVersion: 2.0

DGDragGetFileData

Gets the drag and drop data with the specified format with the specified folderpath.

    bool DGDragGetFileData (
      DGDragFormat        format,
      const GS::uchar_t*  folderPath,
      void*               data,
      ULong*              size
    );

Parameters

format
Int32 value, usually used in it's character representation ('FILE', 'TEXT'). Used to identify the format of the data being drag dropped.
 
folderPath
The destination folder on a delayed 'FILE' drag and drop.
 
data
Output parameter: Previously allocated data to receive the requested drag and drop data. Can be NULL, to retrieve the size of drag and drop data in the size parameter.
 
size
Output parameter: Receives the size of the drag and drop data with the given format.
 

Return Values

Value Meaning
true The drag and drop data was successfully retrieved.
false The function parameters are incorrect.

Remarks

There is the possibility to set up user-defined data blocks for a drag and drop operation with DGDragSetData function. A data block has a format, which is an Int32 value, and describes the data-format of this block. This format must be unique among the added data blocks' formats, so you cannot set up a data block with an already existing format. Usually this block contains the dragged items, entities (or references to them) in the specified format.

The setting of data block can be delayed, if necessary: the DGDragSetDelayedData function should be called, instead of DGDragSetData, and after DG_DRAG_SETDELAYEDDATA submessage comes, the data block must be set with DGDragSetData.

For list views, tree views, list boxes and edit controls DG sets up data block at the beginning of the drag and drop operation. These blocks' types are: 'LVEX', 'TVEX', 'LBEX', 'TEXT'. There are some special functions, which can be used with these formats: DGDragGetItemCount, DGDragGetTreeViewItem, DGDragGetListBoxItem, DGDragGetListViewItem, DGDragModifyBaseFormat.

DGDragGetFileData retrieves the data block, and the size of the data block of the given format.

Use NULL for the data parameter to determine the necessary buffer size.

Use this function when a drop target specific event occurs such as DG_DRAG_ENTER, DG_DRAG_OVER, DG_DRAG_DROP. If the drag drop data is too large, use this function only when DG_DRAG_DROP occurs, in other cases use DGDragHasFormat to provide the necessary feedback.

In the case when 'FILE' format is specified, the data is stored as an array of IO::Location-s allocated with placement new.

Requirements

Version: DG 2.0.0 or later
Header: DG.h
Import Library: DG.lib [WIN]
Module: DGLib [MAC], DG.dll [WIN]

See Also

DG_MSG_DRAGDROP, DGDragHasFormat, DGDragSetData
BuiltInDragFormats, DGDragSetDelayedData, DGDragModifyBaseFormat