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!

Monday, December 29, 2008

Keyboard Shortcut for Creating Constants/Controls/Indicators...What Say You?

Does anybody else think this would be useful? I've been on a keyboard kick ever since I created Quick Drop, which has caused me to become increasingly annoyed when I am required to slog through using a right-click menu. I'm thinking of a few solutions here:
  • Hold down a keyboard key, then double-click a diagram terminal. Depending on what key is being held down, a control, indicator, or constant would be created. Currently double-clicking a terminal with the wiring tool doesn't do anything special...it creates a wire, just like if you single-clicked the terminal. So it would probably be safe to change the behavior of the double-click operation.
  • Add this functionality to Quick Drop. Hover over a terminal, press Ctrl-Space, then type a special key combo (which could be customizable like normal QD shortcuts) to create the control, indicator, or constant.
Any other ideas out there? Am I the only one who thinks this would totally rock?

Saturday, December 27, 2008

Welcome to LabVIEW Artisan!

Welcome to LabVIEW Artisan, my blog where I discuss LabVIEW programming. I write LabVIEW code every day at work, but I'm also in the unique position of being in LabVIEW R&D at National Instruments, so most of my coding involves writing features of the LabVIEW IDE itself.

I plan on talking about lots of different things on this blog, including, but not limited to, the following:
  • LabVIEW tips and tricks
  • Observations on design patterns that I use
  • Life in LabVIEW R&D
  • Information/news/tidbits about the LabVIEW community
  • Any other non-confidential LabVIEW awesomeness I can think of
Thanks for visiting, and look for more posts soon!