Jump to content

Tabbing through elements of an cluster in an array


Sparc

Recommended Posts

In somewhat never ending attempt to get some of LabVIEW's UI controls to behave more like traditional Windows controls I have long sought for 'smooth' scrolling arrays. Now, using splitters and panes I finally have an array of clusters that will scroll smoothly. Feel my joy! :wub:

Now that I have achieved this, I want to tab through the elements for data entry. I can get the focus rectangle (KeyFocus) to the controls in the cluster (in the array) and it will cycle through them, however it only cycles through the controls in one element of the array.

How can I make is so when the last control in the cluster has the focus and the user presses 'Tab' that the focus rectangle jumps to the first enabled control in the cluster in the next element of the array?

There appears to be no subtle method for setting the element the focus rectangle should be on. I can set the 'Index Values' property of the array, but that affects the visual appearance of the array as well (causes the wired index to become the element in the top of the array). The SelStart property has no effect. :headbang:

Note you can mouse click on a new element in the array and the focus rectangle will follow the mouse and not change the visual appearance of the array.

Smooth scrolling array example in LV 8.2 attached.

Link to comment

Your problem lies in the fact that by changing any single element's property in an array you are affecting all elements, so the KeyFocus property for an array element reference doesn't really work as expected (It basically just returns focus to the last element that had focus before tabbing away from the array).

However, looking at this NI article it appears that you can use keyboard shortcuts to navigate your way through the array elements. Since Michael has so graciously provided a way to simulate keypresses, one way to work around this would be to catch when a user is on the last element of the cluster in each row and send the appropriate keypresses to navigate to the next row.

I whipped up a subVI that tabs down in an array, and modified your VI to use it when the user presses tab while on the last enum in the cluster.

I know, it's a hack :rolleyes: But I really can't think of another way of doing this.

http://forums.lavag.org/index.php?act=attach&type=post&id=6351 (LV 8.2.1)

Link to comment
  • 2 weeks later...

QUOTE(orko @ Jul 13 2007, 09:30 AM)

However, looking at http://zone.ni.com/reference/en-XX/help/371361B-01/lvhowto/tabbing_through_elements/' target="_blank">this NI article it appears that you can use keyboard shortcuts to navigate your way through the array elements. Since Michael has so graciously provided a way to simulate keypresses, one way to work around this would be to catch when a user is on the last element of the cluster in each row and send the appropriate keypresses to navigate to the next row.

Thanks, Orko. I had moved forward with simulating a mouse click on the next element in the array. Talk about a hack . . . :thumbdown: . This is actually much cleaner.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.