¿cambiar fuente en msgRun ?

¿cambiar fuente en msgRun ?

Postby JoseAlvarez » Fri Feb 16, 2024 12:03 pm

Estimados amigos, un saludo a todos

¿ Es posible cambiar el tipo de fuente y color a un dialogo rápido de tipo msgRun() ?

Code: Select all  Expand view
msgRun("Espere Mientras se Crea el Catálogo...",NIL, {|| :PrepareReport() })


con la letra por defecto se ve mal, por lo menos en este caso,

Image
"Los errores en programación, siempre están entre la silla y el teclado..."

Fwh 19.06 32 bits + Harbour 3.2 + Borland 7.4 + MariaDB + TDolphin

Carora, Estado Lara, Venezuela.
User avatar
JoseAlvarez
 
Posts: 726
Joined: Sun Nov 09, 2014 5:01 pm

Re: ¿cambiar fuente en msgRun ?

Postby karinha » Fri Feb 16, 2024 12:44 pm

https://forums.fivetechsupport.com/viewtopic.php?f=3&t=34020

MsgRun.prg

Code: Select all  Expand view

/*
    MsgWait y MsgRun no se muestran correctamente bajo 32 bits, el
    cálculo de coordenadas no es correcto pues el texto de cuerpo
    se recorta:

    Moises,

    En source\function\msgrun.prg hay que modificar estas líneas asi:

    Código:

    ACTIVATE DIALOG oDlg CENTER ;
             ON PAINT oDlg:Say( 11, 0, xPadC( oDlg:cMsg, nWidth ),,,, .T. )

    Antonio Linares
    www.fivetechsoft.com
*/


#include "FiveWin.Ch"

// ----------------------------------------------------------------------------//

FUNCTION MsgRun( cCaption, cTitle, bAction, oWndParent )  // MUDEI: 24/07/2017 - Joao

   LOCAL oDlg, nWidth, uReturn, aGrad

   /*
   DEFAULT cCaption := "Please, wait...",;
           bAction  := { || WaitSeconds( 1 ) }
   */


   DEFAULT cCaption := "Por Favor, Espere...", ;
      bAction  := {|| WaitSeconds( 1 ) }

   // Modelos de gradient
   // aGrad := { { 0.5, CLR_HRED,CLR_WHITE},{ 0.5,CLR_WHITE,CLR_HRED } }

   // aGrad := { { 0.30, CLR_HRED, CLR_WHITE},{ 0.70, CLR_WHITE, CLR_HRED } }

   aGrad := { { 0.30, CLR_BLACK, CLR_YELLOW }, { 0.70, CLR_YELLOW, CLR_BLACK } }

   /*
   SetDlgGradient( { {0.30,CLR_HRED,CLR_WHITE}, {0.70,CLR_WHITE,CLR_HRED} } )
   */


   DEFINE FONT oFnt    NAME "Ms Sans Serif" SIZE 0, - 12 BOLD
   DEFINE FONT oFont   NAME "Ms Sans Serif" SIZE 0, - 14 BOLD

   IF cTitle == NIL

      DEFINE DIALOG oDlg GRADIENT aGrad           ; // usando gradient
         FROM 0, 0 TO 3, Len( cCaption ) + 4   ;
         STYLE nOr( DS_MODALFRAME, WS_POPUP )

   ELSE

      DEFINE DIALOG oDlg GRADIENT aGrad           ; // usando gradient
         FROM 0, 0 TO 4, Max( Len( cCaption ), Len( cTitle ) ) + 4 ;
         TITLE cTitle ;
         STYLE DS_MODALFRAME

   ENDIF

   oDlg:bStart := {|| uReturn := Eval( bAction, oDlg ), oDlg:End(), SysRefresh() }
   oDlg:cMsg   := cCaption

   nWidth := oDlg:nRight - oDlg:nLeft

   SET FONT OF oDlg TO oFnt

   ACTIVATE DIALOG oDlg ON PAINT oDlg:SayText( oDlg:cMsg ) ;
      ON INIT oDlg:Center( oWndParent )

   oFnt:End()
   oFont:End()

RETURN uReturn

// ---------------------------------------------------------------------------//

FUNCTION WaitSeconds( nSecs )

   LOCAL nStart := GetTickCount()

   DEFAULT nSecs := 1

   WHILE GetTickCount() - nStart < ( 1000 * nSecs )
   ENDDO

RETURN NIL

// ---------------------------------------------------------------------------//

FUNCTION MsgWait( cCaption, cTitle, nSeconds )

   DEFAULT nSeconds := 4

RETURN MsgRun( cCaption, cTitle, {|| WaitSeconds( nSeconds ) } )

// ---------------------------------------------------------------------------//

FUNCTION StopUntil( bBlock )

   DO WHILE !Eval( bBlock )
      WaitMessage()
      SysRefresh()
   ENDDO

RETURN NIL

// ---------------------------------------------------------------------------//

// FIN / END
 


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

Re: ¿cambiar fuente en msgRun ?

Postby JoseAlvarez » Fri Feb 16, 2024 4:18 pm

Gracias joao,

No me funcionó, pero me diste la idea para resolver.

Saludos amigo!
"Los errores en programación, siempre están entre la silla y el teclado..."

Fwh 19.06 32 bits + Harbour 3.2 + Borland 7.4 + MariaDB + TDolphin

Carora, Estado Lara, Venezuela.
User avatar
JoseAlvarez
 
Posts: 726
Joined: Sun Nov 09, 2014 5:01 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 87 guests