LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tabing in an array

Hi,

 

I have a 2D array of a cluster. The cluster has a boolean control and a string control. I'm trying to use barcode reader to enter the string inside the cluster inside the array. When I enter the current string value, I would like to automatically set key focus to the string control of the next element inside the array. I played a little about the tabbing but wasn't able to get what I want.

 

http://zone.ni.com/reference/en-XX/help/371361E-01/lvhowto/tabbing_through_elements/

 

I have a very bad way to do it. Since I know the current index, I can start tabbing from the first array element until to the one I want and then ctrl-down inside the cluster until the key focus is in the string. There must be a better to do this.

 

Any idea is appreciated,

 

Thanks,

Joseph

0 Kudos
Message 1 of 6
(3,027 Views)

Please post some code of what you have in mind.  What would be best is a front panel with the controls you want, and a description of how you want to go where, after seeing some event.

 

In the past I have gone through some elaborate set of steps to tab into, and out of the controls I want.  My setup had an array of cluster, and I wanted to skip some controls in the cluster in some cases, and not in others.  I also wanted to go to the next array item if the last control was selected.  Lastly I wanted Shift + Tab to go to the previous array item if the first item was selected.  This was done by capturing the Key Down? and looking for tabs, then detecting where the current cursor was using references.  It all worked well in the end but was a bit of a pain.  I'm just glad I could make the interface I wanted.

0 Kudos
Message 2 of 6
(3,025 Views)
This was done by capturing the Key Down? and looking for tabs, then detecting where the current cursor was using references.

Do you mind providing your post about this?
When I try to do is when I enter the string control in array (0,0), I want to have my key focus on the string control of array (0,1).
tab.png
Thanks,
Joseph

 

 

0 Kudos
Message 3 of 6
(3,015 Views)

Next time post code not a picture.  In any case I think this is a very crude method that might work for you.

0 Kudos
Message 4 of 6
(3,004 Views)

@Hooovahh wrote:

Next time post code not a picture.  In any case I think this is a very crude method that might work for you.


I don't have any code yet that it's why I didn't pose code

 

I checked your code that you need to press tab to jump the next string control. It would be nice that the user doesn't have to pres tab (the user is using a barcode reader).

 

I think the ideal way to do it is that when I detect a array value change, I compare the old/new values and find out which element is changed and set key focus to the next one. But I am not sure if it is possible.

 

Thank you very much for your help.

Joseph

0 Kudos
Message 5 of 6
(2,986 Views)

The way you described it won't work, but a solution can be done similar to what I have shown.

 

If you use the "Value Change" on the string control then this value change will only be initiated if keyfocus is taken away from the control.  This is usually done by the user clicking on another control, or the pane.  This won't happen with the barcode scanner.

 

But usually barcodes will send a return character after scanning.  So instead of looking for the tab key, like it does now, have it look for the return key, then peform the same steps it already does.

0 Kudos
Message 6 of 6
(2,957 Views)