jacobson Posted November 8, 2015 Report Share Posted November 8, 2015 I am finally checking out the new 2015 feature that allows you to add features to your right click menu and was having trouble figuring out how to do something. I wanted to start with a very simple project that would allow you to create an IMAQ image container when right-clicking on an image reference wire/node rather than just a reference. What I cannot figure out is how to get the location of where the user spawned the right-click menu. I want to mimic the behavior or creating an indicator from a wire where it will place the block diagram terminal where the user right-clicked. Any help would be appreciated. Matt J Quote Link to comment
Yair Posted November 8, 2015 Report Share Posted November 8, 2015 The VIs should have the information (I assume that's what I used for this plugin - https://decibel.ni.com/content/docs/DOC-43445 ), but even if not, you should get the reference of the object(s) you invoked the plugin on and you should be able to use that. I'm also pretty sure there's a method for creating an indicator from a terminal, which also connects the indicator to the terminal. Quote Link to comment
jacobson Posted November 8, 2015 Author Report Share Posted November 8, 2015 Thanks, I'll have to take a look at that plugin. If you invoke the menu from a wire, where is the location of the wire though? My first guess would be the center of the wire but I'll have to test it out with different configurations. Matt J Quote Link to comment
Yair Posted November 8, 2015 Report Share Posted November 8, 2015 Wires don't have a position. They have a joints property, which is an array of all the fixed points of the wire. But like I said, the VI should give you the actual click position. Quote Link to comment
Darren Posted November 9, 2015 Report Share Posted November 9, 2015 The Mouse Position value passed in to your plugin gives you the location of the right-click. Future questions about right-click plugins should be posted to the community page here: http://www.ni.com/lvmenus 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.