- Code: Select all Expand view RUN
ACTIVATE DIALOG oDlg VALID .F. NOWAIT CENTERED
ACTIVATE DIALOG oDlg VALID .F. NOWAIT CENTERED
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.
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()
#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
Antonio Linares wrote:Our example runs the same if there is an open window in the background.
We wait for your example, thanks
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
James 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
#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
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:
- Code: Select all Expand view RUN
#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
James
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 53 guests