Lazarus

Programming => Packages and Libraries => Lazarus Extra Components => Topic started by: Andy on September 12, 2006, 07:39:38 pm

Title: Complex HTML-Viewer Component?
Post by: Andy on September 12, 2006, 07:39:38 pm
Hello,
is it possible to include a browser (HTML-Viewer) in the application? I need something like TWebBrowser or TMozillaBrowser (ActiveX-Objects for Delphi/Win32). But it must run under Win32 and Linux and display complex homepages with CSS 2.0 and so on. Do you know anything?

EDIT: Sorry, I have posted in the false forum.
Title: RE: Complex HTML-Viewer Component?
Post by: CCRDude on September 12, 2006, 08:10:55 pm
I know this (http://pbear.com/) quite nice one from Delphi, no idea on how compatible to Lazarus it would be.

Then there's the TurboPower one somewhere I guess (TIpHtmlPanel).
Title: Re: RE: Complex HTML-Viewer Component?
Post by: Andy on September 12, 2006, 08:44:23 pm
Hi,
Quote from: "CCRDude"
I know this (http://pbear.com/) quite nice one from Delphi, no idea on how compatible to Lazarus it would be.

I will test this tomorrow.
Quote from: "CCRDude"


Then there's the TurboPower one somewhere I guess (TIpHtmlPanel).


I have seen the component. But I don't have an idea how to use this. And the help of lazarus don't include a usage tutorial of this component. Can you say me how to use?

Thank you :-)
Title: RE: Re: RE: Complex HTML-Viewer Component?
Post by: RudieD on September 18, 2006, 01:34:05 pm
As far as I know the TIpHtmlPanel doesn't support css.
Title: Re: RE: Re: RE: Complex HTML-Viewer Component?
Post by: felipemdc on September 18, 2006, 11:54:59 pm
Quote from: "RudieD"
As far as I know the TIpHtmlPanel doesn't support css.


It´s open source isn´t it? So it would be great if someone extends it to support css =)

Or posts a bounty http://wiki.lazarus.freepascal.org/Bounties
Title: RE: Re: RE: Re: RE: Complex HTML-Viewer Component?
Post by: RudieD on September 19, 2006, 01:32:38 pm
Hi Sekel,

I'm trying to get the time to extend it. I want to see if we can't maybe make use of PSP 1.6.x oo version. If it works out, we don't have to duplicate so much code. If XHTML is later extended, we just need to keep the libs in PSP up to date.
Title: Re: RE: Re: RE: Re: RE: Complex HTML-Viewer Component?
Post by: L505 on November 18, 2006, 02:59:46 am
On win32 another option is to grab the handle of a real web browser and do some setparent() tricks.. Actually in windows 2000 I don't think setparent works across process boundries. But you could still setwindowpos and lock a real web browser into a lazarus form.

I'm not expert enough in GTK on linux to know if you can do the same thing - like setwindowpos. In windows I've done this before when I need to take another application and steal it into my own.. for example, locking an internet explorer window into a form without ever using an activex component. In Windows 98 I think it was possible with a single setparent call and a few stayontop tricks using the windows API - then in windows 2000 and up, one had to use setwindowpos and stayontop trick. In GTK I have no idea.

That's just an alternative for you to think about if you can't get a component ready. This idea works good for other web browsers such as Opera or other programs, because Opera and other programs will never have a ActiveX style component. But by using this setwindowpos and stayontop tricks you can take any web browser, whether it has activex style control or not, and lock it (steal it) into your application.
Title: Re: RE: Re: RE: Re: RE: Complex HTML-Viewer Component?
Post by: L505 on November 18, 2006, 03:02:13 am
Quote from: "RudieD"
Hi Sekel,

I'm trying to get the time to extend it. I want to see if we can't maybe make use of PSP 1.6.x oo version. If it works out, we don't have to duplicate so much code. If XHTML is later extended, we just need to keep the libs in PSP up to date.


Do you mean to make some sort of PSP preview feature.. so that one can preview their compiled PSP application in a web browser of an IDE?
Title: RE: Re: RE: Re: RE: Re: RE: Complex HTML-Viewer Component?
Post by: SergKam on November 22, 2006, 05:16:29 pm
we need mozilla(firefox) expert developer to use Gecko with pascal.
Title: RE: Re: RE: Re: RE: Re: RE: Complex HTML-Viewer Component?
Post by: RudieD on November 23, 2006, 02:26:51 pm
[quoted]Do you mean to make some sort of PSP preview feature.. so that one can preview their compiled PSP application in a web browser of an IDE?[/quoted]
Title: RE: Re: RE: Re: RE: Re: RE: Complex HTML-Viewer Component?
Post by: RudieD on November 23, 2006, 02:35:36 pm
Sorry , trigger happy finger !

