This is because the methode _cust_tree_getItem()does not check whether an item is actually visible or not (when it's parent is collapsed, x and y should be -1 but they aren't). So it can happen that the method returns a wrong item which results in the following behavior:
I click a visible item but an invisible item which parent is collapsed will be selected and highlighted.
Edit: This should fix the error:
Code: Select all
Procedure.i _cust_tree_getItem(*tree.ct_main, List tree.ct_entry(), x.i, y.i)
Protected *Res.ct_entry
ForEach tree()
If y.i >= tree()\y And y.i <= tree()\y + *tree\lineHeight And tree()\y <> -1 And tree()\x <> -1
ProcedureReturn tree()
EndIf
If ListSize(tree()\childs()) > 0 And tree()\status <> #collapsed ; <- FIX
*Res = _cust_tree_getItem(*tree, tree()\childs(), x.i, y.i)
If *Res <> 0: Break: EndIf
EndIf
Next
ProcedureReturn *Res
EndProcedure