Using Lists with forms

Discussion in 'Cadence' started by eric.d.fitzsimmons, Apr 14, 2009.

  1. All,

    Is there a way to "refresh" a list that has changed in a form. For
    example, I have (1 2 3 4 5) in a list, I change the list to (1 2 3)
    can I "refresh" the form or does the form need to be closed and
    brought back up?

    Thank you,
    Eric
     
    eric.d.fitzsimmons, Apr 14, 2009
    #1
  2. eric.d.fitzsimmons

    Riad KACED Guest

    Riad KACED, Apr 14, 2009
    #2
  3. Riad KACED wrote, on 04/14/09 23:39:
    Eric,

    It's not entirely obvious what you're trying to achieve. Is this list a list of
    choices in a cyclic field, or is it a list of entries in a list box? Or is it
    some list completely outside the form? What triggers the change?

    Sorry, more questions than answers... but callbacks could well be the answer, as
    Riad said.

    Andrew.
     
    Andrew Beckett, Apr 15, 2009
    #3
  4. Riad and Andrew,

    I went home last night thinking I did not give enough information to
    articulate what I was trying to accomplish, sorry about that. I did
    look over the example and learned a few things, but I am still fuzzy
    on how I do what I want.

    So, from the code below if I hit "apply" a procedure is called and
    with that procedure I want to "refresh"(maybe bad wording) the list
    box. How do I do that?

    Thank you for your help in advance,
    Eric



    let((EFDualMode EFSortBy EFNetsBox)

    EFDualMode = hiCreateRadioField(
    ?name 'EFDualMode
    ?prompt "Sort data by?"
    ?value "Instance"
    ?defValue "Instance"
    ?choices list("Instance" "Cellname" "Pin" "Net")
    )
    )

    EFSortBy = hiCreateStringField(
    ?name 'EFSortBy
    ?prompt "Instance, Net, Cellname or Pin"
    ?editable nil
    ?value ""
    )

    EFNetsBox = hiCreateListBoxField(
    ?name 'EFListBoxField
    ?prompt " "
    ?choices EFNet_list
    ?value nil
    ?multipleSelect nil
    ?changeCB "EFprobe()"
    ?doubleClickCB "EFprobeinst()"
    ?numRows length(EFNet_list)
    )

    ;;; defines the form

    hiCreateAppForm(
    ?name 'EFInstanceNetsForm
    ?formTitle "Instance Nets"
    ?callback "EFSortExecution()"
    ?fields
    list(
    EFDualMode
    EFSortBy
    EFNetsBox
    )

    ) ; hiCreateAppForm
    )
    hiDisplayForm(EFInstanceNetsForm)

    procedure(EFSortExecution()
    printf("Procdure to refresh the List Box")
    )
     
    eric.d.fitzsimmons, Apr 15, 2009
    #4
  5. Eric,

    You had a parenthesis in the wrong place, which I fixed (after the EFDualMode
    variable definition). I think you want something like this:

    let((EFDualMode EFSortBy EFNetsBox)

    EFDualMode = hiCreateRadioField(
    ?name 'EFDualMode
    ?prompt "Sort data by?"
    ?value "Instance"
    ?defValue "Instance"
    ?choices list("Instance" "Cellname" "Pin" "Net")
    )

    EFSortBy = hiCreateStringField(
    ?name 'EFSortBy
    ?prompt "Instance, Net, Cellname or Pin"
    ?editable nil
    ?value ""
    )

    EFNetsBox = hiCreateListBoxField(
    ?name 'EFListBoxField
    ?prompt " "
    ?choices EFNet_list
    ?value nil
    ?multipleSelect nil
    ?changeCB "EFprobe()"
    ?doubleClickCB "EFprobeinst()"
    ?numRows length(EFNet_list)
    )

    ;;; defines the form

    hiCreateAppForm(
    ?name 'EFInstanceNetsForm
    ?formTitle "Instance Nets"
    ?callback "EFSortExecution()"
    ?fields
    list(
    EFDualMode
    EFSortBy
    EFNetsBox
    )

    ) ; hiCreateAppForm
    )
    hiDisplayForm(EFInstanceNetsForm)

    procedure(EFSortExecution()
    let((currentList)
    printf("Procdure to refresh the List Box")
    currentList=EFInstanceNetsForm->EFListBoxField->choices
    ; silly examples of updating the choices
    EFInstanceNetsForm->EFListBoxField->choices=reverse(currentList)
    ;EFInstanceNetsForm->EFListBoxField->choices=cdr(currentList)
    )
    )


    Regards,

    Andrew.
     
    Andrew Beckett, Apr 15, 2009
    #5
  6. Andrew,

    It appears I was working hard at making something simple really
    complicated.

    Thank you very much from saving me from myself,
    Eric
     
    eric.d.fitzsimmons, Apr 15, 2009
    #6
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.