' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
'
'                           Q D E M O _ E . B A S
'
'  This file is a subcomponent of the QBSCR Screen Routines Demonstration
'  program QDEMO. It is not meant to run as a standalone program. Use only
'  in conjunction with the QDEMO.BAS program.  See QBSCR documentation or
'  QDEMO.BAS for more information.
'
' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ

'$INCLUDE: 'qbscr.inc'
'$INCLUDE: 'mouse.bi'

COMMON SHARED kolor%
COMMON SHARED mouseExists%

CONST NEEDMOUSE = -3
CONST ORDERFORMMISSING = -12
CONST NEEDVGA = -16
CONST NOFONTS = -17

DECLARE SUB InfoBox (messageNum%)
DECLARE SUB DrawMouse (x%, y%)
DECLARE SUB PrintForm ()

SUB DrawMouse (x%, y%)

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  This function draws a 3D text representation of a mouse on the screen.
	'  It is used by the Mouse Movement demo, and maybe a routine or two
	'  elsewise.  Drawn with upper-left corner at passed-in x and y.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
 
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Set color dependent data.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	IF kolor% THEN
		ft1% = 6
		ft2% = 7
		bs% = STYLE3D
	ELSE
		ft1% = 0
		ft2% = 0
		bs% = STYLE2D
	END IF

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Use the MakeWindow routine to draw the mouse and two mouse buttons.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	MakeWindow CSNG(y%), CSNG(x%), CSNG(y% + 8), CSNG(x% + 14), 0, 7, 0, ft1%, -1, 0, ""' Mouse body
	MakeWindow CSNG(y% + 1), CSNG(x% + 2), CSNG(y% + 3), CSNG(x% + 6), 0, 7, 0, ft1%, -1, 0, ""' Mouse left button
	MakeWindow CSNG(y% + 1), CSNG(x% + 8), CSNG(y% + 3), CSNG(x% + 12), 0, 7, 0, ft1%, -1, 0, ""' Mouse right button
 
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Add some more mouse detail - a horizontal dividing line and a brand
	'  name.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	IF kolor% THEN
		COLOR 15, 7
	ELSE
		COLOR 0, 7
	END IF
	LOCATE y% + 4, x% + 1, 0: PRINT STRING$(13, 196);         ' Dividing line
	COLOR 0, 7
	LOCATE y% + 7, x% + 4, 0: PRINT "BAD Mouse";              ' Mouse brand name

END SUB

