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 

newbie html editor

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc
View previous topic :: View next topic  
Author Message
John Taylor-Johnston
Guest





PostPosted: Sat Feb 28, 2004 4:14 am    Post subject: newbie html editor Reply with 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 Smile I would like to find an example someplace, something I can hack and learn from example.

John

Back to top
Jeremy Collins
Guest





PostPosted: Sat Feb 28, 2004 7:36 am    Post subject: Re: newbie html editor Reply with quote



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 Smile 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





PostPosted: Sat Feb 28, 2004 7:34 pm    Post subject: Re: newbie html editor Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc 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.