Virtual TreeView中可能有多个扩展节点? [英] Multiple Expanding Nodes in Virtual TreeView possible?

查看:94
本文介绍了Virtual TreeView中可能有多个扩展节点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用TVirtualStringTree(属于虚拟TreeView组件)在我的

I am using a TVirtualStringTree (part of the Virtual TreeView Component) in my Delphi project and I would like to create a view where 2 columns can have children that are expandable/collapsable with [+] sign. In the picture below as sample I would like to have a [+] sign in the Server Column but also in the Image column. The idea is that the tree has several Server nodes that each have many process child's (which main colum is image) and some processes have sub-processes which are children of the processes'node.


(来源:
remkoweijnen.nl )


(source: remkoweijnen.nl)

这样的布局可行吗?如果不使用默认组件,那么我将为您提供有关如何在后代中实现此功能的建议.

Is such a layout possible? If not with the default component I would appreciate advice on how to implement this in a descendant.

/以下屏幕快照是使用TOndrej建议的方法的: 替代文本http://www.remkoweijnen.nl/temp/TreeView2.png 替代文字http://www.remkoweijnen.nl/temp/TreeView3.png 替代文本http://www.remkoweijnen.nl/temp/TreeView4.png

/ The following screenshots are when using the method TOndrej suggests: alt text http://www.remkoweijnen.nl/temp/TreeView2.png alt text http://www.remkoweijnen.nl/temp/TreeView3.png alt text http://www.remkoweijnen.nl/temp/TreeView4.png

好的,我决定按照TOndrej的想法实施: 替代文本http://www.remkoweijnen.nl/temp/TreeView5.png

OK, I decided to implement as per TOndrej's idea: alt text http://www.remkoweijnen.nl/temp/TreeView5.png

推荐答案

您很可能不需要它.只是清楚地说明您需要的分组.第一列可以是多用途的-在每个分组级别上显示不同的信息-例如级别0:服务器,级别1:进程,级别2和更高级别:子进程. 在每个级别上,仅与该级别相关的列需要显示任何信息.在上面的示例中,级别0仅在第一列中显示服务器名称;其余的列将保持为空.

You most probably don't need that. Just make yourself a clear specification of what grouping you need. The first column can be multi-purpose - showing different information on each grouping level - e.g. level 0: server, level 1: process, level 2 and higher: child process. On each level, only columns relevant to that level need to display any information. In the above example, level 0 would only display the server name in the first column; the rest of the columns would remain empty.

您可以通过自定义绘图实现任意数量的加号,但这将需要大量工作,我真的认为结果是不必要的,不寻常的,并且容易使用户感到困惑.

You could probably implement as many plus signs as you want by custom-drawing but it would be a lot of work and I really think the result is unnecessary, unusual and easily confusing to the user.

这篇关于Virtual TreeView中可能有多个扩展节点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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