TreeControl

From wiki.visual-prolog.com

Revision as of 01:15, 1 June 2010 by Thomas Linder Puls (talk | contribs) (Initial Draft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The new treeControl is generic meaning that the entities in the treeControl have the type you decide. In the example that comes with Visual Prolog 7.3 the control is used four different ways. In one of them the treeControl simply contains strings that represent directory paths. The program deal with paths not with some artificial node-ids. So the programmer works directly with the "concepts" without some strange ID level in-between. The new treeControl is also model based meaning that the programmer creates a model describing the tree rather than a complete data representation. This has the advantage that the tree accessed lazily: the children of nodes are requested when they are needed (i.e. when their parent are expanded). Another advantage is that the treeControl is driven by events from the model, so changes in the model is automatically reflected in the treeControl. If a single model is shown by several treeControl's changes will automatically be shown in all the treeControls.