TIME IN A DIALOG

TIME IN A DIALOG

Postby Silvio.Falconi » Mon Mar 21, 2016 6:29 pm

where can I find an example to display a clock with the time () function and the latter because I can not refresh 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: 7047
Joined: Thu Oct 18, 2012 7:17 pm

Re: TIME IN A DIALOG

Postby karinha » Tue Mar 22, 2016 12:43 pm

Code: Select all  Expand view

//-> 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 <-------------------------------------------------------//
 


João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7801
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: TIME IN A DIALOG

Postby Silvio.Falconi » Fri Mar 25, 2016 10:53 am

thanks
-i use a time into a control and if I insert the refresh then refresh al control and not only the time
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: 7047
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 74 guests