Nag Screen

Nag Screen

Postby Silvio.Falconi » Fri Sep 20, 2013 7: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Nag Screen

Postby Antonio Linares » Fri Sep 20, 2013 10:38 am

Silvio,

function MsgWait( cMsg, cTitle, 20 )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Nag Screen

Postby Silvio.Falconi » 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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Nag Screen

Postby Wanderson » 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
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: Nag Screen

Postby ADutheil » Fri Sep 20, 2013 9:36 pm

Silvio,

try this:

Code: Select all  Expand view  RUN


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
 
Last edited by ADutheil on Sat Sep 21, 2013 11:30 am, edited 1 time in total.
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Nag Screen

Postby Silvio.Falconi » Sat Sep 21, 2013 6: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Nag Screen

Postby Silvio.Falconi » Sat Sep 21, 2013 8: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: Select all  Expand view  RUN


#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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Nag Screen

Postby ADutheil » 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
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Nag Screen

Postby Silvio.Falconi » 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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Nag Screen

Postby ADutheil » Sat Sep 21, 2013 2: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
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 97 guests