You've already forked lazarus-ccr
systools: Initial commit of Lazarus port of TurboPower SysTools (incomplete).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6140 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
82
components/systools/examples/html/ex2html.lpi
Normal file
82
components/systools/examples/html/ex2html.lpi
Normal file
@@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<UseDefaultCompilerOptions Value="True"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="ex2html"/>
|
||||
<Scaled Value="True"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
<XPManifest>
|
||||
<DpiAware Value="True"/>
|
||||
</XPManifest>
|
||||
<Icon Value="0"/>
|
||||
</General>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
<Modes Count="0"/>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="laz_systools"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="ex2html.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="EX2HTML"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="ex2htmlu.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<HasResources Value="True"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="ex2html"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<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>
|
38
components/systools/examples/html/ex2html.lpr
Normal file
38
components/systools/examples/html/ex2html.lpr
Normal file
@@ -0,0 +1,38 @@
|
||||
(* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is TurboPower SysTools
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* TurboPower Software
|
||||
*
|
||||
* Portions created by the Initial Developer are Copyright (C) 1996-2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** *)
|
||||
|
||||
program EX2HTML;
|
||||
|
||||
uses
|
||||
Forms, Interfaces,
|
||||
ex2htmlu in 'ex2htmlu.pas' {Form1};
|
||||
|
||||
{$R *.RES}
|
||||
|
||||
begin
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
184
components/systools/examples/html/ex2htmlu.lfm
Normal file
184
components/systools/examples/html/ex2htmlu.lfm
Normal file
@@ -0,0 +1,184 @@
|
||||
object Form1: TForm1
|
||||
Left = 384
|
||||
Height = 184
|
||||
Top = 318
|
||||
Width = 221
|
||||
BorderStyle = bsDialog
|
||||
Caption = 'EXTOHTML'
|
||||
ClientHeight = 184
|
||||
ClientWidth = 221
|
||||
Color = clBtnFace
|
||||
Font.Color = clBlack
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '1.9.0.0'
|
||||
object Label1: TLabel
|
||||
Left = 10
|
||||
Height = 15
|
||||
Top = 12
|
||||
Width = 49
|
||||
Caption = 'Input File'
|
||||
ParentColor = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 10
|
||||
Height = 15
|
||||
Top = 59
|
||||
Width = 59
|
||||
Caption = 'Output File'
|
||||
ParentColor = False
|
||||
end
|
||||
object SpeedButton1: TSpeedButton
|
||||
Left = 184
|
||||
Height = 25
|
||||
Top = 28
|
||||
Width = 25
|
||||
OnClick = GetFileClick
|
||||
end
|
||||
object SpeedButton2: TSpeedButton
|
||||
Left = 183
|
||||
Height = 25
|
||||
Top = 75
|
||||
Width = 25
|
||||
OnClick = GetFileClick
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 10
|
||||
Height = 15
|
||||
Top = 115
|
||||
Width = 41
|
||||
Caption = 'Waiting'
|
||||
ParentColor = False
|
||||
end
|
||||
object Button1: TButton
|
||||
Left = 66
|
||||
Height = 25
|
||||
Top = 147
|
||||
Width = 75
|
||||
Caption = 'Convert'
|
||||
OnClick = Button1Click
|
||||
TabOrder = 2
|
||||
end
|
||||
object Edit1: TEdit
|
||||
Left = 10
|
||||
Height = 23
|
||||
Top = 29
|
||||
Width = 169
|
||||
TabOrder = 0
|
||||
Text = '..\..\source\run/sttohtml.pas'
|
||||
end
|
||||
object Edit2: TEdit
|
||||
Left = 10
|
||||
Height = 23
|
||||
Top = 76
|
||||
Width = 168
|
||||
TabOrder = 1
|
||||
Text = 'out.htm'
|
||||
end
|
||||
object StFileToHTML1: TStFileToHTML
|
||||
CommentMarkers.Strings = (
|
||||
'//=;<font color=#FF0000><i>;</i></font>'
|
||||
'(*=*);<font color=#FF0000><i>;</i></font>'
|
||||
'/*=*/;<font color=#FF0000><i>;</i></font>'
|
||||
'{=};<font color=#FF0000><i>;</i></font>'
|
||||
)
|
||||
EmbeddedHTML.Strings = (
|
||||
'"="'
|
||||
'&=&'
|
||||
'<=<'
|
||||
'>=>'
|
||||
'¡=¡'
|
||||
'¢=¢'
|
||||
'£=£'
|
||||
'©=©'
|
||||
'®=®'
|
||||
'±=±'
|
||||
'¼=¼'
|
||||
'½=½'
|
||||
'¾=¾'
|
||||
'÷=÷'
|
||||
)
|
||||
Keywords.Strings = (
|
||||
'and=<B>;</B>'
|
||||
'array=<B>;</B>'
|
||||
'as=<B>;</B>'
|
||||
'asm=<B>;</B>'
|
||||
'begin=<B>;</B>'
|
||||
'case=<B>;</B>'
|
||||
'class=<B>;</B>'
|
||||
'const=<B>;</B>'
|
||||
'constructor=<B>;</B>'
|
||||
'destructor=<B>;</B>'
|
||||
'dispinterface=<B>;</B>'
|
||||
'div=<B>;</B>'
|
||||
'do=<B>;</B>'
|
||||
'downto=<B>;</B>'
|
||||
'else=<B>;</B>'
|
||||
'end=<B>;</B>'
|
||||
'except=<B>;</B>'
|
||||
'exports=<B>;</B>'
|
||||
'file=<B>;</B>'
|
||||
'finalization=<B>;</B>'
|
||||
'finally=<B>;</B>'
|
||||
'for=<B>;</B>'
|
||||
'function=<B>;</B>'
|
||||
'goto=<B>;</B>'
|
||||
'if=<B>;</B>'
|
||||
'implementation=<B>;</B>'
|
||||
'in=<B>;</B>'
|
||||
'inherited=<B>;</B>'
|
||||
'initialization=<B>;</B>'
|
||||
'inline=<B>;</B>'
|
||||
'interface=<B>;</B>'
|
||||
'is=<B>;</B>'
|
||||
'label=<B>;</B>'
|
||||
'library=<B>;</B>'
|
||||
'mod=<B>;</B>'
|
||||
'nil=<B>;</B>'
|
||||
'not=<B>;</B>'
|
||||
'object=<B>;</B>'
|
||||
'of=<B>;</B>'
|
||||
'or=<B>;</B>'
|
||||
'out=<B>;</B>'
|
||||
'packed=<B>;</B>'
|
||||
'procedure=<B>;</B>'
|
||||
'program=<B>;</B>'
|
||||
'property=<B>;</B>'
|
||||
'protected=<B>;</B>'
|
||||
'public=<B>;</B>'
|
||||
'raise=<B>;</B>'
|
||||
'record=<B>;</B>'
|
||||
'repeat=<B>;</B>'
|
||||
'resourcestring=<B>;</B>'
|
||||
'set=<B>;</B>'
|
||||
'shl=<B>;</B>'
|
||||
'shr=<B>;</B>'
|
||||
'string=<B>;</B>'
|
||||
'then=<B>;</B>'
|
||||
'thread=<B>;</B>'
|
||||
'var=<B>;</B>'
|
||||
'to=<B>;</B>'
|
||||
'try=<B>;</B>'
|
||||
'type=<B>;</B>'
|
||||
'unit=<B>;</B>'
|
||||
'until=<B>;</B>'
|
||||
'uses=<B>;</B>'
|
||||
'var=<B>;</B>'
|
||||
'while=<B>;</B>'
|
||||
'with=<B>;</B>'
|
||||
)
|
||||
OnProgress = StFileToHTML1Progress
|
||||
StringMarkers.Strings = (
|
||||
'"=";<font color=#0000FF>;</font>'
|
||||
'''='';<font color=#0000FF>;</font>'
|
||||
)
|
||||
WordDelimiters = ',; .()'
|
||||
left = 133
|
||||
top = 1
|
||||
end
|
||||
object OpenDialog1: TOpenDialog
|
||||
Filter = 'Pascal files (*.pas)|*.pas|C++ files (*.cpp)|*.cpp|All files (*.*)|*.*'
|
||||
Options = [ofOverwritePrompt, ofPathMustExist]
|
||||
left = 97
|
||||
top = 65535
|
||||
end
|
||||
end
|
99
components/systools/examples/html/ex2htmlu.pas
Normal file
99
components/systools/examples/html/ex2htmlu.pas
Normal file
@@ -0,0 +1,99 @@
|
||||
(* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is TurboPower SysTools
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* TurboPower Software
|
||||
*
|
||||
* Portions created by the Initial Developer are Copyright (C) 1996-2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** *)
|
||||
|
||||
unit ex2htmlu;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
{$IFNDEF FPC}
|
||||
Windows, Messages,
|
||||
{$ENDIF}
|
||||
SysUtils, Classes, Graphics, Controls,
|
||||
Forms, Dialogs, StdCtrls, Buttons,
|
||||
|
||||
StBase, StToHTML;
|
||||
|
||||
type
|
||||
TForm1 = class(TForm)
|
||||
Button1: TButton;
|
||||
StFileToHTML1: TStFileToHTML;
|
||||
Edit1: TEdit;
|
||||
Edit2: TEdit;
|
||||
Label1: TLabel;
|
||||
Label2: TLabel;
|
||||
SpeedButton1: TSpeedButton;
|
||||
SpeedButton2: TSpeedButton;
|
||||
Label3: TLabel;
|
||||
OpenDialog1: TOpenDialog;
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure GetFileClick(Sender: TObject);
|
||||
procedure StFileToHTML1Progress(Sender: TObject; Percent: Word);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
procedure TForm1.Button1Click(Sender: TObject);
|
||||
begin
|
||||
if (not FileExists(Edit1.Text)) then begin
|
||||
ShowMessage('Input file does not exist');
|
||||
Exit;
|
||||
end;
|
||||
|
||||
StFileToHTML1.InFileName := Edit1.Text;
|
||||
StFileToHTML1.OutFileName := Edit2.Text;
|
||||
|
||||
StFileToHTML1.Execute;
|
||||
Label1.Caption := 'Waiting';
|
||||
ShowMessage('Done');
|
||||
end;
|
||||
|
||||
|
||||
procedure TForm1.GetFileClick(Sender: TObject);
|
||||
begin
|
||||
if (OpenDialog1.Execute) then begin
|
||||
if (Sender = SpeedButton1) then
|
||||
Edit1.Text := OpenDialog1.FileName
|
||||
else if (Sender = SpeedButton2) then
|
||||
Edit2.Text := OpenDialog1.FileName;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.StFileToHTML1Progress(Sender: TObject; Percent: Word);
|
||||
begin
|
||||
Label1.Caption := 'Completed: ' + IntToStr(Percent) + '%';
|
||||
end;
|
||||
|
||||
|
||||
end.
|
Reference in New Issue
Block a user