FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Nag Screen
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Nag Screen
Posted: Fri Sep 20, 2013 07:09 AM

Someone have a mall sample of Nag-screen for a wait time of 20 seconds ? thanks

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Nag Screen
Posted: Fri Sep 20, 2013 10:38 AM

Silvio,

function MsgWait( cMsg, cTitle, 20 )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Nag Screen
Posted: Fri Sep 20, 2013 10:57 AM

opps sorry
but I wish show the seconds

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 332
Joined: Thu Nov 17, 2005 09:11 PM
Re: Nag Screen
Posted: Fri Sep 20, 2013 12:34 PM
Silvio.Falconi wrote:opps sorry
but I wish show the seconds


Hi Silvio, I use this to 5 seconds, but you can change to other value (nFor)


MsgRun( " Aguardando resposta da entidade receptora em 5 segundos",;
"Processando, aguarde...",;
{ | oDlgSef | UpdCaption( oDlgSef) } )

...

Static function UpdCaption( oDlg )

local nFor, nStart

for nFor := 4 to 0 step -1
nStart = GetTickCount()
while ( GetTickCount() - nStart ) < 1000
end
oDlg:cMsg := " wait for "+;
LTrim( Str( nFor ) ) + " second" + ;
If( nFor > 1, "s", "" )
oDlg:Refresh()
SysRefresh()
next

return nil
Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: Nag Screen
Posted: Fri Sep 20, 2013 09:36 PM
Silvio,

try this:

Code (fw): Select all Collapse
your code
..........
nSecs := 20 // The seconds u wuant to wait.
MsgMeter( { | oMeter, oText | CountDown( nSecs, oMeter, oText ) }, "          " + allTrim( str( nSecs ) ) + " SECONDS", "PLEASE WAIT..." )
........
your code


FUNCTION CountDown( nSecs, oMeter, oText )
LOCAL nI := 0

oMeter:nTotal := nSecs
oMeter:Set( nSecs )
WHILE nI < nSecs
    WaitSeconds( 1 )
    nI ++
    oText:VarPut( "          " + allTrim( str( nSecs - nI ) ) + " SECONDS" )
    oText:Refresh()
    oMeter:Set( nSecs - nI )
ENDDO
RETURN NIL
Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Nag Screen
Posted: Sat Sep 21, 2013 06:27 AM

Dear friends,
do You remember the dialog of Copyrights of old Wdbu ?
I mean something of it ...

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Nag Screen
Posted: Sat Sep 21, 2013 08:19 AM
Friends ,
I tried to make a test with numbers and a progress bar but the time progress is not the same of the time for the numbers
where is the error ?

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

#define LIGHTCYAN        nRGB( 203, 225, 252 )


FUNCTION TEST()
   MsgRun( " NagScreen title",;
           "Processando, aguarde...",;
        { | oDlgSef | UpdCaption( oDlgSef) } )

   RETURN NIL




Static function MsgRun( cCaption, cTitle, bAction )
   Local oDlg,oProgress
   Local nBottom   := 26.9
   Local nRight    := 66
   Local nWidth :=  Max( nRight * DLG_CHARPIX_W, 180 )
   Local nHeight := nBottom * DLG_CHARPIX_H

   DEFAULT cCaption := "Per favore, attendi",;
             bAction  := { || WaitSeconds( 1 ) }

   DEFINE FONT oFont NAME "MS Sans Serif" SIZE 0, 8

   DEFINE DIALOG oDlg        ;
   TITLE cCaption  ;
   SIZE nWidth, nHeight  TRANSPARENT PIXEL               ;
   GRADIENT { { 1,CLR_WHITE, LIGHTCYAN } }    ;
   FONT oFont



   oProgress := TProgress():New( 2.8, 1, oDlg, , , , .f.,, 250, 10, , .f., .f. )
   oDlg:bStart := { || uReturn := Eval( bAction, oDlg ), oDlg:End(), SysRefresh() }
   oDlg:cMsg   := cCaption

   ACTIVATE DIALOG oDlg CENTER ;
          ON PAINT (TrayTimer( oDlg, 80, oProgress ),;
          oDlg:Say( 11, 0, xPadC( oDlg:cMsg, nWidth ),,,, .T., .T. ) )
   return nil


 //----------------------------------------------------------------------------//
Static function WaitSeconds( nSecs )

   local nStart := GetTickCount()

   DEFAULT nSecs := 1

   while GetTickCount() - nStart < ( 1000 * nSecs )
   end

return nil

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

Static function MsgWait( cCaption, cTitle, nSeconds )

   DEFAULT nSeconds := 4

return MsgRun( cCaption, cTitle, { || WaitSeconds( nSeconds ) } )

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

Static function StopUntil( bBlock )

   DO WHILE !Eval( bBlock )
      WaitMessage()
      SysRefresh()
   ENDDO

Return NIL
//----------------------------------------------------------------------------//


Static function TrayTimer( DlgT, nInterval, oMet )
LOCAL oTmr
DEFINE   TIMER oTmr OF DlgT INTERVAL 1 ;
   ACTION ( oMet:nPosition +=1, IIF(oMet:nPosition > nInterval, DlgT:End(), Msgbeep() ) )
   ACTIVATE TIMER oTmr
RETURN nil
//-------------------------------------------------------------------------//

Static function UpdCaption( oDlg )
          local nFor, nStart
             for nFor := 20 to 0 step -1
                nStart = GetTickCount()
                while ( GetTickCount() - nStart ) < 1000

                 end
                  oDlg:cMsg := " attendi per "+;
                              LTrim( Str( nFor ) ) + " second" + ;
                             If( nFor > 1, "i", "o" )
                          oDlg:Refresh()
                   SysRefresh()
             next
return nil
//-------------------------------------------------------------------------//
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: Nag Screen
Posted: Sat Sep 21, 2013 11:31 AM

Did U try the code I sent? Works OK for me.

Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Nag Screen
Posted: Sat Sep 21, 2013 11:33 AM

yes but the meter is not the same of numbers step

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: Nag Screen
Posted: Sat Sep 21, 2013 02:17 PM

Check if U have oMeter:Set( nSecs ) before the WHILE of the CountDown function.

Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10

Continue the discussion