home *** CD-ROM | disk | FTP | other *** search
/ Frostbyte's 1980s DOS Shareware Collection / floppyshareware.zip / floppyshareware / USCX / TURBO-06.ZIP / LU-1.PAS < prev    next >
Pascal/Delphi Source File  |  1985-02-23  |  3KB  |  124 lines

  1.  
  2. procedure clear_status;
  3. begin
  4.       write(esc,'j',                 { save cursor position }
  5.             esc,'Y',chr(24+32),' ',  { go to start of line 25 }
  6.             esc,'l',                 { erase entire line }
  7.             esc,'k');                { restore cursor position }
  8. end;
  9.  
  10. procedure set_status( l1,l2,l3,l4,l5,l6,l7 : string10);
  11.     begin
  12.     write(esc,'x1',                 { enable line 25 }
  13.           esc,'j',                  { save cursor position }
  14.           esc,'Y',chr(24+32),' ');  { go to start of line 25 }
  15.  
  16.     if l1 <> '' then write(HI,l1,LO) else write('          '); write(' ');
  17.     if l2 <> '' then write(HI,l2,LO) else write('          '); write(' ');
  18.     if l3 <> '' then write(HI,l3,LO) else write('          '); write(' ');
  19.     if l4 <> '' then write(HI,l4,LO) else write('          '); write(' ');
  20.     if l5 <> '' then write(HI,l5,LO) else write('          '); write(' ');
  21.     if l6 <> '' then write(HI,l6,LO) else write('          '); write(' ');
  22.     if l7 <> '' then write(HI,l7,LO) else write('          '); write(' ');
  23.     write(esc,'k');                 { restore cursor position }
  24.     end;
  25.  
  26.  
  27.  
  28. procedure w_erase;
  29. { frame and clear window }
  30. var x,y : integer;
  31. begin
  32. if w_table.x1 <> -1 then
  33.   with w_table do begin
  34.     for y := y1 + 1 to y2 - 1 do begin
  35.         gotoxy(x1,y);
  36.         write(#$BA,'':x2-x1-2,#$BA);
  37.     end;
  38.     gotoxy(x1,y1); write(#$C9);
  39.     for x := 3 to x2-x1 do write(#$CD); write(#$BB);
  40.     gotoxy(x1,y2); write(#$C8);
  41.     for x := 3 to x2-x1 do write(#$CD); write(#$BC);
  42.     gotoxy(x1+1,y1+1);
  43.     currx := x1+1; curry := y1+1;
  44. end;
  45. end;
  46.  
  47. procedure w_delete;
  48.  { get rid of the sub window:
  49.       restore the screen contents from 'overwrote'
  50.       invalidate window
  51.  }
  52.  
  53. begin
  54. if w_table.x1 <> -1 then
  55.   with w_table do begin
  56.     move(overwrote,screen,4096);
  57.     write(esc,'k');
  58.     x1 := -1;
  59.   end;
  60. end;
  61.  
  62. procedure w_make   (nx1,nx2,ny1,ny2 : integer);  { boundrys }
  63.  { make the sub-window:
  64.          save current screen in 'overwrote'
  65.          set defaults in w_table
  66.          save old cursor position
  67.          call w_erase (above)
  68.  
  69.  }
  70. var x, y : integer;
  71. begin
  72. if w_table.x1 <> -1 then w_delete;
  73. with w_table do begin
  74.   move(screen,overwrote,4096); (* save screen state *)
  75.   x1 := nx1;x2 := nx2;y1 := ny1;y2 := ny2;
  76.   write(esc,'j');  (* save old cursor position  - VT52+ emulator - *)
  77.   w_erase;
  78. end;
  79. end;
  80.  
  81. procedure w_writeln;
  82. begin
  83. if w_table.x1 <> -1 then
  84.   with w_table do begin
  85.     currx := x1 + 1;
  86.     if curry >= y2-1 then curry := y1+1
  87.     else curry := curry + 1;
  88.   end;
  89. end;
  90.  
  91. procedure w_write_c(ch : char);
  92. begin
  93. if w_table.x1 <> -1 then
  94.   with w_table do begin
  95.     gotoxy(currx,curry);
  96.     write(ch);
  97.     if currx >= x2-1 then begin
  98.         currx := x1;
  99.         if curry >= y2-1 then
  100.             curry := y1+1
  101.         else curry := curry + 1;
  102.     end
  103.     else currx := currx + 1;
  104.   end;
  105. end;
  106.  
  107. procedure w_write_s(s : maxstr);
  108. var x : integer;
  109. begin
  110. with w_table do begin
  111. for x := 1 to length(s) do w_write_c(s[x]);
  112. end;
  113. end;
  114.  
  115. procedure w_gotoxy (x,y : integer);
  116. begin
  117. if w_table.x1 <> -1 then
  118.   with w_table do begin
  119.     currx := x1 + x;
  120.     curry := y1 + y;
  121.     gotoxy(currx,curry);
  122.   end;
  123. end;
  124.