Improved sample for turbopower_ipro package

git-svn-id: trunk@7410 -
This commit is contained in:
jesus 2005-07-23 21:03:07 +00:00
parent b0fd07ca4f
commit c9df107267
5 changed files with 134 additions and 93 deletions

View File

@ -8,7 +8,19 @@
<body> <body>
Lazarus example for IPro HTML control.<br> Lazarus example for IPro HTML control.<br>
<br> <br>
<img src="../../images/lazarus.bmp" title="" alt="Lazarus image" Image ../../docs/images/cheetah1.png
<br>
<img src="../../docs/images/cheetah1.png" title="" alt="cheetah.png image"
style="width: 250px; height: 188px;"><br>
<br>
Image ../../docs/images/laztitle.jpg
<br>
<img src="../../docs/images/laztitle.jpg" title="" alt="laztitle.jpg image"
style="width: 250px; height: 188px;"><br>
<br>
Image broken
<br>
<img src="../../docs/images/cheetah2.png" title="" alt="cheetah.png image"
style="width: 250px; height: 188px;"><br> style="width: 250px; height: 188px;"><br>
<br> <br>
<a href="simplepage2.html">Link</a><br> <a href="simplepage2.html">Link</a><br>

View File

@ -3,15 +3,18 @@ object MainForm: TMainForm
ClientHeight = 327 ClientHeight = 327
ClientWidth = 569 ClientWidth = 569
OnCreate = MainFormCreate OnCreate = MainFormCreate
HorzScrollBar.Page = 570 OnDestroy = MainFormDestroy
VertScrollBar.Page = 328 PixelsPerInch = 75
Left = 291 HorzScrollBar.Page = 568
VertScrollBar.Page = 326
Left = 222
Height = 327 Height = 327
Top = 163 Top = 163
Width = 569 Width = 569
object OpenHTMLFileButton: TButton object OpenHTMLFileButton: TButton
Align = alTop Align = alTop
Caption = 'Open HTML File' Caption = 'Open HTML File'
OnClick = OpenHTMLFileButtonClick
TabOrder = 0 TabOrder = 0
Height = 25 Height = 25
Width = 569 Width = 569
@ -28,4 +31,12 @@ object MainForm: TMainForm
Top = 25 Top = 25
Width = 569 Width = 569
end end
object OpenDialog1: TOpenDialog
Title = 'Open existing file'
Filter = 'Web Pages|*.html;*.htm'
FilterIndex = 0
Title = 'Open existing file'
left = 26
top = 93
end
end end

View File