SUB FontsDemo

	CONST MAXFONTS = 8
	DIM fi AS FileInfoType
	DIM usedLetters(MAXFONTS + 1) AS STRING * 1
 
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  This demo will illustrate the use of the VGA text mode screen fonts.
	'  If user does not have a VGA card, this routine displays a message and
	'  exits.  If so, they can choose a VGA font to change everything to.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Is a VGA card here?  If not, display an error message and leave.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	IF VgaPresent% THEN
		scanLines% = 16
	ELSE
		IF EgaPresent% THEN
			scanLines% = 14
		ELSE
			InfoBox NEEDVGA
			EXIT SUB
		END IF
	END IF

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Find all VGA fonts on disk. There won't be more than, say, 8 of them,
	'  so simply DIM an array of 8 strings.  If there are more than 8,
	'  then just ignore the extras.  And, as long as we're here, build the
	'  fonts menu.  First, inform the user that we're looking for fonts.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	IF kolor% THEN
		ft1% = 6
		ft2% = 7
		bs% = STYLE3D
	ELSE
		ft1% = 0
		ft2% = 0
		bs% = STYLE2D
	END IF

	IF mouseExists% THEN
		MouseHide
	END IF

	MakeWindow 9, 21, 13, 60, 0, 7, 0, ft1%, -1, 0, "" ' Ä¿
	COLOR 0, 7                                         '  Ã Tell user we're looking
	Center "Looking for font files...", 11             ' ÄÙ
 
	DIM fontfiles$(MAXFONTS)
	DIM menu$(MAXFONTS + 1)
 
	IF scanLines% = 14 THEN
		fileSpec$ = "*.EGF"
	ELSE
		fileSpec$ = "*.VGF"
	END IF
	numFonts% = 0
	found% = FALSE
	found% = FirstFile%(fileSpec$, NormalAttr, dta$)
 
	WHILE (found%) AND (numFonts% < MAXFONTS)
		numFonts% = numFonts% + 1
		FileInfo fi, dta$
		fontfiles$(numFonts%) = fi.fname
		IF INSTR(fontfiles$(numFonts%), CHR$(0)) THEN
			fontfiles$(numFonts%) = LEFT$(fontfiles$(numFonts%), INSTR(fontfiles$(numFonts%), CHR$(0)) - 1)
		END IF
		menu$(numFonts%) = LEFT$(fontfiles$(numFonts%), INSTR(fontfiles$(numFonts%), ".") - 1)
		found% = NextFile%(dta$)
	WEND

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  If there were no font files then display a message and exit.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	IF numFonts% = 0 THEN
		InfoBox NOFONTS
		EXIT SUB
	END IF

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Add the "Default" menu option to the bottom of the menu list.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	numFonts% = numFonts% + 1
	menu$(numFonts%) = "DEFAULT"

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Select a unique quick access letter for each menu choice.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	FOR i% = 1 TO numFonts%
	 
		found% = FALSE
		WHILE found% = FALSE
		 
			FOR j% = 1 TO LEN(menu$(i%))
			 
				' Check every used letter against the current character in the menu
				' choice string.
				letterOK% = TRUE
				currentLtr$ = MID$(menu$(i%), j%, 1)
				FOR k% = 1 TO i%
					IF currentLtr$ = usedLetters(k%) THEN
						letterOK% = FALSE
					END IF
				NEXT k%
			 
				' If the current letter was used, letterOK% will be false. If not, it
				' will be true and we can use it.
				IF letterOK% THEN
					usedLetters(i%) = currentLtr$
					menu$(i%) = LEFT$(menu$(i%), INSTR(menu$(i%), usedLetters(i%)) - 1) + "^" + RIGHT$(menu$(i%), LEN(menu$(i%)) - INSTR(menu$(i%), usedLetters(i%)) + 1)
					found% = TRUE
					EXIT FOR
				END IF
			NEXT j%

		WEND

	NEXT i%

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Now that we' have all we need, let's get started.  Display a window
	'  and some buttons.  The Done button will get us outta here and the
	'  Font button will display a menu of fonts to choose from.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	MakeWindow 5, 8, 23, 73, 0, 7, 0, ft1%, -1, 0, ""
	DrawButton SINGLEBORDER, 11, 20, 20, 22, 0, 7, "Font", bs%
	DrawButton SINGLEBORDER, 22, 20, 31, 22, 0, 7, "Done", bs%

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Add text to the window explaining about fonts and the font demo.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	Center "úúú Text Mode Screen Fonts úúú", 7
	Center "This routine will let you change the screen font on an EGA/", 9
	Center "VGA monitor-equipped machine. QBSCR comes supplied with 10,", 10
	Center "or so fonts and a program called Font Builder that lets you", 11
	Center "create your own fonts.", 12
	Center "If you click the Font button below (or hit F), you will see", 14
	Center "a menu of available fonts.  Simply select the one you want", 15
	Center "and it will remain in effect until you change it or end the", 16
	Center "demo.  If you want out of here, click the Done button or hit", 17
	Center "the D or ESC keys.  You will return to the main menu.", 18

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Wait on user events.  Act based on event.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	IF mouseExists% THEN
		MouseShow
	END IF
	done% = FALSE
	WHILE done% = FALSE

		result% = getEvent%(mouseExists%, kc%, mx%, my%)

		SELECT CASE result%
			CASE EMpressedLeft      ' Left mouse button pressed
				IF (mx% >= 11) AND (mx% <= 20) AND (my% >= 20) AND (my% <= 22) THEN
					PressButton SINGLEBORDER, 11, 20, 20, 22, 0, 7, "Font", bs%
					MakeWindow 8, 35, 8 + numFonts% + 1, 46, 0, 7, 0, ft1%, -1, 0, ""
					menuResult% = MakeMenu%(menu$(), numFonts%, "L", 37, 48, 9, "^", "|", 0, 7, 15, 0, 15, 7, mouseExists%)
					IF (menuResult% > 0) AND (menuResult% < numFonts%) THEN
						IF scanLines% = 16 THEN
							LoadVgaTextFont fontfiles$(menuResult%)
						ELSE
							LoadEgaTextFont fontfiles$(menuResult%)
						END IF
					END IF
					IF menuResult% = numFonts% THEN
						IF scanLines% = 16 THEN
							LoadVgaTextFont ""
						ELSE
							LoadEgaTextFont ""
						END IF
					END IF
					done% = TRUE
				END IF
				IF (mx% >= 22) AND (mx% <= 31) AND (my% >= 20) AND (my% <= 22) THEN
					PressButton SINGLEBORDER, 22, 20, 31, 22, 0, 7, "Done", bs%
					done% = TRUE
				END IF
			CASE EMpressedRight     ' Right mouse button pressed
				done% = TRUE
			CASE EKpressed          ' Keyboard key pressed.
				IF (kc% = ASC("F")) OR (kc% = ASC("f")) THEN
					MakeWindow 8, 35, 8 + numFonts% + 1, 46, 0, 7, 0, ft1%, -1, 0, ""
					menuResult% = MakeMenu%(menu$(), numFonts%, "L", 37, 48, 9, "^", "|", 0, 7, 15, 0, 15, 7, mouseExists%)
					IF (menuResult% > 0) AND (menuResult% < numFonts%) THEN
						IF scanLines% = 16 THEN
							LoadVgaTextFont fontfiles$(menuResult%)
						ELSE
							LoadEgaTextFont fontfiles$(menuResult%)
						END IF
					END IF
					IF menuResult% = numFonts% THEN
						IF scanLines% = 16 THEN
							LoadVgaTextFont ""
						ELSE
							LoadEgaTextFont ""
						END IF
					END IF
					done% = TRUE
				END IF
				IF (kc% = ASC("D")) OR (kc% = ASC("d")) OR (kc% = 27) THEN
					done% = TRUE
				END IF
			CASE ELSE
		END SELECT

	WEND

