Re: Win32lib 0.60.6 and Judith Evans IDE (how to make it work)

new topic     » goto parent     » topic index » view thread      » older message » newer message

Sascha Zindel wrote:
> 
> Hello again!
> 
> After Derek pointed out that the function findParentWindows works fine with=
> 
> his patch applied,
> i took a closer look at the fDo..... Routines.
> 
> 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.
> 
> 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?)
> 
> 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
> 
> 
> Modify in function fDoMouse
> ---------------------------
> line 31247:
> if (lParent != 0 and sequence(ctrl_Mousetrap[lParent])) then
> 
> Modify in function fDoSetFocus
> 
> line 31393:
> if (lParentWindow != 0 and ctrl_Closed[lParentWindow] = 1) or (lParent =
> !=0
> and ctrl_Closed[lParent] = 1) then
> 
> Modify in function fDoKillFocus
> 
> Modify in function fDoCommand
> -----------------------------
> line 31655:
> if (lParent != 0 and ctrl_Type[lParent] = TabItem) then
> 
> 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.
> 
> Greetings,
> Sascha Zindel
> 
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)

----------------------------------------------------
function fDoSetFocus(integer id, atom hWnd, atom iMsg, atom wParam, atom lParam,
atom pReturn)
----------------------------------------------------
    sequence lRC
    sequence lProp

    integer lParent
    integer lParentWindow
    integer lTempId


    lRC = {kSubclassedMsg}
    lParent = findParent(id)

    lParentWindow = findParentWindow(id)

    -- 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

    -- Check for special case of a control in a closed window that
    -- gets focus again!
if (lParentWindow != 0 and ctrl_Closed[lParentWindow] = 1) or (lParent !=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


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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu