Graphisoft®

Dialog ManagerVersion: 2.0

ItemDragDropData::GetTreeViewItem

Gets the drag source treeview item.

long GetTreeViewItem (ULong index) const;

Parameters

index
Index of the tree view item being drag from the drag source tree view.

Return Value

The tree view item specified by the index parameter.

Description

First use the GetItemCount member function to get the item count. Then you can iterate through tree view items by using a 0 based index.

Example

// Method Example:
if (ev.HasDataFormat ('TVEX')) {
	DG::MultiSelTreeView* sourceTree = reinterpret_cast<DG::MultiSelTreeView*> (ev.GetTreeViewSource ());
	for (i = ev.GetItemCount () - 1; i >= 0 ; i--) {
		long treeItem = ev.GetTreeViewItem (i);	//Getting the selected treeview items from the source
		InsertItemRecursively (sourceTree, treeItem, insertPos, relativePos);
	}
	if (*effect == DG::DragDrop::Move) {
		for (i = ev.GetItemCount () - 1; i >= 0; i--) {
			long treeItem = ev.GetTreeViewItem (i);
			sourceTree->DeleteItem (treeItem);
		}
	}
}

Accessing tree view items from the drag source.