Tuesday, December 30, 2008

Plug-in VIs for Right-Click Menu Options in the Editor

Ok, here's another idea I had. Since we can't always avoid right-click menus, what if we could write our own VIs, and place them in a special location on disk, and those VIs would become right-click menu options for objects in the LabVIEW editor? I'm not talking about run-time menus here, I'm basically talking about adding features to the editor. I'm also not talking about XControls...I want to be able to define new editor operations for native LabVIEW controls. There could be a folder on disk like [LabVIEW]\resource\MenuPlugins\String. Any VI in this folder would be presented as a new right-click menu option whenever a string (and by inheritance, a ComboBox) control/indicator is right-clicked on the front panel. If you pick this menu option, the VI executes. It takes in a VI Server reference of type String, and then you can perform whatever operations you want on the String. Perhaps the VI could take an array of references so the right-click operation could be performed when multiple controls are selected.

And with scripting, we could do the same thing with block diagram objects. For example, one diagram operation I always find tedious is when I need to delete a node from the diagram that had several pass-through wires (error in, error out, reference in, reference out), I always have to manually wire up the pass through wires once the node is deleted. I could write a plug-in VI for the Node class of the diagram that adds a "Delete and Rewire" menu option that will delete the object, then automatically create those wires for me.

Thoughts?

Edit: Here's another example. Just today I was working on a UI and really loving the "Delete All Items" right-click menu option on Tree Controls, and being annoyed that the same option isn't available for Multicolumn Listboxes. With my plug-in menu VI idea, I could have just written the functionality for the menu option myself!

8 comments:

  1. Great idea! I've been wanting the same thing for quite some time.

    ReplyDelete
  2. I think this might finally provide a way to emulate a typedef'd combo box constant that will auto update!!!

    ReplyDelete
  3. I wish the contents of the project I am in would be available from a right click menu, organized by the virtual folders in my project. I often access these VIs to add them to a new VI and end up either having to use the 'select a VI' or drag from the project to the block diagram. I would like to have the project contents indexed into these menus and available from both the right click and from quick drop.

    ReplyDelete
  4. Yes, having the current Project-VIs in right click is much more needed than a right click on a control.

    There is a difference between the IDE and a developed VI.

    Ton

    ReplyDelete
  5. This "Current-Project-VIs menu" idea is great. But I don't see a debate on whether or not Darren's idea should be less needed. I think they are both neat features that I would use plenty.
    It's not unlike our politicians: why asking them to concentrate their efforts solely on economy when they can take care of improving economy, healthcare, environment, etc. all at the same time? ;-) I'm sure Darren wireworks even in his sleep, as do we all? Don't we?

    Darren, keep it coming! Your insights are greatly appreciated.

    ReplyDelete
  6. Anonymous/Ton: It would not be unreasonable to expect easier access to project VIs in a future LabVIEW version.

    ReplyDelete
  7. Sorry fo rthe late reply - I'm just catching up on stuff :) I think this would be a very useful addition to LabVIEW and would encourage a whole to of thrid-party tools. I can imagine a gah-zillion of them!

    ReplyDelete