pascalabcnet/InstallerSamples/Graphics/GraphABCLinux/Stamps/Stamp3.pas
Mikhalkovich Stanislav 6e34bc00fa TeacherControlPlugin в проекте
GraphABCLinux
Поправил иконку PABCHealth
Изменения в LightPT.pas
Цветной вывод в окне вывода (только для Windows)
Console.OutputEncoding := new System.Text.UTF8Encoding(false); в __RedirectIOMode.pas чтобы в Linux нормально выводилось
2022-07-10 14:51:51 +03:00

28 lines
647 B
ObjectPascal
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Класс штампа прямоугольника с методами увеличения-уменьшения
uses GraphABCLinux;
type
RectangleStamp = auto class
x,y,w,h: integer;
procedure Stamp := Rectangle(x,y,x+w,y+h);
procedure Increase(dw,dh: integer);
begin
w += dw; h += dh;
end;
procedure Decrease(dw,dh: integer) := Increase(-dw,-dh);
procedure MoveOn(dx,dy: integer);
begin
x += dx; y += dy;
end;
end;
begin
var r := new RectangleStamp(100,100,300,300);
r.Stamp;
while r.w>2 do
begin
r.Decrease(8,8);
r.MoveOn(4,4);
r.Stamp;
end;
end.