FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Working with Rich Edit
Posts: 142
Joined: Sun Oct 09, 2005 10:59 AM
Working with Rich Edit
Posted: 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. !!!!!!!!!

Posts: 142
Joined: Sun Oct 09, 2005 10:59 AM
Temporary work around
Posted: 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.

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Working with Rich Edit
Posted: Thu Mar 09, 2006 05:55 PM

Frank,

Modified as per your suggestion. Thanks! :)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion