home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / pascal / EDSCREEN.ZIP / EDCON.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1979-12-31  |  5.9 KB  |  231 lines

  1.  
  2. procedure screen;
  3. begin
  4.   title(' SCREEN WRITER CONFIGURATION ');
  5.   textcolor(white);
  6.   gotoxy(1,6);
  7.   center('Written by Martine B. Wedlake');
  8.   textcolor(lightblue);
  9.   gotoxy(5,8);
  10.   write('Insert Mode At Start  :');
  11.   gotoxy(5,10);
  12.   write('Look To Disk For Help :');
  13.   gotoxy(5,12);
  14.   write('Path For Help         :');
  15.   gotoxy(5,14);
  16.   write('Forground At Start    :');
  17.   gotoxy(5,16);
  18.   write('Background At Start   :');
  19.   gotoxy(5,18);
  20.   write('The Graphic Letter Set:');
  21.   gotoxy(5,20);
  22.   write('Exit The Programme    :');
  23.   gotoxy(9,22);
  24.   textcolor(white);
  25.   write('Press [');
  26.   textcolor(white+blink);
  27.   write('+');
  28.   textcolor(white);
  29.   write('] to increase Graph Level, [');
  30.   textcolor(white+blink);
  31.   write('-');
  32.   textcolor(white);
  33.   write('] to decrease Graph Level.');
  34.   gotoxy(12,24);
  35.   center('Press <SPACE BAR> to reset.');
  36.   gotoxy(1,25);
  37.   center('Use arrow keys to position cursor.  Press RETURN to Activate');
  38. end;
  39.  
  40. procedure display_info(y,level,letter:integer);
  41. var
  42.   counter:integer;
  43. begin
  44.   textcolor(red);
  45.   gotoxy(30,8);
  46.   if configure.insert_mode then write('ON ') else write('OFF');
  47.   gotoxy(30,10);
  48.   if configure.help then write('YES') else write('NO ');
  49.   gotoxy(30,12);
  50.   clreol;
  51.   write(configure.Help_path);
  52.   gotoxy(30,14);
  53.   write(configure.forg:2);
  54.   gotoxy(30,16);
  55.   write(configure.back:2);
  56.   gotoxy(45,14);
  57.   textcolor(configure.forg);
  58.   textbackground(configure.back);
  59.   write('Colour');
  60.   textcolor(white);
  61.   textbackground(black);
  62.   gotoxy(45,16);
  63.   write('Graph Level: ',level:2);
  64.   gotoxy(30,18);
  65.   for counter:=1 to 8 do
  66.   begin
  67.     textcolor(white);
  68.     write(counter);
  69.     textcolor(red);
  70.     write(' ',configure.graphic_letters[level,counter],'   ');
  71.   end;
  72.   gotoxy(30,20);
  73.   write('':10);
  74.   if y<>18 then gotoxy(70,16);
  75.   clreol;
  76.   case y of
  77.     08:begin
  78.          gotoxy(30,8);
  79.          textcolor(black);
  80.          textbackground(white);
  81.          if configure.insert_mode then write('ON ') else write('OFF');
  82.          textcolor(white);
  83.          textbackground(black);
  84.        end;
  85.     10:begin
  86.          gotoxy(30,10);
  87.          textcolor(black);
  88.          textbackground(white);
  89.          if configure.help then write('YES') else write('NO');
  90.          textcolor(white);
  91.          textbackground(black);
  92.        end;
  93.     12:begin
  94.          gotoxy(30,12);
  95.          textcolor(black);
  96.          textbackground(white);
  97.          write(configure.Help_path);
  98.          textcolor(white);
  99.          textbackground(black);
  100.        end;
  101.     14:begin
  102.          gotoxy(30,14);
  103.          textcolor(black);
  104.          textbackground(white);
  105.          write(configure.forg:2);
  106.          textcolor(white);
  107.          textbackground(black);
  108.        end;
  109.     16:begin
  110.          gotoxy(30,16);
  111.          textcolor(black);
  112.          textbackground(white);
  113.          write(configure.back:2);
  114.          textcolor(white);
  115.          textbackground(black);
  116.        end;
  117.     18:begin
  118.          gotoxy(70,16);
  119.          textcolor(white);
  120.          write('ASCII = ');
  121.          clreol;
  122.          write(ord(configure.graphic_letters[level,letter]):3);
  123.          gotoxy(letter*6+26,18);
  124.          textbackground(white);
  125.          textcolor(blue);
  126.          write(configure.graphic_letters[level,letter]);
  127.          textcolor(white);
  128.          textbackground(black);
  129.        end;
  130.     20:begin
  131.          gotoxy(30,20);
  132.          textcolor(black);
  133.          textbackground(white);
  134.          write('':10);
  135.          textcolor(white);
  136.          textbackground(black);
  137.        end;
  138.   end;
  139. end;
  140.  
  141. procedure do_input;
  142. var
  143.   numstr:string[3];
  144.   letter,
  145.   level,
  146.   num,
  147.   y,
  148.   code:integer;
  149.   saved,
  150.   leave:boolean;
  151.   key,
  152.   key1:char;
  153. begin
  154.   leave:=false;
  155.   level:=1;
  156.   letter:=1;
  157.   y:=8;
  158.   repeat
  159.     repeat
  160.       key:=#0;
  161.       key1:=#0;
  162.       display_info(y,level,letter);
  163.       read(kbd,key);
  164.       if keypressed then read(kbd,key1);
  165.       case ord(key1) of
  166.         72:if y>8 then y:=y-2 else y:=20;
  167.         80:if y<20 then y:=y+2 else y:=8;
  168.         77:if (y=18) then
  169.              if letter<8 then letter:=letter+1 else letter:=1;
  170.         75:if (y=18) then
  171.              if letter>1 then letter:=letter-1 else letter:=8;
  172.       end;
  173.       if key='-' then if level>1 then level:=level-1 else level:=19;
  174.       if key in['=','+'] then if level<19 then level:=level+1 else level:=1;
  175.       if key=' ' then load_config;
  176.     until key=#13;
  177.     case y of
  178.      8:configure.insert_mode:=not configure.insert_mode;
  179.      10:configure.Help:=not configure.help;
  180.      12:begin
  181.           gotoxy(40,10);
  182.           write('Enter NEW Path for EdScreen.HLP');
  183.           gotoxy(30,12);
  184.           cursor(true);
  185.           repeat until keypressed;
  186.           clreol;
  187.           read(configure.help_path);
  188.           cursor(false);
  189.           gotoxy(40,10);
  190.           clreol;
  191.         end;
  192.      14:if configure.forg<15 then configure.forg:=configure.forg+1 else configure.forg:=0;
  193.      16:if configure.back<7 then configure.back:=configure.back+1 else configure.back:=0;
  194.      18:begin
  195.           gotoxy(20,17);
  196.           write('Enter ASCII for character to replace:');
  197.           repeat
  198.             cursor(true);
  199.             gotoxy(59,17);
  200.             clreol;
  201.             buflen:=3;
  202.             read(numstr);
  203.             cursor(false);
  204.             val(numstr,num,code);
  205.             if code<>0 then write(^g);
  206.           until code=0;
  207.           configure.graphic_letters[level,letter]:=chr(num);
  208.           gotoxy(20,17);
  209.           clreol;
  210.         end;
  211.      20:begin
  212.           gotoxy(30,20);
  213.           write('Do you want the Configuration saved [Y/N] ? ');
  214.           repeat
  215.             read(kbd,key);
  216.             key:=upcase(key);
  217.           until key in ['Y','N'];
  218.           leave:=true;
  219.           saved:=key = 'Y';
  220.         end;
  221.     end;
  222.   until leave;
  223.   if saved then
  224.   begin
  225.     assign(f_configure,'EDSCREEN.CNF');
  226.     rewrite(f_configure);
  227.     write(f_configure,configure);
  228.     close(f_configure);
  229.   end;
  230. end;
  231.