Re: Win32lib 0.60.6 and Judith Evans IDE (how to make it work)
- Posted by "Sascha Zindel" <s.zindel at gmx.de> Feb 11, 2005
- 484 views
Hi Ferlin, for some reason my mail client removed a line from my sent mail. In function fDoSetFocus you should also change line 31387 as follows: if ctrl_Destroyed[id] != 0 or (lParentWindow != 0 and ctrl_Destroyed[lParentWindow] != 0) then After that your problem is solved. Greetings, Sascha Zindel > > > posted by: Ferlin Scarborough <ferlin1 at bellsouth.net> > > Sascha Zindel wrote: > >=20 > > Hello again! > >=20 > > After Derek pointed out that the function findParentWindows works fine > with= > >=20 > > his patch applied, > > i took a closer look at the fDo..... Routines. > >=20 > > Since findParentWindows can return a 0 if no parentWindow is existing, > all > > sequence handling > > should be verified to not access sequence[0]. > > From what i found out, Derek already considered this in some calls, but= > not > > in all the necessary ones. > >=20 > > The following changes need to applied to Win32Lib 0.60.6 to work > properly > > with Judith Evans IDE > > and consider Dereks latest patch to findCurrentWindows (and hopefully > not > > break anything else -> > > Derek, could you check this and tell me whether this is the right track= > to > > follow?) > >=20 > > Modify findCurrentWindows > > ------------------------- > > line 13579: > > -- find the parent window > > if (id <= 0) or (ctrl_Parent[id] = 0) then > > -- The specified control has no parent > > return 0 > > end if > > -- loop until I hit top of the tree or a Window control. > > while id and (ctrl_Type[id] != Window) and (isTopLevelWindow(id) = = > > w32False) do > > -- move up > > id = ctrl_Parent[id] > > end while > > return id > > end function > >=20 > >=20 > > Modify in function fDoMouse > > --------------------------- > > line 31247: > > if (lParent != 0 and sequence(ctrl_Mousetrap[lParent])) then > >=20 > > Modify in function fDoSetFocus > >=20 > > line 31393: > > if (lParentWindow != 0 and ctrl_Closed[lParentWindow] = 1) or (lPar= ent = > > !=0 > > and ctrl_Closed[lParent] = 1) then > >=20 > > Modify in function fDoKillFocus > >=20 > > Modify in function fDoCommand > > ----------------------------- > > line 31655: > > if (lParent != 0 and ctrl_Type[lParent] = TabItem) then > >=20 > > On my system this patch works fine. I did intensive tests and compared > the > > behaviour between 0.60.4 and 0.60.6. So far everything seems fine. > >=20 > > Greetings, > > Sascha Zindel > >=20 > Sascha, > > I tried to make the above changes, and now the IDE will not run at all, I= > get > the following error. I have listed the first few lines of ex.err below: > > C:\EuPrograms\IDE\IDE18-22\win32lib.ew:31387 in function fDoSetFocus()= > subscript value 0 is out of bounds, reading from a sequence of length 18= > id = 3 > hWnd = 4850276 > iMsg = 7 > wParam = 0 > lParam = 0 > pReturn = -2761 > lRC = {-9987} > lProp = <no value> > lParent = 0 > lParentWindow = 0 > lTempId = <no value> > > Here is the code around line 31387 from Win32Lib.ew (v0.60.6) > > }}} <eucode> > sequence lRC > sequence lProp >=20 > integer lParent > integer lParentWindow > integer lTempId >=20 >=20 > lRC = {kSubclassedMsg} > lParent = findParent(id) >=20 > lParentWindow = findParentWindow(id) >=20 > -- Don't bother setting focus to a window that's going down. > if ctrl_Destroyed[id] != 0 or ctrl_Destroyed[lParentWindow] != 0 = then > return lRC > end if >=20 > -- Check for special case of a control in a closed window that > -- gets focus again! > if (lParentWindow != 0 and ctrl_Closed[lParentWindow] = 1) or (lP= arent > !=0 and ctrl_Closed[lParent] = 1) then > if focus_current > 0 and focus_current != id then > -- Reset focus on the last control that had an explicit set > focus. > setFocus(focus_current) > return lRC > end if > end if > </eucode> {{{ > > Did I miss something here? > > Thanks. > > Ferlin Scarborough > > Learn To Program Games in Free Courses At > http://www.gameuniv.net > > My Euphoria Home Page > http://mywebpage.netscape.com/shadetreesoft > > > > -- DSL Komplett von GMX +++ Superg=FCnstig und stressfrei einsteigen! AKTION "Kein Einrichtungspreis" nutzen: http://www.gmx.net/de/go/dsl