home *** CD-ROM | disk | FTP | other *** search
- { Module: Exploding Window V 01.02.00
-
- Programmer: Bryan Woodruff, Tucson Az.
- Release date: 03-21-86
- History: created 03-20-86
- modified morning of 03-21-86
-
- Description: Exploding Window will expand a window from the center
- of a box with given coordinates of Upper Left Hand corner
- X and Y, and the Lower Right Hand corner X and Y. This module
- uses a modified fastwrite procedure by Marshall Brain.
-
- Procedures included:
-
- Procedure Frame - given the upper left and lower right corners
- and maskcode, will frame a window
-
- Procedure ExplodingWindow - expands window to given coordinates
- with background and foreground
- colors in maskcode
-
- Maskcode:=BackgroundColor * 16 + ForegroundColor
-
-
- Send any inquiries to:
-
- Bryan Woodruff
- 8457 E. Beverly St.
- Tucson, Az 85710 }
-
- Type
- string80 = string[80];
-
- {$I FSTWRITE.INC}
-
- Procedure Frame (UpperLeftX,
- UpperLeftY,
- LowerRightX,
- LowerRightY,
- maskcode:integer);
- var
- i: Integer;
- begin
- fastwrite(UpperLeftX,UpperLeftY,maskcode,Chr(213));
- fastwrite(UpperLeftX,LowerRightY,maskcode,Chr(212));
- fastwrite(LowerRightX,UpperLeftY,maskcode,Chr(184));
- fastwrite(LowerRightX,LowerRightY,maskcode,Chr(190));
- for I:=UpperLeftX+1 to LowerRightX-1 do
- begin
- fastwrite(I,UpperLeftY,maskcode,Chr(205));
- fastwrite(I,LowerRightY,maskcode,Chr(205));
- end;
- for I:=UpperLeftY+1 to LowerRightY-1 do
- begin
- fastwrite(UpperLeftX,I,maskcode,Chr(179));
- fastwrite(LowerRightX,I,maskcode,Chr(179));
- end;
- end;
-
- Procedure ExplodingWindow ( UpperLeftX,
- UpperLeftY,
- LowerRightX,
- LowerRightY,
- maskcode:integer);
- var
- cx,cy,dx,dy,d,i,x1,x2,y1,y2:integer;
- ix,iy: real;
- begin
- cx:=( UpperLeftX + LowerRightX ) div 2;
- cy:=( UpperLeftY + LowerRightY ) div 2;
- dx:=cx-UpperLeftX;
- dy:=cy-UpperLeftY;
- if dx>dy then
- d:=dx div 4
- else
- d:=dy div 4;
- ix:=dx / d; iy:=dy / d;
- for i:=2 to d do
- begin
- x1:=round(cx-(ix*i));
- x2:=round(cx+(ix*i));
- y1:=round(cy-(iy*i));
- y2:=round(cy+(iy*i));
- Window(x1,y1,x2,y2);
- textbackground(maskcode div 16);
- clrscr;
- Frame(x1,y1,x2,y2,maskcode);
- end;
- end;
-
- var maskcode:integer;
- BEGIN
- clrscr;
- maskcode:=red*16+blue;
- ExplodingWindow(1,1,80,25,maskcode)
- END.
-
-