mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-06 16:00:44 +02:00
New example for IPro FindNode functions. Issue #29483, from Silvio Clécio.
git-svn-id: trunk@51432 -
This commit is contained in:
parent
3da9248939
commit
380b2f5724
5
.gitattributes
vendored
5
.gitattributes
vendored
@ -4290,6 +4290,11 @@ components/turbopower_ipro/examples/htmlwithcssfrm.lfm svneol=native#text/plain
|
||||
components/turbopower_ipro/examples/htmlwithcssfrm.pas svneol=native#text/plain
|
||||
components/turbopower_ipro/examples/index.html svneol=native#text/plain
|
||||
components/turbopower_ipro/examples/simplepage2.html svneol=native#text/plain
|
||||
components/turbopower_ipro/examples/sum.html svneol=native#text/plain
|
||||
components/turbopower_ipro/examples/sumab.lpi svneol=native#text/plain
|
||||
components/turbopower_ipro/examples/sumab.lpr svneol=native#text/pascal
|
||||
components/turbopower_ipro/examples/sumabfrm.lfm svneol=native#text/plain
|
||||
components/turbopower_ipro/examples/sumabfrm.pas svneol=native#text/pascal
|
||||
components/turbopower_ipro/for_delphi/ipHtml.dcr -text
|
||||
components/turbopower_ipro/for_delphi/iphtml.res -text
|
||||
components/turbopower_ipro/ipanim.pas svneol=native#text/pascal
|
||||
|
14
components/turbopower_ipro/examples/sum.html
Normal file
14
components/turbopower_ipro/examples/sum.html
Normal file
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Sum</title>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post">
|
||||
Value A: <input id="a" type="text" value="10" style="background-color: #ffff96;"/><br />
|
||||
Value B: <input id="b" type="text" value="20" style="background-color: #ffff96;"/><br />
|
||||
<input type="submit" value="Sum" />
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
90
components/turbopower_ipro/examples/sumab.lpi
Normal file
90
components/turbopower_ipro/examples/sumab.lpi
Normal file
@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="9"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<SaveOnlyProjectUnits Value="True"/>
|
||||
</Flags>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="sumab"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
<Icon Value="0"/>
|
||||
</General>
|
||||
<i18n>
|
||||
<EnableI18N LFM="False"/>
|
||||
</i18n>
|
||||
<VersionInfo>
|
||||
<StringTable ProductVersion=""/>
|
||||
</VersionInfo>
|
||||
<BuildModes Count="1" Active="Default">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="TurboPowerIPro"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="sumab.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UsageCount Value="20"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="sumabfrm.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<UsageCount Value="20"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="sumab"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Linking>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
19
components/turbopower_ipro/examples/sumab.lpr
Normal file
19
components/turbopower_ipro/examples/sumab.lpr
Normal file
@ -0,0 +1,19 @@
|
||||
program sumab;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, Forms, sumabfrm;
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
RequireDerivedFormResource := True;
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
||||
|
33
components/turbopower_ipro/examples/sumabfrm.lfm
Normal file
33
components/turbopower_ipro/examples/sumabfrm.lfm
Normal file
@ -0,0 +1,33 @@
|
||||
object Form1: TForm1
|
||||
Left = 237
|
||||
Height = 240
|
||||
Top = 144
|
||||
Width = 320
|
||||
Caption = 'Sum A+B'
|
||||
ClientHeight = 240
|
||||
ClientWidth = 320
|
||||
OnShow = FormShow
|
||||
LCLVersion = '1.7'
|
||||
object IpHtmlPanel1: TIpHtmlPanel
|
||||
Left = 0
|
||||
Height = 240
|
||||
Top = 0
|
||||
Width = 320
|
||||
Align = alClient
|
||||
DataProvider = IpFileDataProvider1
|
||||
FixedTypeface = 'Courier New'
|
||||
DefaultTypeFace = 'default'
|
||||
DefaultFontSize = 12
|
||||
FlagErrors = False
|
||||
PrintSettings.MarginLeft = 0.5
|
||||
PrintSettings.MarginTop = 0.5
|
||||
PrintSettings.MarginRight = 0.5
|
||||
PrintSettings.MarginBottom = 0.5
|
||||
TabOrder = 0
|
||||
OnControlClick2 = IpHtmlPanel1ControlClick2
|
||||
end
|
||||
object IpFileDataProvider1: TIpFileDataProvider
|
||||
left = 56
|
||||
top = 23
|
||||
end
|
||||
end
|
51
components/turbopower_ipro/examples/sumabfrm.pas
Normal file
51
components/turbopower_ipro/examples/sumabfrm.pas
Normal file
@ -0,0 +1,51 @@
|
||||
unit sumabfrm;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
{$MODESWITCH NESTEDPROCVARS}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Ipfilebroker, IpHtml, Forms, Dialogs;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
IpFileDataProvider1: TIpFileDataProvider;
|
||||
IpHtmlPanel1: TIpHtmlPanel;
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure IpHtmlPanel1ControlClick2(Sender: TIpHtmlCustomPanel;
|
||||
Frame: TIpHtmlFrame; Html: TIpHtml; Node: TIpHtmlNodeControl;
|
||||
var cancel: boolean);
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
procedure TForm1.FormShow(Sender: TObject);
|
||||
begin
|
||||
IpHtmlPanel1.OpenURL(
|
||||
ExpandLocalHtmlFileName(ExtractFilePath(ParamStr(0)) + 'sum.html'));
|
||||
end;
|
||||
|
||||
procedure TForm1.IpHtmlPanel1ControlClick2(Sender: TIpHtmlCustomPanel;
|
||||
Frame: TIpHtmlFrame; Html: TIpHtml; Node: TIpHtmlNodeControl;
|
||||
var cancel: boolean);
|
||||
var
|
||||
A, B: TIpHtmlNodeINPUT;
|
||||
begin
|
||||
A := FindNodeByElemId(Html.HtmlNode, 'a') as TIpHtmlNodeINPUT;
|
||||
B := FindNodeByElemId(Html.HtmlNode, 'b') as TIpHtmlNodeINPUT;
|
||||
ShowMessageFmt('Sum: %d', [A.Value.ToInteger + B.Value.ToInteger]);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user