1. RE: child windows not receiving focus events?

irv mullins wrote:
> 
> 
> posted by: irv mullins <irvm at ellijay.com>
> 
> Greg Haberek wrote:
> > 
> > M#0II;F-L=61E(%=I;C,R3&EB+F5W#0IW:71H;W5T('=A<FYI;F<-"@T*8V]N
> > M<W1A;G0-"@T*"4UA:6X)/2!C<F5A=&4H(%=I;F1O=RP@(D9O8W5S(%1E<W0B
> > M+" P+"!#96YT97(L($-E;G1E<BP@-# P+" S,# L(# @*2P-"@E497AT,0D]
> > M(&-R96%T92@@161I=%1E>'0L("(B+"!-86EN+"![=S,R161G92PQ,'TL('MW
> ......
> 
> Please don't post perl code to the Euphoria list.
> 
> Thank you.
> 
> Irv

It's just uuencoded.  Paste into notepad, save with extension .uue, 
extract with WinZip (or uudecode).  Anyway, I think attachments should 
be avoided because the code doesn't get archived.  For such a small 
amount of code, just paste it:

include Win32Lib.ew
without warning

constant

	Main	= create( Window, "Focus Test", 0, Center, Center, 400, 300, 0 ),
	Text1	= create( EditText, "", Main, {w32Edge,10}, {w32Edge,10}, 
{0.5,-5}, 20, 0 ),
	Text2	= create( EditText, "", Main, {0.5,5}, {w32Edge,10}, 
{w32Edge,-10}, 20, 0 ),
	SubWin	= createEx( Window, "", Main, {w32Edge,10}, {w32Edge,40}, 
{w32Edge,-10}, {w32Edge,-10},
		{WS_CHILD,WS_VISIBLE,WS_CLIPSIBLINGS}, WS_EX_CLIENTEDGE )



procedure FocusHandler( integer pSelf, integer pEvent, sequence pParams 
)

	if pSelf = Text1 then
		puts(1, "Text1")
	elsif pSelf = Text2 then
		puts(1, "Text2")
	elsif pSelf = SubWin then
		puts(1, "SubWin")
	end if

	if pEvent = w32HGotFocus then
		puts(1, " GotFocus\n")
	elsif pEvent = w32HLostFocus then
		puts(1, " LostFocus\n")
	end if

end procedure
setHandler( {Text1,Text2,SubWin}, {w32HGotFocus,w32HLostFocus}, 
routine_id("FocusHandler") )

WinMain( Main, Normal )


-- Brian

new topic     » topic index » view message » categorize

2. RE: child windows not receiving focus events?

Brian Broker wrote:
> 
> irv mullins wrote:
> > 
> > posted by: irv mullins <irvm at ellijay.com>
> > 
> > Greg Haberek wrote:
> > > 
> > > M#0II;F-L=61E(%=I;C,R3&EB+F5W#0IW:71H;W5T('=A<FYI;F<-"@T*8V]N
> > > M<W1A;G0-"@T*"4UA:6X)/2!C<F5A=&4H(%=I;F1O=RP@(D9O8W5S(%1E<W0B
> > > M+" P+"!#96YT97(L($-E;G1E<BP@-# P+" S,# L(# @*2P-"@E497AT,0D]
> > > M(&-R96%T92@@161I=%1E>'0L("(B+"!-86EN+"![=S,R161G92PQ,'TL('MW
> > ......
> > 
> > Please don't post perl code to the Euphoria list.
> > 
> > Thank you.
> > 
> > Irv
> 
> It's just uuencoded.

Irv was joking. And very funny at that! :D

> -- Brian

-=ck
"Programming in a state of EUPHORIA."

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

3. RE: child windows not receiving focus events?

ck wrote:
> Irv was joking. And very funny at that! :D

I know, but I still wanted to make the point about attachments...

-- Brian

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

4. RE: child windows not receiving focus events?

Brian Broker wrote:
> 
> ck wrote:
> > Irv was joking. And very funny at that! :D
> 
> I know, but I still wanted to make the point about attachments...
> 
> -- Brian

Good point, because I was unable to decode the file after copy/pasting 
from the webpage to a .uue file. Perhaps the listfilter/euforum caused 
some corruption. Looks like it would be best to avoid attachments.

Irv

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

5. RE: child windows not receiving focus events?

Try these two patches in the win32lib to see if it helps..

--- Patch #1 ---
Find the routine "tab_direction()" and replace the lines ...

    if  window_family[id] = WINDOW  or find(window_type[id],{ TabItem}) then
        -- parent is self
        parent = id


with ...

    if  find(window_type[id],{ TabItem}) then
        -- parent is self
        parent = id

    elsif window_family[id] = WINDOW and window_owner[id] = 0 then
        -- parent is self
        parent = id

--- Patch #2 ---
In the routine createWindow(), replace the lines ...

    if owner != 0 and  and_bits(WS_VISIBLE, lFlags) then
        call_proc(r_openWindow, {id, Normal})
    end if


with ...

    if owner != 0 then
        if  and_bits(WS_VISIBLE, lFlags) then
            call_proc(r_openWindow, {id, Normal})
        end if

        if and_bits( WS_TABSTOP, lFlags ) then
            -- add to the owner's focus_order list
            window_focus_order[owner] &= id
        end if

    end if


Then all you have to do is create your child window with the
WS_TABSTOP flag included.

-- 
Derek Parnell
Melbourne, Australia

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

Search



Quick Links

User menu

Not signed in.

Misc Menu