Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ __history
*.#??
*.pbi

# FPC Compiler output files
*.o
*.ppu
**/lib/i386-*/
*.rst
*.or

# Lazarus files
*.compiled
*.lps

# 64bit Delphi/C++Builder files
*.[ao]

Expand All @@ -33,6 +44,7 @@ jcl/lib/*/*.res
jcl/lib/*/debug/*.res
jcl/lib/*/win*/*.res
jcl/lib/*/win*/debug/*.res
jcl/lib/fpc/*/*.res

# JCL files
jcl/bin/*
Expand All @@ -42,9 +54,8 @@ jcl/install/dcc32.cfg
# Auto generated compiler version include files
jcl/source/include/jcld*.inc
jcl/source/include/jclc*.inc
jcl/source/include/jclfpc.inc
jcl/source/include/jclwin32.inc

# InnoSetup installer
thirdparty/InnoSetup/setupbuild/*
thirdparty/InnoSetup/Settings.iss
thirdparty/InnoSetup/Settings.iss
3 changes: 0 additions & 3 deletions jcl/devtools/included_files.bat
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,3 @@ copy ..\source\include\jcl.template.inc ..\source\include\jcld20win32.inc
copy ..\source\include\jcl.template.inc ..\source\include\jcld20win64.inc
copy ..\source\include\jcl.template.inc ..\source\include\jcld21win32.inc
copy ..\source\include\jcl.template.inc ..\source\include\jcld21win64.inc


copy ..\source\include\jcl.template.inc ..\source\include\jclfpc.inc
2 changes: 0 additions & 2 deletions jcl/devtools/included_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,3 @@ cp ../source/include/jcl.template.inc ../source/include/jcld20win64.inc
cp ../source/include/jcl.template.inc ../source/include/jcld21win32.inc
cp ../source/include/jcl.template.inc ../source/include/jcld21win64.inc


cp ../source/include/jcl.template.inc ../source/include/jclfpc.inc
104 changes: 104 additions & 0 deletions jcl/examples/common/expreval/ExprEvalExampleFPC.lpi
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="9"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasUsesSectionForAllUnits Value="False"/>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="ExprEvalExampleFPC"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<XPManifest>
<DpiAware Value="True"/>
</XPManifest>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<StringTable ProductVersion=""/>
</VersionInfo>
<BuildModes Count="1">
<Item1 Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="Jcl"/>
</Item2>
</RequiredPackages>
<Units Count="3">
<Unit0>
<Filename Value="ExprEvalExampleFPC.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ExprEvalExampleFPC"/>
</Unit0>
<Unit1>
<Filename Value="ExprEvalExampleMain.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="ExprEvalForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="ExprEvalExampleMain"/>
</Unit1>
<Unit2>
<Filename Value="ExprEvalExampleLogic.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="ExprEvalExampleFPC"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<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>
17 changes: 17 additions & 0 deletions jcl/examples/common/expreval/ExprEvalExampleFPC.lpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
program ExprEvalExampleFPC;

{$MODE Delphi}

uses
Forms, Interfaces,
ExprEvalExampleMain in 'ExprEvalExampleMain.pas' {ExprEvalForm},
ExprEvalExampleLogic in 'ExprEvalExampleLogic.pas';


{$R *.res}

begin
Application.Initialize;
Application.CreateForm(TExprEvalForm, ExprEvalForm);
Application.Run;
end.
Binary file not shown.
2 changes: 1 addition & 1 deletion jcl/examples/common/expreval/ExprEvalExampleMain.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ object ExprEvalForm: TExprEvalForm
ItemHeight = 13
Sorted = True
TabOrder = 4
OnClick = FuncListClick
OnChange = FuncListChange
end
object ValueEdit: TEdit
Left = 271
Expand Down
115 changes: 115 additions & 0 deletions jcl/examples/common/expreval/ExprEvalExampleMain.lfm
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
object ExprEvalForm: TExprEvalForm
Left = 222
Height = 321
Top = 107
Width = 479
Caption = 'JclExprEval Example'
ClientHeight = 321
ClientWidth = 479
Color = clBtnFace
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
OnCreate = FormCreate
OnDestroy = FormDestroy
Position = poScreenCenter
LCLVersion = '1.3'
object Label1: TLabel
Left = 8
Height = 13
Top = 37
Width = 54
Caption = 'E&xpression:'
FocusControl = ExpressionInput
ParentColor = False
end
object Label2: TLabel
Left = 8
Height = 13
Top = 64
Width = 49
Caption = 'Functions:'
ParentColor = False
end
object Label3: TLabel
Left = 8
Height = 13
Top = 11
Width = 46
Caption = 'Variables:'
ParentColor = False
end
object ExpressionInput: TEdit
Left = 80
Height = 21
Top = 34
Width = 305
Anchors = [akTop, akLeft, akRight]
TabOrder = 3
end
object Memo1: TMemo
Left = 0
Height = 242
Top = 88
Width = 479
Anchors = [akTop, akLeft, akRight, akBottom]
TabOrder = 6
end
object EnterButton: TButton
Left = 396
Height = 25
Top = 34
Width = 75
Anchors = [akTop, akRight]
Caption = 'Evaluate'
Default = True
OnClick = EnterButtonClick
TabOrder = 5
end
object FuncList: TComboBox
Left = 80
Height = 21
Top = 61
Width = 145
ItemHeight = 13
OnChange = FuncListChange
Sorted = True
Style = csDropDownList
TabOrder = 4
end
object ValueEdit: TEdit
Left = 271
Height = 21
Top = 8
Width = 114
OnChange = ValueEditChange
TabOrder = 2
Text = '0'
end
object VarComboBox: TComboBox
Left = 80
Height = 21
Top = 8
Width = 145
ItemHeight = 13
ItemIndex = 0
Items.Strings = (
'x'
'y'
'z'
)
OnChange = VarComboBoxChange
Style = csDropDownList
TabOrder = 0
Text = 'x'
end
object AssignButton: TButton
Left = 231
Height = 21
Top = 8
Width = 34
Caption = ':='
OnClick = AssignButtonClick
TabOrder = 1
end
end
23 changes: 15 additions & 8 deletions jcl/examples/common/expreval/ExprEvalExampleMain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
interface

uses
Windows, SysUtils, Classes, Graphics, Controls, Forms, StdCtrls,
SysUtils, Classes, Graphics, Controls, Forms, StdCtrls,
JclExprEval;

type

{ TExprEvalForm }

TExprEvalForm = class(TForm)
ExpressionInput: TEdit;
Memo1: TMemo;
Expand All @@ -21,8 +24,8 @@ TExprEvalForm = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure EnterButtonClick(Sender: TObject);
procedure FuncListClick(Sender: TObject);
procedure AssignButtonClick(Sender: TObject);
procedure FuncListChange(Sender: TObject);
procedure ValueEditChange(Sender: TObject);
procedure VarComboBoxChange(Sender: TObject);
private
Expand All @@ -40,7 +43,11 @@ TExprEvalForm = class(TForm)

implementation

{$IFDEF FPC}
{$R *.LFM}
{$ELSE}
{$R *.DFM}
{$ENDIF}

uses
ExprEvalExampleLogic;
Expand Down Expand Up @@ -74,18 +81,18 @@ procedure TExprEvalForm.AssignButtonClick(Sender: TObject);
ValueEdit.Font.Color := clRed;
end;

procedure TExprEvalForm.EnterButtonClick(Sender: TObject);
begin
Memo1.Lines.Add(ResultAsText(FEvaluator as TEvaluator, ExpressionInput.Text));
end;

procedure TExprEvalForm.FuncListClick(Sender: TObject);
procedure TExprEvalForm.FuncListChange(Sender: TObject);
begin
ExpressionInput.Text := ExpressionInput.Text + FuncList.Text;
ActiveControl := ExpressionInput;
ExpressionInput.SelStart := Length(ExpressionInput.Text);
end;

procedure TExprEvalForm.EnterButtonClick(Sender: TObject);
begin
Memo1.Lines.Add(ResultAsText(FEvaluator as TEvaluator, ExpressionInput.Text));
end;

procedure TExprEvalForm.ValueEditChange(Sender: TObject);
const
TextColor: array[Boolean] of TColor = (clRed, clWindowText);
Expand Down
Loading