Graphisoft®

Dialog ManagerVersion: 2.0

ItemDragDropData::GetLocation

Gets a location if 'FILE' type drag format exists in the current drag and drop operation.

bool GetLocation (
    ULong               index,
    IO::Location &      location
) const;

Parameters

index
Index of the location we want to acces in a drag and drop operation which contains the 'FILE' drag format.
location
Output parameter: reference to a location with the given index.

Return Value

true if the specified location (IO::Location) was successfully retrieved, otherwise false.

Description

Before using this function check the number of available locations with the GetLocationCount function. After that you can get a pointer to the specified IO::Locations, by using a 0 based index.

Example

// Method Example:
void	PictureControl::UserItemDropped (const DG::UserItemDropTargetEvent& ev, DG::DragDrop::Effect* /*effect*/)
{
	if (ev.HasDataFormat ('FILE')) {
		IO::Location fileLoc;
		ev.GetLocation (0, fileLoc);
		PicHandle pict = NULL;
		if (DBERROR (::FMReadImageFile (fileLoc, &pict) != GS::NoError))
			return;
		sourceDocument->Set (pict);
		KillPicture (pict);
	}
}

Getting out a location when files are present in a drag and drop operation.