home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Phoenix CD 2.0
/
Phoenix_CD.cdr
/
24b
/
machinfo.zip
/
BOX.TUR
next >
Wrap
Text File
|
1986-04-27
|
3KB
|
128 lines
{ BOX.TUR
By: Drew O. Letcher
Iowa City, IA
April, 1986
}
TYPE
str72 = string[ 72 ];
{typed} CONST
{ global window coordinates }
W1 : byte = 1;
W2 : byte = 1;
W3 : byte = 80;
W4 : byte = 25;
PROCEDURE Box( LeftColumn, TopRow, RightColumn, BottomRow : integer;
Title : str72 );
{ This procedure creates a box. Then it creates a window inside the box and
clears the window.
The title is automatically centered in the middle of the top line, it is
the programmers responsiblity to make sure the title will fit.
Box dimensions are relative to the full screen. The window dimensions are
saved in the global variables W1, W2, W3, W4.
NOTE: Needs the include file CharAttr.tur.
}
VAR
Column,
Row : integer;
BEGIN
Window( 1,1, 80,25 );
HighIntensity;
{ upper left corner }
GotoXY( LeftColumn, TopRow );
write( '╓' );
{ top line & title }
FOR Column := 1 TO
Round( ( RightColumn - LeftColumn - Length( Title ) - 7 ) / 2 ) DO
write( '─' );
Write( '┤' );
LowIntensity;
ReverseVideo;
Write( ' ', Title, ' ' );
HighIntensity;
Write( '├' );
FOR Column := 1 TO
( RightColumn - LeftColumn - Length( Title ) - 7 ) DIV 2 DO
write( '─' );
{ upper right corner }
write( '╖' );
{ left side }
FOR Row := ( TopRow + 1 ) TO ( BottomRow - 1 ) DO
BEGIN
GotoXY( LeftColumn, Row );
write( '║' )
END;
{ right side }
FOR Row := ( TopRow + 1 ) TO ( BottomRow - 1 ) DO
BEGIN
GotoXY( RightColumn, Row );
write( '║' )
END;
{ lower left corner }
GotoXY( LeftColumn, BottomRow );
write( '╙' );
{ bottom }
FOR Column := ( LeftColumn + 1 ) TO ( RightColumn - 1 ) DO
write( '─' );
{ lower right corner }
write( '╜' );
{ create and clear the window }
W1 := LeftColumn + 1;
W2 := TopRow + 1;
W3 := RightColumn - 1;
W4 := BottomRow - 1;
Window( W1, W2, W3, W4 );
ClrScr;
END; { ** Procedure Box3 ** }
PROCEDURE Instruction( Line : str72 );
{ Displays a string in reverse video on the top line of the screen and returns
the window to ( W1,W2, W3,W4 ) and replaces the cursor.
}
VAR
X,Y : byte;
BEGIN
X := WhereX;
Y := WhereY;
Window( 1,1, 80,25 );
GotoXY( 1,1 );
LowIntensity;
ReverseVideo;
ClrEOL;
Write( Line );
HighIntensity;
Window( W1,W2, W3,W4 );
GotoXY( X,Y );
END; { ** Procedure Instruction ** }