BBS: Inland Empire Archive Date: 10-16-93 (12:57) Number: 3 From: EDWARD SCHLUNDER Refer#: NONE To: ALL Recvd: NO Subj: Window Drawing (1/4) Conf: (2) Quik_Bas
Well, someone wanted some Window drawing routines that would
explode a window. Well, its been quite a while since I said I would
post it, but here it is... The delay was due to the HD crash I had and
then the HD upgrade to IDE (was using RLL). Oh yeah, and the BBS I
picked mail up at went down for good, so I went found a new one a
couple weeks later..
These routines are now being placed into the public domain, I don't
need 'em, I don't use 'em much.. I'm moving more and more to pure
Assembler programming, now that I have to write some MOD/ROL playing
routines that run real fast and in the background supporting SB, SBPro
(Stereo), AdLib, PC Internal Speaker, LPT DAC, GUS, etc...
If someone would like to make improvements, overhauls, etc, feel
free to post, trash, whatever.. As I said, I don't really want to have
anything to do with this stuff, I wrote them in 4th/5th grade and it
isn't my best peice of code.
___O_/____________________| SNIP |_____________________O_/___
O \ | HERE | O \
DECLARE SUB WaitSec (SEC!)
DECLARE SUB Blink (XBLINK%)
DECLARE SUB DrawBox (Row1%, Col1%, Row2%, Col2%, BORDER$, ATTR%)
DECLARE SUB OpenWindow (Row1%, Col1%, Row2%, Col2%, Fore%, Back%, ATTR%)
DECLARE FUNCTION COLAR% (Fore%, Back%)
DECLARE SUB SetColor (ATTR%)
DECLARE SUB PrintWindowTitle (Title$, Fore%, Back%, ATTR%)
DECLARE SUB PutShadow (Row1%, Col1%, Row2%, Col2%, ATTR%)
DECLARE SUB DrawWindow (Row1%, Col1%, Row2%, Col2%, Fore%, Back%, ATTR%)
COMMON SHARED /WINDOWZ/ WindowNum AS INTEGER
COMMON SHARED /WINDOWZ/ WindowRow1() AS INTEGER
COMMON SHARED /WINDOWZ/ WindowCol1() AS INTEGER
COMMON SHARED /WINDOWZ/ WindowRow2() AS INTEGER
COMMON SHARED /WINDOWZ/ WindowCol2() AS INTEGER
COMMON SHARED /WINDOWZ/ WindowFore() AS INTEGER
COMMON SHARED /WINDOWZ/ WindowBack() AS INTEGER
COMMON SHARED /WINDOWZ/ WindowAttr() AS INTEGER
COMMON SHARED /WINDOWZ/ WindowShadow() AS STRING
COMMON SHARED /WINDOWZ/ WindowTitle() AS STRING
DIM WindowFore(10) AS INTEGER
DIM WindowBack(10) AS INTEGER
DIM WindowAttr(10) AS INTEGER
DIM WindowTitle(10) AS STRING
DIM WindowShadow(10, 10) AS STRING
DIM WindowRow1(10) AS INTEGER
DIM WindowCol1(10) AS INTEGER
DIM WindowRow2(10) AS INTEGER
DIM WindowCol2(10) AS INTEGER
TYPE RegType
AX AS INTEGER
BX AS INTEGER
CX AS INTEGER
DX AS INTEGER
BP AS INTEGER
SI AS INTEGER
DI AS INTEGER
FLAGS AS INTEGER
END TYPE
CONST TRUE = -1, FALSE = 0, VIDEOTYPE = 2
'Blink 0
DO
OpenWindow 10, 10, 20, 20, 15, 2, 200
DrawBox 1, 1, 10, 40, "ÛŸß߇۟Û.ÛxÜ÷Ü^Û˜", 200
SLEEP
LOOP UNTIL UCASE$(INKEY$) = "X"
DEFINT A-Z
FUNCTION COLAR (Fore, Back)
COLAR = (Fore * 8 AND 128) + (Back * 16) + (Fore AND 15)
END FUNCTION
SUB DrawBox (Row1, Col1, Row2, Col2, BORDER$, ATTR)
IF Row1 > Row2 THEN SWAP Row1, Row2
IF Col1 > Col2 THEN SWAP Col1, Col2
WWIDTH = Col2 - Col1
WHEIGHT = Row2 - Row1
'Here are some good windows! Place them in the BORDER$ parameter:
'
' "۟ߟ߇۟ ŸÛxÜ÷ܘۘ" ;This gives the look of having a 3-D window on_
' screen.
ULC$ = MID$(BORDER$, 1, 1) '*É*
TOP$ = MID$(BORDER$, 3, 1) '*Í*
URC$ = MID$(BORDER$, 5, 1) '*»*
LFT$ = MID$(BORDER$, 7, 1) '*º*
FIL$ = MID$(BORDER$, 9, 1) '* *
RGT$ = MID$(BORDER$, 11, 1) '*º*
LLC$ = MID$(BORDER$, 13, 1) '*È*
BOT$ = MID$(BORDER$, 15, 1) '*Í*
LRC$ = MID$(BORDER$, 17, 1) '*¼*
CULC = ASC(MID$(BORDER$, 2, 1)) '*É*
CTOP = ASC(MID$(BORDER$, 4, 1)) '*Í*
CURC = ASC(MID$(BORDER$, 6, 1)) '*»*
CLFT = ASC(MID$(BORDER$, 8, 1)) '*º*
CFIL = ASC(MID$(BORDER$, 10, 1)) '* *
CRGT = ASC(MID$(BORDER$, 12, 1)) '*º*
CLLC = ASC(MID$(BORDER$, 14, 1)) '*È*
CBOT = ASC(MID$(BORDER$, 16, 1)) '*Í*
--- WM v3.01/93-0966
* Origin: 1:114/289 POWER SURGE - Phoenix, Arizona 602/548-
9020 (1:114/289.0)

Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET