Skip to content

Commit

Permalink
Beta 14
Browse files Browse the repository at this point in the history
  • Loading branch information
David Berneda committed Jul 1, 2016
1 parent cddc163 commit 0765292
Show file tree
Hide file tree
Showing 136 changed files with 6,127 additions and 935 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ procedure FillTree(const ATree:TTreeView; const AExpression:TExpression);
tmp:=NewNode('not');
AddNodes(tmp,TUnaryExpression(AExpression).Expression);
end
else
if AExpression is TIfExpression then
begin
tmp:=NewNode(TIfExpression(AExpression).Condition.ToString);

AddNodes(tmp,TIfExpression(AExpression).ThenExpression);
AddNodes(tmp,TIfExpression(AExpression).ElseExpression);
end
else
NewNode(AExpression.ToString)
end;
Expand Down
52 changes: 36 additions & 16 deletions demos/delphi/firemonkey/Expressions/Main_Unit.fmx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ object FormMain: TFormMain
Size.Width = 393.000000000000000000
Size.Height = 600.000000000000000000
Size.PlatformDefault = False
TabIndex = 0
TabIndex = 1
TabOrder = 11
TabPosition = PlatformDefault
object TabTest: TTabItem
CustomIcon = <
item
end>
IsSelected = True
IsSelected = False
Size.Width = 41.000000000000000000
Size.Height = 26.000000000000000000
Size.PlatformDefault = False
Expand Down Expand Up @@ -196,28 +196,28 @@ object FormMain: TFormMain
CustomIcon = <
item
end>
IsSelected = False
Size.Width = 69.000000000000000000
IsSelected = True
Size.Width = 51.000000000000000000
Size.Height = 26.000000000000000000
Size.PlatformDefault = False
StyleLookup = ''
TabOrder = 0
Text = 'Examples'
Text = 'Other'
ExplicitSize.cx = 69.000000000000000000
ExplicitSize.cy = 26.000000000000000000
object BExampleFormula: TButton
Position.X = 24.000000000000000000
Position.Y = 39.000000000000000000
Position.Y = 22.000000000000000000
Size.Width = 233.000000000000000000
Size.Height = 22.000000000000000000
Size.PlatformDefault = False
TabOrder = 19
TabOrder = 21
Text = 'x:= (3*2) + Sqr(4) - 7'
OnClick = BExampleFormulaClick
end
object Button2: TButton
Position.X = 24.000000000000000000
Position.Y = 72.000000000000000000
Position.Y = 56.000000000000000000
Size.Width = 233.000000000000000000
Size.Height = 22.000000000000000000
Size.PlatformDefault = False
Expand All @@ -227,17 +227,17 @@ object FormMain: TFormMain
end
object Button3: TButton
Position.X = 24.000000000000000000
Position.Y = 140.000000000000000000
Position.Y = 125.000000000000000000
Size.Width = 233.000000000000000000
Size.Height = 22.000000000000000000
Size.PlatformDefault = False
TabOrder = 6
TabOrder = 8
Text = 'Animals Size>7 and Name<>'#39'Ocelot'#39
OnClick = Button3Click
end
object Button4: TButton
Position.X = 24.000000000000000000
Position.Y = 105.000000000000000000
Position.Y = 90.000000000000000000
Size.Width = 233.000000000000000000
Size.Height = 22.000000000000000000
Size.PlatformDefault = False
Expand All @@ -249,7 +249,7 @@ object FormMain: TFormMain
Touch.InteractiveGestures = [LongTap, DoubleTap]
TabOrder = 1
Position.X = 24.000000000000000000
Position.Y = 184.000000000000000000
Position.Y = 269.000000000000000000
Size.Width = 233.000000000000000000
Size.Height = 22.000000000000000000
Size.PlatformDefault = False
Expand All @@ -258,7 +258,7 @@ object FormMain: TFormMain
end
object BEvaluate: TButton
Position.X = 24.000000000000000000
Position.Y = 216.000000000000000000
Position.Y = 301.000000000000000000
Size.Width = 80.000000000000000000
Size.Height = 22.000000000000000000
Size.PlatformDefault = False
Expand All @@ -269,22 +269,42 @@ object FormMain: TFormMain
object Button5: TButton
Enabled = False
Position.X = 176.000000000000000000
Position.Y = 216.000000000000000000
Position.Y = 301.000000000000000000
Size.Width = 80.000000000000000000
Size.Height = 22.000000000000000000
Size.PlatformDefault = False
TabOrder = 8
TabOrder = 10
Text = '&Edit...'
OnClick = Button5Click
end
object LabelResult: TLabel
Position.X = 24.000000000000000000
Position.Y = 248.000000000000000000
Position.Y = 333.000000000000000000
Size.Width = 233.000000000000000000
Size.Height = 17.000000000000000000
Size.PlatformDefault = False
Text = '?'
end
object Button1: TButton
Position.X = 24.000000000000000000
Position.Y = 159.000000000000000000
Size.Width = 233.000000000000000000
Size.Height = 22.000000000000000000
Size.PlatformDefault = False
TabOrder = 7
Text = 'RTTI Expression'
OnClick = Button1Click
end
object Button6: TButton
Position.X = 24.000000000000000000
Position.Y = 194.000000000000000000
Size.Width = 233.000000000000000000
Size.Height = 22.000000000000000000
Size.PlatformDefault = False
TabOrder = 6
Text = 'If Expression then A else B'
OnClick = Button6Click
end
end
end
object Layout2: TLayout
Expand Down
45 changes: 42 additions & 3 deletions demos/delphi/firemonkey/Expressions/Main_Unit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ TFormMain = class(TForm)
Layout2: TLayout;
TreeView1: TTreeView;
Splitter1: TSplitter;
Button1: TButton;
Button6: TButton;
procedure BEvaluateClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
Expand All @@ -78,6 +80,8 @@ TFormMain = class(TForm)
procedure BTestAllClick(Sender: TObject);
procedure BExampleFormulaClick(Sender: TObject);
procedure Button8Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
private
{ Private declarations }