END SUB

SUB MouseMovement

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  This routine demonstrates the ability of the QBSCR Screen Routines
	'  to track mouse movement.  In this case, we are using the MousePosition
	'  routine to track the mouse's whereabouts.  If the position changes,
	'  then the mouse location on the screen is changed.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	DIM mScr%(BlockSize(1, 15, 1, 9))

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Make sure there is a mouse around before anything else happens.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	IF mouseExists% = FALSE THEN
		InfoBox NEEDMOUSE
		EXIT SUB
	END IF

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Hide the mouse before we display anything.  Note that we don't have to
	'  check for the mouse's existence any longer in this routine.  We would
	'  not be here if it didn't exist.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	MouseHide

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Determine color and 3D information before we proceed.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	IF kolor% THEN
		ft1% = 6
		ft2% = 7
		bs% = STYLE3D
	ELSE
		ft1% = 0
		ft2% = 0
		bs% = STYLE2D
	END IF

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Draw a window with some info and a mouse.  Save what's underneath the
	'  Mouse before we draw.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	MakeWindow 5, 8, 23, 73, 0, 7, 0, ft1%, -1, 0, ""
	COLOR 0, 7
	LOCATE 7, 11, 0: PRINT "This demo illustarates how your own programs can detect the";
	LOCATE 8, 11, 0: PRINT "movement of the mouse.";
	LOCATE 10, 11, 0: PRINT "To see how mouse movement can be utilized, move your mouse";
	LOCATE 11, 11, 0: PRINT "around the screen.  In response to those movements, we will";
	LOCATE 12, 11, 0: PRINT "move the simulated mouse in the lower-right corner of this";
	LOCATE 13, 11, 0: PRINT "window.";
	LOCATE 15, 11, 0: PRINT "See the source code for this demo for more";
	LOCATE 16, 11, 0: PRINT "information on how this all works.";
	LOCATE 18, 11, 0: PRINT "When you are finished, click either mouse";
	LOCATE 19, 11, 0: PRINT "button, or hit the ESC key.  You will be";
	LOCATE 20, 11, 0: PRINT "You will be returned to the menu.";
	mx% = 56
	my% = 14
	MakeWindow my% + 1, mx% + 2, my% + 6, mx% + 11, 0, 7, 0, ft2%, -1, 0, ""
	LOCATE my% + 2, mx% + 4, 0: PRINT "Pretty";
	LOCATE my% + 3, mx% + 4, 0: PRINT "Nifty";
	LOCATE my% + 4, mx% + 4, 0: PRINT "Mouse";
	LOCATE my% + 5, mx% + 4, 0: PRINT "Stuff!";
	BlockSave mx%, mx% + 14, my%, my% + 8, mScr%(), GetVideoSegment!
	DrawMouse mx%, my%

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Set the mouse position to the upper-left corner of the screen "mouse."
	'  First we must turn the mouse cursor on, since the SetPosition command
	'  doesn't do anything if the cursor is not visible.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	MouseShow
	MouseSetPosition mx% * 8, my% * 8

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Set the maximum X and Y values so that the user cannot run our screen
	'  "mouse" off the screen.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	MouseSetMinMaxX 0, 65 * 8
	MouseSetMinMaxY 0, 16 * 8

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Initialize a few variables before we go into the event loop.  The
	'  oldmx% and oldmy% variables keep track of the previous location of
	'  the mouse, so that we know where to restore the screen when our
	'  screen "mouse" is moved.  Hide the mouse before we go into the loop
	'  since our screen "mouse" acts as our cursor.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	oldmx% = mx%
	oldmy% = my%
	MouseHide
	done% = FALSE

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Sit in a loop waiting on events.  If the user moves the mouse, then
	'  update the position of our screen "mouse."  If the user clicks one
	'  of the mouse buttons, then exit this demo (also if they hit ESC).
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	WHILE done% = FALSE

		' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
		'  Get event from user.
		' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
		result% = getEvent%(mouseExists%, kc%, mx%, my%)

		' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
		'  Decide what to do based on user event.
		' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
		SELECT CASE result%
			CASE EMmoved    ' Mouse was moved.
				IF (mx% <> oldmx%) OR (my% <> oldmy%) THEN
					BlockRestore oldmx%, oldmx% + 14, oldmy%, oldmy% + 8, mScr%(), GetVideoSegment!
					BlockSave mx%, mx% + 14, my%, my% + 8, mScr%(), GetVideoSegment!
					DrawMouse mx%, my%
					oldmx% = mx%
					oldmy% = my%
				END IF
			CASE EMpressedRight, EMpressedLeft    ' Mouse button was pressed.
				done% = TRUE
			CASE EKpressed    ' Keyboard key was pressed.
				IF (kc% = 27) THEN
					done% = TRUE
				END IF
			CASE ELSE
		END SELECT
 
	WEND

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Make sure we reset the mouse mouse maximum X and Y to the full screen
	'  before we leave.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	MouseSetMinMaxX 0, 80 * 8
	MouseSetMinMaxY 0, 25 * 8

