#Include "FiveWin.Ch"
Static oDlg
//----------------------------------------------------------------------------//
Function Contador_Simples()
DEFINE DIALOG oDlg ;
TITLE "Cronometro Simples" ;
FROM 10, 10 TO 23, 70
oDlg:lHelpIcon := .F.
@ 004, 002 BUTTON "Cronometro" ;
ACTION( Cronometro() ) ;
OF oDlg
@ 004, 015 BUTTON "&Saida" OF oDlg ;
ACTION ( oDlg:End ) CANCEL
ACTIVATE DIALOG oDlg
Return Nil
//----------------------------------------------------------------------------//
Function Cronometro()
Local Cronometro
Local nHora_Calc
Local nSegundos
// Calculo Sobre 24 Horas de um dia... Cada Hora Tem 3.600 Segundos.
Cronometro := 0 // Contador de Segundos do Cronometro.
nHora_Calc := 0 // Quantidade de Horas Que Ele Vai Achar.
nSegundos := 86400 // Quantidade de Segundos Para Se Achar as Horas.
@ 03, 20 Say "Em Segundos " Of oDlg
For Cronometro := 1 To nSegundos // -> Segundos a Calcular Para Horas
nHora_Calc := 0
oDlg:Say( 03, 10, Cronometro )
SysRefresh()
// Formula Para Calcular em Horas...
nHora_Calc := ( nHora_Calc ) + ( Cronometro / 60 ) / 60
Next Cronometro
@ 05, 10 Say "Em Horas: " Of oDlg // Resultado: 24:00:00 hrs.
@ 07, 10 Say nHora_Calc Picture "99.99.99.99" Of oDlg
Return Nil
#Include "FiveWin.Ch"
Static nGet
Static oBmp1, oBmp2, oBmp3, oBmp4, oBmp5
//----------------------------------------------------------------------------//
Function Velocimetro()
Local oDlg, oGet
nGet := 0
DEFINE DIALOG oDlg FROM 0, 0 TO 20, 60 ;
TITLE "Mostrando um Velocimetro/Cronômetro"
// Mostrando Barras Verticais no Mostrador(Display)
oDlg:lHelpIcon := .F.
//--------------------Ãrea do DisPlay do Cronômetro------------------------
/* Cada dÃgito é de 34 x 48 */
/* Copie o "DisPlay.Bmp" de \FW..\BitMaps\ Para o Seu Diretório de Uso */
@ 002, 001 SAY 'Contador : ' OF oDlg
@ 000, 000 BITMAP oBmp1 FILE "..\BitMaps\DisPlay.Bmp" OF oDlg
@ 000, 000 BITMAP oBmp2 FILE "..\BitMaps\DisPlay.Bmp" OF oDlg
@ 000, 000 BITMAP oBmp3 FILE "..\BitMaps\DisPlay.Bmp" OF oDlg
@ 000, 000 BITMAP oBmp4 FILE "..\BitMaps\DisPlay.Bmp" OF oDlg
@ 000, 000 BITMAP oBmp5 FILE "..\BitMaps\DisPlay.Bmp" OF oDlg
//-------------------------------------------------------------------------
oBmp1:nTop := 28
oBmp1:nLeft := 80
oBmp1:nBottom := 52
oBmp1:nRight := 97
oBmp2:nTop := 28
oBmp2:nLeft := 98
oBmp2:nBottom := 52
oBmp2:nRight := 115
oBmp3:nTop := 28
oBmp3:nLeft := 116
oBmp3:nBottom := 52
oBmp3:nRight := 133
oBmp4:nTop := 28
oBmp4:nLeft := 134
oBmp4:nBottom := 52
oBmp4:nRight := 151
oBmp5:nTop := 28
oBmp5:nLeft := 152
oBmp5:nBottom := 52
oBmp5:nRight := 169
//--------------------Ãrea dos Say's---------------------------------------
@ 002, 030 SAY "Evandro 1 Minuto" OF oDlg
@ 2.5, 030 SAY "Tem 60 Segundos " OF oDlg
@ 004, 010 SAY "Use Sua Imaginação... Estás Trabalhando Com Horas..." OF oDlg
@ 005, 010 SAY "Vai Contar até 180 Milésimos de Secs = 3 Segundos. " OF oDlg
@ 006, 010 SAY "By João Santos - In FiveWin The Best! " OF oDlg
@ 007, 010 SAY "Todos os Direitos Reservados - 27/12/2003 " OF oDlg
//--------------------Ãrea dos Botões--------------------------------------
@ 007, 002 BUTTON "&Aumentar" OF oDlg SIZE 40, 12 ;
ACTION ( nGet++, Por_Bmp( oBmp1, oBmp2, oBmp3, oBmp4, oBmp5, nGet ) )
@ 007, 010 BUTTON "&Diminuir" OF oDlg SIZE 40, 12 ;
ACTION ( nGet--, Por_Bmp( oBmp1, oBmp2, oBmp3, oBmp4, oBmp5, nGet ) )
@ 007, 018 BUTTON "&Executar" OF oDlg SIZE 40, 12 ;
ACTION Executar_Bmp()
@ 007, 026 BUTTON "&Saida" OF oDlg ;
ACTION ( oDlg:End ) CANCEL
ACTIVATE DIALOG oDlg CENTERED
EndDialog() // Fechar a Dialog
GlobalFree() // By João Santos - São Paulo - Brazil - Recursos Liberados
ResAllFree() // By Vagner Wirts .And. Elias Junior - Recursos Liberados
Return Nil
//----------------------------------------------------------------------------//
Function Executar_Bmp()
Local I
Local nSegundos
// Fórmula Para Calculo de Horas, Minutos, Segundos, Etc... Ex. Simples
nSegundos := Seconds() + ( 3600 + 5 ) / 60 * 3 //( 3 = Qtde. de Segundos)
For I = 1 To ( nSegundos - Seconds() )
Por_Bmp( oBmp1, oBmp2, oBmp3, oBmp4, oBmp5, I )
SysRefresh()
Next I
Return Nil
//----------------------------------------------------------------------------//
Function Por_Bmp ( oBjeto1, oBjeto2, oBjeto3, oBjeto4, oBjeto5, nQuantidade )
Local cNum := SPACE( 5 )
Local nLen := 3
Local nDigito1 := 3
Local nDigito2 := 3
Local nDigito3 := 3
Local nDigito4 := 3
Local nDigito5 := 3
cNum := STR( nQuantidade )
nLen := LEN( cNum )
nDigito1 := VAL( SUBSTR( cNum, nLen - 4, 1 ) )
If nDigito1 = 0
oBjeto1:nX := -528 // 0 - (11 * 48)
Else
oBjeto1:nX := 0 - ( nDigito1 * 48 )
Endif
nDigito2 := VAL( SUBSTR( cNum, nLen - 3, 1 ) )
If nDigito2 = 0 .AND. nDigito1 = 0
oBjeto2:nX := -528
Else
oBjeto2:nX := 0 - ( nDigito2 * 48 )
Endif
nDigito3 := VAL( SUBSTR( cNum, nLen - 2, 1 ) )
If nDigito3 = 0 .AND. nDigito2 = 0 .AND. nDigito1 = 0
oBjeto3:nX := -528
Else
oBjeto3:nX := 0 - ( nDigito3 * 48 )
Endif
nDigito4 := VAL( SUBSTR( cNum, nLen - 1, 1 ) )
If nDigito4 = 0 .AND. nDigito3 = 0 .AND. nDigito2 = 0 .AND. nDigito1 = 0
oBjeto4:nX := -528
Else
oBjeto4:nX := 0 - ( nDigito4 * 48 )
Endif
nDigito5 := VAL( SUBSTR( cNum, nLen, 1 ) )
oBjeto5:nX := 0 - ( nDigito5 * 48 )
oBjeto5:Refresh( .F. )
oBjeto4:Refresh( .F. )
oBjeto3:Refresh( .F. )
oBjeto2:Refresh( .F. )
oBjeto1:Refresh( .F. )
SysRefresh()
Return Nil
#Include "FiveWin.Ch"
Static nGet
Static oBmp1, oBmp2, oBmp3, oBmp4, oBmp5
//----------------------------------------------------------------------------//
Function Velocimetro()
Local oDlg, oGet
nGet := 0
DEFINE DIALOG oDlg FROM 0, 0 TO 20, 60 ;
TITLE "Mostrando um Velocimetro/Cronômetro" ;
STYLE nOR( DS_MODALFRAME )
oDlg:lHelpIcon := .F.
//--------------------Ãrea do DisPlay do Cronômetro------------------------
/* Cada dÃgito é de 34 x 48 */
/* Copie o "DisPlay.Bmp" de \FW..\BitMaps\ Para o Seu Diretório de Uso */
@ 002, 001 SAY 'Contador : ' OF oDlg
@ 000, 000 BITMAP oBmp1 FILE "..\BitMaps\DisPlay.Bmp" OF oDlg
@ 000, 000 BITMAP oBmp2 FILE "..\BitMaps\DisPlay.Bmp" OF oDlg
@ 000, 000 BITMAP oBmp3 FILE "..\BitMaps\DisPlay.Bmp" OF oDlg
@ 000, 000 BITMAP oBmp4 FILE "..\BitMaps\DisPlay.Bmp" OF oDlg
@ 000, 000 BITMAP oBmp5 FILE "..\BitMaps\DisPlay.Bmp" OF oDlg
//-------------------------------------------------------------------------
oBmp1:nTop := 28
oBmp1:nLeft := 80
oBmp1:nBottom := 52
oBmp1:nRight := 97
oBmp2:nTop := 28
oBmp2:nLeft := 98
oBmp2:nBottom := 52
oBmp2:nRight := 115
oBmp3:nTop := 28
oBmp3:nLeft := 116
oBmp3:nBottom := 52
oBmp3:nRight := 133
oBmp4:nTop := 28
oBmp4:nLeft := 134
oBmp4:nBottom := 52
oBmp4:nRight := 151
oBmp5:nTop := 28
oBmp5:nLeft := 152
oBmp5:nBottom := 52
oBmp5:nRight := 169
//--------------------Ãrea dos Say's---------------------------------------
@ 004, 010 SAY "Caro Usuário Tenha Calma, Espere o Contador Voltar!!" OF oDlg
@ 005, 010 SAY "Vai Contar até 99.999 e Depois Regressa o Cronômetro" OF oDlg
@ 006, 010 SAY "By João Santos - In FiveWin The Best! " OF oDlg
@ 007, 010 SAY "Todos os Direitos Reservados - 27/12/2003 " OF oDlg
//--------------------Ãrea dos Botões--------------------------------------
@ 007, 002 BUTTON "&Aumentar" OF oDlg SIZE 40, 12 ;
ACTION ( nGet++, Por_Bmp( oBmp1, oBmp2, oBmp3, oBmp4, oBmp5, nGet ) )
@ 007, 010 BUTTON "&Diminuir" OF oDlg SIZE 40, 12 ;
ACTION ( nGet--, Por_Bmp( oBmp1, oBmp2, oBmp3, oBmp4, oBmp5, nGet ) )
@ 007, 018 BUTTON "&Executar" OF oDlg SIZE 40, 12 ;
ACTION Executar_Bmp()
@ 007, 026 BUTTON "&Saida" OF oDlg ;
ACTION ( oDlg:End ) CANCEL
ACTIVATE DIALOG oDlg CENTERED
EndDialog() // Fechar a Dialog
GlobalFree() // By Joã£o Santos - São Paulo - Brazil - Recursos Liberados
ResAllFree() // By Vagner Wirts .And. Elias Junior - Recursos Liberados
Return Nil
//----------------------------------------------------------------------------//
Function Executar_Bmp()
Local I
For I = 1 To 99999 // (Step By Step... Indo/Aumentando)
Por_Bmp( oBmp1, oBmp2, oBmp3, oBmp4, oBmp5, I )
SysRefresh()
Next I
//InKey( 1 ) // Pode-se usar este comando velho do Clipper!
SysWait( .1 ) // Eu somente uso FiveWin! He he he he...
For I = 99999 To 1 STEP -1 // (Step By Step... Voltando/Diminuindo)
Por_Bmp( oBmp1, oBmp2, oBmp3, oBmp4, oBmp5, I )
SysRefresh()
Next I
Return Nil
//----------------------------------------------------------------------------//
Function Troca_Bmp( oBmp1, oBmp2, oBmp3, lSinal )
STATIC nCont := 0
Local nInc := IIF( lSinal, 1, -1 )
Local nCam := IIF( lSinal, -528, -527 )
Local nTopeI := IIF( lSinal, -576, 0 )
Local nTopeS := IIF( lSinal, 0, -576 )
If ! lSinal .And. nCont == 0
Return Nil
Endif
If oBmp3:nX == nTopeI
oBmp3:nX := nTopeS
Endif
If oBmp2:nX == nTopeI
oBmp2:nX := nTopeS
Endif
If oBmp1:nX == nTopeI
oBmp1:nX := nTopeS
Endif
oBmp3:nX -= nInc
nCont += nInc
If oBmp3:nX <= nCam
oBmp2:nX -= nInc
If oBmp2:nX <= nCam
oBmp1:nX -= nInc
Endif
Endif
oBmp3:Refresh( .F. )
oBmp2:Refresh( .F. )
oBmp1:Refresh( .F. )
Return Nil
//---------------------------------------------------------------------------//
Function Por_Bmp ( oBjeto1, oBjeto2, oBjeto3, oBjeto4, oBjeto5, nQuantidade )
Local cNum := SPACE( 5 )
Local nLen := 0
Local nDigito1 := 0
Local nDigito2 := 0
Local nDigito3 := 0
Local nDigito4 := 0
Local nDigito5 := 0
cNum := STR( nQuantidade )
nLen := LEN( cNum )
nDigito1 := VAL( SUBSTR( cNum, nLen - 4, 1 ) )
If nDigito1 = 0
oBjeto1:nX := -528 // 0 - (11 * 48)
else
oBjeto1:nX := 0 - ( nDigito1 * 48 )
Endif
nDigito2 := VAL( SUBSTR( cNum, nLen - 3, 1 ) )
If nDigito2 = 0 .AND. nDigito1 = 0
oBjeto2:nX := -528
else
oBjeto2:nX := 0 - ( nDigito2 * 48 )
Endif
nDigito3 := VAL( SUBSTR( cNum, nLen - 2, 1 ) )
If nDigito3 = 0 .AND. nDigito2 = 0 .AND. nDigito1 = 0
oBjeto3:nX := -528
else
oBjeto3:nX := 0 - (nDigito3 * 48)
Endif
nDigito4 := VAL( SUBSTR( cNum, nLen - 1, 1 ) )
If nDigito4 = 0 .AND. nDigito3 = 0 .AND. nDigito2 = 0 .AND. nDigito1 = 0
oBjeto4:nX := -528
else
oBjeto4:nX := 0 - (nDigito4 * 48)
Endif
nDigito5 := VAL( SUBSTR( cNum, nLen, 1 ) )
oBjeto5:nX := 0 - ( nDigito5 * 48 )
oBjeto5:Refresh( .F. )
oBjeto4:Refresh( .F. )
oBjeto3:Refresh( .F. )
oBjeto2:Refresh( .F. )
oBjeto1:Refresh( .F. )
SysRefresh()
Return Nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 117 guests