Working with Rich Edit

Working with Rich Edit

Postby Frank Demont » Thu Mar 09, 2006 12:23 pm

Antonio,

I am succesfull with using this class , printing multiple rtf- files

Now , i have a routine to convert txt-files with esc-sequences to rtf format , it works very fine except :



I have to use oRtf:find(......) . When nothing is found (i have to loop trought the text till no escape sequenses are found) , i got a message. This can not be the intention.

I expect a construction as :

DO WHIL oRtf:Find( Esc-sequens ON , .T. ) // Bold on
nFrom := oRtf:GetPos()
oRtf:ReplaceSel( .F. , "" )
oRtf:Find( Esc-sequens OFF , .T. ) // Bold Off
nTo := oRtf:GetPos()
oRtf:ReplaceSel( .F. , "" )
oRTF:SetSel(nFrom , nTo , .T.)
oRtf:SetBold( .T. )
END


Important is that method find returns .T. or .F. !!!!!!!!!
Frank Demont
 
Posts: 142
Joined: Sun Oct 09, 2005 10:59 am

Temporary work around

Postby Frank Demont » Thu Mar 09, 2006 12:53 pm

@ 0, 0 RICHEDIT oRTF VAR cRTF OF oWnd ;

__ObjModMethod(oRtf,"Find",@Find())




FUNCTION Find( cFind, lDown, lCase, lWord )

LOCAL Self := HB_QSelf()

local nIndex := REFindText( self:hWnd, cFind, lDown, lCase, lWord )

if nIndex != -1
RESetSelection( self:hWnd, nIndex + Len( cFind ), nIndex )
self:Change()
else
//MsgInfo( "String not found: " + cFind, "Find" )
RETURN .F.
endif

return .T.
Frank Demont
 
Posts: 142
Joined: Sun Oct 09, 2005 10:59 am

Postby Antonio Linares » Thu Mar 09, 2006 5:55 pm

Frank,

Modified as per your suggestion. Thanks! :)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 36 guests