home *** CD-ROM | disk | FTP | other *** search
- '============================================================================
- ' QUICKWINDOWS Demonstration/Tutorial Program Version 2.1
- ' Modified for QuickBASIC 4.x
- ' Entire contents Copyright 1989/1990 by
- ' Software Interphase, Inc.
- '============================================================================
- '
- ' This demonstration program will give you a general idea on how to use
- ' most of the QuickWindows functions. Note that this demo works only with
- ' QuickBASIC 4.5.
- '
- DECLARE SUB swclear () : DECLARE SUB swcattr () : DECLARE SUB swbuttonget ()
- DECLARE SUB swattr () : DECLARE SUB srevscrn () : DECLARE SUB sputscrn ()
- DECLARE SUB sputch () : DECLARE SUB sgetscrn () : DECLARE SUB sgetch ()
- DECLARE SUB sdmascrn () : DECLARE SUB sbox8set () : DECLARE SUB sattrscrn ()
- DECLARE SUB swdelrow () : DECLARE SUB swcsrpos () : DECLARE SUB swcsron ()
- DECLARE SUB swcsroff () : DECLARE SUB swcopystr () : DECLARE SUB swcolor ()
- DECLARE SUB swcls () : DECLARE SUB swcloseall () : DECLARE SUB swclose ()
- DECLARE SUB swhint () : DECLARE SUB swinput () : DECLARE SUB swsetcsr ()
- DECLARE SUB swselect () : DECLARE SUB swrevline () : DECLARE SUB swrev ()
- DECLARE SUB swrattr () : DECLARE SUB swprint () : DECLARE SUB swopen ()
- DECLARE SUB swlocate () : DECLARE SUB swlint () : DECLARE SUB swinsrow ()
- DECLARE SUB swvscroll () : DECLARE SUB smsetpos () : DECLARE SUB swmouse ()
- DECLARE SUB smouse () : DECLARE SUB smhide () : DECLARE SUB smshow ()
- DECLARE SUB sminit () : DECLARE SUB swwrap () : DECLARE SUB smsety ()
- DECLARE SUB smsetx () : DECLARE SUB smbrel () : DECLARE SUB smbpress ()
- DECLARE SUB smpenoff () : DECLARE SUB smpenon () : DECLARE SUB smratio ()
- DECLARE SUB smenuon () : DECLARE SUB smenuoff () : DECLARE SUB smenubar ()
- DECLARE SUB smenuset () : DECLARE SUB smenuoption () : DECLARE SUB spopmenu ()
- DECLARE SUB spopmenuh () : DECLARE SUB spopmenu1 () : DECLARE SUB prompt ()
- DECLARE SUB savescrn () : DECLARE SUB restorescrn () : DECLARE SUB shelpmenu ()
- DECLARE SUB spopmenuv ()
-
- DEFINT A-Z
- COMMON SHARED accept$(), menu$(), function$(), bar$(), text$()
- COMMON SHARED x(), y(), l(), edits(), scrn(), kb(), cattr()
- COMMON SHARED s1(), s2(), s3(), s4(), s5(), s6(), s8(), s9()
- COMMON SHARED s10(), s11(), sc1(), mouse.status
- REM $DYNAMIC
- DIM SHARED accept$(10), menu$(101), function$(100), bar$(10), text$(30)
- DIM SHARED x(10), y(10), l(10), edits(10), scrn(2100), kb(10), cattr(10)
- DIM SHARED s1(400), s2(400), s3(300), s4(400), s5(1700), s6(1100), s8(1000)
- DIM SHARED s9(700), s10(500), s11(1800), sc1(300)
- CALL QWINIT(4)
- CALL WCLOSEALL: CALL MINIT(mouse.status, num.buttons): num.functions = 63
- blue = 1: CALL TSTMONO(mono%)
- IF mono% = 1 THEN blue = 2: 'If monochrome card, offset blue color by 1
- '(to get rid of underlining)
- COLOR 15, 1, 1: CLS : RESTORE TITLE: READ n, x1, y1, x2, y2
- FOR i = 0 TO n - 1: READ s5(i): NEXT i
- CALL BOX(x1 + 1, y1 + 1, x2 + 1, y2 + 1, 2, 0, "")
- CALL PUTSCRN(x1, y1, x2, y2, s5())
- LOCATE y2 + 3, 1
- PRINT " Feel free to share the QuickWindows library with anyone. This library"
- PRINT " is the most comprehensive windowing library ever released for shareware"
- PRINT " for Microsoft QuickBASIC (3.x, 4.x) and BASIC (6.0, 7.0) compilers."
- PRINT " Use any of the source code in this demo program in your own programs."
- PRINT " The demo source code gives you some helpful hints when using the"
- PRINT " QuickWindows Library. If you are interested in a more advanced version"
- PRINT " of QuickWindows, ask us about QuickWindows Advanced and Designer QW."
- PRINT
- PRINT " QuickWindows is a trademark of Software Interphase, Inc. The QuickWindows"
- PRINT " Library is copyrighted 1987-1990 by Software Interphase, Inc.";
- COLOR 7, 1, 1: LOCATE 25, 25: PRINT "--- Press ENTER to continue ---";
- WHILE INKEY$ <> CHR$(13): WEND: COLOR 15, 1, 1: CLS
- PRINT " QuickWindows is a full-featured, text window management library for Microsoft"
- PRINT " QuickBASIC and BASIC compilers. Over 60 functions give you the ability to"
- PRINT " create windows, pop-up and pull-down menus, and interface to a Microsoft"
- PRINT " compatible mouse. ": PRINT : COLOR 11, 1, 1
- PRINT " * Saves you hours of valuable programming time": PRINT
- PRINT " * Fast! Written entirely in assembly language": PRINT
- PRINT " * Efficient! Uses less than 24K of object code": PRINT
- PRINT " * Easy to use! High level interface provides you with"
- PRINT " simple commands to open and write to a window": PRINT
- PRINT " * Automatically detects both the CGA and MGA cards, or"
- PRINT " EGA cards emulating the CGA/MGA text modes": PRINT : COLOR 15, 1, 1
- PRINT " Comes complete with the library of over 60 functions, a fully-documented"
- PRINT " manual, many programming examples, and the source code to this demo to"
- PRINT " show you how to use QuickWindows. Support the author and register"
- PRINT " your copy of QuickWindows today.": PRINT : COLOR 14, 1, 1
- PRINT " A registration form will appear when you QUIT the QuickWindows demo."
- COLOR 7, 1, 1: LOCATE 25, 25: PRINT "--- Press ENTER to continue ---";
- WHILE INKEY$ <> CHR$(13): WEND: COLOR 15, 1, 1: CLS
-
-
- demo:
- COLOR 7, 1, 1: CLS : RESTORE FUNCTION.LIST
- FOR i = 0 TO num.functions - 1: READ function$(i): NEXT i
- CALL BOX8SET(223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0): y = 2: func = 0
- CALL BOX(2, 2 + y, 38, 10 + y, 1, 0, "")
- CALL WOPEN(1, 1 + y, 37, 9 + y, 8, &H3C, "FUNCTION", s1(), 1)
- CALL BOX(43, 2 + y, 80, 10 + y, 1, 0, "")
- CALL WOPEN(42, 1 + y, 79, 9 + y, 8, &H3C, "OUTPUT", s2(), 2)
- CALL BOX(2, 13 + y, 80, 15 + y, 1, 0, "")
- CALL WOPEN(1, 12 + y, 79, 14 + y, 8, &H4C, "SYNTAX", s3(), 3)
- CALL BOX(2, 18 + y, 80, 22 + y, 1, 0, "")
- CALL WOPEN(1, 17 + y, 79, 21 + y, 8, &H74, "", s4(), 4)
- CALL WCOLOR(4, &H70): CALL WCLS(4)
- CALL WPRINT(4, " QuickWindows Demo and~ Tutorial Program~ Version 2.0")
- CALL WCOLOR(3, &H4E): CALL WCLS(3)
- CALL WPRINT(3, "All function syntax will be displayed in this window.")
- CALL WCOLOR(2, &H3B): CALL WCLS(2)
- CALL WPRINT(2, "~ Any output or demonstrations will~ appear in this window or use")
- CALL WPRINT(2, "~ the entire screen")
- CALL WCOLOR(1, &H3B): CALL WCLS(1)
- CALL WPRINT(1, "~Function definitions are shown here")
- GOSUB BUTTONSET: focus = 1: GOTO MAIN
-
- FUNCTION.LIST:
- DATA ATTRSCRN,BOX,BOX8SET,DMASCRN,GETCH,GETSCRN,PUTCH,PUTSCRN,REVSCRN,VSCROLL
- DATA WATTR,WBOX,WBUTTONGET,WBUTTONSET,WCATTR,WCLEAR,WCLOSE,WCLOSEALL,WCLS
- DATA WCOLOR,WCOPYSTR,WCSROFF,WCSRON,WCSRPOS,WDELROW,WHINT,WINPUT,WINSROW
- DATA WLINT,WLOCATE,WOPEN,WPRINT,WRATTR,WREV,WREVLINE,WSELECT,WSETCSR
- DATA WVSCROLL,WWRAP
- DATA MINIT,MSHOW,MHIDE,MOUSE,WMOUSE,MSETPOS,MBPRESS,MBREL,MSETX,MSETY,MRATIO
- DATA MPENON,MPENOFF
- DATA MENUBAR,MENUGET,MENUOFF,MENUON,MENUOPTION,MENUSET,POPMENU,POPMENU1
- DATA POPMENUH,POPMENUV,HELPMENU
-
- BUTTONSET:
- '****************************************************************************
- ' Define command input buttons. Also resets any highlighting of buttons
- ' on every subsequent calls here.
- '
- CALL MHIDE: 'Turn off mouse cause there will be a screen write
- CALL WBUTTONSET(4, 1, 15104, 0, &H78 + blue, 2, &H70 + blue, 28, 0, "F1-Proceed"): 'Define button 1
- CALL WBUTTONSET(4, 2, 15360, 0, &H78 + blue, 2, &H70 + blue, 45, 0, "F2-Select"): 'Define button 2
- CALL WBUTTONSET(4, 3, 15616, 0, &H78 + blue, 2, &H70 + blue, 61, 0, "F3-Quit"): 'Define button 3
- RETURN
-
-
- NOMOUSE:
- CALL WPRINT(2, "~ Cannot continue with the~ demonstration because there is")
- CALL WPRINT(2, "~ no mouse installed on this~ system."): GOTO MAIN
-
-
- MAIN:
- CALL WBUTTONGET(focus, 1, 3, result)
- IF focus < 1 THEN focus = 3 ELSE IF focus > 3 THEN focus = 1
- IF result = 0 THEN GOTO MAIN ELSE GOSUB BUTTONSET: CALL MHIDE
- IF result = 1 THEN
- func = func + 1
- IF func > num.functions THEN GOTO ORDERFRM
- GOTO MAIN1
- ELSEIF result = 2 THEN
- CALL WOPEN(4, 2, 76, 23, 2, &H74, "", s5(), 5)
- CALL WLOCATE(5, 3, 17)
- CALL WPRINT(5, "Keyboard: Use arrows to highlight Function and press ENTER")
- CALL WPRINT(5, "~ Mouse: Move mouse cursor on top of Function and press left button")
- CALL WOPEN(7, 4, 73, 18, 1, &H74, "", s6(), 6)
- CALL WCOLOR(6, &H70 + blue): CALL WCLS(6): i = func: IF i = 0 THEN i = 1
- CALL POPMENUH(6, i - 1, 13, num.functions, &H75, VARPTR(function$(0)), result, flag)
- CALL MHIDE: CALL WCLOSE(6): CALL WCLOSE(5): IF flag <> 1 THEN GOTO MAIN
- func = result + 1: GOTO MAIN1
- ELSEIF result = 3 THEN
- GOTO ORDERFRM
- END IF
- GOTO MAIN
-
- ORDERFRM:
- COLOR 7, 1, 1: CLS
- PRINT TAB(24); "QUICKWINDOWS REGISTRATION FORM": PRINT
- PRINT " Use this handy form to register your copy of QuickWindows today."
- PRINT " Registration entitles you to receive a full printed manual and"
- PRINT " technical support. Your support will go a long way to helping us"
- PRINT " provide you with better service. The assembly source is also available."
- PRINT ""
- PRINT " ___ 1. Software Registration only (no printed manual) ........... $35"
- PRINT " ___ 2. Software Registration with printed manual ................ $50"
- PRINT " ___ 3. Software Registration with source code and manual ........ $75"
- PRINT " ___ 4. Send me info on your QuickWindows Advanced and Designer QW packages."
- PRINT " ___ 5. Send me info on your full-featured QuickComm Communications Library."
- PRINT ""
- PRINT " Press SHIFT+PRTSC to send this form to your printer."
- PRINT : PRINT STRING$(80, "="): PRINT
- PRINT " Company Name ____________________________"
- PRINT " Name ____________________________________ Mail Check/MO to:"
- PRINT " Address _________________________________"
- PRINT " City, State, Zip ________________________ Software Interphase, Inc."
- PRINT " Telephone _______________________________ 5 Bradley Street, Suite 4A"
- PRINT " QuickBASIC/BASCOM version _______________ Providence, RI 02908-2304"
- WHILE INKEY$ = "": WEND
- END
-
-
- MAIN1:
- 'i! = FRE(""): LOCATE 25, 1: PRINT "Free string space: "; i!; : 'monitors free string space
- CALL WCLS(1): CALL WCLS(2): CALL WCLS(3): LOCATE 1, 1: 'Home physical cursor out of the way (if it's on)
-
- IF func = 1 THEN CALL sattrscrn
- IF func = 2 THEN GOTO sbox
- IF func = 3 THEN CALL sbox8set
- IF func = 4 THEN CALL sdmascrn
- IF func = 5 THEN CALL sgetch
- IF func = 6 THEN CALL sgetscrn
- IF func = 7 THEN CALL sputch
- IF func = 8 THEN CALL sputscrn
- IF func = 9 THEN CALL srevscrn
- IF func = 10 THEN GOTO svscroll
- IF func = 11 THEN CALL swattr
- IF func = 12 THEN GOTO swbox
- IF func = 13 THEN CALL swbuttonget
- IF func = 14 THEN GOTO swbuttonset
- IF func = 15 THEN CALL swcattr
- IF func = 16 THEN CALL swclear
- IF func = 17 THEN CALL swclose
- IF func = 18 THEN CALL swcloseall
- IF func = 19 THEN CALL swcls
- IF func = 20 THEN CALL swcolor
- IF func = 21 THEN CALL swcopystr
- IF func = 22 THEN CALL swcsroff
- IF func = 23 THEN CALL swcsron
- IF func = 24 THEN CALL swcsrpos
- IF func = 25 THEN CALL swdelrow
- IF func = 26 THEN CALL swhint
- IF func = 27 THEN GOTO swinput
- IF func = 28 THEN CALL swinsrow
- IF func = 29 THEN CALL swlint
- IF func = 30 THEN CALL swlocate
- IF func = 31 THEN CALL swopen
- IF func = 32 THEN CALL swprint
- IF func = 33 THEN CALL swrattr
- IF func = 34 THEN CALL swrev
- IF func = 35 THEN CALL swrevline
- IF func = 36 THEN CALL swselect
- IF func = 37 THEN CALL swsetcsr
- IF func = 38 THEN CALL swvscroll
- IF func = 39 THEN CALL swwrap
- IF func = 40 THEN CALL sminit
- IF func = 41 THEN CALL smshow
- IF func = 42 THEN CALL smhide
- IF func = 43 THEN CALL smouse
- IF func = 44 THEN CALL swmouse
- IF func = 45 THEN CALL smsetpos
- IF func = 46 THEN CALL smbpress
- IF func = 47 THEN CALL smbrel
- IF func = 48 THEN CALL smsetx
- IF func = 49 THEN CALL smsety
- IF func = 50 THEN CALL smratio
- IF func = 51 THEN CALL smpenon
- IF func = 52 THEN CALL smpenoff
- IF ((func > 39) AND (func < 53) AND (mouse.status = 0)) THEN GOTO NOMOUSE
- IF func = 53 THEN CALL smenubar
- IF func = 54 THEN GOTO smenuget
- IF func = 55 THEN CALL smenuoff
- IF func = 56 THEN CALL smenuon
- IF func = 57 THEN CALL smenuoption
- IF func = 58 THEN CALL smenuset
- IF func = 59 THEN CALL spopmenu
- IF func = 60 THEN CALL spopmenu1
- IF func = 61 THEN CALL spopmenuh
- IF func = 62 THEN CALL spopmenuv
- IF func = 63 THEN CALL shelpmenu
- GOTO MAIN
-
-
- TITLE:
- DATA 936,2,1,79,12 : 'number of elements, (x1,y1)-(x2-y2)
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,16091,16091,16091,16091,16091,14368,14368,16091,14368,14368,14368
- DATA 16091,14368,14368,16091,14368,14368,16091,16091,16091,16091,16091,14368,14368
- DATA 16091,14368,14368,14368,16091,14368,14368,16091,14368,14368,14368,16091,14368
- DATA 14368,16091,14368,14368,16091,16091,16091,16091,16091,14368,14368,16091,16091
- DATA 16091,16091,14368,14368,14368,16091,16091,16091,16091,16091,14368,14368,16091
- DATA 14368,14368,14368,16091,14368,14368,16091,16091,16091,16091,16091,14368,14368
- DATA 14368,14368,16091,14368,14368,14368,16091,14368,14368,16091,14368,14368,14368
- DATA 16091,14368,14368,16091,14368,14368,16091,14368,14368,14368,14368,14368,14368
- DATA 16091,14368,16092,16095,14368,14368,14368,16091,14368,14368,14368,16091,14368
- DATA 14368,16091,14368,14368,16091,14368,15904,14368,16091,14368,14368,16091,14368
- DATA 14368,14368,16091,14368,14368,16091,14368,14368,14368,16091,14368,14368,16091
- DATA 14368,14368,14368,16091,14368,14368,16091,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,16091,14368,14368,14368,16091,14368,14368,16091,14368,14368,14368
- DATA 16091,14368,14368,16091,14368,14368,16091,14368,14368,14368,14368,14368,14368
- DATA 16091,16091,14368,14368,14368,14368,14368,16091,14368,14368,14368,16091,14368
- DATA 14368,16091,14368,14368,16091,14368,15904,14368,16091,14368,14368,16091,14368
- DATA 14368,14368,16091,14368,14368,16091,14368,14368,14368,16091,14368,14368,16091
- DATA 14368,14368,14368,16091,14368,14368,16091,16091,16091,16091,16091,14368,14368
- DATA 14368,14368,16091,14368,14368,16092,16091,14368,14368,16091,14368,14368,14368
- DATA 16091,14368,14368,16091,14368,14368,16091,14368,14368,14368,14368,14368,14368
- DATA 16091,14368,16095,16092,14368,14368,14368,16091,14368,16091,14368,16091,14368
- DATA 14368,16091,14368,14368,16091,14368,15904,15904,16091,14368,14368,16091,14368
- DATA 14368,14368,16091,14368,14368,16091,14368,14368,14368,16091,14368,14368,16091
- DATA 14368,16091,14368,16091,14368,14368,14368,14368,14368,14368,16091,14368,14368
- DATA 14368,14368,16091,16091,16091,16091,16091,14368,14368,16091,16091,16091,16091
- DATA 16091,14368,14368,16091,14368,14368,16091,16091,16091,16091,16091,14368,14368
- DATA 16091,14368,14368,14368,16091,14368,14368,16091,16091,16091,16091,16091,14368
- DATA 14368,16091,14368,14368,16091,14368,14368,14368,16091,14368,14368,16091,16091
- DATA 16091,16091,14368,14368,14368,16091,16091,16091,16091,16091,14368,14368,16091
- DATA 16091,16091,16091,16091,14368,14368,16091,16091,16091,16091,16091,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,15191,15136,15177,15136,15182,15136,15172,15136,15183
- DATA 15136,15191,15136,15136,15136,15181,15136,15169,15136,15182,15136,15169,15136
- DATA 15175,15136,15173,15136,15181,15136,15173,15136,15182,15136,15188,15136,15136
- DATA 15136,15180,15136,15177,15136,15170,15136,15186,15136,15169,15136,15186,15136
- DATA 15193,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,15174,15136,15183,15136,15186,15136,15136
- DATA 15136,15170,15136,15169,15136,15187,15136,15177,15136,15171,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368,14368
- DATA 0,0,0,0,0,0,0,0,0,0,0,0,0
-
- swinput:
- '--------------------------------- WINPUT -----------------------------------
- CALL WPRINT(3, " WINPUT (window_id,input_string,rel_pos,edits,exits,accept$,kb,flag)")
- CALL WPRINT(1, " WINPUT~~ Very versatile window input~ routine.")
- CALL WPRINT(2, " Use WINPUT and create your own~ database input routines. A")
- CALL WPRINT(2, "~ sample video database and WINPUT~ options follow...")
- CALL prompt: CALL savescrn: CLS
- CALL BOX(4, 2, 74, 21, 6, 0, ""): id = 6
- CALL BOX8SET(223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- CALL WOPEN(5, 1, 75, 20, 8, &H34, "", s6(), id): CALL WCOLOR(id, &H3B)
- CALL WCLS(id)
- CALL WPRINT(id, " Here is a list of the 'edits' parameter bits~")
- CALL WPRINT(id, "~ Bit 0 Keep original value of input_string when entering WINPUT")
- CALL WPRINT(id, "~ Bit 1 Accept letters and spaces")
- CALL WPRINT(id, "~ Bit 2 Accept numbers")
- CALL WPRINT(id, "~ Bit 3 Accept +-. characters")
- CALL WPRINT(id, "~ Bit 4 Accept all ASCII characters")
- CALL WPRINT(id, "~ Bit 5 Convert inputted lowercase letters to uppercase")
- CALL WPRINT(id, "~ Bit 6 Convert inputted uppercase letters to lowercase")
- CALL WPRINT(id, "~ Bit 7 Beep if exceeding maximum field size during input")
- CALL WPRINT(id, "~ Bit 8 Allow INS/DEL editing within field")
- CALL WPRINT(id, "~ Bit 9 Allow HOME to position cursor at beginning of field")
- CALL WPRINT(id, "~ Bit 10 Allow END to position cursor at the end of field")
- CALL WPRINT(id, "~ Bit 11 Allow inserting while inputting (CNTRL-END toggles mode")
- CALL WPRINT(id, "~ Bit 12 Cancel edits if exited by exit-type keys")
- CALL WPRINT(id, "~ Bit 13 Normal exit when field buffer is full")
- CALL WPRINT(id, "~ Bit 14 Exit if first mouse button is pressed")
- CALL prompt: CALL WCLS(id)
- CALL WPRINT(id, " List of 'exit' parameter options")
- CALL WPRINT(id, "~~ Bits 0-9 Exit if one of the function keys F1-F10 pressed")
- CALL WPRINT(id, "~ Bit 10 Exit if up-arrow pressed")
- CALL WPRINT(id, "~ Bit 11 Exit if down-arrow pressed")
- CALL WPRINT(id, "~ Bit 12 Exit if CNTRL-PGUP pressed")
- CALL WPRINT(id, "~ Bit 13 Exit if CNTRL-PGDN pressed")
- CALL WPRINT(id, "~ Bit 14 Exit if ESC pressed")
- CALL prompt: CALL WCLS(id)
- CALL WPRINT(id, STRING$(16, 196) + " SAMPLE VIDEO DATABASE INPUT SCREEN " + STRING$(17, 196))
- CALL WLOCATE(id, 0, 17)
- CALL WPRINT(id, SPACE$(12) + "Press F1 for help or ESC to exit this screen")
- WINPUT1:
- RESTORE WINPUT1: CALL WCOLOR(id, &H3E)
- FOR i = 1 TO 5
- READ x, y, a$: CALL WLOCATE(id, x, y): CALL WPRINT(id, a$ + ":")
- NEXT i
- DATA 2,3,"Video Title ",2,5,"Year Produced ",2,7,"Classification"
- DATA 2,9,"Tape ID",2,11,"Summary"
- WINPUT2:
- numflds = 5: relpos = 1: exits = 16384 + 1: 'exits: set up exit for ESC or F1 keys (2^14 + 2^0)
- text$(1) = "Star Trek - The Motion Picture": text$(2) = "1978": text$(5) = ""
- text$(3) = "Sci-Fi": text$(4) = "9B": 'imagine this video data coming from a file
- CALL WCOLOR(id, &H3F)
- FOR i = 1 TO numflds
- READ x(i), y(i), l(i), edits(i), accept$(i)
- CALL WLOCATE(id, x(i), y(i)): CALL WPRINT(id, text$(i))
- NEXT i
- DATA 18,3,30,18305,"" : 'field 1 - Normal input
- DATA 18,5,4,18331,"" : 'field 2 - Allow numbers only
- DATA 18,7,16,18337,"" : 'field 3 - Convert lowercase to upper
- DATA 11,9,4,18337,"0123456789ABCDE" : 'field 4 - Convert l/U and accept only numbers and A-E
- DATA 11,11,74,18305,"" : 'field 5 - Normal input. Notice wrap around when input exceeds length of window
- WINPUT3:
- CALL MSHOW: GOSUB SCRN.INP: 'main s/r for database input/edit screen
- IF flag <> 0 THEN GOTO WINPUT3 ELSE CALL MHIDE: CALL WCSROFF(id)
- : 'HELP routine (F1 pressed)
- IF kb = 15104 THEN
- CALL WOPEN(15, 3, 65, 17, 1, &H74, "", s8(), 8): CALL WCOLOR(8, &H70 + blue)
- CALL WPRINT(8, "~ General Help for WINPUT processing")
- CALL WPRINT(8, "~~ Up/Down Arrows move to different fields")
- CALL WPRINT(8, "~ Right/Left Arrows move cursor within field")
- CALL WPRINT(8, "~ HOME puts cursor to beginning of field")
- CALL WPRINT(8, "~ END positions cursor to end of field")
- CALL WPRINT(8, "~ DEL deletes character at cursor position")
- CALL WPRINT(8, "~ INS inserts space at cursor position")
- CALL WPRINT(8, "~ CNTRL-END toggles Insert/Overtype mode")
- CALL WPRINT(8, "~~ Next Page, press any key")
- WHILE INKEY$ = "": WEND: CALL WCLS(8)
- CALL WPRINT(8, "~ For a quick placement of the cursor anywhere")
- CALL WPRINT(8, "~ within a field, place the mouse cursor on top")
- CALL WPRINT(8, "~ of desired location and press left-most mouse")
- CALL WPRINT(8, "~ button. Then move the mouse cursor out of~ the way.")
- CALL WPRINT(8, "~~~ Press any key to continue")
- WHILE INKEY$ = "": WEND: CALL WCLOSE(8): GOTO WINPUT3
- END IF
- CALL WCLOSE(id): CALL restorescrn: GOTO MAIN
- '============================================================================
- SCRN.INP:
- '............................................................................
- ' Screen input routine
- ' A window (id) must be open before calling this routine
- ' Enter: x(),y() = relative starting location within window
- ' l() = length of field, numflds = number of fields
- ' relpos = starting relative position, id = window id
- ' edits() = edit option bits for each field, exits=exit mask
- ' accept$() = string to contain accepting character for each field
- ' text$() = contains length and field data
- ' Exit: text$() possibly modified
- ' flag=0 if exited ok, -1 if ESC exit
- '
- IF relpos < 1 THEN relpos = numflds ELSE IF relpos > numflds THEN relpos = 1
- relstart = 1
- SCRN.INP1:
- i = relpos: i$ = STRING$(l(i), 32): LSET i$ = text$(i)
- CALL WLOCATE(id, x(i), y(i)): CALL WCSRON(id)
- CALL WINPUT(id, i$, relstart, edits(i), (exits OR &H4C00), accept$(i), kb, flag)
- text$(i) = i$: IF flag = 1 THEN relpos = relpos + 1: GOTO SCRN.INP
- IF flag = 0 THEN
- IF kb = 27 THEN RETURN
- IF kb = 20480 THEN relpos = relpos + 1: GOTO SCRN.INP
- IF kb = 18432 THEN relpos = relpos - 1: GOTO SCRN.INP
- RETURN
- END IF
- IF flag <> -3 THEN GOTO SCRN.INP
- y = INT(kb / 256): x = INT(kb MOD 256): FOR i = 1 TO numflds
- IF (x >= x(i)) AND (x < x(i) + l(i)) AND (y = y(i)) THEN relpos = i: relstart = x - x(i) + 1: GOTO SCRN.INP1
- NEXT i: IF y > y(numflds) THEN RETURN ELSE GOTO SCRN.INP
- '============================================================================
-
- sbox:
- '--------------------------------- BOX --------------------------------------
- CALL WPRINT(3, " BOX (X1,Y1,X2,Y2,style,color,box_title)")
- CALL WPRINT(1, " BOX~~ Draw a box any size, any color,~ anywhere on the screen.")
- CALL WPRINT(1, "~ Choose from 7 pre-defined box~ styles or design one of~ your own.")
- CALL prompt: CALL savescrn: CLS : RESTORE sbox
- FOR i = 1 TO 7
- READ x, y: CALL BOX(x, y, x + 17, y + 7, i, &H18 + i, "STYLE #" + MID$(STR$(i), 2))
- NEXT i
- CALL prompt: CALL restorescrn: GOTO MAIN
- DATA 1,1,20,1,40,1,60,1,1,10,20,10,40,10,60,10
-
-
- smenuget:
- '--------------------------------- MENUGET ----------------------------------
- CALL WPRINT(3, " MENUGET (menu_number,option_number,flag)")
- CALL WPRINT(1, " MENUGET~~ Returns menu number and option")
- CALL WPRINT(1, "~ number if selected with a mouse~ or keyboard")
- CALL WPRINT(2, "~ The pull-down menus must have~ been previously defined and turned")
- CALL WPRINT(2, "~ on with the MENUBAR, MENUSET, and~ MENUON commands.")
- CALL prompt: CALL savescrn
- CLS : RESTORE smenuget: nummenus = 6: barattr = &H30
- '...... Read in values for MENU BAR along the top of the screen............
- FOR i = 0 TO nummenus - 1
- READ bar$(i), kb(i)
- NEXT i
- CALL MENUBAR(nummenus, barattr, kb(), VARPTR(bar$(0)))
- DATA File,15104,Edit,15360,View,15616,Search,15872,Midi,16128,Comm,16384
- ' F1 F2 F3 F4 F5 F6
- '...... Read in each of the menu options & xfer into internal storage......
- FOR i = 1 TO nummenus
- READ msize, menu$(0)
- FOR j = 1 TO msize: READ a$: menu$(j) = " " + a$: NEXT j
- CALL MENUSET(i, msize, 2, 10, 15, 7, -1, VARPTR(menu$(0)))
- NEXT i
- DATA 7,"FILE",Load,Save,Open,Close,Print,Shell,Quit : 'Menu 1
- DATA 4,"",Undo,Cut,Copy,Paste : 'Menu 2
- DATA 2,"",Options,Windows : 'Menu 3
- DATA 4,"",Find,Selected Text,Repeat Last Find,Change : 'Menu 4
- DATA 2,"",Record,Playback : 'Menu 5
- DATA 3,"",Receive File,Send File,Comm Parameters : 'Menu 6
- '....... Turn on menu bar .................................................
- CALL MENUON
- CALL WOPEN(1, 2, 80, 24, 2, 2, "MUSIC EDITOR", s6(), 8)
- CALL WCOLOR(8, &H17): CALL WCLS(8)
- CALL WPRINT(8, "~ This demonstration has been set up so that you can use the mouse")
- CALL WPRINT(8, "~or the function keys (F1-F6) to select one of the menus along the top.")
- CALL WPRINT(8, "~Once a menu pops down, you can use the left or right arrow keys")
- CALL WPRINT(8, "~to pop down the previous or next menu respectively.")
- CALL WPRINT(8, "~~ You may select one of the options in the menu by one of the ways:")
- CALL WPRINT(8, "~ 1. Move mouse cursor on top of option and press left-mouse button.")
- CALL WPRINT(8, "~ 2. Press the first letter of the option and press ENTER.")
- CALL WPRINT(8, "~ 3. Press up/down arrows to highlight the option and press ENTER.")
- CALL WPRINT(8, "~~ If you do not wish to select any option, press the ESC key.")
- CALL WPRINT(8, "~~ In the first menu, the 'Save' and 'Close' options are both")
- CALL WPRINT(8, "~displayed as low-intensity, which means that they may not be selected.")
- CALL WPRINT(8, "~Another standard feature of QuickWindow's pull-down menuing system!")
- CALL MENUOPTION(1, 2, 0): CALL MENUOPTION(1, 4, 0): 'demonstrates disabling menu option
- MENUGET2:
- CALL MENUGET(m, o, f): IF f = 0 THEN GOTO MENUGET2: 'If no activity from kb or mouse
- ' then f is returned as a 0.
- CALL WCLS(8): CALL WLOCATE(8, 0, 10)
- a1$ = "SELECTED OPTION": IF f <> -1 THEN a1$ = "NO OPTION SELECTED"
- CALL WPRINT(8, "Menu: " + STR$(m) + "~Option: " + STR$(o) + "~Flag: " + a1$)
- CALL prompt: CALL WCLOSE(8): CALL MENUOFF: CALL restorescrn
- GOTO MAIN
-
-
- swbuttonset:
- '--------------------------------- WBUTTONSET -------------------------------
- CALL WPRINT(3, " WBUTTONSET (window_id,button,kb,hstyle,hattr,lstyle,lattr,x,y,button$)")
- CALL WPRINT(1, " WBUTTONSET~~ Defines an input button. Up to~ 32 buttons may be defined.")
- CALL prompt: CALL savescrn: CLS
- PRINT "The Input Focus is the button that is highlighted.": PRINT
- PRINT "Keyboard: To move the Input Focus, use the left or right arrows."
- PRINT " Press ENTER to make a selection.": PRINT
- PRINT "Mouse: Move the mouse cursor on top the desired button and press"
- PRINT " the left mouse button."
- CALL WOPEN(1, 11, 80, 24, 2, &H71, "", s11(), 11): RESTORE WBUTTONSET1
- FOR i = 4 TO 19
- READ x, y: a$ = " ": RSET a$ = MID$(STR$(i - 3), 2)
- CALL WBUTTONSET(11, i, 0, 0, &H7C, 1, &H74, x, y, a$)
- NEXT i
- CALL WLOCATE(11, 40, 1): CALL WPRINT(11, "Make a selection.... "): focus = 4
- WBUTTONSET1:
- CALL WBUTTONGET(focus, 4, 16, result)
- IF focus < 4 THEN focus = 19 ELSE IF focus > 19 THEN focus = 4
- IF result = 0 THEN GOTO WBUTTONSET1
- CALL WLOCATE(11, 40, 1): CALL WPRINT(11, "You've selected button " + STR$(result - 3))
- CALL WLOCATE(11, 40, 3): CALL WPRINT(11, "Press ANY key....")
- WHILE INKEY$ = "": WEND: CALL WCLOSE(11): CALL restorescrn
- GOTO MAIN
- DATA 1,0,9,0,17,0,25,0,1,3,9,3,17,3,25,3,1,6,9,6,17,6,25,6,1,9,9,9,17,9,25,9
-
-
- swbox:
- '--------------------------------- WBOX -------------------------------------
- CALL WPRINT(3, " WBOX (window_id,x1,y1,x2,y2,style,attribute)")
- CALL WPRINT(1, " WBOX~~ Draws a box within a given~ window. Choose from 7 styles")
- CALL WPRINT(1, "~ or design one of your own."): RESTORE swbox
- FOR i = 0 TO 7
- READ x, y: CALL WBOX(2, x, y, x + 7, y + 2, 2, &H38 + i)
- NEXT i
- GOTO MAIN
- DATA 0,0,9,0,18,0,27,0,0,4,9,4,18,4,27,4: 'relative coordinates to inside window
-
-
- svscroll:
- '------------------------------ VSCROLL -------------------------------------
- CALL WPRINT(3, " VSCROLL (X1,Y1,X2,Y2,num_times,attribute,direction_flag)")
- CALL WPRINT(1, " VSCROLL~~ Similar to BIOS functions~ 6 and 7. Causes part of the")
- CALL WPRINT(1, "~ screen to scroll upward~ or downward.")
- CALL prompt: CALL savescrn: CLS : PRINT : CALL BOX(20, 10, 60, 23, 1, &H17, "")
- PRINT "A box is placed at (20,10)-(60,23). All scrolling is done inside the box."
- PRINT : PRINT "Press UP arrow to scroll upwards"
- PRINT " DOWN arrow to scroll downwards"
- PRINT " SPACE to pause": PRINT " ESC to quit": direction = 0
- RESTORE VSCROLL1: FOR i = 0 TO 103: READ sc1(i): NEXT i
- CALL PUTSCRN(32, 12, 48, 17, sc1())
- VSCROLL1:
- a$ = INKEY$: IF (LEN(a$) = 1) AND (a$ = CHR$(27)) THEN CALL restorescrn: GOTO MAIN
- IF LEN(a$) = 1 AND a$ = CHR$(32) THEN direction = -1
- IF a$ = MKI$(18432) THEN direction = 0 ELSE IF a$ = MKI$(20480) THEN direction = 1
- IF direction = 0 THEN
- CALL GETSCRN(21, 11, 59, 11, sc1())
- CALL VSCROLL(21, 11, 59, 22, 1, &H1E, direction)
- CALL PUTSCRN(21, 22, 59, 22, sc1())
- ELSEIF direction = 1 THEN
- CALL GETSCRN(21, 22, 59, 22, sc1())
- CALL VSCROLL(21, 11, 59, 22, 1, &H1E, direction)
- CALL PUTSCRN(21, 11, 59, 11, sc1())
- END IF
- FOR delay = 1 TO 1000: NEXT delay: GOTO VSCROLL1
- DATA 16091,16091,16091,16091,16091,16091,7712,7712,7712,7899,7712,7712,7712
- DATA 7712,7712,7899,7712,16091,5809,5809,5809,5809,16091,5809,7712,7712
- DATA 7899,5809,7712,7712,7712,7712,7899,5809,16091,5809,7712,7712,7712
- DATA 16091,5809,7712,7712,7899,5809,7712,7712,7712,7712,7899,5809,16091
- DATA 5809,7712,7712,7900,7899,5809,7712,7712,7899,5809,7712,7899,7712
- DATA 7712,7899,5809,16091,16091,16091,16091,16091,16091,5809,7712,7712,7899
- DATA 7899,7899,7899,7899,7899,7899,5809,7712,5809,5809,5809,5809,5809
- DATA 5809,7712,7712,7712,5809,5809,5809,5809,5809,5809,5809,0,0
-
- REM $STATIC
- SUB prompt
- '**************************************************************************
- ' Prompt user to continue
- '
- CALL WOPEN(1, 19, 79, 23, 2, &H74, "", s11(), 11)
- CALL WCOLOR(11, &H70 + blue)
- CALL WCLS(11): CALL WPRINT(11, "~ Ready to continue:")
- CALL WBUTTONSET(11, 4, 0, 0, &H78 + blue, 1, &H70 + blue, 36, 0, "OK")
- focus1 = 4
- PROMPT1:
- CALL WBUTTONGET(focus1, 4, 1, result): IF focus1 <> 4 THEN focus1 = 4
- IF result = 0 THEN GOTO PROMPT1
- CALL MHIDE: CALL WCLOSE(11)
- END SUB
-
- SUB restorescrn
- '**************************************************************************
- ' Restore entire screen from array
- '
- CALL PUTSCRN(1, 1, 80, 24, scrn())
- END SUB
-
- SUB sattrscrn
- '------------------------------ ATTRSCRN ------------------------------------
- CALL WPRINT(3, " ATTRSCRN (X1,Y1,X2,Y2,color)")
- CALL WPRINT(1, " ATTRSCRN~~ Changes the attribute for all~ or part of the screen")
- CALL prompt: CALL savescrn: CLS : LOCATE 10, 23
- PRINT "This effect is caused by ATTRSCRN.";
- FOR i = 6 TO 0 STEP -1
- CALL ATTRSCRN(21 - (i * 2), 9 - i, 58 + (i * 2), 11 + i, i * 16 + 7)
- NEXT i
- CALL prompt: CALL restorescrn
- END SUB
-
- SUB savescrn
- '**************************************************************************
- ' Save entire screen into array so that demos may be performed without loss
- ' of dialog windows
- '
- CALL GETSCRN(1, 1, 80, 24, scrn())
- END SUB
-
- SUB sbox8set
- '------------------------------- BOX8SET ------------------------------------
- CALL WPRINT(3, " BOX8SET (TL,TR,TA,BL,BR,BA,sides,LTITLE,RTITLE,0,0,0)")
- CALL WPRINT(1, " BOX8SET~~ Define a style of box to be~ used in BOX, WBOX, WOPEN")
- CALL WPRINT(1, "~ or any of the POP-UP or~ PULL-DOWN menus.")
- CALL prompt: CALL savescrn: CLS
- PRINT "Given the parameters for BOX8SET,": PRINT
- PRINT "Top Left = 213 "; CHR$(213): PRINT "Top Right = 184 "; CHR$(184)
- PRINT "Top Across = 205 "; CHR$(205): PRINT "Bottom Left = 212 "; CHR$(212)
- PRINT "Bottom Right = 190 "; CHR$(190): PRINT "Bottom Across = 205 "; CHR$(205)
- PRINT "Sides = 179 "; CHR$(179): PRINT "Left Title = 181 "; CHR$(181)
- PRINT "Right Title = 198 "; CHR$(198)
- CALL BOX8SET(213, 184, 205, 212, 190, 205, 179, 181, 198, 0, 0, 0)
- CALL BOX(32, 7, 72, 17, 8, &H1E, "TITLE")
- LOCATE 5, 36: PRINT "The following box can be made...";
- CALL prompt: CALL restorescrn
- END SUB
-
- SUB sdmascrn
- '-------------------------------- DMASCRN -----------------------------------
- CALL WPRINT(3, " DMASCRN (mode)")
- CALL WPRINT(1, " DMASCRN~~ Select mode that characters~ will be written to the display.")
- CALL WPRINT(1, "~~ 0 = Wait for retrace (no snow)~ 1 = Direct writes (some snow)")
- CALL prompt: CALL savescrn: CLS
- PRINT "Observe Mode 1 - Some snow should be visible with CGA cards"
- CALL DMASCRN(1)
- FOR d = 1 TO 8000: NEXT d
- CALL WOPEN(1, 3, 80, 24, 2, &H12, "", s11(), 11): CALL WCOLOR(11, &H17)
- CALL WWRAP(11, 0)
- FOR i = 1 TO 1000
- CALL WPRINT(11, STR$(i))
- NEXT i
- LOCATE 1, 1: PRINT STRING$(78, 32)
- LOCATE 1, 1: PRINT "Observe mode 0 - There should be very little snow"
- FOR d = 1 TO 5000: NEXT d: CALL DMASCRN(0): CALL WCLS(11)
- FOR i = 1 TO 1000
- CALL WPRINT(11, STR$(i))
- NEXT i
- FOR d = 1 TO 5000: NEXT d: CALL WCLOSE(11): CALL prompt: CALL restorescrn
- END SUB
-
- SUB sgetch
- '-------------------------------- GETCH -------------------------------------
- CALL WPRINT(3, " GETCH (row,col,character,attribute)")
- CALL WPRINT(1, " GETCH~~ Returns a character and its~ attribute for a given")
- CALL WPRINT(1, "~ row (1-24) and column (1-80)")
- END SUB
-
- SUB sgetscrn
- '------------------------------ GETSCRN -------------------------------------
- CALL WPRINT(3, " GETSCRN (X1,Y1,X2,Y2,array())")
- CALL WPRINT(1, " GETSCRN~~ Saves a portion of the screen~ into an array")
- CALL prompt: CALL savescrn: CLS : CALL BOX(1, 1, 35, 6, 4, &H74, "")
- COLOR 1, 7: LOCATE 3, 3: PRINT "This box will be moved by using"
- LOCATE 4, 3: PRINT "the GETSCRN/PUTSCRN functions."
- CALL GETSCRN(1, 1, 35, 6, sc1())
- FOR i = 2 TO 40
- CALL VSCROLL(i - 1, 1, 34 + i, 6, 0, &H11, 1): 'clear box
- CALL PUTSCRN(1 + i, 1, 35 + i, 6, sc1())
- NEXT i
- COLOR 7, 1: CALL prompt: CALL restorescrn
- END SUB
-
- SUB shelpmenu
- '--------------------------------- HELPMENU ---------------------------------
- CALL WPRINT(3, " HELPMENU (window_id,0,barattr,num_lines,menu$(),flag)")
- CALL WPRINT(1, " HELPMENU~~ Creates a pop-up help menu using~ the specified window id.")
- CALL WPRINT(2, "~~ Works identical to POPMENUV but~ you cannot select an 'option'.")
- CALL prompt: CALL savescrn: CLS
- PRINT "Scroll through pages of text by...": PRINT
- PRINT " 1. Pressing PgUp, PgDn, HOME, or END."
- PRINT " 2. Placing mouse cursor before or after scroll"
- PRINT " pointer and clicking left mouse button.": PRINT
- PRINT "Press ESC to exit."
- barattr = 3: relpos = 0: numlines = 100: 'numlines limit is 255
- FOR i = 0 TO numlines
- menu$(i) = " Text line " + MID$(STR$(i + 1), 2)
- NEXT i
- CALL WOPEN(22, 7, 60, 18, 2, &H12, "", s8(), 8)
- CALL WCOLOR(8, &H17): CALL PUTCH(22, 7, &H7F, &H12)
- CALL HELPMENU(8, 0, barattr, numlines, VARPTR(menu$(0)), flag)
- CALL prompt: CALL WCLOSE(8): CALL restorescrn
- END SUB
-
- SUB smbpress
- '--------------------------------- MBPRESS ----------------------------------
- ' Upon entry, the value of status determines which button is checked.
- ' If the value is 0, this means bit 0 or left-most button
- ' If the value is 1, bit 1 or right-most button is checked
- '
- CALL WPRINT(3, " MBPRESS (status,number,column,row)")
- CALL WPRINT(1, " MBPRESS~~ Returns number of button presses")
- CALL WPRINT(1, "~ since last call to this function")
- IF mouse.status = 0 THEN EXIT SUB
- CALL WPRINT(2, " See how many times you can~ press the left-most mouse")
- CALL WPRINT(2, "~ button before the counter~ reaches 0. Press any key to")
- CALL WPRINT(2, "~ start the counter.")
- CALL MSHOW: WHILE INKEY$ = "": WEND: CALL WCLS(2)
- CALL MBPRESS(0, n, x, y) 'initialize internal mouse driver's counter to 0
- FOR i = 10 TO 0 STEP -1
- CALL WLOCATE(2, 16, 3): CALL WPRINT(2, STR$(i) + " "): CALL MSHOW
- FOR delay = 1 TO 30000: NEXT delay
- NEXT i
- CALL WCLS(2): CALL MBPRESS(0, n, x, y)
- CALL WPRINT(2, " You've pressed the mouse button~" + STR$(n) + " times")
- END SUB
-
- SUB smbrel
- '--------------------------------- MBREL ------------------------------------
- ' Upon entry, the value of status determines which button is checked.
- ' If the value is 0, this means bit 0 or left-most button
- ' If the value is 1, bit 1 or right-most button is checked
- '
- CALL WPRINT(3, " MBREL (status,number,column,row)")
- CALL WPRINT(1, " MBREL~~ Returns number of button releases")
- CALL WPRINT(1, "~ since last call to this function")
- IF mouse.status = 0 THEN EXIT SUB
- CALL WPRINT(2, " This function is identical to~ MBPRESS, but counts the number")
- CALL WPRINT(2, "~ of button releases. See MBPRESS~ for demonstration.")
- END SUB
-
- SUB smenubar
- '--------------------------------- MENUBAR ----------------------------------
- CALL WPRINT(3, " MENUBAR (number_menus,bar_attribute,kb(),bar$())")
- CALL WPRINT(1, " MENUBAR~~ Defines a list of pull-down")
- CALL WPRINT(1, "~ menus along the top of the~ screen")
- CALL WPRINT(2, "~ See MENUGET for a complete~ demonstration of the pull-down")
- CALL WPRINT(2, "~ menuing system.")
- END SUB
-
- SUB smenuoff
- '--------------------------------- MENUOFF ----------------------------------
- CALL WPRINT(3, " MENUOFF")
- CALL WPRINT(1, " MENUOFF~~ Turns off the menu bar along the~ top and disables menu checking")
- CALL WPRINT(2, "~ See MENUGET for a complete~ demonstration of the pull-down")
- CALL WPRINT(2, "~ menuing system.")
- END SUB
-
- SUB smenuon
- '--------------------------------- MENUON -----------------------------------
- CALL WPRINT(3, " MENUON")
- CALL WPRINT(1, " MENUON~~ Turns on the menu bar along the~ top and enables menu checking")
- CALL WPRINT(2, "~ See MENUGET for a complete~ demonstration of the pull-down")
- CALL WPRINT(2, "~ menuing system.")
- END SUB
-
- SUB smenuoption
- '--------------------------------- MENUOPTION -------------------------------
- CALL WPRINT(3, " MENUOPTION (menu_number,option_number,mode)")
- CALL WPRINT(1, " MENUOPTION~~ Disables or enables an option~ for selection")
- CALL WPRINT(2, "~ See MENUGET for a complete~ demonstration of the pull-down")
- CALL WPRINT(2, "~ menuing system.")
- END SUB
-
- SUB smenuset
- '------------------------------- MENUSET ----------------------------------
- CALL WPRINT(3, " MENUSET (menu,options,style,battr,cattr_en,cattr_dis,mask,menu$())")
- CALL WPRINT(1, " MENUSET~~ Defines a list of options for")
- CALL WPRINT(1, "~ specified menu number. Can also~ define menu style and")
- CALL WPRINT(1, "~ attributes. Up to 16 options~ may be defined per menu.")
- CALL WPRINT(2, "~ See MENUGET for a complete~ demonstration of the pull-down")
- CALL WPRINT(2, "~ menuing system.")
- END SUB
-
- SUB smhide
- '--------------------------------- MHIDE ------------------------------------
- CALL WPRINT(3, " MHIDE ")
- CALL WPRINT(1, " MHIDE~~ Turns off the mouse cursor")
- CALL WPRINT(1, "~~ The mouse driver tracks the~ position of the mouse even though")
- CALL WPRINT(1, "~ the mouse cursor is off.")
- IF mouse.status = 0 THEN EXIT SUB
- CALL WPRINT(2, "~ Press any key to turn off~ the mouse cursor.")
- CALL MSHOW: WHILE INKEY$ = "": WEND: CALL MHIDE
- CALL WPRINT(2, "~~ Press any key to turn it~ back on.")
- WHILE INKEY$ = "": WEND: CALL MSHOW
- END SUB
-
- SUB sminit
- '--------------------------------- MINIT ------------------------------------
- CALL WPRINT(3, " MINIT (status,number_of_buttons)")
- CALL WPRINT(1, " MINIT~~ Initializes and tests if mouse~ driver is present")
- CALL MINIT(s, b)
- IF s = 0 THEN
- CALL WPRINT(2, "~ The mouse driver is not installed~ on this system.")
- ELSE
- CALL WPRINT(2, "~ The mouse driver is installed")
- CALL WPRINT(2, "~ and the mouse has " + MID$(STR$(b), 2) + " button" + MID$("s", 1, -(b > 1)) + ".")
- END IF
- END SUB
-
- SUB smouse
- '--------------------------------- MOUSE ------------------------------------
- CALL WPRINT(3, " MOUSE (button_status,column,row)")
- CALL WPRINT(1, " MOUSE~~ Returns the current position~ of the mouse cursor and")
- CALL WPRINT(1, "~ button press status")
- IF mouse.status = 0 THEN EXIT SUB
- CALL WPRINT(2, "~ Move the mouse and observe the~ current positions below. Press")
- CALL WPRINT(2, "~ ESC to exit demo"): x1 = 0: y1 = 0: b1 = 0
- MOUSE1:
- CALL MOUSE(b, x, y): CALL MSHOW: x = INT(x / 8): y = INT(y / 8)
- IF INKEY$ = CHR$(27) THEN CALL WCLS(2): EXIT SUB
- IF x = x1 AND y = y1 AND b = b1 THEN GOTO MOUSE1 'keeps cursor on while mouse is not moving
- CALL WLOCATE(2, 0, 5) 'because WPRINT turns off the mouse cursor
- CALL WPRINT(2, " row=" + MID$(STR$(y), 2) + " column=" + MID$(STR$(x), 2) + " button=" + MID$(STR$(b), 2) + " ")
- CALL MSHOW: x1 = x: y1 = y: b1 = b: GOTO MOUSE1
- END SUB
-
- SUB smpenoff
- '--------------------------------- MPENOFF ----------------------------------
- CALL WPRINT(3, " MPENOFF")
- CALL WPRINT(1, " MPENOFF~~ Light pen emulation mode off.")
- CALL WPRINT(2, " See MPENON for a demonstration.")
- END SUB
-
- SUB smpenon
- '--------------------------------- MPENON -----------------------------------
- CALL WPRINT(3, " MPENON")
- CALL WPRINT(1, " MPENON~~ Light pen emulation mode on.")
- CALL WPRINT(1, "~ Calls to BASIC Pen functions~ will return position and")
- CALL WPRINT(1, "~ button press information from~ the mouse.")
- IF mouse.status = 0 THEN EXIT SUB
- CALL WPRINT(2, " Using the BASIC PEN function, the~ mouse info since button-press is:")
- CALL WLOCATE(2, 0, 6): CALL WPRINT(2, " Press ESC to exit...")
- PEN ON: CALL MPENON: x1 = 0: y1 = 0: b1 = 0
- PENON1:
- CALL MSHOW: x = PEN(8): y = PEN(9): button = PEN(3)
- IF button = 0 THEN a1$ = "NO " ELSE a1$ = "YES"
- IF INKEY$ = CHR$(27) THEN PEN OFF: CALL MPENOFF(0, 0): CALL WCLS(2): EXIT SUB
- IF x = x1 AND y = y1 AND button = b1 THEN GOTO PENON1
- CALL WLOCATE(2, 0, 3)
- CALL WPRINT(2, " X-pos=" + MID$(STR$(x), 2) + " Y-pos=" + MID$(STR$(y), 2) + " ")
- CALL WPRINT(2, "~ Any button pressed: " + a1$)
- x1 = x: y1 = y: b1 = button: GOTO PENON1
- END SUB
-
- SUB smratio
- '--------------------------------- MRATIO -----------------------------------
- CALL WPRINT(3, " MRATIO (x_step,y_step)")
- CALL WPRINT(1, " MRATIO~~ Sets how far mouse cursor will")
- CALL WPRINT(1, "~ move in relation to how far the~ mouse has moved physically")
- IF mouse.status = 0 THEN EXIT SUB
- CALL WPRINT(2, " The mouse step-ratio has been~ set so that you have to physically")
- CALL WPRINT(2, " move the mouse far to move~ the mouse cursor just a little.")
- CALL WPRINT(2, "~~ Press any key to return to normal.")
- CALL MSHOW
- CALL MRATIO(40, 80) '5 times more than normal movement
- WHILE INKEY$ = "": WEND: CALL MRATIO(8, 16)
- END SUB
-
- SUB smsetpos
- '--------------------------------- MSETPOS ----------------------------------
- CALL WPRINT(3, " MSETPOS (column,row)")
- CALL WPRINT(1, " MSETPOS~~ Sets the mouse cursor position")
- IF mouse.status = 0 THEN EXIT SUB
- CALL WPRINT(2, " Move the mouse cursor to the~ upper part of the screen. Press")
- CALL WPRINT(2, "~ any key to force the mouse to~ the lower part of the screen.")
- CALL MSHOW: WHILE INKEY$ = "": WEND: x = 80: y = 24
- CALL MSETPOS((x - 1) * 8, (y - 1) * 8)
- END SUB
-
- SUB smsetx
- '--------------------------------- MSETX ------------------------------------
- CALL WPRINT(3, " MSETX (min_x,max_x)")
- CALL WPRINT(1, " MSETX~~ Sets an area within which the")
- CALL WPRINT(1, "~ mouse is able to move~ (between columns)")
- IF mouse.status = 0 THEN EXIT SUB
- CALL WPRINT(2, " The mouse is confined within~ columns 20 and 60. Any attempt")
- CALL WPRINT(2, "~ to move outside this area will~ just keep the mouse on the border.")
- CALL WPRINT(2, "~~ Press any key to return to normal.")
- CALL MSHOW: x1 = 20: x2 = 60
- CALL MSETX((x1 - 1) * 8, (x2 - 1) * 8): '(value x 8) for text cursor
- WHILE INKEY$ = "": WEND: CALL MSETX(0, 632)
- END SUB
-
- SUB smsety
- '--------------------------------- MSETY ------------------------------------
- CALL WPRINT(3, " MSETY (min_y,max_y)")
- CALL WPRINT(1, " MSETY~~ Sets an area within which the")
- CALL WPRINT(1, "~ mouse is able to move~ (between rows)")
- IF mouse.status = 0 THEN EXIT SUB
- CALL WPRINT(2, " The mouse is confined within~ rows 10 and 16. Any attempt")
- CALL WPRINT(2, "~ to move outside this area will~ just keep the mouse on the border.")
- CALL WPRINT(2, "~~ Press any key to return to normal.")
- CALL MSHOW: y1 = 10: y2 = 16
- CALL MSETY((y1 - 1) * 8, (y2 - 1) * 8): '(value x 8) for text cursor
- WHILE INKEY$ = "": WEND: CALL MSETY(0, 192)
- END SUB
-
- SUB smshow
- '--------------------------------- MSHOW ------------------------------------
- CALL WPRINT(3, " MSHOW ")
- CALL WPRINT(1, " MSHOW~~ Turns on the mouse cursor")
- CALL WPRINT(1, "~~ The mouse driver tracks the~ position of the mouse even though")
- CALL WPRINT(1, "~ the mouse cursor may be off.")
- IF mouse.status = 0 THEN EXIT SUB
- CALL MHIDE: CALL WPRINT(2, "~ Press any key to turn on~ the mouse cursor.")
- WHILE INKEY$ = "": WEND: CALL MSHOW
- END SUB
-
- SUB spopmenu
- '------------------------------- POPMENU ----------------------------------
- PMENU1:
- CALL WPRINT(3, " POPMENU (result,kb,style,battr,cattr,x1,y1,num_options,menu$())")
- CALL WPRINT(1, " POPMENU~~ Creates a pop-up menu anywhere~ on the screen")
- CALL WPRINT(2, " Customize border styles, colors,~ and character attributes.")
- CALL WPRINT(2, "~~ Select an option with the~ keyboard or a mouse.")
- CALL prompt: CALL savescrn: CLS
- PRINT "Select an option by..."
- PRINT " 1. Moving mouse cursor on top of option and pressing the left button."
- PRINT " 2. Pressing the first letter of the option and pressing ENTER."
- PRINT " 3. Using up/down arrows to highlight option and press ENTER."
- PRINT : PRINT "Press ESC to exit without selecting an option."
- num.options = 6: x = 32: y = 10: battr = 2: cattr = 14: style = 2: kb = 1
- menu$(0) = "Sample menu"
- menu$(1) = " Account Maintenance"
- menu$(2) = " Download Maintenance"
- menu$(3) = " Message Bas Maintenance"
- menu$(4) = " TeleLink Network Maintenance"
- menu$(5) = " System Configurations"
- menu$(6) = " Quit Syslink"
- CALL POPMENU(result, kb, style, battr, cattr, x, y, num.options, VARPTR(menu$(0)))
- LOCATE 10, 3
- IF result = 0 THEN
- PRINT "No options were selected."
- ELSE
- PRINT "You've selected menu option: "; result; " --> "; menu$(result)
- END IF
- CALL prompt: CALL restorescrn
- END SUB
-
- SUB spopmenu1
- '------------------------------- POPMENU1 ---------------------------------
- PMENU2:
- CALL WPRINT(3, " POPMENU1 (result,kb,style,battr,cattr(),x1,y1,n,menu$())")
- CALL WPRINT(1, " POPMENU1~~ Creates a pop-up menu anywhere~ on the screen")
- CALL WPRINT(1, "~~ Same as POPMENU, but allows each~ row to have its own attribute")
- CALL WPRINT(2, " Customize border styles, colors,~ and character attributes.")
- CALL WPRINT(2, "~~ Select an option with the~ keyboard or a mouse.")
- CALL prompt: CALL savescrn: CLS
- PRINT "Select an option by..."
- PRINT " 1. Moving mouse cursor on top of option and pressing the left button."
- PRINT " 2. Pressing the first letter of the option and pressing ENTER."
- PRINT " 3. Using up/down arrows to highlight option and press ENTER."
- PRINT : PRINT "Press ESC to exit without selecting an option."
- num.options = 6: x = 32: y = 10: battr = 2: style = 2: kb = 1
- menu$(0) = "Another sample menu"
- menu$(1) = " Account Maintenance"
- menu$(2) = " Download Maintenance"
- menu$(3) = " Message Bas Maintenance"
- menu$(4) = " TeleLink Network Maintenance"
- menu$(5) = " System Configurations"
- menu$(6) = " Quit Syslink"
- FOR i = 0 TO 5: cattr(i) = i + 1: NEXT i'....Define each row's attributes....
- CALL POPMENU1(result, kb, style, battr, cattr(), x, y, num.options, VARPTR(menu$(0)))
- LOCATE 10, 3
- IF result = 0 THEN
- PRINT "No options were selected."
- ELSE
- PRINT "You've selected menu option: "; result; " --> "; menu$(result)
- END IF
- CALL prompt: CALL restorescrn
- END SUB
-
- SUB spopmenuh
- '--------------------------------- POPMENUH ---------------------------------
- PMENUH:
- CALL WPRINT(3, " POPMENUH (id,posn,opt_width,num_opts,barattr,menu$(),result,flg)")
- CALL WPRINT(1, " POPMENUH~~ Creates a pop-up menu using the~ specified window id.")
- CALL WPRINT(1, "~ Menu options are laid out~ horizontally according to option")
- CALL WPRINT(1, "~ width and size of the window.")
- CALL WPRINT(2, "~~ Select an option with the~ keyboard or a mouse.")
- CALL prompt: CALL savescrn: CLS
- PRINT "Scroll through pages of options by..."
- PRINT " 1. Pressing PgUp, PgDn, HOME, or END."
- PRINT " 2. Placing mouse cursor before or after scroll pointer and clicking left"
- PRINT " mouse button.": PRINT
- PRINT "Select an option by..."
- PRINT " 1. Moving mouse cursor on top of option and pressing the left button."
- PRINT " 2. Using up/down/left/right arrows to highlight option and press ENTER."
- PRINT : PRINT "Press ESC to exit without selecting an option."
- barattr = 3: relpos = 0: menuwidth = 15: numoptions = 100: 'max numoptions is 255
- FOR i = 0 TO numoptions: menu$(i) = "00000" + MID$(STR$(i), 2): NEXT i
- CALL WOPEN(9, 12, 70, 23, 2, &H12, "", s8(), 8)
- CALL WCOLOR(8, &H17): CALL PUTCH(9, 12, &H7F, &H12)
- CALL POPMENUH(8, relpos, menuwidth, numoptions, barattr, VARPTR(menu$(0)), result, flag)
- CALL VSCROLL(1, 1, 80, 10, 0, &H17, 1): LOCATE 1, 1: 'clear upper part of screen
- PRINT "Selected menu option: "; result, "("; menu$(result); ")", "Exit flag: ";
- IF flag = 0 THEN PRINT "NO SELECTION MADE" ELSE PRINT "SELECTED OPTION"
- CALL prompt: CALL WCLOSE(8): CALL restorescrn
- END SUB
-
- SUB spopmenuv
- '--------------------------------- POPMENUV ---------------------------------
- CALL WPRINT(3, " POPMENUV (id,rel_pos,barattr,num_options,menu$(),result,flg)")
- CALL WPRINT(1, " POPMENUV~~ Creates a pop-up menu using the~ specified window id.")
- CALL WPRINT(1, "~ Menu options are laid out~ vertically according to the")
- CALL WPRINT(1, "~ size of the window.")
- CALL WPRINT(2, "~~ Select an option using the~ keyboard or a mouse.")
- CALL prompt: CALL savescrn: CLS
- PRINT "Scroll through pages of options by..."
- PRINT " 1. Pressing PgUp, PgDn, HOME, or END."
- PRINT " 2. Placing mouse cursor before or after scroll"
- PRINT " pointer and clicking left mouse button.": PRINT
- PRINT "Select an option by..."
- PRINT " 1. Moving mouse cursor on top of option and"
- PRINT " pressing the left button."
- PRINT " 2. Using up/down arrows to highlight option"
- PRINT " and press ENTER.": PRINT
- PRINT "Press ESC to exit without selecting an option."
- barattr = 3: relpos = 0: numoptions = 100: 'numoptions limit is 255
- FOR i = 0 TO numoptions: menu$(i) = "00000" + MID$(STR$(i), 2): NEXT i
- CALL WOPEN(55, 2, 74, 23, 2, &H12, "", s8(), 8)
- CALL WCOLOR(8, &H17): CALL PUTCH(55, 2, &H7F, &H12)
- CALL POPMENUV(8, relpos, barattr, numoptions, VARPTR(menu$(0)), result, flag)
- CALL VSCROLL(1, 1, 54, 14, 0, &H17, 1): LOCATE 1, 1: 'clear upper part of screen
- PRINT "Selected menu option: "; result, "("; menu$(result); ")", "Exit flag: ";
- IF flag = 0 THEN PRINT "NO SELECTION MADE" ELSE PRINT "SELECTED OPTION"
- CALL prompt: CALL WCLOSE(8): CALL restorescrn
- END SUB
-
- SUB sputch
- '-------------------------------- PUTCH -------------------------------------
- CALL WPRINT(3, " PUTCH (row,col,character,attribute)")
- CALL WPRINT(1, " PUTCH~~ Writes a character and its~ attribute for a given")
- CALL WPRINT(1, "~ row (1-24) and column (1-80)~ to the screen")
- END SUB
-
- SUB sputscrn
- '------------------------------- PUTSCRN ------------------------------------
- CALL WPRINT(3, " PUTSCRN (X1,Y1,X2,Y2,array())")
- CALL WPRINT(1, " PUTSCRN~~ Writes the contents of an~ array to the screen")
- CALL prompt: CALL savescrn: CLS : CALL BOX(1, 1, 35, 6, 4, &H74, "")
- COLOR 1, 7: LOCATE 3, 3: PRINT "This box will be moved by using"
- LOCATE 4, 3: PRINT "the GETSCRN/PUTSCRN functions."
- CALL GETSCRN(1, 1, 35, 6, sc1())
- FOR i = 2 TO 40
- CALL VSCROLL(i - 1, 1, 34 + i, 6, 0, &H11, 1): 'clear box
- CALL PUTSCRN(1 + i, 1, 35 + i, 6, sc1())
- NEXT i
- COLOR 7, 1: CALL prompt: CALL restorescrn
- END SUB
-
- SUB srevscrn
- '-------------------------------- REVSCRN -----------------------------------
- CALL WPRINT(3, " REVSCRN (X1,Y1,X2,Y2)")
- CALL WPRINT(1, " REVSCRN~~ Reverses the attributes for all~ or part of the screen")
- CALL prompt: CALL savescrn: CLS : LOCATE 10, 1
- PRINT "Upon executing CALL REVSCRN(10,5,70,17), this part of the screen is reversed...";
- LOCATE 12, 17: COLOR 6, 1
- PRINT "Regardless of the number of color combinations."
- CALL prompt: CALL REVSCRN(10, 5, 70, 17): COLOR 7, 1
- CALL prompt: CALL restorescrn
- END SUB
-
-