Real Software Forums
http://forums.realsoftware.com/

Formatted Text Control (FTC) Help - How to do Text Uppercase
http://forums.realsoftware.com/viewtopic.php?f=20&t=40382
Page 1 of 1

Author:  eddy2099 [ Mon Aug 22, 2011 3:03 pm ]
Post subject:  Formatted Text Control (FTC) Help - How to do Text Uppercase

I am beginning to work with FTC as the provided TextArea could not really handle some imported RTF files. Although FTC solves many of my issues, I just could not grasp how to handle some seemingly basic functions. I guess I am just stupid, no matter how many times I go through the provided example and the help file. I did find some ways of getting some things done by experimenting around and after weeks, I could get something done.

However, there are some things I still cannot do. Firstly, I know how to determine the length of the selected text by doing a formattedtext1.getdoc.getSelectionLength but how do I go about determining the text which has been selected ?

Secondly, I do not know how to do a simple convert all text to uppercase while retaining the styles. I tried doing a formattedtext1.setrtf(uppercase(formattedtext1.getrtf)) but it mess the rtf tags which are supposed to be in lowercase. That method works with converting text to lowercase.

I contacted Brendan and he told me to look at the FTInterator class as template and to walk through the paragraphs and then for each paragraph change the case of each FTStylerun. I looked at the HTMLInterator and try to replicate it without success. I feel really stupid because I really do not understand how to do it. I was wondering if there is a simple example of how to accomplish this.

Thanks.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/