|
From: Alexander S.K. <al...@be...> - 2014-12-01 10:11:32
|
I just returned from a vacation and begin to answer.
Baloghy Gábor ?????:
> Hi
>
> I would like to call a nomodal window with some explanation text from
> a when method of a get , then to close it from the valid.
>
> There is below my wrong code.
>
> Do you have some working solution?
>
> Thank you in advance,
>
> ...
> function whelp(p)
> if p=="on"
> INIT DIALOG owhelp AT 60,60 TITLE "Help" SIZE 200,100
> @ 30,30 say "Text" size 100,25
> activate dialog owhelp NOMODAL
> hwg_setfocus(owin:ox2:handle)
> elseif p=="off"
> owhelp:close()
> endif
> return .t.
>
Replace whelp with the following:
function whelp(p)
Local bSetGet
static owhelp := Nil
if p=="on"
if Empty( owhelp )
bSetGet := ox2:bSetGet
ox2:bSetGet := Nil
INIT DIALOG owhelp AT 60,60 TITLE "Help" SIZE 200,100
@ 30,30 say "Text" size 100,25
activate dialog owhelp NOMODAL
hwg_setfocus(owin:ox2:handle)
ox2:bSetGet := bSetGet
endif
elseif p=="off"
if !Empty( owhelp )
owhelp:close()
owhelp := Nil
endif
endif
return .t.
The problem was that when you created the dialog, the get item lost the
focus and the "valid" event appears - so the dialog was closed
immedeately after creating. Temporary setting ox2:bSetGet to Nil
prevents handling of the "valid" event.
Regards, Alexander.
|