LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1d array of clusters mouse down

hi there,

I have a 1d array of cluster with 5 controls in the cluster, one enum control and 4 numeric controls.

I would like to know how to determine which control the user clicks on the array in order to bring up a virtual keyboard that I made in LabView and then atributte the value that the user chose on the virtual keyboard to the specific control.

Thanks

Adam
0 Kudos
Message 1 of 10
(4,202 Views)
You can use dynamic events. You can register the "Mouse Down?" event for the array as a whole, and then use the returned coordinates to figure out over which control the mouse was when it was clicked. Or, you can register the "Mouse Down?" event for each element of the cluster. Unfortunately, neither solution is all that clean. With the second method you can register the event for each control, but you won't have a way of knowing which array index it was unless you limit the control's size to only display one element. Attached is a VI that can get you started using the second method.
Message 2 of 10
(4,178 Views)
Adam,

smercurio's reply shows one reason why many programmers prefer to minimize the use of arrays for user interaction. While arrays are often advantageous representations of data for analysis, they do not make the best user interfaces.

Think about what you are trying to do to see if another approach might be better: Tab control? A selector which gives the user only one set of controls at a time? Other?

Without knowing what you are trying to do, it is hard to make a good suggestion.

Lynn
0 Kudos
Message 3 of 10
(4,167 Views)

Agreed!

A cluster of cluster would make it easier because you then configure a single event for all of the sub-controls.

The "ref" returned by the event structure would let you determine which control was clicked.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 10
(4,165 Views)
Let me state for the record that I was not endorsing the 1D array as described as a user interface element. I agree that arrays as controls are not the best choice for user interface. Well, maybe except for tables. I was just anwering the question and hoping the user would see that it's not that great of a solution, and would therefore reconsider the interface. I probably should have stated that more explicitly in my response.
0 Kudos
Message 5 of 10
(4,161 Views)
It is actually LabVIEW that do not like array for interface object.
For memory reason LabVIEW do not make a real array of objects.
It just make an array of default value of the object.

Hoping to see an option in the next LAbVIEW Realease.

0 Kudos
Message 6 of 10
(4,094 Views)

"

For memory reason LabVIEW do not make a real array of objects.
It just make an array of default value of the object.

"

Could you please elaborate?

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 10
(4,085 Views)
"For memory reason LabVIEW do not make a real array of objects."

LabVIEW take an object,  a string control for example,
and it create an array of string value.
LabVIEW do not create an array of properties and methos associated to the string control.
So you can not use mouse down on the element 2, but you have just a  mouse down for the whole array.


Message 8 of 10
(4,072 Views)

"

LabVIEW do not create an array of properties and methos associated to the string control.
So you can not use mouse down on the element 2, but you have just a  mouse down for the whole array.

"

I'll buy that!

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 10
(4,068 Views)
This discussion is running along similar lines to one earlier last month. The conversation covers a lot about using a cluster of clusters to create a "scrolling" list. This is an example of how far you can take this sort of manipulation.

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 10 of 10
(4,053 Views)