From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event structure for an element of cluster belonging to an array

Solved!
Go to solution

Dear friends, 

I have a two-dimensional array of clusters. Every cluster includes two numeric box. I want to define an "Event of mouse up" for this element. Can someone help me?

0 Kudos
Message 1 of 5
(3,261 Views)
Solution
Accepted by topic author hadibashiri

That can't be done out-of-the-box. These is no way to get a mouse up event for some array elements.

 

You'll have to register for any mouse up event on the array, and then manually check if the coordinates are on a element. That is tedious, but I don't think it can be done otherwise.

0 Kudos
Message 2 of 5
(3,236 Views)

Thank You.

I did that by matching the coordinates with position and bound property nodes of the elements.

It's Ok now.

Message 3 of 5
(3,233 Views)

It is not clear what exactly you want to perform in the mouse up event. 

You could get mouse up event on individual elements of the array (entire cluster) or on each cluster controls (the Numeric controls) as shown below. 

 EventArrayOfClusters.png

However, the CtlRef in the event is for the clusters (in Array 2) or cluster elements (in Array). 

So if you need the index of the element in the corresponding array, I guess you might anyway end up checking coordinates. 

BR
Download All
Message 4 of 5
(3,200 Views)

@Kallis

 

Cool, I forgot that is possible, probably because it's usually quite useless.

 

However, if you are already using cluster in the (2D) array, there might be a trick to avoid coordinates checking. Add two numeric to the cluster, one for X index, one for Y index. When you initialize\fill the array, set the X and Y indices to the appropriate coordinate in the array. Then, when you get an even on the luster change, you can simply read the X and Y position. The X and Y values can be hidden, so the user won't see them. It will be a pain to convert back and forth from\to the original cluster to the enhanced cluster. If you add the X and Y to the back, a type cast would do...

Array Element Events.png

 

Message 5 of 5
(3,116 Views)