1. lost focus

When program 1 runs program 2 which does it's stuff then terminates, the 
setFocus(idList) on program 1 does not work under certain circumstances. If
I look at program 2's screen for more that about 15 seconds, the setFocus in
program
1 does not work. If I return to immediately from program 2 to program 1 then
idList does have
the focus and works properly. Any idea's how to fix this?

--------------------------------- Drill Down api030b
--------------------------------
procedure processDrill(integer self, integer event, sequence args)
integer retCode, index

    index = getIndex(idList)
    if index > lnCount then
    	-- do nothing
    else
	    dbKey = drillTable[index]
retCode = system_exec("exw.exe "&"opi030b.exw " & str(selectType) & " " &
dbKey ,0)
	    if retCode != 0 then
	        tmp = message_box("Program error link not found","",0)
	    end if
	 end if

    setFocus(idList)

end procedure


new topic     » topic index » view message » categorize

2. Re: lost focus

George Walters wrote:
> 
> 
> When program 1 runs program 2 which does it's stuff then terminates, the 
> setFocus(idList) on program 1 does not work under certain circumstances. If
> I look at program 2's screen for more that about 15 seconds, the setFocus in
> program
> 1 does not work. If I return to immediately from program 2 to program 1 then
> idList
> does have
> the focus and works properly. Any idea's how to fix this?
> 
> }}}
<eucode>
> --------------------------------- Drill Down api030b
> --------------------------------
> procedure processDrill(integer self, integer event, sequence args)
> integer retCode, index
> 
>     index = getIndex(idList)
>     if index > lnCount then
>     	-- do nothing
>     else
> 	    dbKey = drillTable[index]
> 	    retCode = system_exec("exw.exe "&"opi030b.exw " & str(selectType) & " " &
> dbKey ,0)
> 	    if retCode != 0 then
> 	        tmp = message_box("Program error link not found","",0)
> 	    end if
> 	 end if
> 
>     setFocus(idList)
> 
> end procedure
> </eucode>
{{{


Try setting focus to the window that contains the idList before setting
focus to the list. I'm not sure if that is what you are after. 

-- 
Derek Parnell
Melbourne, Australia

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

3. Re: lost focus

Derek, that didn't work any better. The window of program 1 does have focus when
program 2
finishes because my trap of esc key works fine. Windows should control the up
and
down arrows in the list box if it has focus...and it does most of the time. Some
how the time
element causes windows to forget about the arrows until I actually click on the
list box, then the arrows work. If program 2 only exists for 2 sec or less then
the arrows on the list box of program 1 work, if program 2 persists for longer
periods of time the arrows on the list box of program 1 are dead until I click
on the list box.

Hard to explain, hopefully this is clear.

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

4. lost focus

can someone show me how to tell when an editText field looses focus whether
it came about from a tab or mouse click or otherwise? i would like to take
some action based on what caused the lost focus.

George

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

5. lost focus

this did not show up so i'm posting it again.

can someone show me how to tell when an editText field looses focus whether
it came about from a tab or mouse click or otherwise? i would like to take
some action based on what caused the lost focus.

George


)

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

6. Re: lost focus

----- Original Message -----
From: <gwalters at sc.rr.com>
To: "EUforum" <EUforum at topica.com>
Subject: lost focus


>
> can someone show me how to tell when an editText field looses focus
whether
> it came about from a tab or mouse click or otherwise? i would like to take
> some action based on what caused the lost focus.
>

Hi George,
here is one way to do it...

 ---
 without warning
 include win32lib.ew
 constant w = createEx(Window,"TEST", 0, 0,  0, 100, 200, 0, 0),
         f1 = createEx(EditText, "one", w, 5,  5, 80,  25, 0, 0),
         f2 = createEx(EditText, "two", w, 5, 45, 80,  25, 0, 0),
         f3 = createEx(EditText, "three", w, 5, 85, 80,  25, 0, 0),
         sb = createEx(StatusBar, "", w, 0, 0, 0, 0, 0, 0)

 atom vEvent vEvent = -1

 procedure eh(integer self, integer event, sequence parms)
    atom Msg
    Msg = parms[1]
    if find(Msg, {WM_KEYDOWN, WM_LBUTTONDOWN, WM_RBUTTONDOWN}) then
        vEvent = Msg
    end if
 end procedure

 procedure lf(integer self, integer event, sequence parms)
    sequence msg

    if vEvent = WM_KEYDOWN then
        msg = "key"
    elsif find(vEvent, {WM_LBUTTONDOWN, WM_RBUTTONDOWN}) then
        msg = "btn"
    elsif vEvent = 0 then
        msg = "other"
    elsif vEvent = -1 then
        msg = "initial"
    else
        msg = sprintf("%d?", vEvent)
    end if

    setText(sb, sprintf("%s %s ", {getText(self), msg}))
    -- Reset so we can trap Alt-TAB etc...
    vEvent = 0

 end procedure

 setHandler({f1,f2,f3}, w32HEvent,     routine_id("eh"))
 setHandler({f1,f2,f3}, w32HLostFocus, routine_id("lf"))

 WinMain(w, Normal)
 ----------
cheers,
Derek

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

7. Re: lost focus

thanks for the example.

George Walters
3418 Wilmot Ave.
Columbia, SC 29205
803/765-1128(work)
803/771-4700(home)
803/422-1648(cell when on)
----- Original Message -----
From: "Derek Parnell" <ddparnell at bigpond.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: lost focus


>
> ----- Original Message -----
> From: <gwalters at sc.rr.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Tuesday, February 19, 2002 5:09 AM
> Subject: lost focus
>
>
> > can someone show me how to tell when an editText field looses focus
> whether
> > it came about from a tab or mouse click or otherwise? i would like to
take
> > some action based on what caused the lost focus.
> >
>
> Hi George,
> here is one way to do it...
>
>  ---
>  without warning
>  include win32lib.ew
>  constant w = createEx(Window,"TEST", 0, 0,  0, 100, 200, 0, 0),
>          f1 = createEx(EditText, "one", w, 5,  5, 80,  25, 0, 0),
>          f2 = createEx(EditText, "two", w, 5, 45, 80,  25, 0, 0),
>          f3 = createEx(EditText, "three", w, 5, 85, 80,  25, 0, 0),
>          sb = createEx(StatusBar, "", w, 0, 0, 0, 0, 0, 0)
>
>  atom vEvent vEvent = -1
>
>  procedure eh(integer self, integer event, sequence parms)
>     atom Msg
>     Msg = parms[1]
>     if find(Msg, {WM_KEYDOWN, WM_LBUTTONDOWN, WM_RBUTTONDOWN}) then
>         vEvent = Msg
>     end if
>  end procedure
>
>  procedure lf(integer self, integer event, sequence parms)
>     sequence msg
>
>     if vEvent = WM_KEYDOWN then
>         msg = "key"
>     elsif find(vEvent, {WM_LBUTTONDOWN, WM_RBUTTONDOWN}) then
>         msg = "btn"
>     elsif vEvent = 0 then
>         msg = "other"
>     elsif vEvent = -1 then
>         msg = "initial"
>     else
>         msg = sprintf("%d?", vEvent)
>     end if
>
>     setText(sb, sprintf("%s %s ", {getText(self), msg}))
>     -- Reset so we can trap Alt-TAB etc...
>     vEvent = 0
>
>  end procedure
>
>  setHandler({f1,f2,f3}, w32HEvent,     routine_id("eh"))
>  setHandler({f1,f2,f3}, w32HLostFocus, routine_id("lf"))
>
>  WinMain(w, Normal)
>  ----------
> cheers,
> Derek
>
>
>
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu