Data Tree - a treeview control for LiveCode
Put simply, Data Tree is a fast, robust and easy to use tree library that looks like a native control on both Windows and Mac OS X.
In summary, you can:
- easily create and manipulate tree controls using a set of commands and functions
- work with huge numbers of nodes within a tree and display up to 1,200 at once
- tap into the underlying data arrays for raw processing power
- create multiple parent/child levels
- easily apply icons and set other properties of nodes to fine tune the way they behave
- insert a tree into the tabbing order of the card
- receive keyboard and mouse events
- add your own properties to nodes, allowing you to store data within the tree
- even incorporate code within a node to execute when the user interacts with it
The download contains a fully functional library, a manual and example stacks. You can trial the library for as long as you like but please be aware that without a valid licence key in use, it will periodically display a nag window.
How do I use it?
Like any custom control, each Data Tree is a collection of LiveCode objects that are grouped together. With a template copied to your card, you just need to put the library into use for it to come alive.
From here, you can issue a series of commands to it to create nodes, move them around and set their properties. Each node is given a unique ID by you, which is used to determine which node has been clicked on. The data that you create is stored within the tree and persists from session to session.
It's easy to set up parent/child relationships: when you create a new node or move an already existing node, you simply tell Data Tree its new owner.
Data Tree introduces new events that are received by the tree controls. Events received include nodeDown, nodeUp, expandNode and so on. Data Trees can also receive keyboard input so you can code cursor key navigation and suchlike.
Data Tree is written 100% in LiveCode. Data Tree requires LiveCode 4.0 or higher (LiveCode 4.6 required for iOS support - currently in beta) and is designed to run on Mac OS X and Microsoft Windows platforms.