Graphisoft®

Dialog ManagerVersion: 2.0

ItemDragDropData::HasDataFormat

Checks if the requested drag format is present in the current drag drop operation.

bool HasDataFormat (DGDragFormat format) const;

Parameters

format
DGDragFormat type parameter. Used to specify the drag format in character style like: 'TEXT', 'FILE' etc.

Return Value

If true, the specified format is present in the current drag and drop operation. Otherwise false.

Description

This function is usefull to check is a given drag and drop format is present in the current drag and drop operation. Usually it is called in drop target event handler member functions. If a delayed drag and drop format is checked the set delayed data event is not fired toward the drag source.

Example

// Method Example:
void	TextControl::RichEditDragEntered (const DG::RichEditDropTargetEvent& ev, DG::DragDrop::Effect* effect, bool* defBehaviour)
{
	if (ev.GetSource () == &controlledView->editControl && (ev.HasDataFormat ('TEXT') || ev.HasDataFormat ('FILE'))) {
		*effect = DG::DragDrop::Accept;
		if (ev.HasDataFormat ('TDDE'))
			*defBehaviour = false;
	}
}

Cheking for available data formats in a richedit drag target.