From 0f0bf1df4ba58e0e1fc791a2026110a457e036dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=BE=D0=BD=D0=B4=D0=B0=D1=80=D0=B5=D0=B2=20=D0=98?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD?= Date: Sun, 26 Nov 2017 18:40:20 +0100 Subject: [PATCH] #570 --- Compiler/Compiler.cs | 11 ++++++ InstallerSamples/Graph3D/ЧаÑ�Ñ‹.pas | 12 +++---- ReleaseGenerators/PABCRtl/PABCRtl.pas | 4 +-- ReleaseGenerators/PABCRtl/PABCRtl32.pas | 4 +-- ReleaseGenerators/RebuildStandartModules.pas | 2 +- TestSuite/CompilationSamples/Colors.pas | 5 --- .../RebuildStandartModules.pas | 2 +- bin/Lib/Colors.pas | 5 --- bin/Lib/Graph3D.pas | 34 ++++++++++++++++++- 9 files changed, 56 insertions(+), 23 deletions(-) delete mode 100644 TestSuite/CompilationSamples/Colors.pas delete mode 100644 bin/Lib/Colors.pas diff --git a/Compiler/Compiler.cs b/Compiler/Compiler.cs index f7eea11f2..6d509e722 100644 --- a/Compiler/Compiler.cs +++ b/Compiler/Compiler.cs @@ -2857,6 +2857,17 @@ namespace PascalABCCompiler directives.Add(new TreeRealization.compiler_directive("reference", "%GAC%\\System.Numerics.dll", null)); directives.Add(new TreeRealization.compiler_directive("reference", "%GAC%\\System.Windows.Forms.dll", null)); directives.Add(new TreeRealization.compiler_directive("reference", "%GAC%\\System.Drawing.dll", null)); + if (Unit.SyntaxTree is SyntaxTree.program_module && (Unit.SyntaxTree as SyntaxTree.program_module).used_units != null) + foreach (SyntaxTree.unit_or_namespace uui in (Unit.SyntaxTree as SyntaxTree.program_module).used_units.units) + { + if (uui.name.ToString() == "Graph3D") + { + directives.Add(new TreeRealization.compiler_directive("reference", "%GAC%\\PresentationFramework.dll", null)); + directives.Add(new TreeRealization.compiler_directive("reference", "%GAC%\\WindowsBase.dll", null)); + directives.Add(new TreeRealization.compiler_directive("reference", "%GAC%\\PresentationCore.dll", null)); + directives.Add(new TreeRealization.compiler_directive("reference", "%GAC%\\HelixToolkit.Wpf.dll", null)); + } + } } foreach (TreeRealization.compiler_directive cd in directives) { diff --git a/InstallerSamples/Graph3D/ЧаÑ�Ñ‹.pas b/InstallerSamples/Graph3D/ЧаÑ�Ñ‹.pas index 21e641040..5ca71fab5 100644 --- a/InstallerSamples/Graph3D/ЧаÑ�Ñ‹.pas +++ b/InstallerSamples/Graph3D/ЧаÑ�Ñ‹.pas @@ -1,10 +1,10 @@ -uses Graph3D; +uses Graph3D; begin View3D.ShowGridLines := False; - var Öèôåðáëàò := Cylinder(0,0,-0.4,0.2,6,Colors.DeepPink); - var Ñåê := Arrow(0,0,0,0,-5.5,0,0.2,Colors.Yellow); - var Ìèí := Arrow(0,0,0,0,-6.0,0,0.3,Colors.Red); + var Циферблат := Cylinder(0,0,-0.4,0.2,6,Colors.DeepPink); + var Сек := Arrow(0,0,0,0,-5.5,0,0.2,Colors.Yellow); + var Мин := Arrow(0,0,0,0,-6.0,0,0.3,Colors.Red); var a := 0; var r := 5.8; @@ -17,7 +17,7 @@ begin while True do begin Sleep(10); - Ñåê.Rotate(v3D(0,0,1),-6); - Ìèí.Rotate(v3D(0,0,1),-6/60); + Сек.Rotate(v3D(0,0,1),-6); + Мин.Rotate(v3D(0,0,1),-6/60); end; end. \ No newline at end of file diff --git a/ReleaseGenerators/PABCRtl/PABCRtl.pas b/ReleaseGenerators/PABCRtl/PABCRtl.pas index 6faf0ed9a..360a5daaa 100644 --- a/ReleaseGenerators/PABCRtl/PABCRtl.pas +++ b/ReleaseGenerators/PABCRtl/PABCRtl.pas @@ -2,10 +2,10 @@ library PABCRtl; uses PABCSystem, PABCExtensions, ABCButtons, ABCHouse, ABCObjects, - ABCSprites, Colors, CRT, DMCollect, DMTaskMaker, DMZadan, Drawman, + ABCSprites, CRT, DMCollect, DMTaskMaker, DMZadan, Drawman, DrawManField, Events, FilesOperations, GraphABC, GraphABCHelper, IniFile, PointerTools, PointRect, Robot, RobotField, RobotTaskMaker, RobotZadan, Sockets, Utils, VCL, Timers, PT4TaskMakerNET, RBDMUtils, - FormsABC, Collections, Arrays, ClientServer, __RedirectIOMode, __RunMode, __RtlUtils; + FormsABC, Collections, Arrays, ClientServer, Graph3D, __RedirectIOMode, __RunMode, __RtlUtils; end. \ No newline at end of file diff --git a/ReleaseGenerators/PABCRtl/PABCRtl32.pas b/ReleaseGenerators/PABCRtl/PABCRtl32.pas index 8eba5da49..a4ff63195 100644 --- a/ReleaseGenerators/PABCRtl/PABCRtl32.pas +++ b/ReleaseGenerators/PABCRtl/PABCRtl32.pas @@ -2,10 +2,10 @@ library PABCRtl32; uses PABCSystem, PABCExtensions, ABCButtons, ABCHouse, ABCObjects, - ABCSprites, Colors, CRT, DMCollect, DMTaskMaker, DMZadan, Drawman, + ABCSprites, CRT, DMCollect, DMTaskMaker, DMZadan, Drawman, DrawManField, Events, FilesOperations, GraphABC, GraphABCHelper, IniFile, PointerTools, PointRect, Robot, RobotField, RobotTaskMaker, RobotZadan, Sockets, Utils, VCL, Timers, PT4, PT4TaskMakerNET, RBDMUtils, - FormsABC, Collections, Arrays, ClientServer, __RedirectIOMode, __RunMode, __RtlUtils; + FormsABC, Collections, Arrays, ClientServer, Graph3D, __RedirectIOMode, __RunMode, __RtlUtils; end. \ No newline at end of file diff --git a/ReleaseGenerators/RebuildStandartModules.pas b/ReleaseGenerators/RebuildStandartModules.pas index ff31082a7..0d3737b35 100644 --- a/ReleaseGenerators/RebuildStandartModules.pas +++ b/ReleaseGenerators/RebuildStandartModules.pas @@ -1,6 +1,6 @@ uses PABCSystem, PABCExtensions, __RedirectIOMode, __RunMode, ABCButtons, ABCHouse, ABCObjects, - ABCSprites, Colors, CRT, DMCollect, DMTaskMaker, DMZadan, Drawman, + ABCSprites, CRT, DMCollect, DMTaskMaker, DMZadan, Drawman, DrawManField, Events, FilesOperations, GraphABC, GraphABCHelper, Graph3D, diff --git a/TestSuite/CompilationSamples/Colors.pas b/TestSuite/CompilationSamples/Colors.pas deleted file mode 100644 index 8a89e1ff4..000000000 --- a/TestSuite/CompilationSamples/Colors.pas +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Ivan Bondarev, Stanislav Mihalkovich (for details please see \doc\copyright.txt) -// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) -//ДлÑ� Ñ�овмеÑ�тимоÑ�ти Ñ� Pascal ABC -unit Colors; -end. \ No newline at end of file diff --git a/TestSuite/CompilationSamples/RebuildStandartModules.pas b/TestSuite/CompilationSamples/RebuildStandartModules.pas index ad94146f7..484a0eeca 100644 --- a/TestSuite/CompilationSamples/RebuildStandartModules.pas +++ b/TestSuite/CompilationSamples/RebuildStandartModules.pas @@ -1,6 +1,6 @@ uses PABCSystem, __RedirectIOMode, __RunMode, ABCButtons, ABCHouse, ABCObjects, - ABCSprites, BFSystem, Colors, CRT, DMCollect, DMTaskMaker, DMZadan, Drawman, + ABCSprites, BFSystem, CRT, DMCollect, DMTaskMaker, DMZadan, Drawman, DrawManField, Events, FilesOperations, GOLDParserEngine, GraphABC, GraphABCHelper, IniFile, PointerTools, PointRect, PT4, Robot, RobotField, RobotTaskMaker, RobotZadan, Sockets, Utils, VCL, Timers, PT4Exam, PT4TaskMakerNET, RBDMUtils, diff --git a/bin/Lib/Colors.pas b/bin/Lib/Colors.pas deleted file mode 100644 index 8a89e1ff4..000000000 --- a/bin/Lib/Colors.pas +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Ivan Bondarev, Stanislav Mihalkovich (for details please see \doc\copyright.txt) -// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) -//ДлÑ� Ñ�овмеÑ�тимоÑ�ти Ñ� Pascal ABC -unit Colors; -end. \ No newline at end of file diff --git a/bin/Lib/Graph3D.pas b/bin/Lib/Graph3D.pas index d63dbb3af..870295102 100644 --- a/bin/Lib/Graph3D.pas +++ b/bin/Lib/Graph3D.pas @@ -1819,12 +1819,44 @@ begin app.Run(MainWindow); end; -initialization +var +///-- +__initialized := false; + +var +///-- +__finalized := false; + +procedure __InitModule; +begin MainFormThread := new System.Threading.Thread(InitWPF0); MainFormThread.SetApartmentState(ApartmentState.STA); MainFormThread.Start; mre.WaitOne; // Îñíîâíàÿ ïðîãðàììà íå íà÷íåòñÿ ïîêà íå áóäóò èíèöèàëèçèðîâàíû âñå êîìïîíåíòû ïðèëîæåíèÿ +end; + +///-- +procedure __InitModule__; +begin + if not __initialized then + begin + __initialized := true; + __InitModule; + end; +end; + +///-- +procedure __FinalizeModule__; +begin + if not __finalized then + begin + __finalized := true; + end; +end; + +initialization + __InitModule; finalization end. \ No newline at end of file