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.
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.
03-25-2018 03:12 AM
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?
Solved! Go to Solution.
03-25-2018 05:08 AM
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.
03-25-2018 05:22 AM
Thank You.
I did that by matching the coordinates with position and bound property nodes of the elements.
It's Ok now.
03-25-2018 12:32 PM - edited 03-25-2018 12:33 PM
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.
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.
03-27-2018 03:59 AM
@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...