1. win32lib: Tabbing between controls in/not in a group

How can I tab between controls when one of them is in a group?
Once it gets into the group, the cursor does not want to come out.
Run the following program and press Tab five or more times to see what
I mean (using 0.60.0; under 0.59.2 it skips the group, but that is not
what I want either):

--
-- test
--
include win32lib.ew
constant
MOUSEOPT = create( Window, "Mouse Options", 0, 120, 70, 340,
200,{WS_DLGFRAME,WS_SYSMENU}),
MOUSESCROLLG = create( Group, "Scroll lines", MOUSEOPT, 10, 10, 95,
45, 0),
MOUSESCROLL = create( EditText, "", MOUSESCROLLG, 15, 15, 30, 20, 0),
ASIT = create( LText, "Autosave interval in seconds", MOUSEOPT,
10,70,200,20,0),
ASI = create( EditText, "", MOUSEOPT, 210, 70, 60, 20, 0 ),
ASTS = create( CheckBox, "Autosave on Tab Switch?", MOUSEOPT,
10,100,200,20,0),
MOK = create( DefPushButton, "OK", MOUSEOPT, 130, 130, 65, 25, 0 )

WinMain(MOUSEOPT,Normal)

new topic     » topic index » view message » categorize

2. Re: win32lib: Tabbing between controls in/not in a group

On Mon, 5 Jul 2004 14:12:43 -0700, Andrew Hall
<barnacle83-euforum at yahoo.com> wrote:

>Yep.  I've run into this difficulty as well.  Here's the procedure I
>use--it's not the most efficient solution, but it works. blink
Brilliant!
>Feel free to improve upon it.
One easy thing stood out:
		if not find(parent, parents) then
			parents &= parent
			VOID = setTabStops(parent, flds)	-- <--
		end if
	end for
--	for i = 1 to length(parents) do
--		VOID = setTabStops(parents[i], flds)
--	end for
end procedure

You can also get rid of both local variables and just call setTabStops
on all, since it does not appear to be particularly expensive:
	for i = 1 to length(flds) do
		VOID=setTabStops(findParent(flds[i]),flds)
	end for
..but I don't claim that is necessarily better.

Many thanks,
Pete

PS Derek, I noticed about 6 cases in 0.60.0 where you use x&={{..}};
I believe x=append(x,{..}) is about 30% faster. Probly insignificant.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu