home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 15
/
CD_ASCQ_15_070894.iso
/
vrac
/
dnalib7a.zip
/
POPWIND.BAS
< prev
next >
Wrap
BASIC Source File
|
1994-05-14
|
4KB
|
111 lines
DECLARE SUB CalcByte(Attr%,LowByte%,HiByte%)
SUB POPWIND (Title$,Toprow%,Leftcolumn%,Bottomrow%,Rightcolumn%,Attr%,Shadow%,Border%) PUBLIC
$CODE SEG "DNASEG1"
CalcByte Attr%,FGround%,BGround%
SELECT CASE Border%
CASE 1
Tlc% = 218:Lbs% = 180:Rbs% = 195:Trc% = 191 'single line border
Sds% = 179
Blc% = 192:Tbs% = 196:Brc% = 217
CASE 2
Tlc% = 201:Lbs% = 181:Rbs% = 198:Trc% = 187 'double line border
Sds% = 186
Blc% = 200:Tbs% = 205:Brc% = 188
CASE 3
Tlc% = 213:Lbs% = 181:Rbs% = 198:Trc% = 184 'single sides double top
Sds% = 179 'and bottom
Blc% = 212:Tbs% = 205:Brc% = 190
CASE 4
Tlc% = 214:Lbs% = 180:Rbs% = 195:Trc% = 183 'double sides single top
Sds% = 186 'and bottom
Blc% = 211:Tbs% = 196:Brc% = 189
CASE ELSE
Tlc% = 32:Lbs% = 32:Rbs% = 32:Trc% = 32 'plain border
Sds% = 32
Blc% = 32:Tbs% = 32:Brc% = 32
END SELECT
COLOR Fground%,Bground%
LOCATE Toprow%,Leftcolumn%,0
W$ = STRING$(((Rightcolumn% - Leftcolumn%) - 1), Tbs%)
'┌─────────────────────────────────────────────────────────────────────┐
'│ The following block of code looks to see if you want a Title and │░░
'│ then check it's length, and the width of the window to see if it │░░
'│ will fit with even spacing and will append a period to the end of │░░
'│ the Title to keep everything centred. │░░
'└─────────────────────────────────────────────────────────────────────┘░░
' ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
IF LEN(Title$) THEN
Title$ = CHR$(32) + Title$ + CHR$(32)
a% = ((Rightcolumn% - Leftcolumn%) - 1) - (LEN(Title$) + 2)
b% = a% \ 2
c% = a% - b%
T$ = STRING$(b%,Tbs%) + CHR$(Lbs%) + Title$ + CHR$(Rbs%) + STRING$(c%,Tbs%)
PRINT CHR$(Tlc%) + T$ + CHR$(Trc%);
ELSE
PRINT CHR$(Tlc%) + W$ + CHR$(Trc%);
END IF
'┌─────────────────────────────────────────────────────────────────────┐
'│ The FOR NEXT loop simply fills in the centre of the window and │░░
'│ then the bottom line is PRINTed. │░░
'└─────────────────────────────────────────────────────────────────────┘░░
' ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Row% = Toprow%
FOR i = Toprow% TO Bottomrow% - 2
IF Row% <= Bottomrow% - 1 THEN
INCR Row%
LOCATE Row%, Leftcolumn%,0
PRINT CHR$(Sds%) + SPACE$((Rightcolumn% - Leftcolumn%) - 1) + CHR$(Sds%);
END IF
NEXT i
LOCATE Row% + 1, Leftcolumn%,0
PRINT CHR$(Blc%) + W$ + CHR$(Brc%);
'┌─────────────────────────────────────────────────────────────────────┐
'│ The final block of code is for PRINTing the shadow, the cursor │░░
'│ is LOCATEd and the SCREEN function is used to get the character, │░░
'│ the character is then placed into Shd1-2-3 and is then PRINTed │░░
'│ with a different attribute to give a transparent effect. │░░
'└─────────────────────────────────────────────────────────────────────┘░░
' ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
IF Shadow% = 1 THEN
COLOR 7,0
Row% = Toprow%
FOR j = Toprow% TO Bottomrow%
IF Row% < Bottomrow% + 1 THEN
INCR Row%
LOCATE Row%, Rightcolumn% + 1,0
Shd1% = SCREEN(Row%,Rightcolumn% + 1)
Shd2% = SCREEN(Row%,Rightcolumn% + 2)
PRINT CHR$(Shd1%) + CHR$(Shd2%);
END IF
NEXT j
Br% = Bottomrow% + 1
Lc% = Leftcolumn% + 2
FOR k% = 1 TO Rightcolumn% - Leftcolumn%
Shd3% = SCREEN(Br%,Lc%)
LOCATE Br%,Lc%,0
PRINT CHR$(Shd3%);
INCR Lc%
NEXT k%
END IF
END SUB