@ -3,14 +3,18 @@
LazarusResources.Add('TMainForm','FORMDATA',[ LazarusResources.Add('TMainForm','FORMDATA',[
'TPF0'#9'TMainForm'#8'MainForm'#7'Caption'#6'0Example for turbopower internet' 'TPF0'#9'TMainForm'#8'MainForm'#7'Caption'#6'0Example for turbopower internet'
+' pro HTML control'#12'ClientHeight'#3'G'#1#11'ClientWidth'#3'9'#2#8'OnCreat' +' pro HTML control'#12'ClientHeight'#3'G'#1#11'ClientWidth'#3'9'#2#8'OnCreat'
+'e'#7#14'MainFormCreate'#18'HorzScrollBar.Page'#3':'#2#18'VertScrollBar.Page' +'e'#7#14'MainFormCreate'#9'OnDestroy'#7#15'MainFormDestroy'#13'PixelsPerInch'
+#3'H'#1#4'Left'#3'#'#1#6'Height'#3'G'#1#3'Top'#3#163#0#5'Width'#3'9'#2#0#7'T' +#2'K'#18'HorzScrollBar.Page'#3'8'#2#18'VertScrollBar.Page'#3'F'#1#4'Left'#3
+'Button'#18'OpenHTMLFileButton'#5'Align'#7#5'alTop'#7'Caption'#6#14'Open HTM' +#222#0#6'Height'#3'G'#1#3'Top'#3#163#0#5'Width'#3'9'#2#0#7'TButton'#18'OpenH'
+'L File'#8'TabOrder'#2#0#6'Height'#2#25#5'Width'#3'9'#2#0#0#12'TIpHtmlPanel' +'TMLFileButton'#5'Align'#7#5'alTop'#7'Caption'#6#14'Open HTML File'#7'OnClic'
+#12'IpHtmlPanel1'#5'Align'#7#8'alClient'#13'FixedTypeface'#6#11'Courier New' +'k'#7#23'OpenHTMLFileButtonClick'#8'TabOrder'#2#0#6'Height'#2#25#5'Width'#3
+#24'PrintSettings.MarginLeft'#5#0#0#0#0#0#0#0#128#254'?'#23'PrintSettings.Ma' +'9'#2#0#0#12'TIpHtmlPanel'#12'IpHtmlPanel1'#5'Align'#7#8'alClient'#13'FixedT'
+'rginTop'#5#0#0#0#0#0#0#0#128#254'?'#25'PrintSettings.MarginRight'#5#0#0#0#0 +'ypeface'#6#11'Courier New'#24'PrintSettings.MarginLeft'#5#0#0#0#0#0#0#0#128
+#0#0#0#128#254'?'#26'PrintSettings.MarginBottom'#5#0#0#0#0#0#0#0#128#254'?' +#254'?'#23'PrintSettings.MarginTop'#5#0#0#0#0#0#0#0#128#254'?'#25'PrintSetti'
+#10'OnHotClick'#7#20'IpHtmlPanel1HotClick'#6'Height'#3'.'#1#3'Top'#2#25#5'Wi' +'ngs.MarginRight'#5#0#0#0#0#0#0#0#128#254'?'#26'PrintSettings.MarginBottom'#5
+'dth'#3'9'#2#0#0#0 +#0#0#0#0#0#0#0#128#254'?'#10'OnHotClick'#7#20'IpHtmlPanel1HotClick'#6'Height'
+#3'.'#1#3'Top'#2#25#5'Width'#3'9'#2#0#0#11'TOpenDialog'#11'OpenDialog1'#5'Ti'
+'tle'#6#18'Open existing file'#6'Filter'#6#22'Web Pages|*.html;*.htm'#11'Fil'
+'terIndex'#2#0#5'Title'#6#18'Open existing file'#4'left'#2#26#3'top'#2']'#0#0
+#0
]); ]);

View File

