diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index de2f2a81b..443cbbdce 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 = "6"; public const string Build = "3"; - public const string Revision = "2552"; + public const string Revision = "2556"; 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 6ae7b119a..0df7c9511 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ %COREVERSION%=3 -%REVISION%=2552 +%REVISION%=2556 %MINOR%=6 %MAJOR%=3 diff --git a/InstallerSamples/StandardUnits/Turtle/Turtle1.pas b/InstallerSamples/StandardUnits/Turtle/Turtle1.pas new file mode 100644 index 000000000..2d40e8812 --- /dev/null +++ b/InstallerSamples/StandardUnits/Turtle/Turtle1.pas @@ -0,0 +1,53 @@ +uses Turtle,GraphWPF; + +var + Atom,FStr,XStr,YStr: string; + angle,len,x0,y0: real; + n: integer; + +procedure Init1; // Dragon +begin + (Atom,FStr,XStr,YStr) := ('fx','f','x+yf+','-fx-y'); + (angle,len,n,x0,y0) := (90,3,15,300,450); +end; + +procedure Init2; // Koch curve +begin + (Atom,FStr,XStr,YStr) := ('F', 'F-F++F-F', '', ''); + (angle,len,n,x0,y0) := (60,5,7,10,550); +end; + +procedure Init3; // Quadratic Koch Island +begin + (Atom,FStr,XStr,YStr) := ('F+F+F+F', 'F+F-FF+F+F-F', '', ''); + (angle,len,n,x0,y0) := (90,4,4,250,450); +end; + +procedure Init4; // Gosper hexagonal curve +begin + (Atom,FStr,XStr,YStr) := ('XF', 'F', 'X+YF++YF-FX--FXFX-YF+','-FX+YFYF++YF+FX--FX-Y'); + (angle,len,n,x0,y0) := (60,4,5,580,56); +end; + +procedure RunStr(s: string; n: integer); +begin + foreach var c in s do + case c of + '+': Turn(angle); + '-': Turn(-angle); + 'f','F': if n>0 then RunStr(FStr,n-1) else Forw(len); + 'x','X': if n>0 then RunStr(XStr,n-1); + 'y','Y': if n>0 then RunStr(YStr,n-1); + else Print('error') + end; +end; + +begin + Init4; + ToPoint(x0,y0); + SetWidth(0.5); + //SetColor(Colors.Red); + Down; + RunStr(Atom,n); + Up; +end. \ No newline at end of file diff --git a/Localization/DefaultLang.resources b/Localization/DefaultLang.resources index f50eebaa7..3b61dd5c3 100644 Binary files a/Localization/DefaultLang.resources and b/Localization/DefaultLang.resources differ diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index a5b73e223..ef457c0e7 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.6.3.2552 +3.6.3.2556 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 36ef42a60..d929a41b7 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.6.3.2552' +!define VERSION '3.6.3.2556' diff --git a/ReleaseGenerators/RebuildStandartModules.pas b/ReleaseGenerators/RebuildStandartModules.pas index 52d5c5b3e..3dacd3073 100644 --- a/ReleaseGenerators/RebuildStandartModules.pas +++ b/ReleaseGenerators/RebuildStandartModules.pas @@ -6,7 +6,7 @@ GraphABCHelper, GraphWPFBase, Graph3D, - GraphWPF, + GraphWPF, Turtle, WPFObjects, NumLibABC, IniFile, PointerTools, PointRect, PT4, PT4MakerNetX, Robot, RobotField, diff --git a/ReleaseGenerators/sect_Core.nsh b/ReleaseGenerators/sect_Core.nsh index c85d2b535..a2b6d610f 100644 --- a/ReleaseGenerators/sect_Core.nsh +++ b/ReleaseGenerators/sect_Core.nsh @@ -134,6 +134,7 @@ File ..\bin\Lib\OpenGLABC.pcu File ..\bin\Lib\School.pcu File ..\bin\Lib\SF.pcu + File ..\bin\Lib\Turtle.pcu File ..\bin\Lib\PABCRtl.dll File ..\bin\Lib\HelixToolkit.Wpf.dll @@ -202,6 +203,7 @@ ${AddFile} "OpenGLABC.pcu" ${AddFile} "School.pcu" ${AddFile} "SF.pcu" + ${AddFile} "Turtle.pcu" ${AddFile} "PABCRtl.dll" ${AddFile} "HelixToolkit.Wpf.dll" @@ -281,6 +283,7 @@ File ..\bin\Lib\OpenGLABC.pas File ..\bin\Lib\School.pas File ..\bin\Lib\SF.pas + File ..\bin\Lib\Turtle.pas File ..\bin\Lib\__RedirectIOMode.vb File ..\bin\Lib\VBSystem.vb @@ -346,6 +349,7 @@ ${AddFile} "OpenGLABC.pas" ${AddFile} "School.pas" ${AddFile} "SF.pas" + ${AddFile} "Turtle.pas" ${AddFile} "__RedirectIOMode.vb" ${AddFile} "VBSystem.vb" diff --git a/bin/Lib/Controls.pas b/bin/Lib/Controls.pas index 28659cf7c..1bacbe659 100644 --- a/bin/Lib/Controls.pas +++ b/bin/Lib/Controls.pas @@ -108,7 +108,7 @@ type begin var tb := new GTextBlock; element := tb; - element.Margin := new Thickness(0, 0, 0, GlobalHMargin); + //element.Margin := new Thickness(0, 0, 0, GlobalHMargin); //element.Margin := new Thickness(5,5,5,0); tb.FontSize := fontsize; Text := Txt; @@ -346,12 +346,13 @@ protected sl.Minimum := min; sl.Maximum := max; sl.Value := val; + sl.Foreground := Brushes.Black; ActivePanel.Children.Add(sl); end; procedure ValueChangedP := if ValueChanged <> nil then ValueChanged; public - event ValueChanged: procedure; + ValueChanged: procedure; constructor Create(min, max, val: real); begin Invoke(CreateP, min, max, val); diff --git a/bin/Lib/Turtle.pas b/bin/Lib/Turtle.pas new file mode 100644 index 000000000..e427420d4 --- /dev/null +++ b/bin/Lib/Turtle.pas @@ -0,0 +1,49 @@ +/// Исполнитель Черепаха +unit Turtle; + +uses GraphWPF; + +var + tp := Window.Center; + a: real := 0; + dr := False; + +/// Поворачивает Черепаху на угол da против часовой стрелки +procedure Turn(da: real); +begin + a += da; +end; + +/// Продвигает Черепаху вперёд на расстояние r +procedure Forw(r: real); +begin + tp += r * Vect(Cos(DegToRad(a)),Sin(DegToRad(a))); + if dr then + LineTo(tp.X,tp.Y) + else MoveTo(tp.X,tp.Y) +end; + +/// Опускает хвост Черепахи +procedure Down := dr := True; + +/// Поднимает хвост Черепахи +procedure Up := dr := False; + +/// Устанавливает ширину линии +procedure SetWidth(w: real) := Pen.Width := w; + +/// Устанавливает цвет линии +procedure SetColor(c: GColor) := Pen.Color := c; + +/// Перемещает Черепаху в точку (x,y) +procedure ToPoint(x,y: real); +begin + tp := Pnt(x,y); + MoveTo(tp.X,tp.Y); +end; + + +begin + pen.RoundCap := True; + MoveTo(tp.X,tp.Y) +end. \ No newline at end of file