 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
John Taylor-Johnston Guest
|
Posted: Sat Feb 28, 2004 4:14 am Post subject: newbie html editor |
|
|
I'm looking for code, or for help. I would use a Richedit using this:
How plainf2fs20cf1ulstrike are plainf2fs20cf0 you?
and be able to generate html, doing really nothing more than this:
How are <a href="javascript:alert('Message')">you</a>?
Any ideas where I can start? I would need to "gap" words in the rtf and some how store my "Messages" in a list. Would I use a Tstringlist a TQList or ... ?
I'm not so newbie, but not skilled enough to get started? I can do php, but not this I would like to find an example someplace, something I can hack and learn from example.
John
|
|
| Back to top |
|
 |
Jeremy Collins Guest
|
Posted: Sat Feb 28, 2004 7:36 am Post subject: Re: newbie html editor |
|
|
John Taylor-Johnston wrote:
| Quote: | I'm looking for code, or for help. I would use a Richedit using this:
How plainf2fs20cf1ulstrike are plainf2fs20cf0 you?
and be able to generate html, doing really nothing more than this:
How are <a href="javascript:alert('Message')">you</a>?
Any ideas where I can start? I would need to "gap" words in the rtf and some how store my "Messages" in a list. Would I use a Tstringlist a TQList or ... ?
I'm not so newbie, but not skilled enough to get started? I can do php, but not this I would like to find an example someplace, something I can hack and learn from example.
|
Well, you can easily find the RTF spec via a Google search,
and searching for "Delphi parser" will give you lots of links
on how to write a parser.
It would be far simply to examine the TFont properties of
the text in a TRichEdit, and generate the HTML code from
that, something like
function GenerateHTML(AFont : TFont; const s : string) : string;
begin
if fsStrikeout in AFont.Style then
Result := Format('<a href="javascript:alert(''Message'')">%s</a>',
[s]);
if fsBold in AFont.Style then
Result := Format('%s', [Result]);
//etc
end;
--
jc
Remove the -not from email
|
|
| Back to top |
|
 |
John Taylor-Johnston Guest
|
Posted: Sat Feb 28, 2004 7:34 pm Post subject: Re: newbie html editor |
|
|
Jeremy,
Thanks. But It would also have to work like an editor where I would store "Message" somewhere, somehow, as if it were embedded. I have thought of Tlist or tqlist. But creating the gui so I can add insert update and delete items in my tlist.
I might as well face it. I can do PHP; I just get discouraged with Delphi. Maybe because of the availabel of Open SOurce code to hack and build upon. But the harder I try on this project, the harder I fall. It's been a project I've toyed with for a long time.
| Quote: | How plainf2fs20cf1ulstrike are plainf2fs20cf0 you?
How are <a href="javascript:alert('Message')">you</a>?
It would be far simply to examine the TFont properties of
the text in a TRichEdit, and generate the HTML code from
that, something like
function GenerateHTML(AFont : TFont; const s : string) : string;
begin
if fsStrikeout in AFont.Style then
Result := Format('<a href="javascript:alert(''Message'')">%s</a>',
[s]);
if fsBold in AFont.Style then
Result := Format('%s', [Result]);
//etc
end;
|
|
|
| Back to top |
|
 |
|
|
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
|
|