• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Create Nested Toggle (Check) Boxes

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 15486
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Create Nested Toggle (Check) Boxes

gs748
gs748 over 10 years ago

Hello,

I am new to SKILL and would like to take your inputs on the below scenario.
I am creating a App form with Toggle (Check) Boxes for few lines in a file which are as below:

 <file lout >
Numbers
1,2,3,4,5
6,7,8,9,10
11,12,13,14,15

Characters
a,b,c,d,e
e,f,g,h,i
j,k,l,m,n

Letters
ab,cd,ef,gh,ij
kl,mn,op,qr,st


I read each line from file lout and create a Check Box for each line but if the user selects “Numbers” or “Characters” then all lines below “Numbers” or “Characters” must be checked until an empty line is read.
I have the below code which errors out with below message:

----------------------
*Error* hiCreateToggleField: each toggle item must be a list of at least it's unquoted symbol representation
*Error* load: error while loading file - "te.il"
---------------------

 Can you please help me with the error check on this code as I am not familiar with most SKILL functions . Thanks in advance.
---------------------
CODE
---------------------

procedure(readcsv(ln)
 cline=ln
 tline = substring(cline 1 strlen(cline)-1)
 pline=parseString(tline ",")
  i=length(pline)
;  printf("Length is %d\n" i)
   item8 = nth(i-1 pline)
   item7 = nth(i-2 pline)
   item6 = nth(i-3 pline)
   item5 = nth(i-4 pline)
   item4 = nth(i-5 pline)
;printf("ITEM'S 1-8:\n %L\n %L\n %L\n %L\n %L\n %L\n %L\n %L\n" item1 item2 item3 item4 item5 item6 item7 item8)
lista = list(item4 item5 item6 item7 item8)
printf("LIST ITEM'S:%L\n" lista)
lista
);end proc readcsv


port=infile("lout")
listN='()
listM='()
listNew='()
count =0
when(port
   while(gets(ln port)
        listb=readcsv(ln)
        listM = cons(listb listM)
        ;printf("ListM:%L\n" listM)
    );end while
   );end when
 close(port)

; Create Check Box

mytoggle = hiCreateToggleField(
 ?name ’toppings
 ?prompt "Toppings"
 ?choices listM
 ;?value ’( nil)
 ;?numSelect 1 )
)
hiCreateAppForm( ?name ’iceCreamForm
 ?formTitle "Ice Cream"
 ?callback "buildIceCreamCone()"
 ?fields list( mytoggle )
 ?help "cream" )
status = hiDisplayForm( iceCreamForm )

---------------------

  • Cancel
