praktika-pascal-2PO07/PRAKTIKA.PAS
2024-03-02 18:40:56 +02:00

105 lines
2.7 KiB
Plaintext

program pr;
uses crt, graph;
var tmp_d, tmp_m : integer; {screen variables}
p : char; {readkey}
y_wlcm : integer; {Vsplivayushii text}
i : integer; {Vspomogatelnie peremennye}
cur : integer; {Posicia kursora v menu}
javame, author,
welcome,
menustatus : string;
mainmenu : array [1..22] of string; {menu}
{Procedura inicializacii grafiki}
procedure init_screen;
begin
tmp_d := detect;
initgraph(tmp_d, tmp_m, '');
end;
{Procedura inicializacii peremennyh}
procedure init_variables;
begin
y_wlcm := -20;
author := 'Author: Victor aNNiMON Melnik';
welcome := 'Welcome';
javame := 'JavaME';
menustatus := 'ESC - Vyhod UP,DOWN,LEFT,RIGHT - Peredvijenie kursora ENTER - Perehod';
{Menu Lekcii}
for i:= 1 to 10 do
begin
mainmenu[i] := chr(47+i)+'. Lekcia #'+chr(47+i);
mainmenu[i+10] := 'Test #'+chr(47+i)
end;
mainmenu[21] := 'Author';
mainmenu[22] := 'Exit';
end;
{Procedura vyvoda zastavki}
procedure helloscreen;
begin
init_screen;
repeat
setcolor(7);
bar(0,0,640,480);
settextstyle(1, 0, 7);
{vyvod texta Welcome s tenyu}
setcolor(green);
outtextxy(192, y_wlcm+2, welcome);
setcolor(lightgreen);
outtextxy(190, y_wlcm, welcome);
inc(y_wlcm);
{Vyvod imeni}
settextstyle(3, 0, 4);
setcolor(red);
outtextxy(y_wlcm*2-100, 281, author);
setcolor(lightred);
outtextxy(y_wlcm*2-99, 280,author);
delay(1000);
{Vyvod nazvania}
settextstyle(6,0,8);
setcolor(lightblue);
for i:= 1 to 6 do
begin
if(y_wlcm/16)<i then break;
outtextxy(70+i*60, 120, javame[i]);
end;
until (y_wlcm>100) or (keypressed);
readkey;
end;
{Procedura vyvoda menu}
procedure menu;
begin
init_screen;
setbkcolor(9);
{Title}
setfillstyle(1, 1);
bar(0, 0, 640, 18);
setcolor(13);
settextstyle(2,0,6);
outtextxy(300, 0, javame);
{Status}
setfillstyle(1, 7);
settextstyle(2,0,4);
bar(0, 466, 640, 480);
setcolor(24);
outtextxy(10, 468, menustatus);
{Otrisovka menu}
setcolor(14);
settextstyle(2,0,6);
for i:= 1 to 10 do
begin
outtextxy(40, 40+i*20, mainmenu[i]);
end;
readkey;
end;
{Glavnaya programma}
begin
init_variables;
{helloscreen;}
menu;
closegraph;
end.