hiCreateTreeTable usage

Discussion in 'Cadence' started by Tracy Groller, Jan 31, 2005.

  1. All,

    I am using the below example from the Skill CDS docs,
    I would like to be able to edit these fields,
    anyone have any ideas ?

    Thanks

    Tracy







    ; create a root tree
    indexTree=hiCreateTree('index)

    ; create two tree items and append them to the root tree
    dow=hiCreateTreeItem('dow list("Dow Jones"))
    nas=hiCreateTreeItem('nas list("NASDAQ"))
    hiTreeAppendItem(indexTree dow)
    hiTreeAppendItem(indexTree nas)

    ; create two sub-trees
    dowTree=hiCreateTree('dows)
    nasTree=hiCreateTree('nass)

    ; put the two sub-trees into the two items created earlier
    hiItemInsertTree(dow dowTree)
    hiItemInsertTree(nas nasTree)

    ; add a few leaves for the dowTree and nasTree
    hiTreeAppendItem(dowTree hiCreateTreeItem('cdn list("Cadence" 80.5 1 "Strong
    Buy")))
    hiTreeAppendItem(dowTree hiCreateTreeItem('ibm list("I.B.M." 118 3 "Hold")))
    hiTreeAppendItem(nasTree hiCreateTreeItem('sunw list("Sun Micro" 27.750 4
    "Sell")))
    hiTreeAppendItem(nasTree hiCreateTreeItem('orcl list("Oracle" 28.925 5 "Strong
    Sell")))

    ; create callback, which is called whenever any tree items are selected and which
    ; prints the selected item's description
    procedure( treeCB(name itemSymList)
    while(itemSymList
    itemSym=car(itemSymList)
    println(hiGetTreeItemDescription(eval(itemSym)))
    itemSymList=cdr(itemSymList)
    )

    )

    ; create tree table and use indexTree as the value for ?choice
    treeField = hiCreateTreeTable(
    ?name 'treeField
    ?title "Stocks"
    ?titleAlignment 'center
    ?headers list(list("Name" 125 'left 'string)
    list("Price" 60 'left 'float3)
    list("Rating" 45 'center 'int)
    list("Recommendation" 125 'right)
    )
    ?choice indexTree
    ?callback "treeCB"
    )

    ; create a form
    form = hiCreateAppForm(
    ?name 'form
    ?formTitle "A Tree Sample"
    ?fields list(
    list(treeField 5:5 400:200 55)
    )
    ?initialSize 500:250)

    hiDisplayForm(form)

    --


    \ ~ ~ ///
    ---- ( @ @ )
    | | ======oOOo==(_)==oOOo=======================================
    | |__<*> ___ Tracy Groller | Texas Instruments, Inc.
    | _|III|_ | ------------------| Wireless RFCMOS Design
    _____| /_ III _/ \ TI MSGID: TAG2 | P.O. Box 660199, MS 8729
    \_ /III/ | PC Drop: PFLL | Dallas, Texas 75266
    \ _ /III/ _| -------------------------------------------------
    \_/ \ \___> - Phone: (214) 480-2217 Text Pager
    \ / Email:
    \ \ =======================================================
    \---\
     
    Tracy Groller, Jan 31, 2005
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.