Thoric Posted May 16, 2014 Report Share Posted May 16, 2014 (edited) 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 May 16, 2014 by Thoric Quote Link to comment
Yair Posted May 18, 2014 Report Share Posted May 18, 2014 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). Quote Link to comment
Rolf Kalbermatter Posted May 18, 2014 Report Share Posted May 18, 2014 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. Quote Link to comment
Thoric Posted May 18, 2014 Author Report Share Posted May 18, 2014 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... Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.