Pasting into a Richtext control

Pasting into a Richtext control

Postby reinaldocrespo » Sat Feb 11, 2006 3:26 pm

Hi everyone.

I'm needing to insert richtext formated text into a richtext focused control. I'm trying to do it with a cut from one and then paste into the other.

Here is my code:
Code: Select all  Expand view
   MemoWrit( cFile, cRtfTxt2BInserted )
   oMcrRtf := TRichEdit():New()
   oMcrRTF:LoadRTF( cFile )
   oMcrRtf:cFileName := cFile
   oMcrRtf:SetSel( 0, -1 )
   oMcrRtf:Copy()

   logfile( "trace.log", { cfile, oMcrRtf:GetText() } ) //debuging

   oMcrRtf:End()
   ferase( cfile )

   ::oRtf:Paste()
   ::oWnd:Setfocus()
   ::oRtf:Refresh()
   ::oRtf:SetSel( 0, 0 )

Where ::ortf is the focused rtf control where rtf formatted text is to be inserted.

The logfile instruction is only to monitor what text is inside oMcrRtf object. It is always empty eventhough cfile contains the rtf text allright. So obviously when :copy() is executed nothing is copied to the clipboard. I'm using :loadRtf( cfile ) in other places in my code without a problem. Why won't it work in this situation?

Can someone help?

Thank you,



Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 83 guests