Hi guys,
I want to do a timer that shows a message after 10 seconds de pressing the button
please help me
Gente:
Necesito programar un timer dentro de un botón que despues de 10 segundos de presionado muestre un msje
ayuda por favor
//-> By Joao Santos - Sao Paulo - Brazil - kapiabafwh@gmail.com
//-> Participacao Especial, Vailton Renato - renato@kssoftware.com.br
#Include "FiveWin.Ch"
STATIC oDlgRelog, oTimerRelog, lDesliga := .F., oWnd, oTimerPorta
STATIC oFnt, oSaida
//---------------------------------------------------------------------------//
FUNCTION RELOG()
LOCAL oSayMens, oFnt2, aGrad
oSayMens := "This a Test message"
aGrad := { { 0.30, CLR_BLACK, CLR_YELLOW},{ 0.70, CLR_YELLOW, CLR_BLACK } }
DEFINE FONT oFnt NAME "Arial" SIZE 08, 20 BOLD
DEFINE FONT oFnt2 NAME "Arial" SIZE 00, -12 BOLD
DEFINE DIALOG oDlgRelog FROM 3, 3 TO 20, 50 ;
TITLE "Test of Message with Timer" ;
GRADIENT aGrad TRANSPARENT ;
STYLE nOR( DS_MODALFRAME )
oDlgRelog:lHelpIcon := .F.
@ .5,10 SAY oSayMens OF oDlgRelog SIZE 100, 12 ;
COLOR CLR_BLACK, CLR_WHITE TRANSPARENT ADJUST
@ 5, 11 BUTTON oSaida PROMPT "&Timer" OF oDlgRelog ;
SIZE 50, 14 ;
ACTION( ACIONA_TIMER( oWnd ) )
oSaida:cToolTip := "Timer"
SET FONT OF oSaida TO oFnt
SET FONT OF oDlgRelog TO oFnt2
ACTIVATE DIALOG oDlgRelog CENTERED
IF lDesliga
oTimerRelog:DeActivate()
oTimerPorta:DeActivate()
ENDIF
oFnt:End()
oFnt2:End()
RETURN NIL
FUNCTION ACIONA_TIMER( oWnd )
DEFINE TIMER oTimerPorta INTERVAL 50 OF oDlgRelog ;
ACTION ACIONA_RELOGIO( oWnd )
ACTIVATE TIMER oTimerPorta
RETURN NIL
FUNCTION ACIONA_RELOGIO( oWnd )
LOCAL oFont
DEFINE FONT oFont NAME "Arial" SIZE 0, -70 BOLD
DEFINE FONT oFnt NAME "Arial" SIZE 08, 20 BOLD
DEFINE TIMER oTimerRelog INTERVAL 50 ;
ACTION ExibeRelogio()
ACTIVATE TIMER oTimerRelog
SET FONT OF oDlgRelog TO oFont
SET FONT OF oSaida TO oFnt
oFont:End()
lDesliga := .T. //-> Para Desligar o Timer
oTimerPorta:DeActivate()
RETURN NIL
FUNCTION ExibeRelogio()
LOCAL NewMensa := "Mensagem"
// Mensageria
IF ISWINDOWVISIBLE( oDlgRelog:hWnd )
oDlgRelog:Say( 3, 01, NewMensa, ;
CLR_YELLOW, CLR_BLACK,, .F. )
// .T. Esquerda - .F. Direita da Dialog.
ENDIF
RETURN NIL
//-> FIM / END
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 32 guests