• 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. Maintaining two exclusive lists

Stats

  • Locked Locked
  • Replies 9
  • Subscribers 142
  • Views 15216
  • 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

Maintaining two exclusive lists

RK56
RK56 over 6 years ago

Hi,

I have a GUI with two list boxes. I want to maintain the list box content exclusive of each other. The list box contents are not unique. I want to move selected items to other box and remove from the source. I have implemented the move call back as follows. Since I have used member function, not able to retain duplicate values. Is there any better way of doing?

;;scrField and dstField are the list box field

procedure(moveBin(scrField dstField)
let((scrList dstList)
    scrList = hiGetListBoxValue(scrField)
    dstList = dstField->choices
    foreach(ele scrList
        dstList = cons(ele dstList)
    )
    dstField->choices = dstList
    scrList = setof(x scrField->choices !member(x dstList))
    scrField->choices = scrList
))

Thanks

Ramakrishnan

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago

    I'm not sure I quite get what you're asking (I can guess, but I might be guessing wrong). Perhaps a picture of what the form looks like, what it does now and what you're expecting it to do?

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RK56
    RK56 over 6 years ago in reply to Andrew Beckett

    Hi Andrew,

    Here is a picture of my GUI. I want to move selected elements back and forth from pin list listBoxField to selection bin listBoxField. The above procedure is the callback implementation of move buttons. I swap scrField and dstField to move left to right and vice versa. Things works but when there are duplicate entries in the listBox, the above callback is not able to handle and maintain only unique ones since I have used member function.

    Overnight I got another idea by maintaining the list box entries unique by appending with pin's bBox which works fine. But still wondering how to do if entries are not unique.

    Thanks

    Ramakrishnan

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to RK56

    Ramakrishnan,

    How about something like this?

    procedure(moveBin(scrField dstField)
    let((scrList dstList usedCount)
        scrList = hiGetListBoxValue(scrField)
        usedCount = makeTable('usedCount 0)
        dstList = dstField->choices
        foreach(ele scrList
            dstList = cons(ele dstList)
            usedCount[ele] = usedCount[ele] + 1;
        )
        dstField->choices = dstList
        scrList = setof(x scrField->choices 
            if(zerop(usedCount[x]) then
                t
            else
                usedCount[x] = usedCount[x] - 1
                nil
            )
        )
        scrField->choices = scrList
    ))

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RK56
    RK56 over 6 years ago in reply to Andrew Beckett

    Hi Andrew,

    Thanks for the solution. I have never thought of using a if-else block inside setoff. Something new I learnt.

    On a related topic, I see some trouble in doing multiple selection by dragging or holding shift in a list box when the entries are duplicate. The selection does not happen continuous, there are few unselected items in between. Is it a known issue? I am using  virtuoso version ICADV12.3-64b 12/04/2018 18:23.

    Thanks again

    -Ramakrishnan

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to RK56

    Hi Ramakrishnan,

    Yes, I see that slightly odd behaviour too. I thought something felt odd yesterday when I was trying this out, but I didn't play with it long enough to notice what wasn't right. I suggest you contact customer support with an example to get this fixed...

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RK56
    RK56 over 6 years ago in reply to Andrew Beckett

    Cadence case https://support.cadence.com/COSCaseDetailPage?CaseID=5000V00001JASMqQAP&pageName=COSCaseDetailPage&isNewCase=false&oMenu=46364198

    is created. Thanks for the support here.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to RK56

    For completeness (should anyone else hit the same issue), the answer is to use ?valueByPosition t when creating the listbox field (I tried, and that solves it). The documentation is going to be updated to make this clear as being the correct approach when you have duplicate entries in the listbox fields.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RK56
    RK56 over 6 years ago in reply to Andrew Beckett

    Thanks Andrew.

    Just out of curiosity:  Is the new updated documentation is available only with new Virtuoso versions or Cadence can do a background push to update the docs in my company?

    -Ramakrishnan

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to RK56

    Hi Ramakrishnan,

    The documentation change hasn't happened yet for a start, but when it does, it would be updated on support.cadence.com and in any new hot fix version you install. There is no mechanism to push anything to you (including documentation updates). 

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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