mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 10:09:29 +02:00
Improved sample for turbopower_ipro package
git-svn-id: trunk@7410 -
This commit is contained in:
parent
b0fd07ca4f
commit
c9df107267
@ -8,7 +8,19 @@
|
||||
<body>
|
||||
Lazarus example for IPro HTML control.<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>
|
||||
<br>
|
||||
<a href="simplepage2.html">Link</a><br>
|
||||
|
@ -3,15 +3,18 @@ object MainForm: TMainForm
|
||||
ClientHeight = 327
|
||||
ClientWidth = 569
|
||||
OnCreate = MainFormCreate
|
||||
HorzScrollBar.Page = 570
|
||||
VertScrollBar.Page = 328
|
||||
Left = 291
|
||||
OnDestroy = MainFormDestroy
|
||||
PixelsPerInch = 75
|
||||
HorzScrollBar.Page = 568
|
||||
VertScrollBar.Page = 326
|
||||
Left = 222
|
||||
Height = 327
|
||||
Top = 163
|
||||
Width = 569
|
||||
object OpenHTMLFileButton: TButton
|
||||
Align = alTop
|
||||
Caption = 'Open HTML File'
|
||||
OnClick = OpenHTMLFileButtonClick
|
||||
TabOrder = 0
|
||||
Height = 25
|
||||
Width = 569
|
||||
@ -28,4 +31,12 @@ object MainForm: TMainForm
|
||||
Top = 25
|
||||
Width = 569
|
||||
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
|
||||
|
@ -3,14 +3,18 @@
|
||||
LazarusResources.Add('TMainForm','FORMDATA',[
|
||||
'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'
|
||||
+'e'#7#14'MainFormCreate'#18'HorzScrollBar.Page'#3':'#2#18'VertScrollBar.Page'
|
||||
+#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'
|
||||
+'Button'#18'OpenHTMLFileButton'#5'Align'#7#5'alTop'#7'Caption'#6#14'Open HTM'
|
||||
+'L File'#8'TabOrder'#2#0#6'Height'#2#25#5'Width'#3'9'#2#0#0#12'TIpHtmlPanel'
|
||||
+#12'IpHtmlPanel1'#5'Align'#7#8'alClient'#13'FixedTypeface'#6#11'Courier New'
|
||||
+#24'PrintSettings.MarginLeft'#5#0#0#0#0#0#0#0#128#254'?'#23'PrintSettings.Ma'
|
||||
+'rginTop'#5#0#0#0#0#0#0#0#128#254'?'#25'PrintSettings.MarginRight'#5#0#0#0#0
|
||||
+#0#0#0#128#254'?'#26'PrintSettings.MarginBottom'#5#0#0#0#0#0#0#0#128#254'?'
|
||||
+#10'OnHotClick'#7#20'IpHtmlPanel1HotClick'#6'Height'#3'.'#1#3'Top'#2#25#5'Wi'
|
||||
+'dth'#3'9'#2#0#0#0
|
||||
+'e'#7#14'MainFormCreate'#9'OnDestroy'#7#15'MainFormDestroy'#13'PixelsPerInch'
|
||||
+#2'K'#18'HorzScrollBar.Page'#3'8'#2#18'VertScrollBar.Page'#3'F'#1#4'Left'#3
|
||||
+#222#0#6'Height'#3'G'#1#3'Top'#3#163#0#5'Width'#3'9'#2#0#7'TButton'#18'OpenH'
|
||||
+'TMLFileButton'#5'Align'#7#5'alTop'#7'Caption'#6#14'Open HTML File'#7'OnClic'
|
||||
+'k'#7#23'OpenHTMLFileButtonClick'#8'TabOrder'#2#0#6'Height'#2#25#5'Width'#3
|
||||
+'9'#2#0#0#12'TIpHtmlPanel'#12'IpHtmlPanel1'#5'Align'#7#8'alClient'#13'FixedT'
|
||||
+'ypeface'#6#11'Courier New'#24'PrintSettings.MarginLeft'#5#0#0#0#0#0#0#0#128
|
||||
+#254'?'#23'PrintSettings.MarginTop'#5#0#0#0#0#0#0#0#128#254'?'#25'PrintSetti'
|
||||
+'ngs.MarginRight'#5#0#0#0#0#0#0#0#128#254'?'#26'PrintSettings.MarginBottom'#5
|
||||
+#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
|
||||
]);
|
||||
|
@ -6,6 +6,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons,
|
||||
//LazJpeg,
|
||||
IpHtml;
|
||||
|
||||
type
|
||||
@ -18,12 +19,16 @@ type
|
||||
|
||||
TMainForm = class(TForm)
|
||||
IpHtmlPanel1: TIpHtmlPanel;
|
||||
OpenDialog1: TOpenDialog;
|
||||
OpenHTMLFileButton: TButton;
|
||||
procedure HTMLGetImageX(Sender: TIpHtmlNode; const URL: string;
|
||||
var Picture: TPicture);
|
||||
procedure IpHtmlPanel1HotClick(Sender: TObject);
|
||||
procedure MainFormCreate(Sender: TObject);
|
||||
procedure MainFormDestroy(Sender: TObject);
|
||||
procedure OpenHTMLFileButtonClick(Sender: TObject);
|
||||
public
|
||||
FDefaultImage: TBitmap;
|
||||
procedure OpenHTMLFile(const Filename: string);
|
||||
end;
|
||||
|
||||
@ -36,9 +41,25 @@ implementation
|
||||
|
||||
procedure TMainForm.MainFormCreate(Sender: TObject);
|
||||
begin
|
||||
|
||||
FDefaultImage := TBitmap.Create;
|
||||
FDefaultImage.LoadFromFile('imagebroken.xpm');
|
||||
|
||||
OpenHTMLFile('index.html');
|
||||
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);
|
||||
var
|
||||
NodeA: TIpHtmlNodeA;
|
||||
@ -59,11 +80,14 @@ begin
|
||||
Picture:=TPicture.Create;
|
||||
Picture.LoadFromFile(URL);
|
||||
except
|
||||
Picture.Assign(FDefaultImage);
|
||||
{
|
||||
on E: Exception do begin
|
||||
MessageDlg('Unable to open image file',
|
||||
'Image file: '+URL+#13
|
||||
+'Error: '+E.Message,mtError,[mbCancel],0);
|
||||
end;
|
||||
}
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -1,92 +1,36 @@
|
||||
<?xml version="1.0"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<PathDelim Value="/"/>
|
||||
<Version Value="5"/>
|
||||
<General>
|
||||
<MainUnit Value="0"/>
|
||||
<ActiveEditorIndexAtStart Value="3"/>
|
||||
<ActiveEditorIndexAtStart Value="0"/>
|
||||
<IconPath Value="./"/>
|
||||
<TargetFileExt Value=""/>
|
||||
<Title Value="tpiproexample"/>
|
||||
</General>
|
||||
<JumpHistory Count="14" HistoryIndex="9">
|
||||
<Position1>
|
||||
<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">
|
||||
<JumpHistory Count="0" HistoryIndex="-1"/>
|
||||
<Units Count="17">
|
||||
<Unit0>
|
||||
<CursorPos X="5" Y="6"/>
|
||||
<CursorPos X="1" Y="1"/>
|
||||
<Filename Value="tpiproexample.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<TopLine Value="1"/>
|
||||
<UnitName Value="TPIProExample"/>
|
||||
<UsageCount Value="25"/>
|
||||
<UsageCount Value="33"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<CursorPos X="11" Y="72"/>
|
||||
<CursorPos X="33" Y="12"/>
|
||||
<EditorIndex Value="0"/>
|
||||
<Filename Value="mainunit.pas"/>
|
||||
<ComponentName Value="MainForm"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<Loaded Value="True"/>
|
||||
<ResourceFilename Value="mainunit.lrs"/>
|
||||
<TopLine Value="51"/>
|
||||
<TopLine Value="6"/>
|
||||
<UnitName Value="MainUnit"/>
|
||||
<UsageCount Value="25"/>
|
||||
<UsageCount Value="33"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<CursorPos X="1" Y="1"/>
|
||||
@ -94,61 +38,107 @@
|
||||
<IsPartOfProject Value="True"/>
|
||||
<SyntaxHighlighter Value="HTML"/>
|
||||
<TopLine Value="1"/>
|
||||
<UsageCount Value="25"/>
|
||||
<UsageCount Value="33"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
<CursorPos X="28" Y="519"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/iputils.pas"/>
|
||||
<Loaded Value="True"/>
|
||||
<TopLine Value="485"/>
|
||||
<UnitName Value="IpUtils"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit3>
|
||||
<Unit4>
|
||||
<CursorPos X="1" Y="29"/>
|
||||
<EditorIndex Value="6"/>
|
||||
<Filename Value="/home/mattias/pascal/wichtig/lazarus/lcl/fileutil.pas"/>
|
||||
<Loaded Value="True"/>
|
||||
<TopLine Value="1"/>
|
||||
<UnitName Value="FileUtil"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit4>
|
||||
<Unit5>
|
||||
<CursorPos X="1" Y="2991"/>
|
||||
<EditorIndex Value="3"/>
|
||||
<Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/iphtml.pas"/>
|
||||
<Loaded Value="True"/>
|
||||
<TopLine Value="2964"/>
|
||||
<UnitName Value="IpHtml"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit5>
|
||||
<Unit6>
|
||||
<CursorPos X="3" Y="434"/>
|
||||
<EditorIndex Value="2"/>
|
||||
<Filename Value="/home/mattias/pascal/wichtig/lazarus/components/turbopower_ipro/ipstrms.pas"/>
|
||||
<Loaded Value="True"/>
|
||||
<TopLine Value="412"/>
|
||||
<UnitName Value="IpStrms"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit6>
|
||||
<Unit7>
|
||||
<CursorPos X="15" Y="820"/>
|
||||
<EditorIndex Value="4"/>
|
||||
<Filename Value="/home/mattias/pascal/wichtig/lazarus/lcl/stdctrls.pp"/>
|
||||
<Loaded Value="True"/>
|
||||
<TopLine Value="798"/>
|
||||
<UnitName Value="StdCtrls"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit7>
|
||||
<Unit8>
|
||||
<CursorPos X="3" Y="142"/>
|
||||
<EditorIndex Value="5"/>
|
||||
<Filename Value="/home/mattias/pascal/wichtig/lazarus/lcl/include/customcheckbox.inc"/>
|
||||
<Loaded Value="True"/>
|
||||
<TopLine Value="131"/>
|
||||
<UsageCount Value="10"/>
|
||||
</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>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
@ -174,7 +164,7 @@
|
||||
</RequiredPackages>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="2"/>
|
||||
<Version Value="5"/>
|
||||
<SearchPaths>
|
||||
<OtherUnitFiles Value="$(LazarusDir)/components/units/$(TargetCPU)/$(TargetOS)/"/>
|
||||
<SrcPath Value="$(LazarusDir)/lcl/;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)/"/>
|
||||
|
Loading…
Reference in New Issue
Block a user