Files
lazarus-ccr/components/geckoport/SampleApps/gec10.pas
macpgmr f7642d12d1 First commit of GeckoPort source
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1009 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2009-11-15 23:34:54 +00:00

70 lines
1.6 KiB
ObjectPascal
Executable File

unit gec10;
interface
uses
{$IFNDEF LCL} Windows, Messages, {$ELSE} LclIntf, LMessages, LclType, LResources, {$ENDIF}
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, GeckoBrowser, StdCtrls;
type
TForm1 = class(TForm)
GeckoBrowser1: TGeckoBrowser;
ListBox1: TListBox;
lblProg: TLabel;
lblProgMax: TLabel;
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}
{$ENDIF}
procedure TForm1.FormShow(Sender: TObject);
begin
// GeckoBrowser1.LoadURI('http://www.yahoo.com', 0, '', '', '');
GeckoBrowser1.LoadURI('http://www.lazarus.freepascal.org');
end;
procedure TForm1.GeckoBrowser1StatusChange(Sender: TObject;
aMessage: WideString);
begin
ListBox1.Items.Add(aMessage);
Application.ProcessMessages;
end;
procedure TForm1.GeckoBrowser1ProgressChange(Sender: TObject; Progress,
ProgressMax: Integer);
begin
lblProg.Caption := IntToStr(Progress);
lblProgMax.Caption := IntToStr(ProgressMax);
Application.ProcessMessages;
end;
procedure TForm1.GeckoBrowser1LocationChange(Sender: TObject;
const uri: string);
begin
// showmessage(uri);
end;
initialization
{$IFDEF LCL}
{$I gec10.lrs} {Include form's resource file}
{$ENDIF}
end.