Навчальна контролююча програма Призма
{Graphic_procedures_}
Procedure ShowGraph;
Var
GD,GM:integer;
Begin
GD:=Detect;
InitGraph(GD,GM,'Data\bgi\');
end;
{Paint Fon}
Procedure Bar_3D;
Var
Y0, Y1, Y2, X1, X2: Integer;
Begin
ShowGraph;
SetFillStyle(8,8);
Y0 := 200;
Y1 := 30;
Y2 := GetMaxY - 10;
X1 := 10;
X2 := GetMaxX - 10;
Bar3D(X1, Y0, X2, Y1, 10, TopOn);
Bar3D(X1, Y1, X2, Y2, 10, TopOff);
end;
{Create Tochki with Prizma}
Procedure BoldPixel(x,y:word;Name:String);
Var
i:1..4;
Begin
SetFillStyle(0,7);
for i:=1 to 3 do CirCle(X,y,i);
SetColor(Black);CirCle(X,y,i+1);
MoveTo(X+4,Y+3);
SetColor(White);
OutText(Name);
end;
{---Fill window---}
Procedure TextXY(sX,sY:byte;Txt:String);
Var
X,Y:byte;
Begin
X:=sX;
Y:=sY;
GotoXY(X+2,Y+1);
if Txt[1]='#'then
Begin
Txt[1]:=' ';
Write('');
end;
Write(' '+txt);
GotoXY(sX,WhereY);
End;
Procedure RePaint(x,y,X1,Y1:byte;Color:byte;ch:char;Execute:boolean);
Var
i,j:byte;
Begin
if execute then
BEGIN
if Ord(Color)>=9 then Color:=Color+8;
if ch = '0' then ch:=Chr(219);
GotoXY(X,Y);
for i:=1 to y1-y do
Begin
GotoXY(X,Y);
for j:=1 to x1-x do
Begin
TextColor(Color);
write(ch);
end;
Y:=Y+1;
End;
NormVideo;
END;
End;
Procedure OutTxT(Txt:String);
Var
X,Y:byte;
Begin
X:=WhereX;
Y:=WhereY;
GotoXY(X,Y);
if (Txt[1]<>'{')then Write(' '+ Txt) else Write(' ');
Y:=Y+1;
GotoXY(X,y);
End;
Procedure ConfirmExit(Var Ansv:Boolean);
Var
ch:char;
Begin
TMus(Result);
RichWindow(22,9,56,16, 2,'[Exi?]',14,Blue,true);
TextBackGround(Blue);
TextColor(Yellow);
OutTxt(' Are you want to Exit now???');
OutTxt(' ');
Write('[ Y/N ]');
GotoXY(WhereX-3,WhereY);
Ch:=ReadKey;
TMus(Beep);
if ( Ch = 'y')or( Ch = 'Y')then Halt(1) else Ansv:=False;
end;
Procedure PaintBackGround(color:byte);
Var i,x1,y1:byte;
Begin
x1:=80;y1:=25;
for i:=2 to 7 do
Begin
x1:=x1-1;
y1:=y1-1;
RichWindow(i,i,x1,y1, 3,'',(Color),1,false);
end;
end;
{------------------------}
Procedure PainPrizmTo(zX,zY:word;Gran:byte;fail:string;Demo:Boolean);
Var
F:File of Word;
X,Y,X1,Y1:array[byte]of Word;
I:1..5;
Long:Word;
Const
TochKa:array[1..5]of string[2]=('A1','A2','A3','A4','A5');
Begin
Bar_3d;
Assign(F,'Data\Digit\'+fail);
Reset(F);
if demo=true then
Begin
SetTextStylE(TriplexFont,HorizDir,0);
for i:=1 to 3 do
Begin
MoveTo((60+i),80+i);
SetColor(7);
OutText('Demo - How to construction');
end;
SetColor(8);
SetTextStylE(TriplexFont,HorizDir,0);
OutTextXY(63,82,'Demo - How to construction');
end;
SetLineStyle(0,2,3);
SetColor(White);
Read(F,Long);
for i:=1 to Gran do
Begin
Read(F,X[i],Y[i]);
X1[i]:=X[i]+zX;
Y1[i]:=Y[i]+Long+zY;
X[i]:=X[i]+zX;
Y[i]:=Y[i]+zY;
if i=Gran then SetLineStyle(1, 2,0 );
Line(X[i],Y[i],X1[i],Y1[i]);
end;