Graphisoft®

Dialog ManagerVersion: 2.0

ItemDragDropData::GetListBoxItem

Gets the drag source listbox item.

short GetListBoxItem (ULong index) const;

Parameters

index
Index of the source list box item to get.

Return Value

The list box item specified by the index parameter.

Description

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

Example

// Method Example:
if (ev.HasDataFormat ('LBEX') || ev.HasDataFormat ('LBDR')) {
	DG::ListBox* sourceList = ev.GetListBoxSource ();			// Getting the source listbox control
	for (i = 0; i < ev.GetItemCount (); i++) {
		short listItem = ev.GetListBoxItem (i);
		ULong size = sourceList->GetTabItemTextLength (listItem, 1);
		text = BMAllocatePtr (size, ALLOCATE_CLEAR, 0);
		sourceList->GetTabItemText (listItem, 1, text, size);
		textArray.Insert (i + 1, text);							// Getting the text of the selected items
	}
}

Accessing listbox items from the drag source.