END SUB

SUB OrderingInfo

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  This routine displays a screen's worth of data and two buttons in the
	'  window.  The first button is Print Form, and the second is Cancel. If
	'  the user hits Print Form, then a form is printed on LPT1.  If the
	'  Cancel button is pressed, we exit from here.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Display a window.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	IF kolor% THEN
		ft% = 6
		ft2% = 7
		bs% = STYLE3D
	ELSE
		ft% = 0
		ft2% = 0
		bs% = STYLE2D
	END IF

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  If we are using the mouse, make sure that it is off while we are
	'  writing to the screen.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	IF mouseExists% THEN
		MouseHide
	END IF

	MakeWindow 2, 11, 24, 70, 0, 7, 0, ft%, -1, 0, ""

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Add the screen buttons.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	DrawButton SINGLEBORDER, 13, 21, 26, 23, 0, 7, "Print Form", bs%
	DrawButton SINGLEBORDER, 28, 21, 41, 23, 0, 7, "Cancel", bs%

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Add the text.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	MakeWindow 3, 21, 5, 60, 0, 7, 0, ft2%, -1, 0, ""
	Center "ùùù Ordering Information ùùù", 4
	Center "If you haven't registered the QBSCR Screen Routines,", 7
	Center "the cost is $20.00, sent to the address below.  Make", 8
	Center "all checks payable to Tony Martin.  For all overseas", 9
	Center "customers, add $5.00 for trans-Atlantic postage, and", 10
	Center "make sure your check is for U.S. funds, AND drawn on", 11
	Center "a U.S. bank.  Otherwise, it cannot be cashed. If you", 12
	Center "would like to print an order on a printer attached", 13
	Center "to your LPT1: port, Click the Print Form button or", 14
	Center "hit P.  To exit, click the Cancel buttor hit ESC.", 15
	Center "Tony Martin", 17
	Center "1611 Harvest Green Ct.", 18
	Center "Reston, VA 22094", 19

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Turn the mouse back on if it is around here.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	IF mouseExists% THEN
		MouseShow
	END IF

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Now we must wait on the user for a response of some kind.  To do this,
	'  we use the QBSCR routine GetEvent%.  It will return a keypress or a
	'  mouse event, whichever occurs first.  If the C, c, Esc, or right
	'  mouse buttons are pressed, or if the left button is pressed while the
	'  mouse cursor is on the Cancel button, we get out. If the P, p, or left
	'  mouse button is pressed while one the Print Form button, then we
	'  print a form and THEN get out.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	done% = FALSE
	WHILE done% = FALSE

		' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
		'  Get an event of some kind.
		' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
		result% = getEvent%(mouseExists%, kc%, mx%, my%)

		' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
		'  Decide what to do based on the event that occurred.
		' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
		SELECT CASE result%
			CASE EMpressedLeft      ' Mouse left button pressed.
			 
				' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
				'  See if the mouse was on the PrintForm button.
				' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
				IF (mx% >= 13) AND (mx% <= 26) AND (my% >= 21) AND (my% <= 23) THEN
					PressButton SINGLEBORDER, 13, 21, 26, 23, 0, 7, "Print Form", bs%
					PrintForm
					done% = TRUE
				END IF

				' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
				'  See if the mouse was on the Cancel button.
				' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
				IF (mx% >= 28) AND (mx% <= 41) AND (my% >= 21) AND (my% <= 23) THEN
					PressButton SINGLEBORDER, 28, 21, 41, 23, 0, 7, "Cancel", bs%
					done% = TRUE
				END IF

			CASE EMpressedRight     ' Right mouse button pressed.
				done% = TRUE

			CASE EKpressed          ' Keyboard pressed.
				IF (kc% = 27) OR (kc% = ASC("C")) OR (kc% = ASC("c")) THEN
					done% = TRUE
				END IF

				IF (kc% = ASC("P")) OR (kc% = ASC("p")) THEN
					PrintForm
					done% = TRUE
				END IF
			CASE ELSE
		END SELECT

	WEND

