FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index To do - WishList / Por hacer - Peticiones MSGRUN
Posts: 299
Joined: Mon Oct 22, 2007 03:03 PM
MSGRUN
Posted: Tue Jan 29, 2008 03:16 PM

Actualmente, el MSGRUN no separa en multiples líneas el texto cuando se le coloca CRLF, y me ví forzado a modificar el fuente original de la clase.
Sería posible Implementar esta característica en el fuente original???,
Se lograría estandarizar el comportamiento de los msg.

Saludos..
Angel.

Saludos



Angel, Valencia, Venezuela



xH .997 - FW 7.9 - BCC55 - WorkShop - MySql
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
MSGRUN
Posted: Tue Jan 29, 2008 10:01 PM

Angel,

Puedes mostrarnos la modificación que has hecho en el código fuente ? gracias

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 299
Joined: Mon Oct 22, 2007 03:03 PM
MSGRUN
Posted: Fri Feb 15, 2008 01:00 PM

include "FiveWin.ch"

define DS_MODALFRAME 128 // 0x80

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

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,aMsg:={},nArrayLeng:=0,cMsg

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

 IF At( CRLF,cCaption ) != 0
   DO WHILE At( CRLF,cCaption ) != 0
     cMsg:=Left(cCaption,At(  CRLF,cCaption )-1)
     aadd(aMsg,cMsg)
     nArrayLeng:=MAX(nArrayLeng,len(cMsg))
     cCaption:=substr(cCaption,At( CRLF,cCaption )+1)
   ENDDO
 ENDIF
 aadd(aMsg,cCaption)
 nArrayLeng:=MAX(nArrayLeng,len(cCaption))

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

 oDlg:lHelpIcon  :=.f.
 oDlg:bStart := { || Eval( bAction, oDlg ), oDlg:End(), SysRefresh() }

 nWidth := oDlg:nRight - oDlg:nLeft

 ACTIVATE DIALOG oDlg CENTER ;
    ON PAINT PresMsg(oDlg,aMsg,nWidth)

return nil

STATIC FUNCTION PresMsg(oDlg,aMsg,nWidth)
LOCAL nAt
FOR nAt=1 to len(aMsg)
oDlg:Say( nAt, 0, xPadC( aMsg[nAt], nWidth ) )
NEXT

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

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

NOTA: Aunque no es mut elegante, por lo menos trabaja

Saludos

Saludos



Angel, Valencia, Venezuela



xH .997 - FW 7.9 - BCC55 - WorkShop - MySql

Continue the discussion