SKILL: Virtuoso Bindkey to Toggle Read-Only Mode?

Discussion in 'Cadence' started by Edward Dodge, May 10, 2006.

  1. Edward Dodge

    Edward Dodge Guest

    I'm trying to set up a bindkey to toggle a design read-only if it's in
    edit-mode. I want to use this same key to toggle the design to edit-mode if
    it's already set to read-only. Here's what I have so far:

    bk("Layout" "Ctrl<Key>m" "if(<test for edit-mode>) then
    (geChangeEditMode(\"r\"))
    else
    (geChangeEditMode(\"a\")))")

    What's missing is the function that returns "t" if the Edit-Mode is "a" and
    "nil" for an Edit-Mode "r." Any ideas?

    --
    Edward Dodge

    __o
    _`\(,_
    (_)/ (_) --- ---
     
    Edward Dodge, May 10, 2006
    #1
  2. Edward,
    cellviewId->mode returns a one character string from which you can find
    out the current edit mode of the cellview.

    hiSetBindKey("Layout" "Ctrl<Key>m"
    "if(hiGetCurrentWindow()->cellView->mode != \"r\" then
    geChangeEditMode(\"r\") else geChangeEditMode(\"a\"))")

    regards,
    Suresh
     
    Suresh Jeevanandam, May 11, 2006
    #2
  3. My shot at the same solution can be found on groups.google.com by searching
    for XXToggleEditMode, where I also mention how to make library browswer
    open cellviews default read only in case you have a revision management
    system naging you with check outs.
     
    Svenn Are Bjerkem, May 11, 2006
    #3
  4. Edward Dodge

    Edward Dodge Guest

    Thanks Suresh,

    I'm providing here, for the benefit of the group*, the code I adopted:

    bk("Layout" "Ctrl<Key>m"
    "if(hiGetCurrentWindow()->cellView->mode == \"r\"
    then geChangeEditMode(\"a\") else geChangeEditMode(\"r\"))")

    I transposed the elements of the if-then to get rid of the NOT function in the
    test. Guess I'm just picky that way.

    Thanks again!

    Edward


    * And my benefit as well! I may have to Google this again one day.


    --
    Edward Dodge

    __o
    _`\(,_
    (_)/ (_) --- ---
     
    Edward Dodge, May 16, 2006
    #4
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.