HTML or RichText viewer components

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

HTML or RichText viewer components

Graeme Geldenhuys-2
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/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: HTML or RichText viewer components

ik-6
On Jan 8, 2008 9:10 AM, Graeme Geldenhuys <[hidden email]> wrote:

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

>
> 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
:))

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



Ido
--
http://ik.homelinux.org/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: HTML or RichText viewer components

Vincent Snijders
In reply to this post by Graeme Geldenhuys-2
Graeme Geldenhuys schreef:
> Anybody got some thoughts or code to offer? Maybe somebody saw a
> article explaining such a process (no matter the language).

Code for html viewer:
http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/components/turbopower_ipro/?root=lazarus

Code for RTF viewer:
http://wiki.lazarus.freepascal.org/RichView

Vincent
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: HTML or RichText viewer components

Graeme Geldenhuys-2
In reply to this post by ik-6
On 08/01/2008, ik <[hidden email]> 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.


> 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/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: HTML or RichText viewer components

Graeme Geldenhuys-2
In reply to this post by Vincent Snijders
On 08/01/2008, Vincent Snijders <[hidden email]> wrote:
>
> Code for html viewer:
> http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/components/turbopower_ipro/?root=lazarus
>
> Code for RTF viewer:
> http://wiki.lazarus.freepascal.org/RichView


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/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: HTML or RichText viewer components

Jeff Pohlmeyer
In reply to this post by Graeme Geldenhuys-2
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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Re: HTML or RichText viewer components

Fabio Dell'Aria
Hi,

2008/1/8, Jeff Pohlmeyer <[hidden email]>:

> 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.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal