FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Dialog NOWAIT lost focus at activation!
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Dialog NOWAIT lost focus at activation!
Posted: Wed Aug 20, 2008 05:08 PM

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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Dialog NOWAIT lost focus at activation!
Posted: Wed Aug 20, 2008 05:12 PM

Julio,

>Ok James, but the code will be execute by the main window, not by the non-modal dialog.

Did you mean you think it will, or that you want it to be executed in the main window?

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
Dialog NOWAIT lost focus at activation!
Posted: Wed Aug 20, 2008 05:19 PM
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


Sorry James! I will try to explain better:

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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Dialog NOWAIT lost focus at activation!
Posted: Wed Aug 20, 2008 05:24 PM

JĂșlio,

Please test your PRG built here:

http://rapidshare.com/files/138789952/nomodal.zip.html

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
Dialog NOWAIT lost focus at activation!
Posted: Wed Aug 20, 2008 05:34 PM
Antonio Linares wrote:JĂșlio,

Please test your PRG built here:
http://rapidshare.com/files/138789952/nomodal.zip.html


I know!
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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Dialog NOWAIT lost focus at activation!
Posted: Wed Aug 20, 2008 05:52 PM
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

#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
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Dialog NOWAIT lost focus at activation!
Posted: Wed Aug 20, 2008 05:59 PM
This example is slightly better. The focus is set to the dialog until it closes.

James

#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
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
Dialog NOWAIT lost focus at activation!
Posted: Wed Aug 20, 2008 06:00 PM
James 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

#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
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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Dialog NOWAIT lost focus at activation!
Posted: Wed Aug 20, 2008 06:02 PM

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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
Dialog NOWAIT lost focus at activation!
Posted: Wed Aug 20, 2008 06:04 PM

James, is like a progressbar dialog!!!
It is show and the process stay into the dialog if call her!

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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Dialog NOWAIT lost focus at activation!
Posted: Wed Aug 20, 2008 06:06 PM

Julio,

>James, is like a progressbar dialog!!!
>It is show and the process stay into the dialog if call her!

So put the progress bar on the dialog and update it from the process.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
Dialog NOWAIT lost focus at activation!
Posted: Wed Aug 20, 2008 06:07 PM
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


The process needs stay in the main window... the non-modal dialog will only for display a message, nothing more!
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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Dialog NOWAIT lost focus at activation!
Posted: Wed Aug 20, 2008 06:21 PM

>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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
Dialog NOWAIT lost focus at activation!
Posted: Wed Aug 20, 2008 06:24 PM
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


James, I will make for you a sample with the complete situation of my problem!
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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Dialog NOWAIT lost focus at activation!
Posted: Wed Aug 20, 2008 06:27 PM
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

#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
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10