//-> By João Santos - São Paulo - Brazil - kapiabafwh@bol.com.br - 23/11/06
//-> Participação Especial, Vailton Renato - renato@kssoftware.com.br
#Include "FiveWin.Ch"
STATIC oDlgRelog, oTimerRelog, lDesliga := .F., oWnd, oTimerPorta
STATIC oFnt, oSaida
//---------------------------------------------------------------------------//
FUNCTION RELOGIO()
LOCAL oBrush
LOCAL dDataDia
SET DATE BRIT
SET CENTURY ON
SET EPOCH TO YEAR( DATE() ) - 30
SET EXCLUSIVE OFF
SET MULTIPLE OFF
dDataDia := DTOC( DATE() )
DEFINE BRUSH oBrush RESOURCE "LOGO2" //-> PEGA A BITMAP DO ARQUIVO.RES(LOGO.BMP)
DEFINE FONT oFnt NAME "Arial" SIZE 08, 20 BOLD
DEFINE DIALOG oDlgRelog FROM 3, 3 TO 20, 50 ;
TITLE ( OemToAnsi( "Gerenciador do Rel¢gio do Sistema - " + ;
"Data: " + dDataDia ) ) ;
BRUSH oBrush TRANSPARENT ;
STYLE nOR( DS_MODALFRAME )
oDlgRelog:lHelpIcon := .F.
@ 005, 010 BUTTON oSaida PROMPT "&Finalizar" OF oDlgRelog ;
SIZE 70, 14 ;
ACTION ( oDlgRelog:End ) CANCEL
oSaida:cToolTip := ( OemToAnsi( "Finalizar Gerenciador do Rel¢gio " ) )
SET FONT OF oSaida TO oFnt
ACTIVATE DIALOG oDlgRelog CENTERED RESIZE16 ;
ON INIT( ACIONA_TIMER( oWnd ) )
IF lDesliga //-> Se For .T., Desligar o TIMER.
oTimerRelog:DeActivate()
oTimerPorta:DeActivate()
ENDIF
oFnt:End()
oBrush:End()
Release All
RETURN NIL
STATIC FUNCTION ACIONA_TIMER( oWnd )
DEFINE TIMER oTimerPorta INTERVAL 50 OF oDlgRelog ;
ACTION ACIONA_RELOGIO( oWnd )
ACTIVATE TIMER oTimerPorta
RETURN NIL
//---------------------------------------------------------------------------//
STATIC FUNCTION ACIONA_RELOGIO( oWnd )
LOCAL oFont
DEFINE FONT oFont NAME "Arial" SIZE 0, -70 BOLD //-> Fonte Para o Relogio
DEFINE FONT oFnt NAME "Arial" SIZE 08, 20 BOLD //-> Fonte Para o BotÆo
//-> Timer Que Ativa o Rel¢gio em Qualquer Lugar do Sistema
DEFINE TIMER oTimerRelog INTERVAL 50 ;
ACTION ExibeRelogio()
ACTIVATE TIMER oTimerRelog
//-> Fonte do Rel¢gio
SET FONT OF oDlgRelog TO oFont
SET FONT OF oSaida TO oFnt
oFont:End()
lDesliga := .T. //-> Para Desligar o Timer do Rel¢gio
oTimerPorta:DeActivate()
RETURN NIL
//-> Para NÆo Pintar a Tela do Windows, By Vailton Renato - 23/11/2006
STATIC FUNCTION ExibeRelogio()
IF ISWINDOWVISIBLE( oDlgRelog:hWnd )
oDlgRelog:Say( 3, 07, TIME(), ;
CLR_YELLOW, CLR_BLACK,, .F. )
// .T. Esquerda - .F. Direita da Dialog.
ENDIF
RETURN NIL
//-> FIM DO PROGRAMA <-------------------------------------------------------//
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 68 guests