Thread View: comp.lang.pascal.delphi.misc
11 messages
11 total messages
Started by Travis Elkins
Wed, 20 Jan 1999 00:00
VB is better! Sub/Superscript in Rich Edit Controls...or, Inserting RTF codes directly
Author: Travis Elkins
Date: Wed, 20 Jan 1999 00:00
Date: Wed, 20 Jan 1999 00:00
22 lines
2164 bytes
2164 bytes
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
Re: VB is better! Sub/Superscript in Rich Edit Controls...or, Inserting RTF codes directly
Author: Alan MacArthur
Date: Thu, 21 Jan 1999 00:00
Date: Thu, 21 Jan 1999 00:00
29 lines
2494 bytes
2494 bytes
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 I am also working on this with a near-term deadline. If we could find the rtf text (including codes) we could insert text quite easily. However, RichEdit.Text is just the text, NOT the rtf codes. I don't know, but if you find out, PLEASE let me know, too! Thanks.
Re: VB is better! Sub/Superscript in Rich Edit Controls...or, Inserting RTF codes directly
Author: Ken White
Date: Thu, 21 Jan 1999 00:00
Date: Thu, 21 Jan 1999 00:00
37 lines
2375 bytes
2375 bytes
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
Re: VB is better! Sub/Superscript in Rich Edit Controls...or, Inserting RTF codes directly
Author: 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--
Re: VB is better! Sub/Superscript in Rich Edit Controls...or, Inserting RTF codes directly
Author: Travis Elkins
Date: Fri, 22 Jan 1999 00:00
Date: Fri, 22 Jan 1999 00:00
54 lines
3621 bytes
3621 bytes
Hi Alan, and thanks for the response. Yes, I've also discovered exactly what you're saying. I have the codes that I need, but I don't know how to insert (or remove) them. As you've pointed out, we seem to only be able to access the text, and nothing more. I think if someone can give us a clue as to how one inserts and manipulates the codes, then it would help a lot. Is there anyone out there...? :-) For now, what I've done is to use the EM_GETCHARFORMAT and EM_SETCHARFORMAT messages along with the CHARFORMAT structure. It's a bit messy right now, and only serves to imitate the actual sub- and super-scripting behavior. I don't like to have to do it this way, but it's all I have right now. I don't know if this "methodology" will help you out, but it might serve until we find out how to actually insert the codes. Or, it could end up being too much trouble. :-) Anyway, I'll be sure to say something to you if I find out anything more. Thanks, Travis Alan MacArthur wrote: > 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 > > I am also working on this with a near-term deadline. If we could find > the rtf text (including codes) we could insert text quite easily. > However, RichEdit.Text is just the text, NOT the rtf codes. I don't > know, but if you find out, PLEASE let me know, too! Thanks.
Re: VB is better! Sub/Superscript in Rich Edit Controls...or, Inserting RTF codes directly
Author: Bruce Roberts
Date: Fri, 22 Jan 1999 00:00
Date: Fri, 22 Jan 1999 00:00
30 lines
2311 bytes
2311 bytes
Its not very elegant, but what you can do is use richedit.lines.savetostream to get the data in a memorystream. Then insert the codes you want in the appropriate places - they are just plain text codes - and use richedit.lines.loadfromstream to update the control. Travis Elkins wrote in message <36A5ECFA.C97294CE@plusdata.com>... >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 >
Re: VB is better! Sub/Superscript in Rich Edit Controls...or, Inserting RTF codes directly
Author: Paul Mason
Date: Mon, 25 Jan 1999 00:00
Date: Mon, 25 Jan 1999 00:00
33 lines
2247 bytes
2247 bytes
Hi Have a look at the EM_SETCHARFORMAT message and the CHARFORMAT structure (dwMask) in the Win32 help file - it may be what you are looking for. Hope this helps. Paul Travis Elkins wrote in message <36A5ECFA.C97294CE@plusdata.com>... >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 >
Re: VB is better! Sub/Superscript in Rich Edit Controls...or, Inserting RTF codes directly
Author: Travis Elkins
Date: Mon, 25 Jan 1999 00:00
Date: Mon, 25 Jan 1999 00:00
43 lines
3036 bytes
3036 bytes
Bruce, Thank you for your input. As far as using the actual RTF codes, this seems to be one of the better suggested solutions. Many of the others are what I consider "work-arounds". I mean, the will do the job, and the text will appear properly to the user, but if you open up the RTF data, there will be no signs of /super or /sub RTF codes. Thanks again, Travis Bruce Roberts wrote: > Its not very elegant, but what you can do is use richedit.lines.savetostream > to get the data in a memorystream. Then insert the codes you want in the > appropriate places - they are just plain text codes - and use > richedit.lines.loadfromstream to update the control. > > Travis Elkins wrote in message <36A5ECFA.C97294CE@plusdata.com>... > >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 > >
Re: VB is better! Sub/Superscript in Rich Edit Controls...or, Inserting RTF codes directly
Author: Travis Elkins
Date: Mon, 25 Jan 1999 00:00
Date: Mon, 25 Jan 1999 00:00
54 lines
3461 bytes
3461 bytes
Paul, Thanks for your input. I have managed to find the message and structure that you mentioned. It appears as though that's one of the only ways to have superscript or subscript in a Rich Edit control. However, I do consider this only a "work-around". I mean, it will do the job, and the text will appear properly to the user, but if you open up the RTF data, there will be no signs of /super or /sub RTF codes....only signs of the RTF codes that have to do with the character formats. A great solution, I think, would be a way to insert and remove RTF codes, and not have to use EM_SETCHARFORMAT and CHARFORMAT. But, for the time being, this appears to be one of the only solutions. There is also a proposed solution from Bruce in this thread that I haven't tried yet. It looks good, in theory, and I intend to try it out ASAP. Thanks again for your time, Travis Paul Mason wrote: > Hi > > Have a look at the EM_SETCHARFORMAT message and the CHARFORMAT structure > (dwMask) in the Win32 help file - it may be what you are looking for. > > Hope this helps. > Paul > > Travis Elkins wrote in message <36A5ECFA.C97294CE@plusdata.com>... > >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 > >
Re: VB is better! Sub/Superscript in Rich Edit Controls...or, Inserting RTF codes directly
Author: Oracle
Date: Mon, 25 Jan 1999 00:00
Date: Mon, 25 Jan 1999 00:00
13 lines
1665 bytes
1665 bytes
Building on Bruce's suggestion: Why not derive a new component from TRichEdit, with your customized procedures. My suggestion would be to have a TStringList structure that holds the unformatted RTF data, and store the data in a memorystream for the RichEdit to load from. It's just a suggestion,... I haven't tried it before. Oracle <oracle-zzz-@bmts.com> Remove the "-zzz-" to reply by mail
Re: VB is better! Sub/Superscript in Rich Edit Controls...or, Inserting RTF codes directly
Author: Thomas
Date: Mon, 08 Feb 1999 00:00
Date: Mon, 08 Feb 1999 00:00
19 lines
1677 bytes
1677 bytes
Ken White <kwhite@westelcom.com> skrev i artiklen
<36A787B3.355650DC@westelcom.com>...
> 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.
>
>
Wordpad kan show superscript, eg. created by WORD.
===
The rtf code for 5^2 is as follows:
\par \pard\plain\f2\fs36 5\plain\f2\fs24\up18 2
Regards Thomas Riedel
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads