Quote: "That's what I'm doing already, but the many-to-many relationship of my entities result in reading arrays from top to bottom just to find relationships"
That really shouldn't be necessary.
There are basically two functions which can affect the order of items in a listview, addListViewItem and removeListViewItem.
All you need to do is to write two wrapper functions which add / remove the item as well as adjusting an array of user data as needed.
This code demonstrates how to associate a piece of string data with each item in a listview:
sync on
listview=createListView(10,10,620,200,0)
itemDataEdit=createEdit(10,250,100,20,0,0)
global dim listViewData(0) as string
addLVItem(listview,"Item One",0)
addLVItem(listview,"Item Two",0)
addLVItem(listview,"Item Three",0)
addLVItem(listview,"Item Four",0)
prevSelItem=-1
`message str$(array count(listViewData(0)))
do
getEvent
if eventSource()=listview
selItem=selectedListViewItem(listview)
if (selItem <> prevSelItem) and (selItem >= 0) and (selItem < array count(listViewData(0)))
setGadgetText itemDataEdit,listViewData(selectedListViewItem(listview))
prevSelItem=selectedListViewItem(listview)
endif
if eventType()=KEYDOWN
if eventData()=46 `DELETE Key
removeLVItem(listview,prevSelItem)
prevSelItem=-1
endif
endif
endif
if eventSource()=itemDataEdit
if eventType()=KEYDOWN
if (prevSelItem >= 0) and (prevSelItem < array count(listViewData(0)))
listViewData(prevSelItem)=getGadgetText(itemDataEdit)
endif
endif
endif
loop
function addLVItem(gadget,caption as string,image)
array insert at bottom listViewData(0)
addListViewItem gadget,caption,image
endfunction
function removeLVItem(gadget,item)
array delete element listViewData(0),item
removeListViewItem gadget,item
endfunction
Select the item by clicking on it, enter the text to associate with the item in the box below. Press the Delete key to delete the selected listview item.
BlueGUI Windows Plugin