New topic: 

styled text

<http://forums.realsoftware.com/viewtopic.php?t=38415>

         Page 1 of 1
   [ 6 posts ]                 Previous topic | Next topic          Author  
Message        aamato          Post subject: styled textPosted: Wed Mar 30, 
2011 8:29 pm                         
Joined: Tue Feb 12, 2008 6:12 pm
Posts: 17                I find styled text difficult to manage. I have a 
simple problem that I cannot solve.
I need to get a selected styledtext from a textarea and put in another 
textarea, but keeping all the style.
The SelText wipes all the style.

How should I do that ??

Thanks a lot


Alexandre Amato
http://www.amato.com.br   
                             Top                Bob Keeney          Post 
subject: Re: styled textPosted: Wed Mar 30, 2011 9:27 pm                        
         
Joined: Fri Sep 30, 2005 11:48 am
Posts: 2273
Location: Lenexa, KS                Look at 
http://docs.realsoftware.com/index.php/TextArea.SetTextAndStyle.  Instructions 
there on how to set the new one and the two properties to get the data from.    
  
_________________
Bob K.

30+ hours of Real Studio Video Training (including over 6 hours of Web Edition) 
at http://www.bkeeney.com/
Real Studio Consulting http://www.bkeeney.com/consulting/real-studio-consulting 
     
BKeeney Briefs Blog For Real Studio Developers http://www.bkeeneybriefs.com/  
                             Top                 Jym          Post subject: Re: 
styled textPosted: Wed Mar 30, 2011 9:34 pm                         
Joined: Sat Oct 01, 2005 5:19 pm
Posts: 2344                If it's just one style that is going to be Selected 
then it's not that difficult (i.e. bold, blue and not italic) however if there 
is more than one style in the Selected Text it's a little more complicated.  
i.e. half the text is green and the other half is blue.

You need to make a new stylerun for each style and set the parameters 
accordingly.  If you are just copying text then that's all you get .. the text. 
 You also need to set the bold, underline, fontsize, fontname ... 

Dim myStyleRun as New StyleRun
myStyleRun.Bold = TextArea1.SelBold

and so forth  ...or Bob's suggestion which I didn't know about    
                             Top                aamato          Post subject: 
Re: styled textPosted: Wed Mar 30, 2011 9:42 pm                         
Joined: Tue Feb 12, 2008 6:12 pm
Posts: 17                There are 3 different styles,  normal, bold and 
italic. But I know sometimes bold is not set, thats because it is using a bold 
font... this font has bold in its name, so the style is not recognized as bold, 
just another font.
Although TextArea.SetTextAndStyle.  seems nice, one line of explanation in the 
manual was not enough to clarify me how could I do that.
Jym, I will study your suggestion 
Thanks   
                             Top                Jym          Post subject: Re: 
styled textPosted: Wed Mar 30, 2011 9:53 pm                         
Joined: Sat Oct 01, 2005 5:19 pm
Posts: 2344                If all the text that is selected is the same i.e. 
abcdef bold, italic then you only need the one stylerun but if you have 
something like abcdefghi then you will need more than one stylerun   
                             Top                aamato          Post subject: 
Re: styled textPosted: Wed Mar 30, 2011 9:58 pm                         
Joined: Tue Feb 12, 2008 6:12 pm
Posts: 17                is it possible maybe to get only the selected text and 
convertit to RTF and then convert back to styled text in the new textarea ?   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 6 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to