rebuilding tree, restoring state (expanded nodes)
How can I restore state of nodes in VirtualStringTree (which ones were expanded) at tree rebuilding?
my application uses VirtualStringTree (one of the best components EVER!). Now, what I need is to rebuild the tree each time the application is started. In most cases however the "new" tree is the same as the one built last time... or at least very similar. What is the best way to restore the state of nodes? Which ones were expanded and so on ... I don't find it convinient to expand all the nodes manually each time I start the app... and so my users, I believe. Unfortunately, due to privacy restrictions I can't save the actual tree to a file and then load it, and compare the existing nodes when rebuilding (adding/removing when neccessary) ... I need some other way, please...
Store only topology of the tree, eg indexes of expanded nodes for each level.
Alternatively, you may form a list of hashes for some invariant nodes value and store hashes only for expanded nodes in that list. That way you will preserve state even if topology is changed, but at the cost of lowered privacy.
链接地址: http://www.djcxy.com/p/35010.html上一篇: 是否有可能更改虚拟字符串树中行的颜色?
下一篇: 重建树,恢复状态(扩展节点)