Expand All @@ -102,7 +106,7 @@ TFormMain = class(TForm)
implementation

uses
BI.Arrays, BI.Data.Expressions,
BI.Arrays, BI.Data.Expressions, BI.Data.RTTI,
BI.FMX.Expression.Tree, BI.Expression.Benchmark;

{$R *.fmx}
Expand All @@ -112,6 +116,18 @@ procedure TFormMain.BEvaluateClick(Sender: TObject);
LabelResult.Text:=Expression.Value;
end;

procedure TFormMain.Button1Click(Sender: TObject);
begin
Expression.Free;

Expression:=TObjectExpression.From(Button1,'Text');

Present;

BEvaluate.Enabled:=True;
BEvaluateClick(Self);
end;

procedure TFormMain.Button2Click(Sender: TObject);
begin
Expression.Free;
Expand Down Expand Up @@ -203,6 +219,27 @@ procedure TFormMain.Button5Click(Sender: TObject);
// TExpressionEditor.Edit(Self,Expression);
end;

procedure TFormMain.Button6Click(Sender: TObject);
begin
Expression.Free;

// " if Edit1.Text = 'S' then 'Spain' else 'Brazil' "
Expression:=TIfExpression.Create(
TLogicalExpression.Create(
TObjectExpression.From(Edit1,'Text'),
TLogicalOperand.Equal,
TTextExpression.Create('S')
),
TTextExpression.Create('Spain'),
TTextExpression.Create('Brazil')
);

ShowTree;

BEvaluate.Enabled:=True;
BEvaluateClick(Self);
end;

// Parse and evaluate S string to verify the expression
procedure TFormMain.TestExpression(const S:String);
var Value,
Expand Down Expand Up @@ -303,8 +340,10 @@ procedure TFormMain.ParseExpression(const AExpression:String);
begin
// Parse error, unknown identifier

LabelResult.Text:='Unknown: '+S;
result:=nil;
result:=TObjectExpression.Parse(Self,S);

if result=nil then
LabelResult.Text:='Unknown: '+S;
end,
function(const APos:Integer; const Text:String):Boolean
begin
Expand Down
36 changes: 18 additions & 18 deletions demos/delphi/firemonkey/Expressions/TeeBI_Expressions_Test.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<FrameworkType>FMX</FrameworkType>
<MainSource>TeeBI_Expressions_Test.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Release</Config>
<Config Condition="'$(Config)'==''">Debug</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>31</TargetedPlatforms>
<AppType>Application</AppType>
Expand Down Expand Up @@ -308,27 +308,12 @@
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="DependencyModule">
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
</Platform>
<DeployClass Name="ProjectiOSDeviceResourceRules">
<Platform Name="iOSDevice64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXResource">
Expand Down Expand Up @@ -692,12 +677,27 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceResourceRules">
<DeployClass Name="DependencyModule">
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
</DeployClass>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
Expand Down
17 changes: 17 additions & 0 deletions demos/delphi/vcl/Dashboards/Editor/BIVisual_Editor.dpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
program BIVisual_Editor;

uses
Vcl.Forms,
Unit_Main in 'Unit_Main.pas' {Form34};

{$R *.res}

begin
{$IFOPT D+}
ReportMemoryLeaksOnShutdown:=True;
{$ENDIF}
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TForm34, Form34);
Application.Run;
end.
Loading

0 comments on commit 0765292

Please sign in to comment.