LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

select and delete array elements using mouse events

Solved!
Go to solution

Hi,

 

I am trying to write code that will allow the user to select or delete array elements from one array into another array. i.e choose which files will be used in some later analysis. The select works ok (using mouse to select from the "available files" array), but my delete section requires an extra mouse click before updating the "trials to use array", this causes a lag.

 

I really can't see why the two events are handled differently in terms of updating the "trials to use array".

 

Please help!

 

Thanks

Graham

0 Kudos
Message 1 of 7
(3,498 Views)
Solution
Accepted by grahamwebb

Graham,

 

Add an event case for the Stop button Value Changed event. Use that to stop the loop. The way your VI is set up two events are needed after Stop is pressed before the loop exits. Turn on Execution highlighting and watch what happens to see why.

 

Also, the typical Mechanical Action for Stop buttons is Latch When Released.

 

Why not use a listbox for Available Trials with SelectionMode set to 0 or more items? Its output is an array of the indexes of the Item Names.

 

Lynn

Message 2 of 7
(3,484 Views)

You need to set the array element keyfocus property to false for the array that you are clicking on.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 3 of 7
(3,480 Views)

I've done interaces similar to this.  Trust me, list boxes will make your life so much easier and they are much more intuitive for your user.  You can even do a drag and drop between listboxes.  You should also remove items from the Available when it is moved to the "to use".


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 7
(3,466 Views)

That's superb! Thank you all very much.

 

Here's my quick version 2. I haven't tried deleting from the "available" list or drag and drop because I don't think they are needed. But in the true spirit of LabVIEW forums, I'll be interested to see how this code can be further simplified or improved. 

 

 

Graham

0 Kudos
Message 5 of 7
(3,436 Views)

I would replace the Trials to Use value change event with a Double Click event. The Row event data node will tell you the item that was double clicked. The results will be an interface that will work more like people expect things like this to - and will be required if you plan on implementing arrow buttons to match the decorations you have on your front panel.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 7
(3,423 Views)

Dear sir,

 

Please help in this case 

suppose i have data 

             
  112233 1 2 3 4  
  112233 2 3 4 5  
  112233 3 4 5 6  
  112233 4 5 6 7  
  112244 5 6 7 8  
  112244 6 7 8 9  
             

 

i want to delete  "112233      4        5       6     7   " by selecting row.

or can we delete row by selecting checkbox.?.

need your help.

 

Thanks,

james Tan 

0 Kudos
Message 7 of 7
(2,457 Views)