MSGRUN

MSGRUN

Postby ADBLANCO » Tue Jan 29, 2008 3: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.
User avatar
ADBLANCO
 
Posts: 299
Joined: Mon Oct 22, 2007 3:03 pm
Location: Valencia - Venezuela

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 41207
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby ADBLANCO » Fri Feb 15, 2008 1: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
User avatar
ADBLANCO
 
Posts: 299
Joined: Mon Oct 22, 2007 3:03 pm
Location: Valencia - Venezuela


Return to To do - WishList / Por hacer - Peticiones

Who is online

Users browsing this forum: No registered users and 3 guests