Dialog NOWAIT lost focus at activation!
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Sorry James! I will try to explain better:James Bott wrote:Julio,
I had already downloaded and looked at your code before my first message. I still don't understand what you are trying to do.
I assume my sample code is not what you are trying to do?
James
When the main window (oWnd) started, I need execute a command 'FOR' for testing any something... but, first I will open a dialog for display a message like "Please, wait a moment..."
So, the main window opens the dialog with non-modal. But I need prevent the user to click at the main window... so I disable her!
After execution of the command 'FOR', the main window is enabled again and closes the dialog non-modal.
You can understanding now? Please, say yes!
The non-modal dialog is only for display a message more pretty!
Peace and lighting!
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
- Antonio Linares
- Site Admin
- Posts: 37485
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
I know!Antonio Linares wrote:Júlio,
Please test your PRG built here:
http://rapidshare.com/files/138789952/nomodal.zip.html
If exists any window behind the main window (oWnd)... when the 'for' finish, the focus goes to the window behind and her bring to front of main window (oWnd), not to main window (oWnd).
The thing is bad don't? What I want is very impossible, too much crazy?

Peace and lighting!
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Julio,
>When the main window (oWnd) started, I need execute a command 'FOR' for testing any something... but, first I will open a dialog for display a message like "Please, wait a moment..."
OK, so why can't you use my code sample to do that? Here is another example closer to what you describe (still using a modal dialog).
James
>When the main window (oWnd) started, I need execute a command 'FOR' for testing any something... but, first I will open a dialog for display a message like "Please, wait a moment..."
OK, so why can't you use my code sample to do that? Here is another example closer to what you describe (still using a modal dialog).
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
activate dialog oDlg on init (oDlg:show(), dowhatever(), oDlg:end())
return nil
function doWhatever()
waitSeconds( 3 )
return nil
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
This example is slightly better. The focus is set to the dialog until it closes.
James
James
Code: Select all
#include "fivewin.ch"
function main()
local oWnd
define window oWnd
activate window oWnd maximized on init doit()
return nil
function doit()
local oDlg, oBtn
define dialog oDlg
activate dialog oDlg center ;
on init (oDlg:show(), oDlg:setFocus(), dowhatever(), oDlg:end())
return nil
function doWhatever()
waitSeconds( 3 )
return nil
Last edited by James Bott on Wed Aug 20, 2008 6:00 pm, edited 1 time in total.
JamesJames Bott wrote:Julio,
>When the main window (oWnd) started, I need execute a command 'FOR' for testing any something... but, first I will open a dialog for display a message like "Please, wait a moment..."
OK, so why can't you use my code sample to do that? Here is another example closer to what you describe (still using a modal dialog).
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 activate dialog oDlg on init (oDlg:show(), dowhatever(), oDlg:end()) return nil function doWhatever() waitSeconds( 3 ) return nil
Your example is perfect but in my situation, "dowhatever()" is not a function and stay at main window. The sequence (oDlg:show(), dowhatever(), oDlg:end() ) needs to calling on main window.
I now think it's not possible to do!
Peace and lighting!
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
The process needs stay in the main window... the non-modal dialog will only for display a message, nothing more!James Bott wrote:Julio,
>The sequence (oDlg:show(), dowhatever(), oDlg:end() ) needs to calling on main window.
Please describe in more detail.
Are you trying to create controls on the main window or something?
James
But only the user can click on it ( the non-modal dialog! )
Peace and lighting!
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
James, I will make for you a sample with the complete situation of my problem!James Bott wrote:>The process needs stay in the main window...
Do you mean that you want to put a progress bar on the main window? Something else? Please explain.
James
Thank for your help!
Wait!
Peace and lighting!
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Julio,
Here is an example showing a message in the message bar on the main window. The message is updated for 3 seconds. The modal dialog is displayed until the process is completed.
James
Here is an example showing a message in the message bar on the main window. The message is updated for 3 seconds. The modal dialog is displayed until the process is completed.
James
Code: Select all
#include "fivewin.ch"
function main()
local oWnd
define window oWnd
set message to "Press F1 for help" of oWnd
activate window oWnd maximized on init doit()
return nil
function doit()
local oDlg
define dialog oDlg
@ 1,1 say "Please wait..."
activate dialog oDlg center ;
on init (oDlg:show(), oDlg:setFocus(), sysrefresh(), dowhatever(), oDlg:end())
return nil
function doWhatever()
wndMain():oMsgBar:setMsg("3 seconds remaining...")
waitSeconds(1)
wndMain():oMsgBar:setMsg("2 seconds remaining...")
waitSeconds(1)
wndMain():oMsgBar:setMsg("1 seconds remaining...")
waitSeconds(1)
return nil