Code: Select all
ACTIVATE DIALOG oDlg VALID .F. NOWAIT CENTERED
Code: Select all
ACTIVATE DIALOG oDlg VALID .F. NOWAIT CENTERED
This my code:Antonio Linares wrote:Have you tried to do:
oDlg:SetFocus()
after ACTIVATE DIALOG oDlg ?
Maybe your program execution is giving the focus to some other window, control, etc. as NONMODAL will not wait.
Code: Select all
DEFINE DIALOG oDlg RESOURCE "WAIT_DIALOG" OF oWnd
oDlg:lHelpIcon := .F.
oDlg:cargo := .F.
REDEFINE SAY oSay ID 101 OF oDlg FONT oFontBoldGrande
ACTIVATE DIALOG oDlg VALID .F. NOWAIT CENTERED
oSay:setText( "Waiting..." )
oSay:refresh()
oDlg:setFocus()
Code: Select all
#include "FiveWin.ch"
function Main()
local oWnd
DEFINE WINDOW oWnd TITLE "A window"
ACTIVATE WINDOW oWnd ;
ON INIT BuildNonModal()
return nil
function BuildNonModal()
local oDlg
DEFINE DIALOG oDlg TITLE "A non modal dialog"
ACTIVATE DIALOG oDlg NOWAIT CENTERED
return nil
I have already sent to you Antonio. But, take the link to download:Antonio Linares wrote:Our example runs the same if there is an open window in the background.
We wait for your example, thanks
James, is it! But, I need to execute a code out of the modal dialog and I think it is the unique way to do! Then, I have disabled the window for execute the code.James Bott wrote:Julio,
I can't figure out what you are trying to do. I looked at your code and you are creating a non-modal dialog and then trying to make it act like a modal dialog by disabling the main window. What is the point? Why not use a modal dialog. A modal dialog automatically disables the main window until it is closed. If you do this then you don't have a problem.
James
Ok James, but the code will be execute by the main window, not by the non-modal dialogJames Bott wrote:Julio,
>Exists another way to do it?
Just execute your code from a modal dialog. The main window will remain disabled until the dialog is closed.
James
Code: Select all
#include "fivewin.ch"
function main()
local oWnd
define window oWnd
activate window oWnd on init doit()
return nil
function doit()
local oDlg, oBtn
define dialog oDlg
@ 1,1 button oBtn action msgInfo("Test process called from modal dialog")
activate dialog oDlg
return nil
Please James, try to download this mini-example... You will understanding my question! And thank for you patience!James Bott wrote:Julio,
>Ok James, but the code will be execute by the main window, not by the non-modal dialog
>For this, a modal dialog will not permit the execution... right?
Here is a working example:
JamesCode: Select all
#include "fivewin.ch" function main() local oWnd define window oWnd activate window oWnd on init doit() return nil function doit() local oDlg, oBtn define dialog oDlg @ 1,1 button oBtn action msgInfo("Test process called from modal dialog") activate dialog oDlg return nil