Jump to content

Edit-time Shortcut menu


Recommended Posts

Is there a way to interfere with the edit time shortcut menu of a front panel control?

 

I want to be able to register for the Shortcut Menu Activation? filter event for the controls of a VI that's in edit mode, and inject my own menu items. I can only get this to work if the target VI is reserved for execution (running state), and not when idle.

 

(To be clear, there are two VIs here. A running VI with an event structure that's meant to be interfering with the shortcut menus of the other's front panel controls whilst the operator is editing it. I want to be able to inject my own menu items.)

Edited by Thoric
Link to comment

Well, it would work if your code was in an XControl, because they run even when their hoster is in edit mode, but I take it that's not what you want.

 

It might work if you use the VI's Fake Exec State method to tell LV that it's not in edit mode, but I never tried it and it might be unstable.

 

In general, LV still isn't very good at letting you inject behaviors into the IDE itself. I believe that when JKI did their own version with the RCF it was basically code which listened in the background for the hotkey and only when that key was pressed, generated a completely new context menu (which only had the RCF actions, not the standard menu), and I wouldn't be surprised if that menu was actually a separate VI (or at least a context menu on the overlay VI, which was itself a separate VI).

Link to comment
Well, it would work if your code was in an XControl, because they run even when their hoster is in edit mode, but I take it that's not what you want.

 

It might work if you use the VI's Fake Exec State method to tell LV that it's not in edit mode, but I never tried it and it might be unstable.

 

In general, LV still isn't very good at letting you inject behaviors into the IDE itself. I believe that when JKI did their own version with the RCF it was basically code which listened in the background for the hotkey and only when that key was pressed, generated a completely new context menu (which only had the RCF actions, not the standard menu), and I wouldn't be surprised if that menu was actually a separate VI (or at least a context menu on the overlay VI, which was itself a separate VI).

 

Fake Exec State might not do what the OP needs in this respect, it anyhow would miss the event handling for the popup menu to do anything when the user selects the menu. And Fake Exec State is known to do some very nasty things to a VI that many LabVIEW functions do not expect at all and will simply drip over with a crash or worse.

Link to comment

Yair, Rolf,

 

Thanks for the replies. I agree, the IDE has always been difficult to tap into, and this was something I wasn't truly expecting to get to work, but it was always worth asking the world's best before giving up.

The Fake Exec state isn't going to work for me, the VI has to remain in true edit mode for what I had in mind.

 

Back to the drawing board...

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.