Jump to content
Fivewin Brasil

Tem como alterando a mensagem do MsgRun() ??


gibaf

Recommended Posts

ola a todos

tem como a rotina q esta sendo executada no MsgRun() ir alterando a mensagem q fica aparecendo (cCaption) ???

Nesse caso exclusivamente, tenho q usar o MsgRun(), e nao pode ser pela classe TProgress() ou ainda pela classe TMeter()

Desde ja agradeco a ajuda: MUITO OBRIGADO !!!!

Link to comment
Share on other sites

Uma idéia:



#Include "FiveWin.Ch"

STATIC oDlg

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

Function WaitSeconds( nSecs )

LOCAL nFor, nStart
// Local nStart := GetTickCount()

DEFAULT nSecs := 5 //1

/*
While GetTickCount() - nStart < ( 1000 * nSecs )
Enddo
*/

FOR nFor = 4 to 0 step -1

nStart = GetTickCount()

//while ( GetTickCount() - nStart ) < 1000
While GetTickCount() - nStart < ( 1000 * nSecs )
enddo

oDlg:cMsg := "Trocando o CAPTION do MsgRun do FiveWin " + ;
LTrim( Str( nFor ) ) + " Segundo" + ;
If( nFor > 1, "s", "" )

oDlg:Refresh()
SysRefresh()

NEXT

Return Nil

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

Function MsgRun( cCaption, cTitle, bAction )

//Local oDlg, nWidth, oFnt, oFont, oBrush
Local nWidth, oFnt, oFont, oBrush

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

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 ;
FROM 0,0 TO 3, Len( cCaption ) + 4 ;
STYLE nOr( DS_MODALFRAME, WS_POPUP ) ;
COLOR nRGB( 000, 000, 000 ), nRGB( 135, 206, 235 )

oDlg:lHelpIcon := .F. // ok

ELSE

DEFINE DIALOG oDlg ;
FROM 0,0 TO 4, Max( Len( cCaption ), Len( cTitle ) ) + 4 ;
TITLE cTitle ;
STYLE nOR( DS_MODALFRAME ) ;
COLOR nRGB( 000, 000, 000 ), nRGB( 135, 206, 235 )

oDlg:lHelpIcon := .F. // ok

ENDIF

oDlg:bKeyDown = { | nKey | IF( nKey == VK_ESCAPE, ( oDlg:End() ), ) }

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

nWidth := oDlg:nRight - oDlg:nLeft

SET FONT OF oDlg TO oFnt

//-> Modificado By Antonio Linares 26/10/2007 - Correcao de Bug
ACTIVATE DIALOG oDlg CENTERED ;
ON PAINT oDlg:Say( 11, 0, xPadC( oDlg:cMsg, nWidth ),,,, .T. )

oFnt:End()
oFont:End()

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

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


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...