https://www.cnblogs.com/yeungchie/
code
1. 创建一个 tree 作为主 tree
mainTree = hiCreateTree('mainTree)
2. 创建两个 tree item
treeItem1 = hiCreateTreeItem('treeItem1 list("FEOL"))
treeItem2 = hiCreateTreeItem('treeItem2 list("BEOL"))
- 将这两个 tree item 追加到主 tree (mainTree) 中
这一步是 mainTree (supset) treeItem
hiTreeAppendItem(mainTree treeItem1)
hiTreeAppendItem(mainTree treeItem2)
3. 又创建两个 tree 作为子 tree
subTree1 = hiCreateTree('subTree1)
subTree2 = hiCreateTree('subTree2)
- 分别将这两个子 tree 插入到对应的 tree item (treeItem1 treeItem2) 中
这一步是 treeItem (supset) subTree
hiItemInsertTree(treeItem1 subTree1)
hiItemInsertTree(treeItem2 subTree2)
4. 双叒创建一些 tree item
这里处理 subTree (supset) subTreeItem
tree 和 item 的关系理清之后,合并起来写更简洁
hiTreeAppendItem(subTree1
; 创建 tree item 的同时追加到对应的 tree 中
hiCreateTreeItem('subTree11 list( "Active" 3 0 nil ))
)
hiTreeAppendItem(subTree1
hiCreateTreeItem('subTree12 list( "POLY" 13 0 nil ))
)
hiTreeAppendItem(subTree2
hiCreateTreeItem('subTree21 list( "METAL1" 16 0 0.8 ))
)
hiTreeAppendItem(subTree2
hiCreateTreeItem('subTree22 list( "METAL2" 18 0 nil ))
)
hiTreeAppendItem(subTree2
hiCreateTreeItem('subTree23 list( "METAL3" 28 0 nil ))
)
5. 创建 tree table
treeField = hiCreateTreeTable(
?name 'treeField
?title "Process information"
?titleAlignment 'center
?headers list(
; list( 标题 宽度 对齐 数据类型 )
list("Layer Name" 125 'left 'string )
list("GDS Number" 85 'center 'int )
list("Data Type" 85 'center 'int )
list("Thickness " 80 'right 'float3 )
)
?choice mainTree ; 将主 tree 赋值给 ?choice
?callback "treeCB"
)
6. 创建 form
form = hiCreateAppForm(
?name 'form
?formTitle "Process"
?fields list(
list(treeField 0:0 380:200 25)
)
?initialSize 500:250
)
7. 创建 callback 函数
procedure(treeCB(name itemSymList)
while(itemSymList
itemSym = car(itemSymList)
println(hiGetTreeItemDescription(eval(itemSym)))
itemSymList = cdr(itemSymList)
)
)
8. 最后把这个 form 显示出来
hiDisplayForm(form)