12-05-2008 09:24 AM - edited 12-05-2008 09:25 AM
Have you ever wanted to have (almost) complete dynamic control over what controls you include in your tab order? How about automatically tabbing into clusters and across tab page boundaries. Would you like to tab into and out of subpanels seamlessly? You can do all of this with some fairly simple code. See the attached example.
The basic idea is as follows.
12-06-2008 10:28 AM
This is why I love the filter events. I remember doing something similar when the user wanted to move between fields using the return key - simply use the Key Down? event and replace the key with ASCII 9. I also did the exact same trick (using the FocusObj terminal) to move between tab pages automatically.
P.S. For what it's worth, a VI wrapping the private functionality in 7.x was already posted in the past here, so there's no need to post it again.
12-06-2008 10:34 AM
12-08-2008 06:12 AM
12-08-2008 10:43 AM
12-11-2008 09:37 AM
See attached for Damien's example calling subVI with error clusters and conditional for loop (to resolve aforementioned infinite loop issue). It is now safe to enable automatic error handling: To More Specific Class throws an error with the first tab key down due to an initial null FocusObj ref.
SubVI can be dropped into any Key Down? event.
Nice work Damien,
Jason
06-24-2013 03:39 PM - edited 06-24-2013 03:47 PM
Bug fix: Using this method, dynamic tabbing does not work on controls when the containing VI is inside a Subpanel because the event structure returns the Subpanel control as the FocusObj instead of the control with actual focus.
Note: the Subpanel VI must be running for one of its controls to receive key focus.
See attached for an updated VI or below for a screenshot of the fix:
06-25-2013 07:15 AM
Actually, the original code worked very well with subpanels. That is why I created it. Thanks for the heads up that something has changed. I will see if I can track down what and when.
06-25-2013 08:47 AM - edited 06-25-2013 09:12 AM
Thanks Damien. While you're looking into subpanels under-the-hood, there are 2 other bugs that would be great to fix:
1: IDE allows loading CTL files into a subpanel, but crashes intermittently (CAR 380143). CTLs load fine once EXE is compiled.
2: VI must be running for its controls to receive key focus once loaded into subpanel (i.e. to allow dynamic tabbing).
I wrote a tool that allows developers to load any CTL file into a universal configuration dialog via subpanel, which retrieves/stores info using GXML calls. #1 above prohibits this directly, so I placed the CTL on a VI panel with no diagram code as a work around only to discover #2. In the end it's working, but developers have to maintain a runable VI for each respective CTL.
08-20-2018 03:10 PM
Re-edited Damien's VIs with the modifications mentioned above and attaching here. The previously edited VIs attached above had gone through a corporate routine that automatically added a copyright notice on repository check-in that I didn't catch before posting.