* Updated GBrowser example
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2353 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
c3ba51579a
commit
3d88234802
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<CONFIG>
|
||||
<Compiler Value="/usr/local/bin/ppc386" Date="1238949773"/>
|
||||
<Params Value=" -MDelphi -Sa -Cirot -O1 -gl -k-framework -kCocoa -WG -vewnhi -l -Fu../Components/units/i386-darwin/ -Fu../../../lazarus/ideintf/units/i386-darwin/ -Fu../../../lazarus/lcl/units/i386-darwin/ -Fu../../../lazarus/lcl/units/i386-darwin/cocoa/ -Fu../../../lazarus/packager/units/i386-darwin/ -Fu. -oGBrowser -dLCL -dLCLcocoa GBrowser.dpr"/>
|
||||
</CONFIG>
|
@ -8,11 +8,8 @@ uses
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
Forms,
|
||||
gec10 in 'gec10.pas' {Form1};
|
||||
gec10 in 'gec10.pas';
|
||||
|
||||
{$IFDEF MSWINDOWS}
|
||||
{$R *.res}
|
||||
{$ENDIF}
|
||||
|
||||
begin
|
||||
{$IFDEF FPC}
|
||||
|
@ -1,20 +1,23 @@
|
||||
<?xml version="1.0"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="7"/>
|
||||
<Version Value="9"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<LRSInOutputDirectory Value="False"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<TargetFileExt Value=""/>
|
||||
<ActiveEditorIndexAtStart Value="1"/>
|
||||
<ResourceType Value="res"/>
|
||||
</General>
|
||||
<VersionInfo>
|
||||
<ProjectVersion Value=""/>
|
||||
<Language Value=""/>
|
||||
<CharSet Value=""/>
|
||||
<StringTable ProductVersion=""/>
|
||||
</VersionInfo>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<IgnoreBinaries Value="False"/>
|
||||
@ -35,35 +38,18 @@
|
||||
<PackageName Value="GeckoComponents"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Units Count="1">
|
||||
<Unit0>
|
||||
<Filename Value="GBrowser.dpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<CursorPos X="1" Y="1"/>
|
||||
<TopLine Value="1"/>
|
||||
<EditorIndex Value="0"/>
|
||||
<UsageCount Value="20"/>
|
||||
<Loaded Value="True"/>
|
||||
<SyntaxHighlighter Value="Delphi"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="gec10.pas"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="gec10"/>
|
||||
<CursorPos X="1" Y="1"/>
|
||||
<TopLine Value="44"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<UsageCount Value="10"/>
|
||||
<Loaded Value="True"/>
|
||||
<SyntaxHighlighter Value="Delphi"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
<JumpHistory Count="0" HistoryIndex="-1"/>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="8"/>
|
||||
<Version Value="11"/>
|
||||
<SearchPaths>
|
||||
<SrcPath Value="..;../gecko10"/>
|
||||
</SearchPaths>
|
||||
<Parsing>
|
||||
<SyntaxOptions>
|
||||
<SyntaxMode Value="Delphi"/>
|
||||
@ -71,6 +57,7 @@
|
||||
<IncludeAssertionCode Value="True"/>
|
||||
<AllowLabel Value="False"/>
|
||||
<CPPInline Value="False"/>
|
||||
<UseAnsiStrings Value="False"/>
|
||||
</SyntaxOptions>
|
||||
</Parsing>
|
||||
<CodeGeneration>
|
||||
|
@ -1,48 +1,74 @@
|
||||
object Form1: TForm1
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 666
|
||||
Height = 427
|
||||
Left = 612
|
||||
Height = 422
|
||||
Top = 209
|
||||
Width = 660
|
||||
Caption = 'Form1'
|
||||
ClientHeight = 422
|
||||
ClientWidth = 660
|
||||
Color = clBtnFace
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'Tahoma'
|
||||
Font.Style = []
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
object lblProg: TLabel
|
||||
Left = 296
|
||||
Top = 400
|
||||
Width = 32
|
||||
Height = 13
|
||||
Caption = 'lblProg'
|
||||
end
|
||||
object lblProgMax: TLabel
|
||||
Left = 352
|
||||
Top = 400
|
||||
Width = 52
|
||||
Height = 13
|
||||
Caption = 'lblProgMax'
|
||||
end
|
||||
LCLVersion = '0.9.31'
|
||||
object GeckoBrowser1: TGeckoBrowser
|
||||
Left = 0
|
||||
Top = 16
|
||||
Width = 665
|
||||
Height = 257
|
||||
Height = 274
|
||||
Top = 0
|
||||
Width = 660
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
TabStop = False
|
||||
OnStatusChange = GeckoBrowser1StatusChange
|
||||
OnProgressChange = GeckoBrowser1ProgressChange
|
||||
OnLocationChange = GeckoBrowser1LocationChange
|
||||
OnProgressChange = GeckoBrowser1ProgressChange
|
||||
OnStatusChange = GeckoBrowser1StatusChange
|
||||
DisableJavaScript = False
|
||||
end
|
||||
object ListBox1: TListBox
|
||||
Left = 0
|
||||
Top = 280
|
||||
Width = 665
|
||||
Height = 113
|
||||
ItemHeight = 13
|
||||
Top = 279
|
||||
Width = 660
|
||||
Align = alBottom
|
||||
ItemHeight = 0
|
||||
ScrollWidth = 658
|
||||
TabOrder = 1
|
||||
TopIndex = -1
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Height = 30
|
||||
Top = 392
|
||||
Width = 660
|
||||
Align = alBottom
|
||||
ClientHeight = 30
|
||||
ClientWidth = 660
|
||||
TabOrder = 2
|
||||
object lblProg: TLabel
|
||||
Left = 240
|
||||
Height = 14
|
||||
Top = 6
|
||||
Width = 40
|
||||
Caption = 'lblProg'
|
||||
ParentColor = False
|
||||
end
|
||||
object lblProgMax: TLabel
|
||||
Left = 344
|
||||
Height = 14
|
||||
Top = 6
|
||||
Width = 62
|
||||
Caption = 'lblProgMax'
|
||||
ParentColor = False
|
||||
end
|
||||
end
|
||||
object Splitter1: TSplitter
|
||||
Cursor = crVSplit
|
||||
Left = 0
|
||||
Height = 5
|
||||
Top = 274
|
||||
Width = 660
|
||||
Align = alBottom
|
||||
ResizeAnchor = akBottom
|
||||
end
|
||||
end
|
||||
|
@ -1,15 +0,0 @@
|
||||
LazarusResources.Add('TForm1','FORMDATA',[
|
||||
'TPF0'#6'TForm1'#5'Form1'#4'Left'#2#0#3'Top'#2#0#5'Width'#3#154#2#6'Height'#3
|
||||
+#171#1#7'Caption'#6#5'Form1'#5'Color'#7#9'clBtnFace'#12'Font.Charset'#7#15'D'
|
||||
+'EFAULT_CHARSET'#10'Font.Color'#7#12'clWindowText'#11'Font.Height'#2#245#9'F'
|
||||
+'ont.Name'#6#6'Tahoma'#10'Font.Style'#11#0#6'OnShow'#7#8'FormShow'#13'Pixels'
|
||||
+'PerInch'#2'`'#0#6'TLabel'#7'lblProg'#4'Left'#3'('#1#3'Top'#3#144#1#5'Width'
|
||||
+#2' '#6'Height'#2#13#7'Caption'#6#7'lblProg'#0#0#6'TLabel'#10'lblProgMax'#4
|
||||
+'Left'#3'`'#1#3'Top'#3#144#1#5'Width'#2'4'#6'Height'#2#13#7'Caption'#6#10'lb'
|
||||
+'lProgMax'#0#0#13'TGeckoBrowser'#13'GeckoBrowser1'#4'Left'#2#0#3'Top'#2#16#5
|
||||
+'Width'#3#153#2#6'Height'#3#1#1#8'TabOrder'#2#0#7'TabStop'#8#14'OnStatusChan'
|
||||
+'ge'#7#25'GeckoBrowser1StatusChange'#16'OnProgressChange'#7#27'GeckoBrowser1'
|
||||
+'ProgressChange'#16'OnLocationChange'#7#27'GeckoBrowser1LocationChange'#0#0#8
|
||||
+'TListBox'#8'ListBox1'#4'Left'#2#0#3'Top'#3#24#1#5'Width'#3#153#2#6'Height'#2
|
||||
+'q'#10'ItemHeight'#2#13#8'TabOrder'#2#1#0#0#0
|
||||
]);
|
@ -5,14 +5,19 @@ interface
|
||||
uses
|
||||
{$IFNDEF LCL} Windows, Messages, {$ELSE} LclIntf, LMessages, LclType, LResources, {$ENDIF}
|
||||
SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, GeckoBrowser, StdCtrls;
|
||||
Dialogs, GeckoBrowser, StdCtrls, ExtCtrls;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
GeckoBrowser1: TGeckoBrowser;
|
||||
ListBox1: TListBox;
|
||||
lblProg: TLabel;
|
||||
lblProgMax: TLabel;
|
||||
Panel1: TPanel;
|
||||
Splitter1: TSplitter;
|
||||
procedure GeckoBrowser1LocationChange(Sender: TObject; const uri: string);
|
||||
procedure GeckoBrowser1ProgressChange(Sender: TObject; Progress,
|
||||
ProgressMax: Integer);
|
||||
@ -32,11 +37,12 @@ implementation
|
||||
|
||||
{$IFNDEF LCL}
|
||||
{$R *.dfm}
|
||||
{$ELSE}
|
||||
{$R *.lfm}
|
||||
{$ENDIF}
|
||||
|
||||
procedure TForm1.FormShow(Sender: TObject);
|
||||
begin
|
||||
// GeckoBrowser1.LoadURI('http://www.yahoo.com', 0, '', '', '');
|
||||
GeckoBrowser1.LoadURI('http://www.lazarus.freepascal.org');
|
||||
end;
|
||||
|
||||
@ -44,6 +50,7 @@ procedure TForm1.GeckoBrowser1StatusChange(Sender: TObject;
|
||||
aMessage: WideString);
|
||||
begin
|
||||
ListBox1.Items.Add(aMessage);
|
||||
ListBox1.Selected[ListBox1.Count-1]:=true;
|
||||
Application.ProcessMessages;
|
||||
end;
|
||||
|
||||
@ -55,15 +62,9 @@ begin
|
||||
Application.ProcessMessages;
|
||||
end;
|
||||
|
||||
procedure TForm1.GeckoBrowser1LocationChange(Sender: TObject;
|
||||
const uri: string);
|
||||
procedure TForm1.GeckoBrowser1LocationChange(Sender: TObject; const uri: string);
|
||||
begin
|
||||
// showmessage(uri);
|
||||
Caption := uri;
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$IFDEF LCL}
|
||||
{$I gec10.lrs} {Include form's resource file}
|
||||
{$ENDIF}
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user