'=========================================================================== ' Subject: SCREEN 13 BOX DRAWER Date: 07-03-97 (17:48) ' Author: Brian Bacon Code: QB, QBasic, PDS ' Origin: kyberteknik@geocities.com Packet: GRAPHICS.ABC '=========================================================================== 'BOX13.BAS - by Brian Bacon 'Box drawing routine for screen mode 13 (actually any graphics mode 'will work.. just make sure to use legal x, y, and color values) ' 'note: If you dont want to use both the outside border colors, 'just set it to the same as the back ground color. ' 'it is easy to add your own box styles in the Box13 sub.. 'just add another CASE statement... ' DECLARE SUB Box13 (x1, y1, x2, y2, style, inside, outside1, outside2) SCREEN 13 LINE (0, 0)-(319, 199), 9, BF Box13 70, 40, 190, 125, 2, 0, 5, 13 Box13 5, 40, 65, 120, 1, 0, 7, 15 Box13 195, 40, 255, 120, 1, 0, 7, 15 Box13 25, 130, 235, 175, 1, 0, 7, 15 SLEEP SUB Box13 (x1, y1, x2, y2, style, inside, outside1, outside2) SELECT CASE style CASE 1 LINE (x1 + 1, y1 + 1)-(x2 - 1, y2 - 1), outside1, B LINE (x1 + 1, y1)-(x2 - 1, y1), outside2 LINE (x1 + 1, y2)-(x2 - 1, y2), outside2 LINE (x1, y1 + 1)-(x1, y2 - 1), outside2 LINE (x2, y1 + 1)-(x2, y2 - 1), outside2 LINE (x1 + 2, y1 + 2)-(x2 - 2, y2 - 2), inside, BF PSET (x1 + 1, y1 + 1), outside2: PSET (x1 + 1, y2 - 1), outside2 PSET (x2 - 1, y1 + 1), outside2: PSET (x2 - 1, y2 - 1), outside2 CASE 2 LINE (x1, y1)-(x2, y2), inside, BF LINE (x1, y1)-(x2, y2), outside2, B LINE (x1 + 1, y1 + 1)-(x2 - 1, y2 - 1), outside1, B CASE 3 LINE (x1, y1)-(x2, y2), inside, BF LINE (x1 + 1, y1 + 1)-(x2 - 1, y2 - 1), outside2, B LINE (x1 + 3, y1 + 3)-(x2 - 3, y2 - 3), outside1, B CASE 4 LINE (x1, y1)-(x2, y2), inside, BF LINE (x1, y1)-(x1 + 3, y1 + 3), outside1, B LINE (x1 + 3, y1 + 3)-(x2 - 3, y2 - 3), outside1, B LINE (x1, y2)-(x1 + 3, y2 - 3), outside1, B LINE (x2, y1)-(x2 - 3, y1 + 3), outside1, B LINE (x2 - 3, y2 - 3)-(x2, y2), outside1, B PSET (x1 + 4, y1 + 4), outside2 PSET (x1 + 4, y2 - 4), outside2 PSET (x2 - 4, y1 + 4), outside2 PSET (x2 - 4, y2 - 4), outside2 LINE (x1, y1 + 5)-(x1 + 1, y2 - 5), outside2, BF PSET (x1 + 2, y1 + 5), outside2 PSET (x1 + 2, y2 - 5), outside2 LINE (x1 + 5, y1)-(x2 - 5, y1 + 1), outside2, BF PSET (x1 + 5, y1 + 2), outside2 PSET (x2 - 5, y1 + 2), outside2 LINE (x2 - 1, y1 + 5)-(x2, y2 - 5), outside2, BF PSET (x2 - 2, y1 + 5), outside2 PSET (x2 - 2, y2 - 5), outside2 LINE (x1 + 5, y2)-(x2 - 5, y2 - 1), outside2, BF PSET (x1 + 5, y2 - 2), outside2 PSET (x2 - 5, y2 - 2), outside2 END SELECT END SUB