From 6d50302df19df877f3f2ca4ab779b8190476ef75 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, 2 Sep 2018 14:13:15 +0200 Subject: [PATCH] #1069 --- ReleaseGenerators/PABCRtl/PABCRtl.pas | 2 +- ReleaseGenerators/PABCRtl/PABCRtl32.pas | 2 +- bin/Lib/GraphWPF.pas | 16 ---------------- bin/Lib/GraphWPFBase.pas | 15 ++++++++++++++- bin/Lib/WPFObjects.pas | 16 ---------------- 5 files changed, 16 insertions(+), 35 deletions(-) diff --git a/ReleaseGenerators/PABCRtl/PABCRtl.pas b/ReleaseGenerators/PABCRtl/PABCRtl.pas index cf5cbab18..5fca3a61b 100644 --- a/ReleaseGenerators/PABCRtl/PABCRtl.pas +++ b/ReleaseGenerators/PABCRtl/PABCRtl.pas @@ -6,6 +6,6 @@ uses DrawManField, Events, FilesOperations, GraphABC, GraphABCHelper, IniFile, PointerTools, PointRect, Robot, RobotField, RobotTaskMaker, RobotZadan, Sockets, Utils, VCL, Timers, PT4TaskMakerNET, RBDMUtils, - FormsABC, Collections, Arrays, ClientServer, Graph3D, GraphWPF, __RedirectIOMode, __RunMode, __RtlUtils; + FormsABC, Collections, Arrays, ClientServer, WPFObjects, Graph3D, GraphWPF, __RedirectIOMode, __RunMode, __RtlUtils; end. \ No newline at end of file diff --git a/ReleaseGenerators/PABCRtl/PABCRtl32.pas b/ReleaseGenerators/PABCRtl/PABCRtl32.pas index 04d6fac1e..6f808629a 100644 --- a/ReleaseGenerators/PABCRtl/PABCRtl32.pas +++ b/ReleaseGenerators/PABCRtl/PABCRtl32.pas @@ -6,6 +6,6 @@ uses DrawManField, Events, FilesOperations, GraphABC, GraphABCHelper, IniFile, PointerTools, PointRect, Robot, RobotField, RobotTaskMaker, RobotZadan, Sockets, Utils, VCL, Timers, PT4, PT4TaskMakerNET, RBDMUtils, - FormsABC, Collections, Arrays, ClientServer, Graph3D, GraphWPF, __RedirectIOMode, __RunMode, __RtlUtils; + FormsABC, Collections, Arrays, ClientServer, Graph3D, GraphWPF, WPFObjects, __RedirectIOMode, __RunMode, __RtlUtils; end. \ No newline at end of file diff --git a/bin/Lib/GraphWPF.pas b/bin/Lib/GraphWPF.pas index d6836bb49..06fd16fc0 100644 --- a/bin/Lib/GraphWPF.pas +++ b/bin/Lib/GraphWPF.pas @@ -501,22 +501,6 @@ begin end; end; -function operator implicit(Self: (integer, integer)): Point; extensionmethod := new Point(Self[0], Self[1]); -function operator implicit(Self: (integer, real)): Point; extensionmethod := new Point(Self[0], Self[1]); -function operator implicit(Self: (real, integer)): Point; extensionmethod := new Point(Self[0], Self[1]); -function operator implicit(Self: (real, real)): Point; extensionmethod := new Point(Self[0], Self[1]); - -function operator implicit(Self: array of (real, real)): array of Point; extensionmethod := - Self.Select(t->new Point(t[0],t[1])).ToArray; -function operator implicit(Self: array of (integer, integer)): array of Point; extensionmethod := - Self.Select(t->new Point(t[0],t[1])).ToArray; - - -///---- Helpers -procedure SetLeft(Self: UIElement; l: integer); extensionmethod := Canvas.SetLeft(Self,l); - -procedure SetTop(Self: UIElement; t: integer); extensionmethod := Canvas.SetTop(Self,t); - {procedure MoveTo(Self: UIElement; l,t: integer); extensionmethod; begin Canvas.SetLeft(Self,l); diff --git a/bin/Lib/GraphWPFBase.pas b/bin/Lib/GraphWPFBase.pas index 0fc2a1dba..f4b09bba9 100644 --- a/bin/Lib/GraphWPFBase.pas +++ b/bin/Lib/GraphWPFBase.pas @@ -207,8 +207,21 @@ function WindowType.Center := Pnt(Width/2,Height/2); function WindowType.ClientRect := Rect(0,0,Width,Height); +function operator implicit(Self: (integer, integer)): Point; extensionmethod := new Point(Self[0], Self[1]); +function operator implicit(Self: (integer, real)): Point; extensionmethod := new Point(Self[0], Self[1]); +function operator implicit(Self: (real, integer)): Point; extensionmethod := new Point(Self[0], Self[1]); +function operator implicit(Self: (real, real)): Point; extensionmethod := new Point(Self[0], Self[1]); + +function operator implicit(Self: array of (real, real)): array of Point; extensionmethod := + Self.Select(t->new Point(t[0],t[1])).ToArray; +function operator implicit(Self: array of (integer, integer)): array of Point; extensionmethod := + Self.Select(t->new Point(t[0],t[1])).ToArray; + +///---- Helpers +procedure SetLeft(Self: UIElement; l: integer); extensionmethod := Canvas.SetLeft(Self,l); + +procedure SetTop(Self: UIElement; t: integer); extensionmethod := Canvas.SetTop(Self,t); - var __initialized: boolean; procedure __InitModule; diff --git a/bin/Lib/WPFObjects.pas b/bin/Lib/WPFObjects.pas index 3d1c8b232..7d76fd1cc 100644 --- a/bin/Lib/WPFObjects.pas +++ b/bin/Lib/WPFObjects.pas @@ -923,22 +923,6 @@ function Pnt(x,y: real) := new Point(x,y); function Rect(x,y,w,h: real) := new System.Windows.Rect(x,y,w,h); function ColorBrush(c: Color) := new SolidColorBrush(c); -function operator implicit(Self: (integer, integer)): Point; extensionmethod := new Point(Self[0], Self[1]); -function operator implicit(Self: (integer, real)): Point; extensionmethod := new Point(Self[0], Self[1]); -function operator implicit(Self: (real, integer)): Point; extensionmethod := new Point(Self[0], Self[1]); -function operator implicit(Self: (real, real)): Point; extensionmethod := new Point(Self[0], Self[1]); - -function operator implicit(Self: array of (real, real)): array of Point; extensionmethod := - Self.Select(t->new Point(t[0],t[1])).ToArray; -function operator implicit(Self: array of (integer, integer)): array of Point; extensionmethod := - Self.Select(t->new Point(t[0],t[1])).ToArray; - - -///---- Helpers -procedure SetLeft(Self: UIElement; l: integer); extensionmethod := Canvas.SetLeft(Self,l); - -procedure SetTop(Self: UIElement; t: integer); extensionmethod := Canvas.SetTop(Self,t); - procedure SetLeft(Self: UIElement; l: integer) := Self.SetLeft(l); procedure SetTop(Self: UIElement; t: integer) := Self.SetTop(t);