Low Level Direct Access to the Visualization Trees

In VLF-WIN code you can directly access the VL trees (class #PRIM_TRVW) that are used to visualize the instance list content.

There may be two trees – the primary tree and possibly a secondary tree when side-by-side or over-under displays are used. 

Once you have a reference to the tree you can access the items with in the tree and the columns within the items. 

The properties #avListManager.avPrimaryTree and #avListManager.avSecondaryTree yield references to the primary and secondary VL trees used to visualize an instance list. 

Some significant usage points:

Some examples:

Get the number of entries in primary visualization tree

#Std_text := #AVLISTMANAGER.avPrimaryTree.Entries.AsString

Use MESSAGE_BOX_SHOW With_Args(ok ok info *COMPONENT ('Tree has ' + #Std_text + ' entries'))

Change the icon associated with every entry at level 1 in a tree

For Each(#TreeItem) In(#avListManager.avPrimaryTree.Items)

  #TreeItem.Image <= #vf_ic004

Endfor

Note:  This example is iterating over the tree so it is working in the visual order of the currently displayed tree - not necessarily the order of the instance list entries.

Make sure the first entry in the tree is visible

 

#avListManager.avPrimaryTree.Items<1>.EnsureVisible := True

 

Note:  This example does not cater for an empty tree.