FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour msgrun - possível FIX?!
Posts: 1286
Joined: Mon Feb 25, 2008 02:54 PM
msgrun - possível FIX?!
Posted: Thu Sep 08, 2011 02: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 := &quot;Please, wait...&quot;,;
         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

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin

Continue the discussion