05-11-2012 08:23 AM
I have a VI in which I am coding a drag and drop events. The front panel has over 200 indicators and Booleans in which I want to make capable of accepting a drop from a drag event. My issue is the time it takes to edit the event structure for all of the controls one by one. Does anyone know of a way to mass edit event structures quickly? Unfortunately I can not figure out a way to do a drop event with the Pane references.
Solved! Go to Solution.
05-11-2012 09:19 AM
How do the drag-drop event cases differ?
If no difference: Simply add all elements as source to the same event
If difference (small): Make a subVI for all redundancies and use this is the simplest event. Duplicate that event case and add appropriate code.
If difference (big): There's not really much to improve except you have redundant code which should be placed in a subVI.
Norbert
05-11-2012 09:29 AM
The event cases do not differ at all, but my issue is that I have over 200 indicators to make capable of executing that event. The edit events menu will not allow me to select more than one control at a time.
Im a little confused by your mention of using "Source". Do you mean using the side panel source tab?
05-11-2012 10:12 AM
There may be a way to do it using LabVIEW scripting to automate the creation of a more complicated event case.
But you could try doing it using User Events. Use arrays of control references fed into a For Loop to register for value change events on each control. Then have a user event case in the event structure that handles it. So you will be dynamically building your event programmatically while running your VI, rather than manually doing it by manipulating the event case dialog boxes.
05-11-2012 11:59 AM
@Buckeye Tre wrote:
[...]
The edit events menu will not allow me to select more than one control at a time.
[...]
I'm SURE I'm misunderstanding this, but you can select more than one control at a time to respond to one particular event...
05-11-2012 12:03 PM
Im probably confusing some of you. My problem is that I can not select multiple controls at the same time by pressing shift or ctrl. Doing it the way that you show only allows you to add one control and action at a time.
05-11-2012 12:08 PM
I have over 200 indicators!
That gets messy! Norbert's advice is one place to start. Another thing to consider is using the bounds property for your indicators to help with identifing which of the 200+ indicators is being dropped into.
05-11-2012 12:43 PM
Your premise was correct Ravens Fan. Creating a User event with the control references array wired to the Register for Events, and then setting that to "Drop", worked the way I was looking for. I can now drop to any control or indicator and it is capable of being scalable.