This commit is contained in:
Mikhalkovich Stanislav 2019-02-22 09:27:54 +03:00
parent 0370d6b271
commit d2a5dd813b
4 changed files with 52 additions and 40 deletions

View file

@ -22,7 +22,7 @@ end;
procedure MyMouseDown(x,y: real; mb: integer);
begin
var ob := ObjectUnderPoint(x,y);
if (ob<>nil) and (ob is RectangleWPF) then
if (ob<>nil) and (ob is RectangleWPF) and (ob<>StatusRect) then
if ob.Number=CurrentDigit then
begin
ob.Destroy;

View file

@ -74,8 +74,9 @@ namespace VisualPascalABC
//w += ttimg.Width*2;
if (w > maxwid)
maxwid = w;
if (e.ItemHeight > 20)
e.ItemHeight = 20;
var ss = ScreenScale.Calc();
if (e.ItemHeight > Convert.ToInt32(20 * ss))
e.ItemHeight = Convert.ToInt32(20 * ss);
}

View file

@ -4701,7 +4701,7 @@ end;
procedure Read(var x: integer);
begin
if input.sr <> nil then
read(input, x)
Read(input, x)
else
try
CurrentIOSystem.read(x)
@ -4714,7 +4714,7 @@ end;
procedure Read(var x: real);
begin
if input.sr <> nil then
read(input, x)
Read(input, x)
else
try
CurrentIOSystem.read(x)
@ -4727,7 +4727,7 @@ end;
procedure Read(var x: char);
begin
if input.sr <> nil then
read(input, x)
Read(input, x)
else
try
CurrentIOSystem.read(x)
@ -4740,7 +4740,7 @@ end;
procedure Read(var x: string);
begin
if input.sr <> nil then
read(input, x)
Read(input, x)
else
try
CurrentIOSystem.read(x)
@ -4753,7 +4753,7 @@ end;
procedure Read(var x: byte);
begin
if input.sr <> nil then
read(input, x)
Read(input, x)
else
try
CurrentIOSystem.read(x)
@ -4766,7 +4766,7 @@ end;
procedure Read(var x: shortint);
begin
if input.sr <> nil then
read(input, x)
Read(input, x)
else
try
CurrentIOSystem.read(x)
@ -4779,7 +4779,7 @@ end;
procedure Read(var x: smallint);
begin
if input.sr <> nil then
read(input, x)
Read(input, x)
else
try
CurrentIOSystem.read(x)
@ -4792,7 +4792,7 @@ end;
procedure Read(var x: word);
begin
if input.sr <> nil then
read(input, x)
Read(input, x)
else
try
CurrentIOSystem.read(x)
@ -4805,7 +4805,7 @@ end;
procedure Read(var x: longword);
begin
if input.sr <> nil then
read(input, x)
Read(input, x)
else
try
CurrentIOSystem.read(x)
@ -4818,7 +4818,7 @@ end;
procedure Read(var x: int64);
begin
if input.sr <> nil then
read(input, x)
Read(input, x)
else
try
CurrentIOSystem.read(x)
@ -4831,7 +4831,7 @@ end;
procedure Read(var x: uint64);
begin
if input.sr <> nil then
read(input, x)
Read(input, x)
else
try
CurrentIOSystem.read(x)
@ -4844,7 +4844,7 @@ end;
procedure Read(var x: single);
begin
if input.sr <> nil then
read(input, x)
Read(input, x)
else
try
CurrentIOSystem.read(x)
@ -4857,7 +4857,7 @@ end;
procedure Read(var x: boolean);
begin
if input.sr <> nil then
read(input, x)
Read(input, x)
else
try
CurrentIOSystem.read(x)
@ -5767,7 +5767,7 @@ begin
p := ptr;
end;
procedure write;
procedure Write;
begin
end;
@ -5781,7 +5781,7 @@ begin
writeln(output);
end;
procedure write(obj: object);
procedure Write(obj: object);
begin
if output.sw <> nil then
write_in_output(obj)
@ -5793,7 +5793,7 @@ end;
// CurrentIOSystem.Write(ptr);
//end;
procedure write(obj1, obj2: object);
procedure Write(obj1, obj2: object);
begin
if output.sw <> nil then
begin
@ -5807,7 +5807,7 @@ begin
end;
end;
procedure write(params args: array of object);
procedure Write(params args: array of object);
begin
for var i := 0 to args.length - 1 do
if output.sw <> nil then
@ -5816,7 +5816,7 @@ begin
CurrentIOSystem.Write(args[i]);
end;
procedure writeln(obj: object);
procedure Writeln(obj: object);
begin
if output.sw <> nil then
begin
@ -5836,7 +5836,7 @@ end;
// CurrentIOSystem.Writeln;
//end;
procedure writeln(obj1, obj2: object);
procedure Writeln(obj1, obj2: object);
begin
if output.sw <> nil then
begin
@ -5852,14 +5852,14 @@ begin
end
end;
procedure writeln;
procedure Writeln;
begin
if output.sw <> nil then
writeln_in_output
else CurrentIOSystem.Writeln;
end;
procedure writeln(params args: array of object);
procedure Writeln(params args: array of object);
begin
if output.sw <> nil then
begin
@ -5875,11 +5875,11 @@ begin
end;
end;
procedure write(f: Text);
procedure Write(f: Text);
begin
end;
procedure write(f: Text; val: object);
procedure Write(f: Text; val: object);
begin
if f.fi = nil then
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
@ -5902,13 +5902,13 @@ begin
end;}
end;
procedure write(f: Text; params args: array of object);
procedure Write(f: Text; params args: array of object);
begin
for var i := 0 to args.length - 1 do
write(f, args[i]);
end;
procedure writeln(f: Text);
procedure Writeln(f: Text);
begin
if f.fi = nil then
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
@ -5918,13 +5918,13 @@ begin
f.sw.WriteLine;
end;
procedure writeln(f: Text; val: object);
procedure Writeln(f: Text; val: object);
begin
write(f, val);
writeln(f);
end;
procedure writeln(f: Text; params args: array of object);
procedure Writeln(f: Text; params args: array of object);
begin
for var i := 0 to args.length - 1 do
write(f, args[i]);

