1. Win32: tabbing between control groups
- Posted by m_sabal Feb 07, 2012
- 1481 views
When using a Group control, at least in version 0.70.8 or earlier, use of the TAB key or SHIFT-TAB was restricted to those controls within the group. I have worked around this problem in two steps. First, I modified win32lib.ew:tab_direction() with an additional piece of logic at line 20747.
-- get the parent's list of tabstop controls tabs = ctrl_Focus_order[ parent ] id = ctrl_Current_focus[parent] -- Added by Michael J. Sabal: -- Some applications may use a control Group, but we need to tab outside the group. -- Use setTabStops(GroupObject,{}) to use the Window's tab list if length(tabs) = 0 and ctrl_Parent[ parent ] > 0 then tabs = ctrl_Focus_order[ ctrl_Parent[ parent ] ] end if
Then, in the application, I added these lines to the Group controls and Window:
if length(tabOrder)>0 then setFocus(tabOrder[1]) if sequence(setTabStops(CSWin,tabOrder)) then end if if sequence(setTabStops(headerSection[1],{})) then end if if sequence(setTabStops(dutiableCostSection[1],{})) then end if if sequence(setTabStops(internalSection[1],{})) then end if end if
The sequence tabOrder was assembled by the application as it added controls to the groups. I hope this will be of value to others who use grouped control sets.
Michael Sabal