Parents
  • gs748
    gs748 over 10 years ago

    Andrew Beckett said:

    This isn't going to work, because hiCreateToggleList doesn't do all of that for you. The structure you're passing to hiCreateToggleList is wrong (please read the manual, which makes it pretty clear that it's expecting a list of lists, where each list is a symbol and a string (the prompt), or just a symbol).

    Hi Andrew, 

    Thank you for your response.  My scenario is a bit different here. I have a script which creates a tree structure. I want to add check box buttons to root of each  tree structure. Below is the script which creates a tree structure:  I would like to know if I can modify the below script to add check boxes to tree structure: Ex: I want to add checkboxes to Maths and Physics, and also for A Book, B Book, C Book and E Book. Whenever I check Maths checkbox it should check all the contents of Maths i.e. A Book and B Book.  Also, When I select Maths, I would like to unselect either A or B Book.:

    ; create a root tree
    maintree=hiCreateTree('index)
     
    ; create two tree items and append them to the root tree
    dow=hiCreateTreeItem('dow list("Maths"))
    nas=hiCreateTreeItem('nas list("Physics"))
     
    hiTreeAppendItem(maintree dow)
    hiTreeAppendItem(maintree 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('acom list("A Book" 80.5 1 "Good   Buy")))
    hiTreeAppendItem(dowTree hiCreateTreeItem('bcom list("B Book" 118 3 "Better")))
    hiTreeAppendItem(nasTree hiCreateTreeItem('ccom list("C Book" 27.750 4   "Better ")))
    hiTreeAppendItem(nasTree hiCreateTreeItem('dcom list("E Book" 28.925 5 "Best   Sell")))
     
    procedure( expandCB(name item)
        println("expanded")
        println(name)   
        println(item))
     
    procedure( collapseCB(name item)
         println("collapsed")
         println(name)
         println(item))
    ; create tree table and use maintree as the value for ?choice
    treeField = hiCreateTreeTable(
           ?name 'treeField         
           ?title "Books"        
           ?titleAlignment 'center    
           ?headers list(list("Name"  125    'left    'string)    
                list("Price"    60       'left    'float3)  
                list("Rating"       45      'center  'int)   
                list("Recommendation"  125      'right)    )    
                ?choice maintree    
               ?callback "treeCB"
                ;?expandCallback "expandCB"
                ;?collapseCallback  "collapseCB"          
                )
    ; create a form
    form = hiCreateAppForm(
           ?name 'form    
           ?formTitle "A Tree Book"  
           ?fields list(  list(treeField 5:5 400:200 55) )       
           ?initialSize 500:250)

    hiDisplayForm(form)








    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • gs748
    gs748 over 10 years ago

    Andrew Beckett said:

    This isn't going to work, because hiCreateToggleList doesn't do all of that for you. The structure you're passing to hiCreateToggleList is wrong (please read the manual, which makes it pretty clear that it's expecting a list of lists, where each list is a symbol and a string (the prompt), or just a symbol).

    Hi Andrew, 

    Thank you for your response.  My scenario is a bit different here. I have a script which creates a tree structure. I want to add check box buttons to root of each  tree structure. Below is the script which creates a tree structure:  I would like to know if I can modify the below script to add check boxes to tree structure: Ex: I want to add checkboxes to Maths and Physics, and also for A Book, B Book, C Book and E Book. Whenever I check Maths checkbox it should check all the contents of Maths i.e. A Book and B Book.  Also, When I select Maths, I would like to unselect either A or B Book.:

    ; create a root tree
    maintree=hiCreateTree('index)
     
    ; create two tree items and append them to the root tree
    dow=hiCreateTreeItem('dow list("Maths"))
    nas=hiCreateTreeItem('nas list("Physics"))
     
    hiTreeAppendItem(maintree dow)
    hiTreeAppendItem(maintree 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('acom list("A Book" 80.5 1 "Good   Buy")))
    hiTreeAppendItem(dowTree hiCreateTreeItem('bcom list("B Book" 118 3 "Better")))
    hiTreeAppendItem(nasTree hiCreateTreeItem('ccom list("C Book" 27.750 4   "Better ")))
    hiTreeAppendItem(nasTree hiCreateTreeItem('dcom list("E Book" 28.925 5 "Best   Sell")))
     
    procedure( expandCB(name item)
        println("expanded")
        println(name)   
        println(item))
     
    procedure( collapseCB(name item)
         println("collapsed")
         println(name)
         println(item))
    ; create tree table and use maintree as the value for ?choice
    treeField = hiCreateTreeTable(
           ?name 'treeField         
           ?title "Books"        
           ?titleAlignment 'center    
           ?headers list(list("Name"  125    'left    'string)    
                list("Price"    60       'left    'float3)  
                list("Rating"       45      'center  'int)   
                list("Recommendation"  125      'right)    )    
                ?choice maintree    
               ?callback "treeCB"
                ;?expandCallback "expandCB"
                ;?collapseCallback  "collapseCB"          
                )
    ; create a form
    form = hiCreateAppForm(
           ?name 'form    
           ?formTitle "A Tree Book"  
           ?fields list(  list(treeField 5:5 400:200 55) )       
           ?initialSize 500:250)

    hiDisplayForm(form)








    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information