2012-03-16 11:32:18 +00:00
|
|
|
unit gec10;
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
|
|
|
{$IFNDEF LCL} Windows, Messages, {$ELSE} LclIntf, LMessages, LclType, LResources, {$ENDIF}
|
|
|
|
SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
2012-03-19 13:33:52 +00:00
|
|
|
Dialogs, GeckoBrowser, StdCtrls, ExtCtrls;
|
2012-03-16 11:32:18 +00:00
|
|
|
|
|
|
|
type
|
2012-03-19 13:33:52 +00:00
|
|
|
|
|
|
|
{ TForm1 }
|
|
|
|
|
2012-03-16 11:32:18 +00:00
|
|
|
TForm1 = class(TForm)
|
|
|
|
GeckoBrowser1: TGeckoBrowser;
|
|
|
|
ListBox1: TListBox;
|
|
|
|
lblProg: TLabel;
|
|
|
|
lblProgMax: TLabel;
|
2012-03-19 13:33:52 +00:00
|
|
|
Panel1: TPanel;
|
|
|
|
Splitter1: TSplitter;
|
2012-03-16 11:32:18 +00:00
|
|
|
procedure GeckoBrowser1LocationChange(Sender: TObject; const uri: string);
|
|
|
|
procedure GeckoBrowser1ProgressChange(Sender: TObject; Progress,
|
|
|
|
ProgressMax: Integer);
|
|
|
|
procedure GeckoBrowser1StatusChange(Sender: TObject;
|
|
|
|
aMessage: WideString);
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
private
|
|
|
|
{ Private declarations }
|
|
|
|
public
|
|
|
|
{ Public declarations }
|
|
|
|
end;
|
|
|
|
|
|
|
|
var
|
|
|
|
Form1: TForm1;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
{$IFNDEF LCL}
|
|
|
|
{$R *.dfm}
|
2012-03-19 13:33:52 +00:00
|
|
|
{$ELSE}
|
|
|
|
{$R *.lfm}
|
2012-03-16 11:32:18 +00:00
|
|
|
{$ENDIF}
|
|
|
|
|
|
|
|
procedure TForm1.FormShow(Sender: TObject);
|
|
|
|
begin
|
|
|
|
GeckoBrowser1.LoadURI('http://www.lazarus.freepascal.org');
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TForm1.GeckoBrowser1StatusChange(Sender: TObject;
|
|
|
|
aMessage: WideString);
|
|
|
|
begin
|
|
|
|
ListBox1.Items.Add(aMessage);
|
2012-03-19 13:33:52 +00:00
|
|
|
ListBox1.Selected[ListBox1.Count-1]:=true;
|
2012-03-16 11:32:18 +00:00
|
|
|
Application.ProcessMessages;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TForm1.GeckoBrowser1ProgressChange(Sender: TObject; Progress,
|
|
|
|
ProgressMax: Integer);
|
|
|
|
begin
|
|
|
|
lblProg.Caption := IntToStr(Progress);
|
|
|
|
lblProgMax.Caption := IntToStr(ProgressMax);
|
|
|
|
Application.ProcessMessages;
|
|
|
|
end;
|
|
|
|
|
2012-03-19 13:33:52 +00:00
|
|
|
procedure TForm1.GeckoBrowser1LocationChange(Sender: TObject; const uri: string);
|
2012-03-16 11:32:18 +00:00
|
|
|
begin
|
2012-03-19 13:33:52 +00:00
|
|
|
Caption := uri;
|
2012-03-16 11:32:18 +00:00
|
|
|
end;
|
|
|
|
|
|
|
|
end.
|