Sparc Posted July 10, 2007 Report Share Posted July 10, 2007 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! 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. Quote Link to comment
orko Posted July 14, 2007 Report Share Posted July 14, 2007 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 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) Quote Link to comment
Yair Posted July 15, 2007 Report Share Posted July 15, 2007 QUOTE(orko @ Jul 13 2007, 07:30 PM) 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. Now, that would be useful. :thumbup: Quote Link to comment
Sparc Posted July 26, 2007 Author Report Share Posted July 26, 2007 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.