@ -6,6 +6,7 @@ interface
uses uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons, Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons,
//LazJpeg,
IpHtml; IpHtml;
type type
@ -18,12 +19,16 @@ type
TMainForm = class(TForm) TMainForm = class(TForm)
IpHtmlPanel1: TIpHtmlPanel; IpHtmlPanel1: TIpHtmlPanel;
OpenDialog1: TOpenDialog;
OpenHTMLFileButton: TButton; OpenHTMLFileButton: TButton;
procedure HTMLGetImageX(Sender: TIpHtmlNode; const URL: string; procedure HTMLGetImageX(Sender: TIpHtmlNode; const URL: string;
var Picture: TPicture); var Picture: TPicture);
procedure IpHtmlPanel1HotClick(Sender: TObject); procedure IpHtmlPanel1HotClick(Sender: TObject);
procedure MainFormCreate(Sender: TObject); procedure MainFormCreate(Sender: TObject);
procedure MainFormDestroy(Sender: TObject);
procedure OpenHTMLFileButtonClick(Sender: TObject);
public public
FDefaultImage: TBitmap;
procedure OpenHTMLFile(const Filename: string); procedure OpenHTMLFile(const Filename: string);
end; end;
@ -36,9 +41,25 @@ implementation
procedure TMainForm.MainFormCreate(Sender: TObject); procedure TMainForm.MainFormCreate(Sender: TObject);
begin begin
FDefaultImage := TBitmap.Create;
FDefaultImage.LoadFromFile('imagebroken.xpm');
OpenHTMLFile('index.html'); OpenHTMLFile('index.html');
end; end;
procedure TMainForm.MainFormDestroy(Sender: TObject);
begin
FDefaultImage.Free;
end;
procedure TMainForm.OpenHTMLFileButtonClick(Sender: TObject);
begin
if OpenDialog1.Execute then begin
OpenHtmlFile(OpenDialog1.FileName);
end;
end;
procedure TMainForm.IpHtmlPanel1HotClick(Sender: TObject); procedure TMainForm.IpHtmlPanel1HotClick(Sender: TObject);
var var
NodeA: TIpHtmlNodeA; NodeA: TIpHtmlNodeA;
@ -59,11 +80,14 @@ begin
Picture:=TPicture.Create; Picture:=TPicture.Create;
Picture.LoadFromFile(URL); Picture.LoadFromFile(URL);
except except
Picture.Assign(FDefaultImage);
{
on E: Exception do begin on E: Exception do begin
MessageDlg('Unable to open image file', MessageDlg('Unable to open image file',
'Image file: '+URL+#13 'Image file: '+URL+#13
+'Error: '+E.Message,mtError,[mbCancel],0); +'Error: '+E.Message,mtError,[mbCancel],0);
end; end;
}
end; end;
end; end;

View File

