![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Using treeview for objects and hierarchies Topic Summary: Created On: 12-Aug-2003 13:53 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: Daniel, (1) You need to insert the parent nodes of "one/two/three" before inserting node "one/two/three" (2) You need to run insertNodes(), not use it in the set() function. The way you are using set(), the list will be populated every time the list is activated. (3) You need to run insertNodes() after the call to realize() See the attached code for a corrected example. | |
![]() |
|
Daniel,
You can populate a treeView with anything you want. You just have to understand that the "depth" of each node in the tree is controlled by how many "/" characters are in the string used to populate the node. For example, inserting "one/two/three" will insert a node "three" that is a child of "two" that is a child of "one", or a node of depth three. You also need to insert the nodes in the order you wish to see them. Usually, I keep a skip list with the full path as the string key, so you can keep track of the mapping between the paths in your treeView, and the data items they represent (Objects, etc.) If you want to build a representation of the Object Hierarchy in a DOORS Module, loop throught the Objects and build a unique path for each Object, making sure no "/" characters appear in the path other than those which will represent the path level separators. ------------------------- Michael Sutherland michael@galactic-solutions.com http://galactic-solutions.com |
|
![]() |
|
![]() |
|
Daniel,
(1) You need to insert the parent nodes of "one/two/three" before inserting node "one/two/three" (2) You need to run insertNodes(), not use it in the set() function. The way you are using set(), the list will be populated every time the list is activated. (3) You need to run insertNodes() after the call to realize() See the attached code for a corrected example. ------------------------- Michael Sutherland michael@galactic-solutions.com http://galactic-solutions.com |
|
![]() |
|
![]() |
|
I have written some code for expanding and collapsing the nodes in a hierarchy in the object view
Works in 6.0SP1 not tested in 7.0. I set these up as keyboard shortcuts in a menu specific to our company. Please refer to the manuals for info on how to do this. It is quite well-documented. The code is left here as it is. I am not using it now and I will not answer to any questions concerning this code. -------------------------- DXL code //Expand Node /* Expand Node */ int lev,levnxt Object obj = current lev = level(obj) Object trav, chempt int cemt = 0 for chempt in obj do{ cemt ++ } if (cemt >0){ Object lst = last(current Module) bool hit = false bool show = false int round = 0 filtering off refresh current filtering on filtering off for trav in entire(current Module) do{ if (trav == obj){hit = true;accept trav} if (level(trav) < lev){hit = false} if (level(trav) == lev and hit == true and trav!= obj){hit = false} if (hit == true and level(trav) > lev){accept trav} if (hit == false){reject trav} } filtering on level (0) refresh current } //if cemt > 0 ------------------------------------------- //Collapse Node /* Collapse Node */ int lev,levnxt Object cur = current Object obj = parent current if (!null obj){ lev = level(obj) Object trav, chempt int cemt = 0 for chempt in obj do{ cemt ++ } if (cemt >0){ Object lst = last(current Module) bool hit = false bool show = false int round = 0 filtering off refresh current filtering on filtering off for trav in entire(current Module) do{ if (trav == obj){hit = true;accept trav} if (level(trav) < lev){hit = false} if (level(trav) == lev and hit == true and trav!= obj){hit = false} if (hit == true and level(trav) > lev){accept trav} if (hit == false){reject trav} } filtering on level (0) current = cur refresh current } //if cemt > 0 } //if nut null parent if (null obj){ filtering off level (1) refresh current } --------------------------------- Edited: 8-Jan-2004 at 18:27 by Christian Hansen |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Using treeview for objects and hierarchies
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.