From fc02fe8edc09f2145493a4ba88d257b8f7a2013d Mon Sep 17 00:00:00 2001 From: miks1965 Date: Fri, 16 Mar 2018 14:32:42 +0300 Subject: [PATCH] EmptyAnim --- Configuration/GlobalAssemblyInfo.cs | 2 +- Configuration/Version.defs | 4 +- ReleaseGenerators/PascalABCNET_version.nsh | 2 +- bin/Lib/Graph3D.pas | 50 +++++++++++++++++----- 4 files changed, 43 insertions(+), 15 deletions(-) diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index cec146ae4..e041c6746 100644 --- a/Configuration/GlobalAssemblyInfo.cs +++ b/Configuration/GlobalAssemblyInfo.cs @@ -15,7 +15,7 @@ internal static class RevisionClass public const string Major = "3"; public const string Minor = "3"; public const string Build = "5"; - public const string Revision = "1638"; + public const string Revision = "1639"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/Configuration/Version.defs b/Configuration/Version.defs index 8a3145d02..736cb4486 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%MINOR%=3 -%REVISION%=1638 %COREVERSION%=5 +%REVISION%=1639 +%MINOR%=3 %MAJOR%=3 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index c1a58d4d0..f69b14244 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.3.5.1638' +!define VERSION '3.3.5.1639' diff --git a/bin/Lib/Graph3D.pas b/bin/Lib/Graph3D.pas index 9781474a5..3eb167df6 100644 --- a/bin/Lib/Graph3D.pas +++ b/bin/Lib/Graph3D.pas @@ -767,15 +767,6 @@ type d(); end; - procedure BeginT; - begin - sb := CreateStoryboard; - InitAnim(sb); - ApplyAllDecorators; - sb.Completed += procedure (o, e) -> sb.Children.Clear; - sb.Begin; - end; - procedure InitAnimWait(sb: StoryBoard; waittime: real); virtual; begin end; @@ -870,9 +861,34 @@ type Result := Self; end; + private + procedure BeginT; + begin + sb := CreateStoryboard; + InitAnim(sb); + ApplyAllDecorators; + sb.Completed += procedure (o, e) -> sb.Children.Clear; + sb.Begin; + end; + procedure RemoveT := begin + sb.Pause; + sb := new Storyboard; + end; + procedure ChangeT(a: MyAnimation); + begin + sb := CreateStoryboard; + Print(a.sb); + foreach var d in a.sb.Children do + sb.Children.Add(d); + Print(2); + end; + public procedure &Begin; virtual := Invoke(BeginT); - procedure Pause := sb.Pause; - procedure Resume := sb.Resume; + procedure Remove := Invoke(RemoveT); + procedure Change(a: MyAnimation) := Invoke(ChangeT,a); + procedure Pause := if sb<>nil then sb.Pause; + procedure Resume := if sb<>nil then sb.Resume; + function Duration: real; virtual := seconds; function &Then(second: MyAnimation): MyAnimation; function Forever: MyAnimation; virtual := Self; @@ -880,6 +896,16 @@ type function AccelerationRatio(acceleration: real; deceleration: real := 0): MyAnimation; virtual := Self; end; + EmptyAnimation = class(MyAnimation) + public + constructor(wait: real); + begin + Self.Seconds := wait; + end; + procedure InitAnim(sb: StoryBoard); virtual := InitAnimWait(sb, Seconds); + end; + + Double1AnimationBase = class(MyAnimation) private v: real; @@ -1279,6 +1305,8 @@ function operator*(a, b: MyAnimation): MyAnimation; extensionmethod := Animate.G function MyAnimation.&Then(second: MyAnimation): MyAnimation := Self + second; +function EmptyAnim(sec: real) := EmptyAnimation.Create(sec); + //------------------------------ End Animation -------------------------------