BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

richedit codes

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Carl P. Singer
Guest





PostPosted: Fri Apr 23, 2004 8:39 pm    Post subject: richedit codes Reply with quote



Is it possible to format text in a RichEdit box other than the standard
formatting like bold, etc. In particular super- and sub-scripting. I can
paste such text into a RichEdit box, but can't seem to find code to set
super- or sub-scripting.

Thank you,

Carl Singer

Back to top
JD
Guest





PostPosted: Fri Apr 23, 2004 11:57 pm    Post subject: Re: richedit codes Reply with quote




"Carl P. Singer" <singer (AT) depauw (DOT) edu> wrote:
Quote:
Is it possible to format text in a RichEdit [...] In particular
super- and sub-scripting.

Yes.

Quote:
I can paste such text into a RichEdit box, but can't seem to
find code to set super- or sub-scripting.

Have you tried searching the web? Most likely not because I
found it in less than 5 minutes. Try using google or

http://www.tamaracka.com/search.htm

~ JD


Back to top
James Cammarata
Guest





PostPosted: Mon Apr 26, 2004 5:16 am    Post subject: Re: richedit codes Reply with quote



I freaking hate responses like that. If you're not going to help, don't
respond.

In response to the original question, yes it is possible to super- and
sub-script text with a rich edit control, but it is not built into the rich
edit control interface provided by Borland (as far as I know).

Here is a link to MS's RTF spec:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnrtfspec/html/rtfspec.asp

Here is MS's documentation on the RE control:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/richedit/richeditcontrols.asp

The RE documentation is really what you want to read, the RTF spec is just
nice as a kind of background info for the RE control.

I'll leave the code as a study for you to do, but to point you in the right
direction, you want to send an EM_SETCHARFORMAT message to the control,
along with a pointer to a CHARFORMAT2 structure that contains the formating
options you wish to set. Use the CFM_SUPERSCRIPT or CFM_SUBSCRIPT flags for
the dwMask member of CHARFORMAT2 and you should be good to go.

There are tons of options with a RE control that are not included in
Borland's implementation and they are not hard to figure out. Just do a
little experimentation and you'll love it :)


Back to top
JD
Guest





PostPosted: Mon Apr 26, 2004 5:54 am    Post subject: Re: richedit codes Reply with quote


"James Cammarata" <jimi (AT) sngx (DOT) net> wrote:
Quote:
I freaking hate responses like that. If you're not going to
help, don't respond.

Since the answer was so easily found, either the OP didn't
know how to find the answer himself OR he was too lazy to do
it. Either way, spoon-feeding him WAS NOT the answer. I stand
by my post.

BTW : you need to read the guidlines for using this group as
demonstrated by your post.

~ JD


Back to top
James Cammarata
Guest





PostPosted: Mon Apr 26, 2004 7:21 am    Post subject: Re: richedit codes Reply with quote

Quote:
Since the answer was so easily found, either the OP didn't
know how to find the answer himself ...

^ this is exactly why people ask for help, they cannot find the answer
themselves. I don't expect everyone to be masters of Google. I do
apologize for my tone earlier, I was in a pissy mood. I also appreciate
your help on my question (got me 90% in the direction I'm trying to go), but
I stand by my post too. The answer was not that easily found for me (took
3-4 days of searching and reading all those docs + experimenting with code),
and I would have appreciated a poke in the right direction to save me some
search time.

Like I said, I apologize, I'm not trying to start a flame war or troll or
anything, so this will be my last post on the subject.



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.