END SUB

SUB PrintForm

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  This routine asks the user to ensure that everything is OK, and then
	'  hit the OK or Cancel buttons to print or abort, respectively.  It
	'  uses the QBSCR OkCancelMessageBox routine to do this.  If the user
	'  responded affirmatively, then a form is printed; otherwise the routine
	'  simply ends.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  If the order form file ORDER.FRM is missing, then display an error and
	'  get out of this function now.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	IF FirstFile%("ORDER.FRM", NormalAttr, dta$) = FALSE THEN
		InfoBox ORDERFORMMISSING
		EXIT SUB
	END IF
 
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  Get ready for and display an OkCancelMessageBox.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	IF kolor% THEN
		ft% = 6
		bs% = STYLE3D
	ELSE
		ft% = 0
		bs% = STYLE2D
	END IF
	DIM txt$(6)
	txt$(1) = "Make sure your printer is attached"
	txt$(2) = "to the LPT1: port of your computer"
	txt$(3) = "and is ON LINE. If this is all set,"
	txt$(4) = "click the OK button or hit O or the"
	txt$(5) = "ENTER key.  If not, then hit C or"
	txt$(6) = "the ESC key."
	result% = OkCancelMessageBox%(21, 7, 60, 19, txt$(), 6, 0, 0, 7, ft%, -1, 0, "", mouseExists%, SINGLEBORDER, bs%)

	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	'  If result% is TRUE (non-zero) then the user hit OK.  If not, the user
	'  hit Cancel.  If OK, then print the form.
	' ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
	IF result% THEN
		IF mouseExists% THEN
			MouseHide
		END IF
		MakeWindow 12, 16, 14, 65, 0, 7, 0, ft%, -1, 0, ""
		Center "Printing form...", 13
		OPEN "ORDER.FRM" FOR INPUT AS #1
		WHILE (NOT (EOF(1)))
			LINE INPUT #1, aLine$
			aLine$ = RTRIM$(aLine$)
			LPRINT aLine$
		WEND
		LPRINT CHR$(12)
		CLOSE #1
	END IF

END SUB

