msgrun - possível FIX?!

msgrun - possível FIX?!

Postby MGA » Thu Sep 08, 2011 2:06 pm

Utilizando MSGRUN,

Resolvi um problema que estava acontecendo comigo adicionando setdialogesc(.f.)


#include "FiveWin.ch"

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

function WaitSeconds( nSecs )

local nStart := GetTickCount()

DEFAULT nSecs := 1

while GetTickCount() - nStart < ( 1000 * nSecs )
end

return nil

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

function MsgRun( cCaption, cTitle, bAction )

LOCAL oDlg, nWidth

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

IF cTitle == NIL
DEFINE DIALOG oDlg ;
FROM 0,0 TO 3, Len( cCaption ) + 4 ;
STYLE nOr( DS_MODALFRAME, WS_POPUP )
ELSE
DEFINE DIALOG oDlg ;
FROM 0,0 TO 4, Max( Len( cCaption ), Len( cTitle ) ) + 4 ;
TITLE cTitle ;
STYLE DS_MODALFRAME
ENDIF

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

nWidth := oDlg:nRight - oDlg:nLeft

setdialogesc(.f.) //AQUI Possivel FIX

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

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
ubiratanmga@gmail.com

FWH18.02
FWPPC
Harbour/xHarbour
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1234
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 93 guests