program UP_DOWN_MENU; uses crt,printer; const a:array[1..5]of string=('File','Edit','Search','Option','Help' ); f1:array[1..6]of string=('New','Open...','Save','Save as...','Print...','Exit'); {********************************************} procedure win(a,b,c,d,e:byte); begin window(a,b,c,d); textbackground(e); clrscr; end; {**********************************************} procedure rec(x1,y1,l,w :byte); var i,j,k,v:byte; begin textcolor(0); gotoxy(x1,y1) ; write('Ú') ; for i:=x1 to x1+l do write('Ä'); for j:=y1+1 to y1+w do begin gotoxy(x1,j); write('³'); end; gotoxy(x1,j); write('À'); for k:=x1 to x1+l do write('Ä'); write('Ù'); gotoxy(x1+l+2,y1); write('¿'); for v:=y1+1 to y1+w-1 do begin gotoxy(x1+l+2,v); write('³'); end; end; {********************************************} procedure f; begin win(4,3,22,12,0); win(2,2,20,11,7); rec(1,1,14,9); gotoxy(3,2); write(f1[1]); gotoxy(3,3); write(f1[2]); gotoxy(3,4); write(f1[3]); gotoxy(3,5); write(f1[4]); gotoxy(3,6); write(f1[5]); gotoxy(3,7); write(f1[6]); end; var ch1,ch2:char; number :integer; begin textbackground(0); textcolor(15); clrscr; number := 1; repeat f; textcolor(0); win(4,number+2,15,number+2,0); textcolor(15); write(f1[number]); ch1:=readkey; if ord(ch1)=0 then begin ch2:=readkey; case ch2 of 'H' :begin number:=number-1; if number<1 then begin number:=6; end; end; 'P': begin number:=number+1; if number>6 then begin number:=1; end; end; end;{ case } end; until ord(ch1)=13; case number of 1 : write('1111111111111111'); 2 : write('2222222222222222'); 3 : write('3333333333333333'); 4 : write('4444444444444444'); 5 : write('5555555555555555'); end; readln; readln; end.