LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating events from a control inside an array of clusters

Hi, I have a question regarding UI events. I would like to capture a mouse down event generated in a string control inside of an array. Each element of the array is a cluster that has a Boolean control, a numeric control and a string control. When I try to add an event to handle the mouse down the only option available in the event structure is the one available for the entire array. If this is not possible to map event from the individual controls inside of the each cluster that are part of the array, could you provide with an alternate way of "knowing" when the string control is selected. The application has a touch screen without a keyboard and mouse. I need to display the touch screen graphic keyboard when the textbox is selected.
Thanks,
Diego F.
0 Kudos
Message 1 of 4
(2,983 Views)
I'm not sure, but I think your only option may be to do some calculations. The mouse down on the array will give the coordinates of the click in VI coords. You can get the coords and size of the cluster and the coords and size of the string using their property nodes. Then, you have to calculate whether the click was on one of the visible strings using addition, subtraction and quotients. Once you make a subVI out of this, it should be easy to use.
You should watch out for the index display and the label, as they change the values of the coords. I'm sorry, I can't think of any easier way to do this.
Correction - I just thought of one. If you use the KeyFocus property on the string inside the mouse down event, it seems to work. I'm not sure whether this will work when bringing the keyboard to the front, which is why I left the other suggestion in place. Here's my test (7.0)

___________________
Try to take over the world!
Message 2 of 4
(2,971 Views)
Thanks for the tip, I will use it in my program.
Regards,
Diego F
0 Kudos
Message 3 of 4
(2,959 Views)
If you're using a constant (or limited) array size, try using a cluster of clusters as this allows access to the events of all sub-controls.

For any calculations which may involve auto-indexing where an array is more convenient, you can use the "Cluster to array" conversion and vise versa.

Hope this helps

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 4 of 4
(2,954 Views)