View file

@ -145,7 +145,7 @@ type
ob: FrameworkElement;
gr: Grid; // Grid связан только с текстом
t: TextBlock;
r: RotateTransform;
rot: RotateTransform;
ChildrenWPF := new List<ObjectWPF>;
procedure InitOb(x,y,w,h: real; o: FrameworkElement; SetWH: boolean := True);
@ -189,7 +189,7 @@ type
begin
Result := GetInternalGeometry;
var g := new TransformGroup();
g.Children.Add(r);
g.Children.Add(rot);
g.Children.Add(new TranslateTransform(Left,Top));
Result.Transform := g; // версия
end;
@ -221,11 +221,11 @@ type
/// Правый нижний угол графического объекта
property RightBottom: Point read Pnt(Left + Height,Top + Height);
/// Угол поворота графического объекта (по часовой стрелке)
property RotateAngle: real read InvokeReal(()->r.Angle) write Invoke(procedure->r.Angle := value);
property RotateAngle: real read InvokeReal(()->rot.Angle) write Invoke(procedure->rot.Angle := value);
/// Центр поворота графического объекта
property RotateCenter: Point
read Invoke&<Point>(()->new Point(r.CenterX,r.CenterY))
write Invoke(procedure->begin r.CenterX := value.X; r.CenterY := value.Y; end);
read Invoke&<Point>(()->new Point(rot.CenterX,rot.CenterY))
write Invoke(procedure->begin rot.CenterX := value.X; rot.CenterY := value.Y; end);
/// Цвет графического объекта
property Color: GColor
read RGB(0,0,0)
@ -287,7 +287,12 @@ type
end;
procedure EF(value: GColor) := Element.Fill := new SolidColorBrush(Value);
procedure ES(value: GColor) := Element.Stroke := new SolidColorBrush(Value);
procedure EST(value: real) := Element.StrokeThickness := Value;
procedure EST(value: real);
begin
Element.StrokeThickness := Value;
if Element.Stroke = nil then
Element.Stroke := new SolidColorBrush(Colors.Black)
end;
function WithNoBorderP: BoundedObjectWPF;
begin
Element.Stroke := nil;
@ -940,6 +945,12 @@ procedure SetLeft(Self: UIElement; l: integer) := Self.SetLeft(l);
procedure SetTop(Self: UIElement; t: integer) := Self.SetTop(t);
function MoveOn(Self: Point; vx,vy: real): Point; extensionmethod;
begin
Result.X := Self.X + vx;
Result.Y := Self.Y + vy;
end;
{procedure MoveTo(Self: UIElement; l,t: integer); extensionmethod;
begin
Canvas.SetLeft(Self,l);
@ -980,10 +991,10 @@ procedure ObjectWPF.InitOb(x,y,w,h: real; o: FrameworkElement; SetWH: boolean);
begin
can := new Canvas;
gr := new Grid;
r := new RotateTransform(0);
r.CenterX := w / 2;
r.CenterY := h / 2;
can.RenderTransform := r;
rot := new RotateTransform(0);
rot.CenterX := w / 2;
rot.CenterY := h / 2;
can.RenderTransform := rot;
ob := o;
if SetWH then
(ob.Width,ob.Height) := (w,h);