FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Automatic xbrowse refresh
Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
Automatic xbrowse refresh
Posted: Sat Oct 20, 2018 03:50 PM

Hi fivewinners.

Any idea on how to automatically refresh a xbrowse after a few minutes of inactivity (no key stroke)

Any help will be appreciated

Thanks in advance

From Chile
Adolfo

;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
Posts: 300
Joined: Wed Jul 11, 2007 11:06 AM
Re: Automatic xbrowse refresh
Posted: Sat Oct 20, 2018 03:57 PM

Hi ,

You can look at TIMER

DEFINE TIMER oTmr INTERVAL 6000 ACTION (oLbx:Refresh()) OF oWnd
ACTIVATE TIMER oTmr

Posts: 300
Joined: Wed Jul 11, 2007 11:06 AM
Re: Automatic xbrowse refresh
Posted: Sat Oct 20, 2018 04:02 PM

You have also setidleactin({||UDF()})

TestIdle.prg

Posts: 346
Joined: Mon Oct 05, 2009 03:35 PM
Re: Automatic xbrowse refresh
Posted: Sat Oct 20, 2018 04:27 PM
Adolfo:
yo lo hago en una window..
se actualiza cada 30 seg aprox.

la funcion Recargar_Datos( oBrw ), es donde realizo el proceso de carga del xbrowse...

Code (fw): Select all Collapse
static nCargo := 0

...
....
....
   ACTIVATE WINDOW xWnd NORMAL ON INIT  ( xWnd:Center(),  GoTimer( xWnd, oBrw ) ) 

RETURN Nil

//-------------------------------------------------------------------------

STATIC FUNCTION GoTimer( xWnd, oBrw )
LOCAL oTmr
     DEFINE   TIMER oTmr OF xWnd INTERVAL 1 ACTION IIF( nCargo > 799, ( Recargar_Datos(  oBrw ), nCargo := 0 ), nCargo += 1 )
     ACTIVATE TIMER oTmr
RETURN Nil

//-------------------------------------------------------------------------


espero de que te sirva.

Saludos
SkyPe: armando.lagunas@hotmail.com

Mail: armando.lagunas@gmail.com
Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
Re: Automatic xbrowse refresh
Posted: Mon Oct 22, 2018 12:39 PM

Thanks to all ...

Jack
SetIdleAction() is only for 16 bits and can cause app freeze.

Armando.
I need to control the time after the last keystroke is done, not at a defined period of time
SP: Necesito controlar el tiempo despues de la ultima tecla presionada, no a un periodo de tiempo definido.

If the user is working in the xBrowse, I let him do his job because I have a routine to do it after he modiies or sees any data, but if he leaves his workplace, I'm want to refresh it after some minutes, so if he returns, he can see new or modified data.

That's the idea.

From Chile
Adolfo

;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
Posts: 300
Joined: Wed Jul 11, 2007 11:06 AM
Re: Automatic xbrowse refresh
Posted: Mon Oct 22, 2018 01:55 PM

Hi,
When i start the xbrowe, i get the time() in a static / global var

When i use the on change, ik get the time in a the same static / global var

In the timer i compre the actual time with the static/gloval var and if it is too long, i do a frefresh() .

Philippe

Continue the discussion