diff --git a/.gitattributes b/.gitattributes index 0439afb164..13ccfda60e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/components/turbopower_ipro/examples/sum.html b/components/turbopower_ipro/examples/sum.html new file mode 100644 index 0000000000..91e095a02f --- /dev/null +++ b/components/turbopower_ipro/examples/sum.html @@ -0,0 +1,14 @@ + + + + + Sum + + +
+ Value A:
+ Value B:
+ +
+ + \ No newline at end of file diff --git a/components/turbopower_ipro/examples/sumab.lpi b/components/turbopower_ipro/examples/sumab.lpi new file mode 100644 index 0000000000..6ed3d9dfdb --- /dev/null +++ b/components/turbopower_ipro/examples/sumab.lpi @@ -0,0 +1,90 @@ + + + + + + + + + + + + <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> diff --git a/components/turbopower_ipro/examples/sumab.lpr b/components/turbopower_ipro/examples/sumab.lpr new file mode 100644 index 0000000000..cc05c94480 --- /dev/null +++ b/components/turbopower_ipro/examples/sumab.lpr @@ -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. + diff --git a/components/turbopower_ipro/examples/sumabfrm.lfm b/components/turbopower_ipro/examples/sumabfrm.lfm new file mode 100644 index 0000000000..2de04fd9e2 --- /dev/null +++ b/components/turbopower_ipro/examples/sumabfrm.lfm @@ -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 diff --git a/components/turbopower_ipro/examples/sumabfrm.pas b/components/turbopower_ipro/examples/sumabfrm.pas new file mode 100644 index 0000000000..b34cb71983 --- /dev/null +++ b/components/turbopower_ipro/examples/sumabfrm.pas @@ -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. +