Quote
Do you mean to make some sort of PSP preview feature.. so that one can preview their compiled PSP application in a web browser of an IDE?


Yes, by making a list off links between PSP OO version objects and delphi components for example input type=bottun -> TButton;textarea -> TMemo; div -> TPanel ... Then comes the JAVA integrpreter that will take most of the time.

This way we can make use of the same clases in PSP and in the browser. Still have to work the finer detayls out !
Title: Re: RE: Complex HTML-Viewer Component?
Post by: abb on March 11, 2007, 08:39:38 am
Quote from: "Andy"
I will test this tomorrow.

Hi, Any results? I'm very interested in portation of this component into Lazarus (in particular into Carbon widgetset), because I'm using it for some years in Delphi. It is very powerful, unicode-safe and now it's free with full source.

This component uses some third-party libs for GIF and PNG images showing. These libs also should be ported into Lazarus.
Title: RE: Re: RE: Complex HTML-Viewer Component?
Post by: kelcio on June 30, 2007, 07:54:18 am
hi gentlemen, I also am needing to make a navigator in lazarus. Somebody knows if the TWebBrowser of the Delphi already was ported?

Thanks.

Kelcio Casemiro. Brazil.
Title: RE: Re: RE: Complex HTML-Viewer Component?
Post by: kelcio on June 30, 2007, 07:58:18 am
if somebody will have a source of as to use the IpHTMLPanel I am thankful.
IpHtmlPanel1.openURL ('http://www.lazarus.freepascal.org');
it never functions.

Thanks.

Kelcio Casemiro. Brazil.
Title: RE: Re: RE: Complex HTML-Viewer Component?
Post by: antonio on June 30, 2007, 08:36:33 am
TWebBrowser is on this list of components: http://wiki.lazarus.freepascal.org/Lazarus_Components

What exactly happens with IpHtmlPanel?
Title: Complex HTML-Viewer Component?
Post by: greendayzero on December 26, 2007, 11:14:52 am
{ I did a search and found the TurboPower sourceforge page.  was searching for something I'm working on.

To use IPHtmlPanel, try this: }

procedure TForm1.Button3Click(Sender: TObject);
var sl    : TStringList;
      ms  : TMemoryStream;
      htm l: TIpHtml;
begin
     try
     ms:=TMemoryStream.Create;
     try
        sl:=StringListLoader(sl,'my.html');
        sl.SaveToStream(ms);
        html:=TIpHtml.Create;
        ms.seek(0,0);
        html.LoadFromStream(ms);
        IpHtmlPanel1.SetHtml(html);
        finally
        ms.free;
     end;
     finally
     sl.free;
 end;
end;        
{
Tried to format nicely, didn't allow  :(
In conclusion,

Tim }
Title: Complex HTML-Viewer Component?
Post by: greendayzero on December 26, 2007, 08:27:39 pm
My apologies, I used a custom function in the last post.  Here are the required corrections to make it work right:

procedure TForm1.Button3Click(Sender: TObject);
var sl : TStringList;
ms : TMemoryStream;
htm l: TIpHtml;
begin
 try
     ms:=TMemoryStream.Create;
     sl:=TStringList.Create;
     try
        sl.LoadFromFile('my.html');
        sl.SaveToStream(ms);
        html:=TIpHtml.Create;
        ms.seek(0,0);
        html.LoadFromStream(ms);
        IpHtmlPanel1.SetHtml(html);
        finally
        ms.free;
     end;
     finally
     sl.free;
  end;
end;
Title: Re: Complex HTML-Viewer Component?
Post by: Whiterawen on July 21, 2010, 08:02:35 pm
Quote from: RudieD
As far as I know the TIpHtmlPanel doesn't support css.

It´s open source isn´t it? So it would be great if someone extends it to support css =)

Or posts a bounty http://wiki.lazarus.freepascal.org/Bounties

Now I'm started to rewriting code of TIpHTML* components to partially support CSS 2.0 such as foreground/background images, colors and shapes. I don't planned to implement layers and full PNG support on All platforms. I already fix some bugs and make some of improves in code, that now it full support CSS color and background color assignment.
Probably I had post code to the my website after it Beta or Full Relise.
TinyPortal © 2005-2018