码迷,mamicode.com
首页 > 其他好文 > 详细

[ Skill ] Form 高级用法 Tree Table

时间:2021-03-02 12:29:11      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:end   splay   oat   skill   技术   spl   hit   class   des   

https://www.cnblogs.com/yeungchie/

  • code
; ----------------------------------------------------------------
; 创建一个 tree 作为主 tree
mainTree = hiCreateTree(‘mainTree)
; 创建两个 tree item
treeItem1 = hiCreateTreeItem(‘treeItem1 list("FEOL"))
treeItem2 = hiCreateTreeItem(‘treeItem2 list("BEOL"))
; 将这两个 tree item 追加到主 tree 中
hiTreeAppendItem(mainTree treeItem1)
hiTreeAppendItem(mainTree treeItem2)
; ----------------------------------------------------------------
; 又创建两个 tree 作为子 tree
subTree1 = hiCreateTree(‘subTree1)
subTree2 = hiCreateTree(‘subTree2)
; 又分别将这两个子 tree 插入到对应的 tree item 中
hiItemInsertTree(treeItem1 subTree1)
hiItemInsertTree(treeItem2 subTree2)
; ----------------------------------------------------------------
; 双叒创建一些 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 ))
)
; ----------------------------------------------------------------
; 创建 tree table
treeField = hiCreateTreeTable(
    ?name           ‘treeField
    ?title          "Process information"
    ?titleAlignment ‘center
    ?headers        list(
        list("Layer Name" 125 ‘left   ‘string  ) 
        list("GDS Number" 85  ‘center ‘int     )
        list("Data Type"  85  ‘center ‘int     )
        list("Thickness " 80  ‘right  ‘float3  )
        ; list(  标题    宽度  对齐   数据类型 )
    )
    ; 将主 tree 赋值给 ?choice
    ?choice     mainTree
    ?callback   "treeCB"
    ?sort       list(2 t)
)
; ----------------------------------------------------------------
; form
form = hiCreateAppForm(
    ?name           ‘form
    ?formTitle      "Process"
    ?fields         list(list(treeField 0:0 380:200 25))
    ?initialSize    500:250
)
; ----------------------------------------------------------------
; callback
procedure(treeCB(name itemSymList)
    while(itemSymList
        itemSym = car(itemSymList)
        println(hiGetTreeItemDescription(eval(itemSym)))
        itemSymList = cdr(itemSymList)
    )
)
; ----------------------------------------------------------------
; display
hiDisplayForm(form)
; ----------------------------------------------------------------
  • show

技术图片

[ Skill ] Form 高级用法 Tree Table

标签:end   splay   oat   skill   技术   spl   hit   class   des   

原文地址:https://www.cnblogs.com/yeungchie/p/14466660.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!