1. 2 bugs in Win32Lib

Mousetraps in groups still don't work:
--  code generated by Win32Lib IDE v0.18.22

 
include Win32Lib.ew
without warning

--------------------------------------------------------------------------------
--  Window w
constant w = createEx( Window, "Window1", 0, Default, Default, 400, 300, 0, 0 )
constant PushButton2 = createEx( PushButton, "PushButton2", w, 72, 124, 88, 28,
0, 0 )
constant Group3 = createEx( Group, "Group3", w, 248, 160, 148, 60, 0, 0 )
constant PushButton4 = createEx( PushButton, "PushButton4", Group3, 12, 16, 88,
28, 0, 0 )
---------------------------------------------------------
--------------------------------------------------------------------------------
?createMouseTrap(w,PushButton2)
?createMouseTrap(w,PushButton4)



procedure MouseTrap(integer self, integer event, sequence params)
?params
end procedure
setHandler(w, w32HMouseTrap, routine_id("MouseTrap"))



WinMain( w,Normal )


add/removeStyle() don't work properly on windows:
--  code generated by Win32Lib IDE v0.18.22

 
include Win32Lib.ew
without warning

--------------------------------------------------------------------------------
--  Window w
constant w = createEx( Window, "Window1", 0, Default, Default, 400, 300, 0, 0 )
constant PushButton2 = createEx( PushButton, "PushButton2", w, 116, 56, 88, 28,
0, 0 )
---------------------------------------------------------
--------------------------------------------------------------------------------
procedure PushButton2_onClick (integer self, integer event, sequence
params)--params is ()
addStyle(w,{0,WS_EX_TOPMOST})
end procedure
setHandler( PushButton2, w32HClick, routine_id("PushButton2_onClick"))


WinMain( w,Normal )


new topic     » topic index » view message » categorize

2. Re: 2 bugs in Win32Lib

CoJaBo wrote:
> 
> Mousetraps in groups still don't work:

Weird! I could have sworn I tested this, but you're right. A fix
is needed in two places.

In "clientToClient()" replace ...

VOID = w32Func( xClientToScreen, { getHandle( id2 ), pt } )

    -- convert from screen space
    VOID = w32Func( xScreenToClient, { getHandle( id1 ), pt } )


with ...

VOID = w32Func( xClientToScreen, { getHandle( id1 ), pt } )

    -- convert from screen space
    VOID = w32Func( xScreenToClient, { getHandle( id2 ), pt } )



and in "createMouseTrap()" replace ...

pRect[1..2] = clientToClient(lRelId, pWindow, pRect[1..2])
    pRect[3..4] = clientToClient(lRelId, pWindow, pRect[3..4])


with ...

pRect[3..4] -= pRect[1..2]
    pRect[1..2] = clientToClient(lRelId, pWindow, {0,0})
    pRect[3..4] = clientToClient(lRelId, pWindow, pRect[3..4])




 
> add/removeStyle() don't work properly on windows:

Now this one you can't blame on me. Microsoft, in their infinite wisdom,
have decided that you can't set the TOPMOST flag via the normal method.
Instead you need to change the Z-Order. Use this ...

moveZOrder(w, HWND_TOPMOST)


instead of this ...

addStyle(w,{0,WS_EX_TOPMOST})



Why did MS do that? Who knows!!!

I guess I could detect somebody trying to do it the normal way 
and silently do it correctly for them.

-- 
Derek Parnell
Melbourne, Australia

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

3. Re: 2 bugs in Win32Lib

Derek Parnell wrote:
> 
> CoJaBo wrote:
> > 
> > Mousetraps in groups still don't work:
> 
> Weird! I could have sworn I tested this, but you're right. A fix
> is needed in two places.
> 
> In "clientToClient()" replace ...
> 
> }}}
<eucode>
>     VOID = w32Func( xClientToScreen, { getHandle( id2 ), pt } )
> 
>     -- convert from screen space
>     VOID = w32Func( xScreenToClient, { getHandle( id1 ), pt } )
> </eucode>
{{{

> 
> with ...
> 
> }}}
<eucode>
>     VOID = w32Func( xClientToScreen, { getHandle( id1 ), pt } )
> 
>     -- convert from screen space
>     VOID = w32Func( xScreenToClient, { getHandle( id2 ), pt } )
> </eucode>
{{{

> 
> 
> and in "createMouseTrap()" replace ...
> 
> }}}
<eucode>
>     pRect[1..2] = clientToClient(lRelId, pWindow, pRect[1..2])
>     pRect[3..4] = clientToClient(lRelId, pWindow, pRect[3..4])
> </eucode>
{{{

> 
> with ...
> 
> }}}
<eucode>
>     pRect[3..4] -= pRect[1..2]
>     pRect[1..2] = clientToClient(lRelId, pWindow, {0,0})
>     pRect[3..4] = clientToClient(lRelId, pWindow, pRect[3..4])
> </eucode>
{{{

> 
> 
> > add/removeStyle() don't work properly on windows:
> 
> Now this one you can't blame on me. Microsoft, in their infinite wisdom,
> have decided that you can't set the TOPMOST flag via the normal method.
> Instead you need to change the Z-Order. Use this ...
> 
> }}}
<eucode>
>   moveZOrder(w, HWND_TOPMOST)
> </eucode>
{{{

> 
> instead of this ...
> 
> }}}
<eucode>
>   addStyle(w,{0,WS_EX_TOPMOST})
> </eucode>
{{{

> 
> 
> Why did MS do that? Who knows!!!
> 
> I guess I could detect somebody trying to do it the normal way 
> and silently do it correctly for them.

It also happens on a few other styles,
but since the other computter is down,
I can't check it right now.

> 
> -- 
> Derek Parnell
> Melbourne, Australia
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu