NOT PART OF BUILD. Delphi sample using ActiveX control

git-svn-id: svn://10.0.0.236/trunk@81810 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
locka%iol.ie 2000-10-26 17:06:28 +00:00
parent fc24bed70d
commit f821f5c184
5 changed files with 180 additions and 0 deletions

View File

@ -0,0 +1,91 @@
unit form;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, OleCtrls, SHDocVw_TLB, MOZILLACONTROLLib_TLB, ExtCtrls,
ComCtrls;
type
TMainForm = class(TForm)
Browser: TMozillaBrowser;
Panel: TPanel;
Status: TPanel;
Address: TComboBox;
Go: TButton;
WebProgress: TProgressBar;
Stop: TButton;
procedure GoClick(Sender: TObject);
procedure FormResize(Sender: TObject);
procedure OnStatusTextChange(Sender: TObject; const Text: WideString);
procedure OnProgressChange(Sender: TObject; Progress,
ProgressMax: Integer);
procedure StopClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
MainForm: TMainForm;
implementation
{$R *.DFM}
procedure TMainForm.GoClick(Sender: TObject);
var Flags, TargetFrameName, PostData, Headers: OleVariant;
begin
Flags := 0;
Browser.Navigate(Address.Text, Flags, TargetFrameName, PostData, Headers);
end;
procedure TMainForm.FormResize(Sender: TObject);
var
oldPanelWidth : Integer;
begin
oldPanelWidth := Panel.Width;
Panel.Top := MainForm.ClientHeight - Panel.Height;
Panel.Width := MainForm.ClientWidth;
Go.Left := Go.Left + Panel.Width - oldPanelWidth;
WebProgress.Left := WebProgress.Left + Panel.Width - oldPanelWidth;
Address.Width := Address.Width + Panel.Width - oldPanelWidth;
Status.Width := Status.Width + Panel.Width - oldPanelWidth;
Browser.Width := MainForm.ClientWidth;
Browser.Height := MainForm.ClientHeight - Panel.Height;
end;
procedure TMainForm.OnStatusTextChange(Sender: TObject;
const Text: WideString);
begin
Status.Caption := Text;
end;
procedure TMainForm.OnProgressChange(Sender: TObject; Progress,
ProgressMax: Integer);
begin
if Progress < 0 then
begin
WebProgress.Position := 0;
WebProgress.Max := 100;
end
else if ProgressMax < Progress then
begin
WebProgress.Position := Progress;
WebProgress.Max := Progress * 10;
end
else
begin
WebProgress.Position := Progress;
WebProgress.Max := ProgressMax;
end
end;
procedure TMainForm.StopClick(Sender: TObject);
begin
Browser.Stop();
end;
end.

View File

@ -0,0 +1,75 @@
[Compiler]
A=1
B=0
C=1
D=1
E=0
F=0
G=1
H=1
I=1
J=1
K=0
L=1
M=0
N=1
O=1
P=1
Q=0
R=0
S=0
T=0
U=0
V=1
W=0
X=1
Y=0
Z=1
ShowHints=1
ShowWarnings=1
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[Linker]
MapFile=0
OutputObjs=0
ConsoleApp=1
DebugInfo=0
MinStackSize=16384
MaxStackSize=1048576
ImageBase=4194304
ExeDescription=
[Directories]
OutputDir=
UnitOutputDir=
SearchPath=
Packages=vclx30;VCL30;vcldb30;vcldbx30;VclSmp30;Qrpt30
Conditionals=
DebugSourceDirs=
UsePackages=0
[Parameters]
RunParams=
HostApplication=
[Version Info]
IncludeVerInfo=0
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=2057
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=

View File

@ -0,0 +1,14 @@
program webbrowser;
uses
Forms,
SHDocVw_TLB in '..\..\Imports\SHDocVw_TLB.pas',
form in 'form.pas' {MainForm};
{$R *.RES}
begin
Application.Initialize;
Application.CreateForm(TMainForm, MainForm);
Application.Run;
end.