Graphisoft®

Dialog ManagerVersion: 2.0

ItemDragDropData::GetListViewSource

Gets the listview drag source if 'LVEX' drag format is present.

ListView * GetListViewSource (void) const;

Return Value

A DG::ListView pointer to the listbox source of the drag and drop operation.

Description

Retrieves a list view type Dialog Manager item. This member function succeedes only if the source item a list view. You can check that by looking for the 'LVEX' drag format (or its modified version - ModifyBaseFormat) with the HasDragFormat function.

Example

// Method Example:
if (ev.HasDataFormat ('LVEX')) {
	DG::ListView* sourceList = ev.GetListViewSource ();			// Getting the source listview control
	for (i = 0; i < ev.GetItemCount (); i++) {
		short listItem = ev.GetListViewItem (i);
		ULong size = sourceList->GetItemTextLength (listItem);
		text = BMAllocatePtr (size, ALLOCATE_CLEAR, 0);
		sourceList->GetItemText (listItem, text, size);
		textArray.Insert (i + 1, text);							// Getting the text of the selected items
		if (sourceList->GetItemImageType (listItem) == DG::ListView::Icon) {
			DG::Icon icon = sourceList->GetItemIcon (listItem);
			iconArray.Insert (i + 1, icon.GetData ());
		}
	}
}

Description of the example.