Delphi非可视化TTree实现 [英] Delphi non visual TTree implementation

查看:142
本文介绍了Delphi非可视化TTree实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个非视觉持久化树(TStringTree)实现。如果有人知道它有什么好处,请让我知道。

I'm looking for a non visual persistent tree (TStringTree) implementation. If someone known any good implentation of it, please let me know.

谢谢。

推荐答案

您将在 DI容器库(商业)。然而,正如其他人在上面已经指出的那样,自己卷起来真的很容易,只添加了你需要的功能。

You'll find a flexible, non-visual tree structure in the DI Containers library (commercial). However, as others have noted above, it's really quite easy to roll your own, adding only the functionality that you need.

您只能使用两个基础对象:TNode和TNodeList(例如TObjectList后代)。至少,TNode只需要三个成员:您的字符串数据,对其父节点的引用(如果节点为根,则为零)和作为其子节点列表的TNodeList。剩下的是(Add(),Delete(),IndexOf(),MoveTo(),GetFirstChild(),GetNext()等各种附带方法的实现(有点乏味)。基本树应该少于一个-nighter。

You can do with just two base objects: TNode and a TNodeList (e.g. a TObjectList descendant). At minimum, TNode needs just three members: your string data, a reference to its parent node (nil if the node is root), and a TNodeList, which is a list of its child nodes. What remains is the (somewhat tedious) implementation of the various attendant methods such as Add(), Delete(), IndexOf(), MoveTo(), GetFirstChild(), GetNext() etc. The basic tree should be less than a one-nighter.

这篇关于Delphi非可视化TTree实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