• 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. One bindkeys for performance of two functions

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 142
  • Views 6867
  • 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

One bindkeys for performance of two functions

Slawa
Slawa over 14 years ago

Hello

For example there is some VerticalFixedMenu with a name the TEST

procedure(TEST_MENU()
hiDisplayFixedMenu(TEST
"top"
500
500
)
hiSetBindKey("Command Interpreter" "Ctrl<Key>p" "TEST_MENU()")

Whether it is possible that similar BindKey also closed the given window operating by a principle hiFixedMenuDown (TEST)?

 

Regards

Slawa

  • Cancel
  • skillUser
    skillUser over 14 years ago

    Hi Slawa,

    I'm not quite sure of your question, but if I understand correctly, you are asking if it is also possible to close the Fixed Menu using a bindkey, similar to the way that the menu was displayed, if so then the answer is "yes".  

    The reason I'm not sure of your question is that it would surely have taken less time to test the question that it must have taken to post it!

    Anyway, I built an example based on what you put in the post, and I was able to add another bindkey to close the menu:

    hiSetBindKey("Command Interpreter" "Ctrl<Key>o" "hiFixedMenuDown(TEST)")

     

    A bindkey can have two different bindings based on whether an enterfunction is running or not.  A bindkey can call more than one function or perform more than one action.  I could not find a function to test if a fixed menu is being displayed, but it is safe to call the hiFixedMenuDown() function even if the menu is not currently displayed.

     

    If I have misunderstood the question, can you please explain in more detail what the question is?

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Slawa
    Slawa over 14 years ago

    Hi, Lawrence

    I meant that the first pressing of a combination of keys displays given FxedMenu and repeated (in a case if the menu is already opened) it closes. The combination of keys is thus invariable. That is
    1) the first pressing = hiDisplayFixedMenu
    2) the second pressing (if the menu is already opened) = hiFixedMenuDown

     

    Regards

    Slawa

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 14 years ago

     Hi Slawa,

    Ok, now I understand - this is possible but a little tricky.  Here's some code that I wrote and tested successfully:

    
    procedure(toggleTestMenu() 
    let( (one two)
      if(boundp('TEST) && hiIsInstantiated(TEST)
      then 
        hiFixedMenuDown(TEST) 
        TEST = 'unbound
      else
        one = hiCreateMenuItem(?name 'one ?itemText "One" ?callback "printf(\"One\\n\")")
        two = hiCreateMenuItem(?name 'two ?itemText "Two" ?callback "printf(\"Two\\n\")")
        TEST = hiCreateVerticalFixedMenu(
                  'TEST 
                  list(one two) 2 1
                )
        hiDisplayFixedMenu(TEST "top" 500 500)
      ); if
    ); let
    ); procedure
    
    

    Then your bindkey would just call the toggleTestMenu().  The global symbol holding the menu needs to be undefined using 'unbound because the function hiIsInstantiated() returns t as long as the menu has been instantiated (displayed) once, even if it is no longer currently displayed!  So the workaround is to recreate the menu each time it is needed.  The unfortunate side effect is that if the menu was dismissed using the automatically added "Done" button, you need to press the bindkey twice to re-display the menu again.

    I hope that this answers your question.

    Best Regards,

    Lawrence

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Slawa
    Slawa over 14 years ago

     Many thanks for the help

     It has very much helped

     

    Best regards

    Slawa

    • 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