Graphisoft®

Dialog ManagerVersion: 2.0

ItemDragDropData::GetLocationCount

Gets the number of locations if the current drag contains the 'FILE' drag format.

ULong GetLocationCount (void) const;

Return Value

Number of locations in a drag and drop which has the 'FILE' format.

Description

After you check the existence of the 'FILE' drag format, use this function to determin the number of file locations in the current drag and drop operation.

Example

// Method Example:
void	PictureControl::UserItemDragEntered (const DG::UserItemDropTargetEvent& ev, DG::DragDrop::Effect* effect, bool* /*defBehaviour*/)
{
	*effect = DG::DragDrop::Reject;
	if (ev.HasDataFormat ('FILE') && ev.GetLocationCount () == 1) {
		IO::Location fileLoc;
		ev.GetLocation (0, fileLoc);
		if (FTM::FileTypeManager::Match (fileLoc, BMPFile, internalFileTypes))
			*effect = DG::DragDrop::Accept;
	}
}

Description of the example.