Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-01

HTML or RichText viewer components

7 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

Has anybody got experience with HTML or RichText viewer components? Has anybody implemented something like this?

I would like to start a HTML/RichText viewer component for fpGUI. Unfortunately I have no idea where to start. I guess trying to make the component HTML 4 and maybe CSS1 complaint would be a good idea.

This will obviously be a long term effort, but would come in very handy if fpGUI wanted to implement it's own HTML based Help Viewer or some Rich Text Viewer. There are lots of other uses for such a component as well.

I need some guidelines of the development process of such a component.... Anybody got some thoughts. Here are some 'off the top of my head' steps to follow.

1. I guess first thing would be to get some HTML parser. There are lots available, so that should be fairly easy.

2. Break down the document into parts (classes or some sort). Letters, Words, Lines, Paragraphs, Document.

3. Next I guess would be to implement simple text formatting as a start - Bold, Italics, Underline, font color etc...

4. A lot more.... :)

I guess I could look at Java or Qt class documentation for ideas of breaking down the classes.

Anybody got some thoughts or code to offer? Maybe somebody saw a article explaining such a process (no matter the language).

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

ik
to Graeme Geldenhuys
Graeme Geldenhuys wrote 20 lines
Hi, Has anybody got experience with HTML or RichText viewer components? Has anybody implemented something like this? I would like to start a HTML/RichText viewer component for fpGUI. Unfortunately I have no idea where to start. I guess trying to make the component HTML 4 and maybe CSS1 complaint would be a good idea. This will obviously be a long term effort, but would come in very handy if fpGUI wanted to implement it's own HTML based Help Viewer or some Rich Text Viewer. There are lots of other uses for such a component as well. I need some guidelines of the development process of such a component.... Anybody got some thoughts. Here are some 'off the top of my head' steps to follow. 1. I guess first thing would be to get some HTML parser. There are lots available, so that should be fairly easy.

First create HTML 3.2 complaint.. it's easier then HTML 4(.1). Then continue to HTML 4.1 :) The TV Pro have HTML 3.2 support...

2. Break down the document into parts (classes or some sort). Letters, Words, Lines, Paragraphs, Document.

There is a DOM. Please note that Om XHTML, the idea is that you have the actual data as HTML (or XML) and the part of how to display it (as CSS).

3. Next I guess would be to implement simple text formatting as a start - Bold, Italics, Underline, font color etc...
That's properties for text... If you are going to implement CSS, then
I belive it should arrive there rather then the HTML classes.
Show quoted text 9 lines
4. A lot more.... :) I guess I could look at Java or Qt class documentation for ideas of breaking down the classes. Anybody got some thoughts or code to offer? Maybe somebody saw a article explaining such a process (no matter the language).

Start slowly and simple... try to be able for example to understand where are you are the document, and what you should do as the main engine.
Also separate between the rendering and the parsing ! They are two different things.

And last, make it library (and API) based as one feature, so we will have a parsing and rendering engines to offer other languages, that will might create a community all around this project (at some point :))

Show quoted text 9 lines
Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Ido

Graeme Geldenhuys
to ik: First create HTML 3.2 complaint.. it's easier then HTML 4(.1). Then continue to HTML 4.1…
ik wrote
First create HTML 3.2 complaint.. it's easier then HTML 4(.1). Then continue to HTML 4.1 :) The TV Pro have HTML 3.2 support...

Easier is always better. :) What is TV Pro? Google gave me a variety of results.

There is a DOM. Please note that Om XHTML, the idea is that you have the actual data as HTML (or XML) and the part of how to display it (as CSS).

Ah, I see there is a DOM unit in FPC I could use.

Show quoted text 7 lines
Also separate between the rendering and the parsing ! They are two different things. And last, make it library (and API) based as one feature, so we will have a parsing and rendering engines to offer other languages, that will might create a community all around this project (at some point :))

Yes, that is what I had in mind. The rendering engine could then be implemented by other toolkits like fpGUI, LCL, MSEgui etc...

Thanks for the quick feedback Ido. I understand what you mean. Try and think small. A full blown HTML/RichText viewer is a huge project. Break it down into small pieces that in the end work together.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Graeme Geldenhuys
to Vincent Snijders: Code for html viewer: http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/components/turbop…
Vincent Snijders wrote 6 lines

Thanks Vincent. I'll have a look at what license they use before I peak at the code for ideas.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Jeff Pohlmeyer

David Baldwin's components are very nice, but maybe not so portable. I think they used to be closed-source, but the only license info I could find on his website now says:

"Complete source code is provided. The HTML Display Components may now be used without charge in any
application including those for sale or company use."

http://pbear.com/

- Jeff

Fabio Dell'Aria
to Jeff Pohlmeyer

Hi,

2008/1/8, Jeff Pohlmeyer :

Show quoted text 12 lines
David Baldwin's components are very nice, but maybe not so portable. I think they used to be closed-source, but the only license info I could find on his website now says: "Complete source code is provided. The HTML Display Components may now be used without charge in any application including those for sale or company use." http://pbear.com/ - Jeff

Another RTF viewer is here:
http://flocke.vssd.de/prog/code/pascal/rtflabel/

Best regards... Fabio Dell'Aria.