home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / BOXFRAMZ.ZIP / BOX3.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1988-01-19  |  1.7 KB  |  45 lines

  1. {          ╒═════════════════════════════════════════════════════════╕
  2.            │  (c) Jan 1988         Box3.PAS          John Tribbett   │
  3.            │                                                         │
  4.            │  Procedure produces frame like you see here.            │
  5.            │  Export to other programs, or use as an include file.   │
  6.            │  The calling sequence is : Box3(boolean,x1,y1,x2,y2);   │
  7.            │  Select your own textbackground and textcolor.          │
  8.            │  See sample program DRAWBOX.PAS for proper syntax.      │
  9.            │                                                         │
  10.            │  If you find BOX FRAMES helpful,  send $5.00 to:        │
  11.            │  John Tribbett; 778 Mildred Ln SE; Salem, OR  97306     │
  12.            ╘═════════════════════════════════════════════════════════╛
  13. }
  14. procedure box3(shadow : boolean; x1,y1,x2,y2 : integer);
  15. var I : integer;
  16. begin
  17.   I := 0;
  18.   window(1,1,80,25);
  19.   IF shadow = true
  20.     then
  21.       begin
  22.         window(x1-2,y1+2,x2-2,y2+1);
  23.         textbackground(0);
  24.         clrscr;
  25.         window(1,1,80,25);
  26.       end;
  27.   textbackground(3);
  28.   textcolor(0);
  29.   gotoxy(x1,y1);   write('╒');     {top left corner}
  30.   gotoxy(x1+1,y1);                 {top row}
  31.   for I := x1+1 to x2-1 do
  32.     write('═');
  33.   gotoxy(x2,y1);  write('╕');      {top right corner}
  34.   for I := y1+1 to y2-1 do
  35.     begin
  36.       gotoxy(x1,I); write('│');    {left side}
  37.       gotoxy(x2,I); write('│');    {right side}
  38.     end;
  39.   gotoxy(x1,y2);  write('╘');      {bottom left corner}
  40.   for I := x1+1 to x2-1 do
  41.     write('═');                    {bottom row}
  42.   gotoxy(x2,y2); write('╛');       {bottom right corner}
  43.   window(x1+1,y1+1,x2-1,y2-1);
  44. end;
  45.