@ -1,92 +1,36 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<PathDelim Value="/"/>
<Version Value="5"/> <Version Value="5"/>
<General> <General>
<MainUnit Value="0"/> <MainUnit Value="0"/>
<ActiveEditorIndexAtStart Value="3"/> <ActiveEditorIndexAtStart Value="0"/>
<IconPath Value="./"/> <IconPath Value="./"/>
<TargetFileExt Value=""/> <TargetFileExt Value=""/>
<Title Value="tpiproexample"/> <Title Value="tpiproexample"/>
</General> </General>
<JumpHistory Count="14" HistoryIndex="9"> <JumpHistory Count="0" HistoryIndex="-1"/>
<Position1> <Units Count="17">
<Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/iputils.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position1>
<Position2>
<Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/iputils.pas"/>
<Caret Line="2672" Column="11" TopLine="2648"/>
</Position2>
<Position3>
<Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/iputils.pas"/>
<Caret Line="44" Column="11" TopLine="1"/>
</Position3>
<Position4>
<Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/iphtml.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position4>
<Position5>
<Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/iputils.pas"/>
<Caret Line="2689" Column="19" TopLine="2667"/>
</Position5>
<Position6>
<Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/ipstrms.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position6>
<Position7>
<Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/ipstrms.pas"/>
<Caret Line="428" Column="1" TopLine="390"/>
</Position7>
<Position8>
<Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/ipstrms.pas"/>
<Caret Line="387" Column="3" TopLine="365"/>
</Position8>
<Position9>
<Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/ipstrms.pas"/>
<Caret Line="481" Column="1" TopLine="438"/>
</Position9>
<Position10>
<Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/ipstrms.pas"/>
<Caret Line="433" Column="3" TopLine="411"/>
</Position10>
<Position11>
<Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/iphtml.pas"/>
<Caret Line="2944" Column="3" TopLine="2920"/>
</Position11>
<Position12>
<Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/iphtml.pas"/>
<Caret Line="17646" Column="33" TopLine="17607"/>
</Position12>
<Position13>
<Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/ipstrms.pas"/>
<Caret Line="434" Column="3" TopLine="412"/>
</Position13>
<Position14>
<Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/iphtml.pas"/>
<Caret Line="16503" Column="1" TopLine="16503"/>
</Position14>
</JumpHistory>
<Units Count="9">
<Unit0> <Unit0>
<CursorPos X="5" Y="6"/> <CursorPos X="1" Y="1"/>
<Filename Value="tpiproexample.lpr"/> <Filename Value="tpiproexample.lpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UnitName Value="TPIProExample"/> <UnitName Value="TPIProExample"/>
<UsageCount Value="25"/> <UsageCount Value="33"/>
</Unit0> </Unit0>
<Unit1> <Unit1>
<CursorPos X="11" Y="72"/> <CursorPos X="33" Y="12"/>
<EditorIndex Value="0"/> <EditorIndex Value="0"/>
<Filename Value="mainunit.pas"/> <Filename Value="mainunit.pas"/>
<ComponentName Value="MainForm"/> <ComponentName Value="MainForm"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<Loaded Value="True"/> <Loaded Value="True"/>
<ResourceFilename Value="mainunit.lrs"/> <ResourceFilename Value="mainunit.lrs"/>
<TopLine Value="51"/> <TopLine Value="6"/>
<UnitName Value="MainUnit"/> <UnitName Value="MainUnit"/>
<UsageCount Value="25"/> <UsageCount Value="33"/>
</Unit1> </Unit1>
<Unit2> <Unit2>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
@ -94,61 +38,107 @@
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<SyntaxHighlighter Value="HTML"/> <SyntaxHighlighter Value="HTML"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UsageCount Value="25"/> <UsageCount Value="33"/>
</Unit2> </Unit2>
<Unit3> <Unit3>
<CursorPos X="28" Y="519"/> <CursorPos X="28" Y="519"/>
<EditorIndex Value="1"/>
<Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/iputils.pas"/> <Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/iputils.pas"/>
<Loaded Value="True"/>
<TopLine Value="485"/> <TopLine Value="485"/>
<UnitName Value="IpUtils"/> <UnitName Value="IpUtils"/>
<UsageCount Value="10"/> <UsageCount Value="10"/>
</Unit3> </Unit3>
<Unit4> <Unit4>
<CursorPos X="1" Y="29"/> <CursorPos X="1" Y="29"/>
<EditorIndex Value="6"/>
<Filename Value="/home/mattias/pascal/wichtig/lazarus/lcl/fileutil.pas"/> <Filename Value="/home/mattias/pascal/wichtig/lazarus/lcl/fileutil.pas"/>
<Loaded Value="True"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UnitName Value="FileUtil"/> <UnitName Value="FileUtil"/>
<UsageCount Value="10"/> <UsageCount Value="10"/>
</Unit4> </Unit4>
<Unit5> <Unit5>
<CursorPos X="1" Y="2991"/> <CursorPos X="1" Y="2991"/>
<EditorIndex Value="3"/>
<Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/iphtml.pas"/> <Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/iphtml.pas"/>
<Loaded Value="True"/>
<TopLine Value="2964"/> <TopLine Value="2964"/>
<UnitName Value="IpHtml"/> <UnitName Value="IpHtml"/>
<UsageCount Value="10"/> <UsageCount Value="10"/>
</Unit5> </Unit5>
<Unit6> <Unit6>
<CursorPos X="3" Y="434"/> <CursorPos X="3" Y="434"/>
<EditorIndex Value="2"/>
<Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/ipstrms.pas"/> <Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/ipstrms.pas"/>
<Loaded Value="True"/>
<TopLine Value="412"/> <TopLine Value="412"/>
<UnitName Value="IpStrms"/> <UnitName Value="IpStrms"/>
<UsageCount Value="10"/> <UsageCount Value="10"/>
</Unit6> </Unit6>
<Unit7> <Unit7>
<CursorPos X="15" Y="820"/> <CursorPos X="15" Y="820"/>
<EditorIndex Value="4"/>
<Filename Value="/home/mattias/pascal/wichtig/lazarus/lcl/stdctrls.pp"/> <Filename Value="/home/mattias/pascal/wichtig/lazarus/lcl/stdctrls.pp"/>
<Loaded Value="True"/>
<TopLine Value="798"/> <TopLine Value="798"/>
<UnitName Value="StdCtrls"/> <UnitName Value="StdCtrls"/>
<UsageCount Value="10"/> <UsageCount Value="10"/>
</Unit7> </Unit7>
<Unit8> <Unit8>
<CursorPos X="3" Y="142"/> <CursorPos X="3" Y="142"/>
<EditorIndex Value="5"/>
<Filename Value="/home/mattias/pascal/wichtig/lazarus/lcl/include/customcheckbox.inc"/> <Filename Value="/home/mattias/pascal/wichtig/lazarus/lcl/include/customcheckbox.inc"/>
<Loaded Value="True"/>
<TopLine Value="131"/> <TopLine Value="131"/>
<UsageCount Value="10"/> <UsageCount Value="10"/>
</Unit8> </Unit8>
<Unit9>
<CursorPos X="42" Y="491"/>
<Filename Value="/home/prog/lazarus/lcl/include/picture.inc"/>
<TopLine Value="471"/>
<UsageCount Value="11"/>
</Unit9>
<Unit10>
<CursorPos X="27" Y="17571"/>
<Filename Value="/home/prog/lazarus/components/turbopower_ipro/iphtml.pas"/>
<TopLine Value="17548"/>
<UnitName Value="IpHtml"/>
<UsageCount Value="13"/>
<Bookmarks Count="3">
<Item0 X="19" Y="17560" ID="0"/>
<Item1 X="13" Y="17511" ID="7"/>
<Item2 X="19" Y="17445" ID="9"/>
</Bookmarks>
</Unit10>
<Unit11>
<CursorPos X="24" Y="884"/>
<Filename Value="/home/prog/lazarus/lcl/graphics.pp"/>
<TopLine Value="871"/>
<UnitName Value="Graphics"/>
<UsageCount Value="11"/>
</Unit11>
<Unit12>
<CursorPos X="15" Y="472"/>
<Filename Value="/home/prog/lazarus/lcl/dbgrids.pas"/>
<TopLine Value="462"/>
<UnitName Value="DBGrids"/>
<UsageCount Value="10"/>
</Unit12>
<Unit13>
<CursorPos X="10" Y="56"/>
<Filename Value="/home/prog/lazarus/lcl/include/lclintfh.inc"/>
<TopLine Value="38"/>
<UsageCount Value="11"/>
</Unit13>
<Unit14>
<CursorPos X="3" Y="93"/>
<Filename Value="/home/prog/lazarus/lcl/include/intfbaselcl.inc"/>
<TopLine Value="91"/>
<UsageCount Value="11"/>
</Unit14>
<Unit15>
<CursorPos X="44" Y="2787"/>
<Filename Value="/home/prog/lazarus/components/turbopower_ipro/iputils.pas"/>
<TopLine Value="2752"/>
<UnitName Value="IpUtils"/>
<UsageCount Value="12"/>
</Unit15>
<Unit16>
<CursorPos X="55" Y="44"/>
<Filename Value="/home/prog/lazarus/components/jpeg/lazjpeg.pas"/>
<TopLine Value="27"/>
<UnitName Value="LazJPEG"/>
<UsageCount Value="10"/>
</Unit16>
</Units> </Units>
<PublishOptions> <PublishOptions>
<Version Value="2"/> <Version Value="2"/>
@ -174,7 +164,7 @@
</RequiredPackages> </RequiredPackages>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>
<Version Value="2"/> <Version Value="5"/>
<SearchPaths> <SearchPaths>
<OtherUnitFiles Value="$(LazarusDir)/components/units/$(TargetCPU)/$(TargetOS)/"/> <OtherUnitFiles Value="$(LazarusDir)/components/units/$(TargetCPU)/$(TargetOS)/"/>
<SrcPath Value="$(LazarusDir)/lcl/;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)/"/> <SrcPath Value="$(LazarusDir)/lcl/;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)/"/>