Riebens Blog

Engaging Infinite Improbability Drive...

Replacing Recursive Tree (Ultratree) in Windev

Posted by Benjamin Dell
Benjamin Dell
Benjamin Dell has not set their biography yet
User is currently offline
on Sunday, 05 February 2012
in Development Chat

One of the few controls that Clarion developers normally hold up as a major reason why they don't switch to another development environment is Ultratree.

Ultratree gives a lot of functionality, and one of these functionalities is to easily create a tree in a single table.

Now with Windev 16 and higher, you need not feel left out.

 

Firstly we need to define the Table.

 

All we really need is an ID, a name to display in the tree and a PARENTID, In the analysis we can also set up the link to maintain the parent/child relationship for us.

 

Table Analysis


So how does this look at runtime?

 

Below is an example of an implementation of a single table tree control.

 

Tree Control in use

 

To Find out what item we have selected on the tree, is as simple as three lines of code

 

sBranch = TreeSelect(TREE_MyName)
IF StringCount(sBranch,TAB) >= 1 THEN
sBranch = ExtractString(sBranch,1,TAB,FromEnd)
END

 

And then to get the correct file from disk

 

HreadseekFirst(MyTreeTable,RecordName,sBranch)

I hope this inspires someone

Kind Regards
Ben


 

 

0 votes
Tags: Untagged
Benjamin Dell has not set their biography yet