FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Code is executing after ACTIVATE WINDOW
Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Code is executing after ACTIVATE WINDOW
Posted: Sun Dec 23, 2012 10:32 AM
Hi All,

I searched in the forum but I could not found the answer may be I could not co-relate with my problem. Basically I want to execute the code after a calling procedure execution is over. A calling procedure create and activate window ( not a dialog ) as WINDOW behavior it does not wait as dialog. I know we have VALID clause to execute the code after the WINDOW close (end) as per my need I can not use VALID clause. I am calling a procedure in the button action's block please see below. so do we have any solution apart from VALID clause ?
Thanks in advance.

Code (fw): Select all Collapse
   aoBTN[2]:bAction := <||

                        IF oRGSQry:vt_id == C_CHQ_RETURN_VT_ID
                           trv_dbrcpt( oRGSQry:vou_id )  // New Window Activates 
                        ENDIF
                           --- below code should be execute after closing previous window 
                           oRGSQry := oApp:gDBServer:Query( C_VT_REG( C_VR_VT_ID, C_VR_FROM_DATE, C_VR_TO_DATE  ) )
                           oBrwRGS:SetDolphin(oRGSQry)
                           oBrwRGS:Refresh()
                           --
                 
                       >

Thanks
Shridhar
Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Code is executing after ACTIVATE WINDOW
Posted: Sun Dec 23, 2012 12:48 PM

Shridhar,

I am not sure about what you want to do exactly, but maybe you could use oWnd:bStart that is executed just once, when the window is initially shown

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Code is executing after ACTIVATE WINDOW
Posted: Sun Dec 23, 2012 02:50 PM
Shirdhar,

Try the code below.

Regards,
James

Code (fw): Select all Collapse
  aoBTN[2]:bAction := {|oBrwRGS| ;
           IIF(oRGSQry:vt_id == C_CHQ_RETURN_VT_ID, ;
           trv_dbrcpt( oRGSQry:vou_id )), ;    // New Window Activates 
           oRGSQry := oApp:gDBServer:Query( C_VT_REG( C_VR_VT_ID, C_VR_FROM_DATE, C_VR_TO_DATE  ) ),;
           oBrwRGS:SetDolphin(oRGSQry),;
           oBrwRGS:Refresh(),;
           }
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Code is executing after ACTIVATE WINDOW
Posted: Sun Dec 23, 2012 10:04 PM
Or you can use this:

Code (fw): Select all Collapse
ACTIVATE WINDOW oWnd;
         VALID ( oWnd := NIL, .T. )

STOPUNTIL( { || oWnd = NIL } )

// Here goes your code


EMG
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Code is executing after ACTIVATE WINDOW
Posted: Mon Dec 24, 2012 02:31 AM

Enrico,

Hey, I like that. Much easier.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: Code is executing after ACTIVATE WINDOW
Posted: Mon Dec 24, 2012 09:22 AM
Hi All,

Thanks a lot..! for your great support.

Hi Antonio ,

Actually I want execute the code after a particular window operation is over. As WINDOW's behaviour the execute after ACTIVATE WINDOW that I do not need. Simply when we say ACTIVATE WINDOW oWnd it should wait till the Window is closed and continue with next code.

Hi Enrico ,

As I read in our forum the below function should not be used. Can we use this function in our code ? Please correct me if I am worng. Thanks in advance.

Code (fw): Select all Collapse
STOPUNTIL( { || oWnd = NIL } )


Thanks
Shridhar
Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Code is executing after ACTIVATE WINDOW
Posted: Mon Dec 24, 2012 10:16 AM

It's already used in rpreview.prg so yes, you can use it in your code.

EMG

Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: Code is executing after ACTIVATE WINDOW
Posted: Mon Dec 24, 2012 02:55 PM

Hi Enrico ,

I tried but its not working and also when I closed entire application still the Window's task manager shows status is running.

Thanks
Shridhar

Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Code is executing after ACTIVATE WINDOW
Posted: Mon Dec 24, 2012 03:18 PM

Hi, if I understood, please look at this:

viewtopic.php?f=3t=18270start=0hilit=oWnd%3Abpostend
Best regards

&&&

Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Code is executing after ACTIVATE WINDOW
Posted: Mon Dec 24, 2012 03:57 PM
A working sample:

Code (fw): Select all Collapse
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oWnd

    DEFINE WINDOW oWnd

    ACTIVATE WINDOW oWnd;
             VALID ( oWnd := NIL, .T. )

    STOPUNTIL( { || oWnd = NIL } )

    ? "The end!"

    RETURN NIL


EMG
Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: Code is executing after ACTIVATE WINDOW
Posted: Tue Dec 25, 2012 04:34 AM
Hi Enrico ,

Extremely sorry..! I had not added the VALID clause in the ACTIVATE WINDOW command.

Code (fw): Select all Collapse
 VALID ( oWnd := NIL, .T. )


Thanks
Shridhar
Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB

Continue the discussion