Listtree class handles tree nodes which can be defined as node or as leaf. Only nodes can contain a list where other tree nodes can be inserted.
You can create a very complex tree. Two different lists of tree nodes exist: First the one which contains all the tree nodes you have inserted. All modifications are made to this list. The second list is the display list. As you can open or close a node, not all of the existing tree nodes are displayed.
The tree nodes can be inserted and removed, sorted, moved, exchanged or renamed. To sort you can also drag and drop them. Modifications can be made in relation to the whole tree, to one level, to a sub-tree or to only one tree node, the visibility is checked or not.
The user can control the listtree by the MUI keys, this means a node is opened with "Right" and closed with "Left". Check your MUI preferences for the specified keys.
Only one entry can be selected yet, so you cannot use the listtree for multi selecting.
If you do not set Listtree.DragDropSort to
False, the list tree
will become active for Drag&Drop. This means you can drag one entry and
drop it on the same listtree again. While dragging an indicator shows where
to drop. You cannot drop an entry on itself, nor you can drop an opened node
on any of its members.
When creating a listtree in XML code, you can use Listtreenode class to fill it with nodes and items. Here is an example declaration:
<listtree> <node name="CPU"> <item>Model: Motorola MPC 7447/7457 Apollo V1.1</item> <item>CPU speed: 999 Mhz</item> <item>FSB speed: 133 Mhz</item> <item>Extensions: performancemonitor altivec</item> </node> <node name="Machine"> <item>Machine name: Pegasos II</item> <item>Memory: 524288 KB</item> <item>Extensions: bus.pci bus.agp</item> </node> <node name="Expansion buses"> <node name="PCI/AGP"> <item>Vendor 0x11AB Device 0x6460</item> </node> </node> <node name="Libraries"> <item>0x6c7d4a58: exec.library V53.34</item> </node> <node name="Devices"> <item>0x6ff8fba4: ramdrive.device V52.6</item> </node> <node name="Tasks"> <node name="input.device"> <item>Stack: 0x6ff4b000 - 0x6ff5b000</item> <item>Signals: SigWait 0x00000000</item> <item>State: Task (Waiting)</item> </node> </node> </listtree>
In this example we have made use of the Listtreenode.Name attribute to add a name to each of our nodes. There are some more attributes that you can use to customize the appearance of your nodes. See Listtreenode class for details.
The strings you specify using the
<item> tag and using the Listtreenode.Name
attribute can use text formatting codes. See Text formatting codes for details.