Page 1 of 1
DC_Appevent parameters
Posted: Tue Apr 19, 2016 6:43 am
by Victorio
Hi,
I have used DC_Progress, and like this
STATIC FUNCTION _Progressuni2(oProgress,lOk,poradie,numrecords,step)
DC_GetProgress(oProgress,poradie,numrecords,step)
DC_AppEvent(@lOk,0,.01)
RETURN lOk
In other function I called this
DO while eof() .and. _Progressuni2(...
...
skip
ENDDO
But DC_AppEvent very slowing process, I tryed parameters 0,1,10,0.1,0.000001...)
How parameter can be in it for delay ?
I must disable DC_AppEvent and process will be again speed.
Re: DC_Appevent parameters
Posted: Tue Apr 19, 2016 6:59 am
by rdonnay
DC_AppEvent() processes events that are occurring while you are updating the progress bar.
It is only needed if you must be able to terminate whatever process is going on.
Just having it in that loop serves no purpose unless you have something like a CANCEL button in your dialog which would exit you from the loop.
Re: DC_Appevent parameters
Posted: Tue Apr 19, 2016 12:45 pm
by Victorio
just I have Cancel button in progress dialog but because slowing down I must disable it, then works quick.
I want only know, how range can have 3.th parameter DC_AppEvent()
Now it is not big problem, because I have two progress bars showing two cycles, and cancel moved to first slower cycle, then process can cancel after operation processed.
Also I can controlling cancel in other place.
Re: DC_Appevent parameters
Posted: Tue Apr 19, 2016 4:33 pm
by rdonnay
You can write your own event loop.
That's really all that DC_AppEvent does. Look at the AppEvent() function of Xbase++.
Code: Select all
FUNCTION DC_AppEvent( lOk, nExit, nDelay)
LOCAL nEvent, mp1, mp2, oXbp
DEFAULT lOk := .t., ;
nExit := xbeP_Close, ;
nDelay := 0
nEvent := -1
DO WHILE lOk .AND. nEvent # nExit
nEvent := AppEvent( @mp1, @mp2, @oXbp, nDelay )
IF Valtype(oXbp) = 'O'
IF nEvent = xbeP_Keyboard .AND. mp1 = K_ESC
EXIT
ELSEIF nEvent = 0 .OR. ( nEvent == xbeM_Motion .AND. mp1 == NIL )
LOOP
ENDIF
oXbp:HandleEvent( nEvent, mp1, mp2 )
ENDIF
ENDDO
RETURN nEvent
Re: DC_Appevent parameters
Posted: Tue Apr 19, 2016 11:26 pm
by Victorio
ok, thank you