Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Nov 18, 2019 1:17 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Styled text information lost after drag and drop
PostPosted: Wed Sep 21, 2011 4:01 pm 
Offline

Joined: Sun Mar 18, 2007 2:42 pm
Posts: 71
Location: Versailles, France
Hi

My app is supposed to receive styled text from MS Word via drag and drop as follows:

1) The text on MS Word is formatted (bold, italic, color etc.)
2) the user selects the text in MS Word and drags it to a Textarea1 in my app
3) the Textarea1 is configured to 'accepttextdrop' and has the following code in the drop event:

textarea1.text = obj.text


The result is that the text is effectively moved to my Textarea1 but has lost the formatting; it is just plain text.

I have tried this but it does not work, as obj does not have styledtext property:

textarea1.styledtext = obj.styledtext



Any idea what I should do to keep the original formatting ? :?:

Thx

Endive


Top
 Profile  
Reply with quote  
 Post subject: Re: Styled text information lost after drag and drop
PostPosted: Wed Sep 21, 2011 4:30 pm 
Offline

Joined: Sun Mar 18, 2007 2:42 pm
Posts: 71
Location: Versailles, France
Ok I think I found the solution:

in the open event of the Textarea I put the following:

me.accepttextdrop
me.AcceptRawDataDrop("styl")


In the dropobject event I put the following:

me.styledtext.RTFData = obj.RawData("styl")
me.text = obj.text


Assuming the Textarea is enabled when you drop the text, the dropped text is formatted. :wink:

Endive


Top
 Profile  
Reply with quote  
 Post subject: Re: Styled text information lost after drag and drop
PostPosted: Thu Sep 22, 2011 4:15 pm 
Offline

Joined: Sun Mar 18, 2007 2:42 pm
Posts: 71
Location: Versailles, France
hummm, :(

no that's not working.

In fact when the drop occurs on a Textarea, no issue. But the problem is when I drop on the Window (which has a accepttextdrop in its open event); In the DropObject event of the Window, the code I put to copy the dropped styled text into the Textarea (same as code copied above), copies the plain text and not the styled text...

I need to work again on that..

Endive


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group