DC_Appevent parameters

This forum is for eXpress++ general support.
Post Reply
Message
Author
Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

DC_Appevent parameters

#1 Post 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.

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DC_Appevent parameters

#2 Post 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.
The eXpress train is coming - and it has more cars.

Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: DC_Appevent parameters

#3 Post 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.

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DC_Appevent parameters

#4 Post 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
The eXpress train is coming - and it has more cars.

Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: DC_Appevent parameters

#5 Post by Victorio »

ok, thank you

Post Reply