Valid clause while closing a Dialog

Valid clause while closing a Dialog

Postby anserkk » Mon Sep 15, 2008 5:39 am

Friends,

I would like someone to confirm whether Valid will work with a Dialog or NOT. In my case VALID statement is not getting executed while I try to close the Dialog but it is working fine if i define the window as MDICHILD


Code: Select all  Expand view
DEFINE DIALOG oDlg TITLE "Account Heads"

@  0, 0 XBROWSE oBrw LINES CELL;
     COLUMNS 'ACCODE','NAME','GRCODE' ;
     SIZE 370,oDlg:nHeight-35 PIXEL ;
     OF oDlg ;
     ALIAS 'AcMaster_ACM'

ACTIVATE WINDOW oDlg ;
   on INIT oBrw:SetFocus();
   VALID MsgYesNo( "Do you want to quit Ac Heads ?","Quit AC Head")


If I try to define the window as Window of wndMain() then there is no title bar and close button for that particular window.

From where can I get more information on the behaviors of different type of windows ? Advantage of Defining a window as "DEFINE Window oWnd of wndMain()"

In case of a DIALOG, to execute a set of instructions after the user close the Dialog, I assume that the statements should be given after the ACTIVATE window instead of using the VALID clause. Am I right ?

I understand that in case of a DIALOG the execution of the PRG pauses till the user close the DIALOG. But in case of other type of Windows, program execution does not pause like a DAILOG ie the next statement after ACTIVATE Window will be executed immediately after displaying the Window. So accordingly you have to write the code based on what type of window you are going to use.

wndMain() works like a DIALOG. The execution of PRG statements pauses till the user close the Main Window ie the statements after ACTIVATE window will get executed only after the user close the Main Window. Ideal for closing the opened DBF files

Friends, correct me if I am wrong.

If the above info is right then it may be useful to new FWH developers like me.

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Postby anserkk » Mon Sep 15, 2008 5:54 am

Sorry,

I made a mistake in the above code. Instead of ACTIVATE DIALOG oDlg, by mistake I used ACTIVATE WINDOW oDlg which was the cause of not executing the VALID clause of DIALOG

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Postby Antonio Linares » Mon Sep 15, 2008 9:50 am

Anser,

Glad to know that you solved it :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 88 guests