Category : BASIC Source Code
Archive   : PBC30B.ZIP
Filename : WINDMAN.BAS

 
Output of file : WINDMAN.BAS contained in archive : PBC30B.ZIP
' +----------------------------------------------------------------------+
' | |
' | PBClone Copyright (c) 1990-1994 Thomas G. Hanlin III |
' | |
' +----------------------------------------------------------------------+

DECLARE SUB CalcAttr (BYVAL Foreground%, BYVAL Background%, VAttr%)
DECLARE SUB DelayV (BYVAL MilliSeconds%)
DECLARE SUB ReColorArea (BYVAL TopRow%, BYVAL LeftCol%, BYVAL BottomRow%, BYVAL RightCol%, BYVAL VAttr%, BYVAL Page%, BYVAL Fast%)
DECLARE SUB XQPrint (St$, BYVAL Row%, BYVAL Column%, BYVAL VAttr%, BYVAL Page%, BYVAL Fast%)

SUB WindowManager (TopRow%, LeftCol%, BottomRow%, RightCol%, Frame%, Fore%, Back%, Grow%, Shade%, TitleFore%, Title$, Page%, Fast%)

CalcAttr Fore%, Back%, VAttr%

IF Grow% THEN
XD% = RightCol% - LeftCol% + 1
YD% = BottomRow% - TopRow% + 1
Y1% = TopRow% + YD% \ 2
X1% = LeftCol% + XD% \ 2
Y2% = BottomRow% - YD% \ 2
X2% = RightCol% - XD% \ 2
IF YD% > XD% THEN
XDelta% = 1
YDelta% = (YD% + XD% \ 2) \ XD%
IF YDelta% < 1 THEN YDelta% = 1
ELSE
YDelta% = 1
XDelta% = (XD% + YD% \ 2) \ YD%
IF XDelta% < 1 THEN XDelta% = 1
END IF
DO
Y1% = Y1% - YDelta%
IF Y1% < TopRow% THEN Y1% = TopRow%
X1% = X1% - XDelta%
IF X1% < LeftCol% THEN X1% = LeftCol%
Y2% = Y2% + YDelta%
IF Y2% > BottomRow% THEN Y2% = BottomRow%
X2% = X2% + XDelta%
IF X2% > RightCol% THEN X2% = RightCol%
GOSUB MakeWindow
IF Grow% > 0 THEN DelayV Grow%
LOOP UNTIL Y1% = TopRow% AND X1% = LeftCol% AND Y2% = BottomRow% AND X2% = RightCol%
ELSE
Y1% = TopRow%
X1% = LeftCol%
Y2% = BottomRow%
X2% = RightCol%
GOSUB MakeWindow
END IF

EXIT SUB



MakeWindow:
tmp% = X2% - X1% + 1
IF Frame% = 5 THEN
TopSt$ = STRING$(tmp%, "Ü")
BotSt$ = STRING$(tmp%, "ß")
ELSEIF Frame% AND 1 THEN
TopSt$ = STRING$(tmp%, "Ä")
BotSt$ = TopSt$
ELSE
TopSt$ = STRING$(tmp%, "Í")
BotSt$ = TopSt$
END IF
MidSt$ = SPACE$(tmp%)
IF Frame% >= 1 AND Frame% <= 5 THEN
TopSt$ = MID$("ÚÉÖÕÜ", Frame%, 1) + TopSt$ + MID$("¿»·¸Ü", Frame%, 1)
MidSt$ = MID$("³ºº³Ý", Frame%, 1) + MidSt$ + MID$("³ºº³Þ", Frame%, 1)
BotSt$ = MID$("ÀÈÓÔß", Frame%, 1) + BotSt$ + MID$("Ù¼½¾ß", Frame%, 1)
ELSE
TopSt$ = SPACE$(tmp% + 2)
MidSt$ = TopSt$
BotSt$ = TopSt$
END IF

Row% = Y1% - 1
Col% = X1% - 1
IF LEN(Title$) > 0 AND LEN(TopSt$) >= 4 THEN
St$ = LEFT$(Title$, LEN(TopSt$) - 4)
MID$(TopSt$, 2) = "[" + St$ + "]"
XQPrint TopSt$, Row%, Col%, VAttr%, Page%, Fast%
CalcAttr TitleFore%, Back%, TAttr%
XQPrint St$, Row%, Col% + 2, TAttr%, Page%, Fast%
ELSE
XQPrint TopSt$, Row%, Col%, VAttr%, Page%, Fast%
END IF
FOR Row% = Y1% TO Y2%
XQPrint MidSt$, Row%, Col%, VAttr%, Page%, Fast%
NEXT
XQPrint BotSt$, Y2% + 1, Col%, VAttr%, Page%, Fast%

Col% = X1% - 3
IF Shade% < 0 THEN
IF Shade% = -1 THEN
SAttr% = 0
ELSE
SAttr% = 8
END IF
IF Shade% < -2 THEN
ReColorArea Y1%, X2% + 2, Y2% + 1, X2% + 3, SAttr%, Page%, Fast%
ReColorArea Y2% + 2, X1% + 1, Y2% + 2, X2% + 3, SAttr%, Page%, Fast%
ELSE
ReColorArea Y1%, Col%, Y2% + 1, X1% - 2, SAttr%, Page%, Fast%
ReColorArea Y2% + 2, Col%, Y2% + 2, X2% - 1, SAttr%, Page%, Fast%
END IF
ELSEIF Shade% THEN
FOR Row% = Y1% TO Y2% + 1
XQPrint "°°", Row%, Col%, Shade%, Page%, Fast%
NEXT
XQPrint STRING$(X2% - X1% + 3, "°"), Y2% + 2, Col%, Shade%, Page%, Fast%
END IF
RETURN

END SUB


  3 Responses to “Category : BASIC Source Code
Archive   : PBC30B.ZIP
Filename : WINDMAN.BAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/