Dialog NOWAIT lost focus at activation!

Postby James Bott » Wed Aug 20, 2008 5: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby James Bott » Wed Aug 20, 2008 5: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby JC » Wed Aug 20, 2008 5: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
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Postby Antonio Linares » Wed Aug 20, 2008 5: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby JC » Wed Aug 20, 2008 5: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? :D
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
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Postby James Bott » Wed Aug 20, 2008 5: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

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
   activate dialog oDlg on init (oDlg:show(), dowhatever(), oDlg:end())
return nil

function doWhatever()
  waitSeconds( 3 )
return nil
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby James Bott » Wed Aug 20, 2008 5:59 pm

This example is slightly better. The focus is set to the dialog until it closes.

James

Code: Select all  Expand view  RUN
#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.
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby JC » Wed Aug 20, 2008 6: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

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
   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
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Postby James Bott » Wed Aug 20, 2008 6: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby JC » Wed Aug 20, 2008 6: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
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Postby James Bott » Wed Aug 20, 2008 6: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby JC » Wed Aug 20, 2008 6: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
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Postby James Bott » Wed Aug 20, 2008 6: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby JC » Wed Aug 20, 2008 6: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
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Postby James Bott » Wed Aug 20, 2008 6: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

Code: Select all  Expand view  RUN
#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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 74 guests