Article View: comp.lang.pascal.delphi.misc
Article #279Re: VB is better! Sub/Superscript in Rich Edit Controls...or, Inserting RTF codes directly
From: Travis Elkins
Date: Fri, 22 Jan 1999 00:00
Date: Fri, 22 Jan 1999 00:00
189 lines
8824 bytes
8824 bytes
--------------09016CE84D636144A2F5F872
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Ken,
Hello. I don't recall whether or not WordPad supports super- or sub-scripts.
I rarely use it...except for the text files that are "too large for Notepad".
:-)
However, I believe you're wrong about it not being supported in TRichEdit just
because it's not supported in WordPad. In MSDN Library (the one with Visual
Studio 6.0), I was able to find a list of supported RTF, or rich text format,
codes. I think you'd be surprised at the number of things you can do with
it. I was. Anyway, within the codes are two: sub for subscript, and super
for superscript.
The only problem is, it doesn't mention how to go about using the codes. I
have been able to pick up a bit here and there, but most of it is fragmented
and vague. Also, I've finally found a way...rather complicated...to make
superscripts and subscripts within a TRichEdit control. I still have a long
ways to go, though, and it's far from user-friendly. That's why I'm still
hoping for someone to come up with a simpler method. (I go into more detail
in response to another posting.)
Another thing is this: the VB RTF control supports superscript and
subscript. Here's a chunk from the help file in the MSDN Library on the VB
RTF control:
The RichTextBox control provides a number of properties you can use to
apply formatting to any portion of text within the control. To change the
formatting of text, it must first be selected. Only selected text can be
assigned character and paragraph formatting. Using these properties, you
can make text bold or italic, change the color, and create superscripts
and subscripts. You can also adjust paragraph formatting by setting both
left and right indents, as well as hanging indents.
So, as you can see, it is supported in one language. And, I must say, it
appears much easier to implement in VB than in Delphi. (This doesn't happen
too often, in my humble experience, but it does happen.)
Anyway, I hope that someone can still help me (and, most likely, others) in
finding a solution.
Thanks for the response,
Travis
Ken White wrote:
> Travis,
>
> Are super/subscript supported in WordPad? I don't believe so... And
> since WordPad is just TRichEdit, anything not supported in WordPad
> isn't supported in TRichEdit.
>
> Ken
> --
> Ken White
>
> Clipper Functions for Delphi
> http://members.aol.com/clipfunc
>
> Travis Elkins wrote:
> >
> > Hello,
> >
> > First of all, I said, "VB is better!" both to attract attention and also
> > to point out that from the documentation that I can read it is simpler
> > to solve my problem in VB than in Delphi. But, PLEASE don't give me the
> > lectures about which is better. Hands down, I say Delphi ROCKS!
> >
> > My problem is this: I would like very much to programmatically create
> > super- or sub- scripts in a rich edit control. I can't seem to find any
> > documentation on how one would go about doing this. Even in the MS SDK
> > and Win32 help files...NOTHING! What's the deal? Is there anyone out
> > there that can help me?
> >
> > I have found a list of supported RTF codes in some MS documentation, but
> > I can't find anything on how to insert (and remove) the various codes.
> >
> > Any help would be appreciated. Oh, if you have some ideas, could you
> > please respond to my email address as well as the newsgroup?
> >
> > Thanks,
> >
> > Travis
--------------09016CE84D636144A2F5F872
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
Ken,
<P>Hello. I don't recall whether or not WordPad supports super- or
sub-scripts. I rarely use it...except for the text files that are
"too large for Notepad". :-)
<P>However, I believe you're wrong about it not being supported in TRichEdit
just because it's not supported in WordPad. In MSDN Library (the
one with Visual Studio 6.0), I was able to find a list of supported RTF,
or rich text format, codes. I think you'd be surprised at the number
of things you can do with it. I was. Anyway, within the codes
are two: sub for subscript, and super for superscript.
<P>The only problem is, it doesn't mention how to go about using the codes.
I have been able to pick up a bit here and there, but most of it is fragmented
and vague. Also, I've finally found a way...rather complicated...to
make superscripts and subscripts within a TRichEdit control. I still
have a long ways to go, though, and it's far from user-friendly.
That's why I'm still hoping for someone to come up with a simpler method.
(I go into more detail in response to another posting.)
<P>Another thing is this: the VB RTF control supports superscript
and subscript. Here's a chunk from the help file in the MSDN Library
on the VB RTF control:
<UL>The RichTextBox control provides a number of properties you can use
to apply formatting to any portion of text within the control. To change
the formatting of text, it must first be selected. Only selected text can
be assigned character and paragraph formatting. Using these properties,
you can make text bold or italic, change the color, and create superscripts
and subscripts. You can also adjust paragraph formatting by setting both
left and right indents, as well as hanging indents.</UL>
So, as you can see, it is supported in one language. And, I must
say, it appears much easier to implement in VB than in Delphi. (This
doesn't happen too often, in my humble experience, but it does happen.)
<P>Anyway, I hope that someone can still help me (and, most likely, others)
in finding a solution.
<P>Thanks for the response,
<P>Travis
<BR>
<P>Ken White wrote:
<BLOCKQUOTE TYPE=CITE>Travis,
<P>Are super/subscript supported in WordPad? I don't believe so... And
<BR>since WordPad is just TRichEdit, anything not supported in WordPad
<BR>isn't supported in TRichEdit.
<P>Ken
<BR>--
<BR>Ken White
<P>Clipper Functions for Delphi
<BR><A HREF="http://members.aol.com/clipfunc">http://members.aol.com/clipfunc</A>
<P>Travis Elkins wrote:
<BR>>
<BR>> Hello,
<BR>>
<BR>> First of all, I said, "VB is better!" both to attract attention and
also
<BR>> to point out that from the documentation that I can read it is simpler
<BR>> to solve my problem in VB than in Delphi. But, PLEASE don't
give me the
<BR>> lectures about which is better. Hands down, I say Delphi ROCKS!
<BR>>
<BR>> My problem is this: I would like very much to programmatically
create
<BR>> super- or sub- scripts in a rich edit control. I can't seem
to find any
<BR>> documentation on how one would go about doing this. Even in
the MS SDK
<BR>> and Win32 help files...NOTHING! What's the deal? Is there
anyone out
<BR>> there that can help me?
<BR>>
<BR>> I have found a list of supported RTF codes in some MS documentation,
but
<BR>> I can't find anything on how to insert (and remove) the various codes.
<BR>>
<BR>> Any help would be appreciated. Oh, if you have some ideas,
could you
<BR>> please respond to my email address as well as the newsgroup?
<BR>>
<BR>> Thanks,
<BR>>
<BR>> Travis</BLOCKQUOTE>
</HTML>
--------------09016CE84D636144A2F5F872--
Technical Details
Message-ID:
<36A82E8E.CDFFD60F@plusdata.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<36A5ECFA.C97294CE@plusdata.com> <36A787B3.355650DC@westelcom.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 104e31,341539ebf602c2f5 X-Google-Attributes: gid104e31,public X-Google-Thread: 10baee,341539ebf602c2f5 X-Google-Attributes: gid10baee,public X-Google-Thread: fd817,341539ebf602c2f5 X-Google-Attributes: gidfd817,public X-Google-Thread: 105ac8,341539ebf602c2f5 X-Google-Attributes: gid105ac8,public X-Google-Thread: f973d,341539ebf602c2f5 X-Google-Attributes: gidf973d,public X-Google-Thread: f894d,341539ebf602c2f5 X-Google-Attributes: gidf894d,public From: Travis Elkins <telkins@plusdata.com> Subject: Re: VB is better! Sub/Superscript in Rich Edit Controls...or, Inserting RTF codes directly Date: 1999/01/22 Message-ID: <36A82E8E.CDFFD60F@plusdata.com> X-Deja-AN: 435548647 References: <36A5ECFA.C97294CE@plusdata.com> <36A787B3.355650DC@westelcom.com> Content-Type: multipart/alternative; boundary="------------09016CE84D636144A2F5F872" X-Complaints-To: abuse@uni2.dk X-Trace: news.get2net.dk 916991710 192.38.197.18 (Fri, 22 Jan 1999 08:55:10 MET DST) Organization: UNI2 Internet Kunde MIME-Version: 1.0 NNTP-Posting-Date: Fri, 22 Jan 1999 08:55:10 MET DST Newsgroups: comp.lang.pascal.delphi.misc,comp.lang.pascal.delphi,borland.public.delphi,alt.lang.delphi,alt.comp.lang.borland-delphi,alt.comp.borland-delphi