Category : BASIC Source Code
Archive   : MNUSYSQB.ZIP
Filename : MNSDEMO.BAS

 
Output of file : MNSDEMO.BAS contained in archive : MNUSYSQB.ZIP
'Menusys-QB Demonstration Program
'Shareware Version
'(C) Copyright 1993 by Tim Gerchmez
'All Rights Reserved.

'This program is designed to present a screen display similar to
'that used by the QuickBASIC 4.5 programming environment (QB.EXE).
'This resemblance is for demonstration purposes only, and no
'copyright infringement is intended. The user may select different
'colors and combinations of options when using these routines in
'their own programs.

'This program uses routines in both Menusys (The main Text Mode GUI
'Interface) and in Menulib, an add-on source code library for
'Menusys programs. Both Menusys and Menulib are included in the
'Shareware version as MENUSYS.LIB and MENUSYS.QLB. To run this demo
'within the environment, you must load QuickBASIC with /L MENUSYS to
'load the quick library. You can then create a standalone .EXE from
'the environment as well. Make sure that MENUSYS.LIB and MENUSYS.QLB
'are in the directory you set for your QuickBASIC LIB files.

DECLARE SUB choosebox (msg$(), choice%)
DECLARE SUB infobox (msg$())
DECLARE SUB mhardreset (ms%, nb%)
DECLARE SUB printtopmenu (menu$(), hilight%)
DECLARE SUB mcheck ()
DECLARE SUB printbottomhelp (hlp$)
DECLARE SUB MENUSYS (menu$(), help$(), menucount%(), menutype%(), topchoice%, bottomchoice%)
DECLARE SUB screenedit (x1%, x2%, y1%, y2%, key$)
DECLARE SUB mscrolldown (nls%, uly%, ulx%, lry%, lrx%, attrib%)
DECLARE SUB mscrollup (nls%, uly%, ulx%, lry%, lrx%, attrib%)
DECLARE SUB vscrollbar (starty%, startx%, length%)
DECLARE SUB printtitle (title$, starty%, hilight%)
DECLARE SUB hscrollbar (starty%, startx%, length%)
DECLARE SUB printborder ()
DECLARE FUNCTION vidseg& ()
DECLARE FUNCTION altkey% ()


DEFINT A-Z

'$INCLUDE: 'qb.bi'
DIM SHARED regs AS RegType, regsx AS RegTypeX

COMMON SHARED mouse%, segment& 'Mouse Flag and Video Segment
COMMON SHARED msx%, msy%, lb%, rb% 'Mouse X and Y pos, Left/Right Buttons
COMMON SHARED topcount%, bottomcount% 'Top/Bottom Menu Counts
COMMON SHARED mainclr%, mainbckg% '"Main" Screen Colors
COMMON SHARED clr%, bckg% 'Temporary (Current) Colors
COMMON SHARED clr1%, clr2%, clr3% 'Alternate Character Colors
COMMON SHARED bckg1%, bckg2%, bckg3% 'Alternate Background Colors
COMMON SHARED helpfn$, progname$ 'Help file and Program name

'Check Mouse and Video

CALL mhardreset(ms%, nb%)
IF ms% = 0 THEN mouse% = 0 ELSE mouse% = 1
segment& = vidseg&
IF segment& = &HB000 THEN
mainclr% = 7: mainbckg% = 0
clr1% = 0: clr2% = 15
clr3% = 0
bckg1% = 7: bckg2% = 7
bckg3% = 7
ELSE
mainclr% = 15: mainbckg% = 1
clr1% = 0: clr2% = 15
clr3% = 8
bckg1% = 7: bckg2% = 7
bckg3% = 3
END IF


topcount% = 8: bottomcount% = 16

REDIM menu$(0 TO topcount%, 1 TO bottomcount%)
REDIM help$(1 TO topcount%, 1 TO bottomcount%)
REDIM menutype%(1 TO topcount%, 1 TO bottomcount%)
REDIM menucount%(1 TO topcount%)

RESTORE menudata

FOR t% = 1 TO topcount%
READ menu$(0, t%)
NEXT t%

FOR t% = 1 TO topcount%
READ menucount%(t%)
FOR u% = 1 TO menucount%(t%)
READ menu$(t%, u%)
NEXT u%
NEXT t%

FOR t% = 1 TO topcount%
FOR u% = 1 TO menucount%(t%)
READ help$(t%, u%)
NEXT u%
NEXT t%

menutype%(2, 1) = 1
menutype%(8, 4) = 2
menutype%(8, 5) = 2

COLOR mainclr%, mainbckg%: CLS
CALL printborder
CALL printtitle(" DEMONSTRATION.BAS ", 2, 1)
CALL vscrollbar(3, 80, 19)
CALL hscrollbar(24, 2, 76)
COLOR mainclr%, mainbckg%
LOCATE 4, 28: PRINT "Menusys-QB Demo Program"
LOCATE 6, 2: PRINT "Welcome to Menusys, a Text Mode GUI (Graphical User Interface) for QuickBASIC"
LOCATE 7, 2: PRINT "4.5 that allows an interface similar (but not identical) to that used by the"
LOCATE 8, 2: PRINT "QuickBASIC programming environment itself. You may be surprised to discover"
LOCATE 9, 2: PRINT "that Menusys and this demo were written ENTIRELY in QuickBASIC Source Code -- "
LOCATE 10, 2: PRINT CHR$(34); "No Assembly Required."; CHR$(34); " This makes it easy for you to alter and modify the"
LOCATE 11, 2: PRINT "subprograms to fit your specific needs."
LOCATE 13, 2: PRINT "This demo program uses colors and menu options similar to those used in the"
LOCATE 14, 2: PRINT "QuickBASIC interactive environment. All of the menu options are "; CHR$(34); "dummy"; CHR$(34);
LOCATE 15, 2: PRINT "options -- I.E. they don't do anything. Use the mouse or the ALT key to"
LOCATE 16, 2: PRINT "select menu options. Note: Menu selection Edit/Undo (2,1) has been set to"
LOCATE 17, 2: PRINT "unavailable status to demonstrate that this availability choice exists"
LOCATE 18, 2: PRINT "in Menusys. Also, selections Options/Syntax (8,4) and Options/Full (8,5) are"
LOCATE 19, 2: PRINT "toggle-type options, and will be displayed with a bullet next to them when"
LOCATE 20, 2: PRINT "toggled ON. Read the included documentation for further information"
LOCATE 21, 2: PRINT "regarding Menusys options and features. Press F8 to end this demo."
CALL printtopmenu(menu$(), 0)
REDIM msg$(3)
msg$(1) = " Menusys Test/Example Program"
msg$(2) = " (C) Copyright 1993 by Tim Gerchmez"
msg$(3) = " All Rights Reserved."
helpfn$ = "demohelp.hlp"
progname$ = "Menusys Demo"
CALL infobox(msg$())

repeatpoint:

hlp$ = "Press ALT-Letter or Select with Mouse -- F8 to End Demo Program."
CALL printbottomhelp(hlp$)

mainprogramloop:

CALL screenedit(2, 79, 3, 23, key$)

IF key$ = CHR$(0) + CHR$(66) THEN
REDIM msg$(3)
msg$(1) = ""
msg$(2) = " Exit to DOS ? "
msg$(3) = ""
CALL choosebox(msg$(), choice%)
IF choice% THEN GOTO mainprogramloop
COLOR 7, 0: CLS : END
END IF

IF mouse% THEN
CALL mcheck
IF lb% = 1 AND msy% = 1 THEN GOTO dothemenu
IF lb% = 1 AND msy% = 23 AND msx% = 80 THEN
CALL mscrollup(1, 3, 2, 23, 79, mainbckg% * 16 + mainclr%)
END IF
IF lb% = 1 AND msy% = 3 AND msx% = 80 THEN
CALL mscrolldown(1, 3, 2, 23, 79, mainbckg% * 16 + mainclr%)
END IF
END IF

IF altkey = 1 THEN GOTO dothemenu

GOTO mainprogramloop

dothemenu:

CALL MENUSYS(menu$(), help$(), menucount%(), menutype%(), topchoice%, bottomchoice%)


IF bottomchoice% = 0 THEN
LOCATE 23, 2: COLOR mainclr%, mainbckg%
PRINT "ESC or Right Mouse Pressed. "
GOTO repeatpoint
END IF

COLOR mainclr%, mainbckg%
LOCATE 22, 2: PRINT "Top Choice: "; topchoice%; " ";
LOCATE 23, 2: PRINT "Bottom Choice: "; bottomchoice%; " ";

IF topchoice% = 8 THEN
IF bottomchoice% = 4 THEN
menutype%(8, 4) = menutype%(8, 4) + 1
IF menutype%(8, 4) = 4 THEN menutype%(8, 4) = 2
END IF
IF bottomchoice% = 5 THEN
menutype%(8, 5) = menutype%(8, 5) + 1
IF menutype%(8, 5) = 4 THEN menutype%(8, 5) = 2
END IF
END IF
GOTO repeatpoint

'*************************************************************************
menudata:

'-----------------------------
'TOP MENU BAR SELECTION TITLES
DATA " (F)ile", " (E)dit", " (V)iew", " (S)earch", " (R)un", " (D)ebug", " (C)alls", " (O)ptions"

'-----------------------------
'BOX MENU TITLES
DATA 15,(N)ew Program, (O)pen Program, (M)erge..., ()Save, Save (A)s...
DATA Sa(v)e All, "-", (C)reate File..., (L)oad File..., (U)nload File...
DATA "-", (P)rint..., (D)OS Shell, "-", E(x)it

DATA 8, (U)ndo, (C)ut, C(o)py, (P)aste, C(l)ear, "-", New (S)ub..., New (F)unction

DATA 9, (S)ubs..., N(e)xt Sub, S(p)lit, "-", (N)ext Statement, O(u)tput Screen
DATA "-", (I)ncluded File, Included (L)ines

DATA 5, (F)ind..., (S)elected Text, (R)epeat Last Find, (C)hange..., (L)abel...

DATA 9, (S)tart, (R)estart, Co(n)tinue, Modify (C)OMMAND$..., "-"
DATA Make E(X)E File..., Make (L)ibrary..., "-", Set (M)ain Module...

DATA 13, (A)dd Watch..., (I)nstant Watch..., (W)atchpoint..., (D)elete Watch...
DATA Delete (A)ll Watch, "-", (T)race On, (H)istory On, "-"
DATA Toggle (B)reakpoint, (C)lear All Breakpoints, Break on (E)rrors, (S)et Next Statement

DATA 1, ()UNTITLED.BAS

DATA 5, (D)isplay, Set (P)aths..., Right (M)ouse..., (S)yntax Checking, (F)ull Menus

'-----------------------------
'BOX MENU HELP

DATA Removes currently loaded program from memory, Loads new program into memory
DATA Inserts specified file into current module, Writes current module to file on disk
DATA Saves current module with specified name and format, Writes all currently loaded modules to files on disk
DATA "-", "Creates a module, include file, or document; retains loaded modules"
DATA "Loads a module, include file, or document; retains loaded modules"
DATA "Removes a loaded module, include file, or document from memory"
DATA "-", Prints specified text or module, Temporarily suspends QuickBASIC and invokes DOS shell
DATA "-", Exits QuickBASIC and returns to DOS

DATA Restores current edited line to its original condition, Deletes selected text and copies it to buffer
DATA Copies selected text to buffer, Inserts buffer contents at current location
DATA Deletes selected text without copying it to buffer, "-"
DATA Opens a window for a new subprogram, Opens a window for a new FUNCTION procedure

DATA "Displays a loaded SUB, FUNCTION, module, include file, or document"
DATA Displays next SUB or FUNCTION procedure in the active window
DATA Divides screen into two View windows, "-"
DATA Displays next statement to be executed, Displays output screen, "-"
DATA Displays include file for editing, Displays include file for viewing only (not for editing)

DATA Finds specified text, Finds selected text, Finds next occurrence of text specified in previous search
DATA Finds and changes specified text, Finds specified line label

DATA Runs current program, Clears variables in preparation for restarting single stepping
DATA Continues execution after a break, Sets string returned by COMMAND$ function
DATA "-", Creates executable file on disk, Creates Quick library and stand-alone (.LIB) library on disk
DATA "-", Makes the specified module the main module

DATA Adds specified expression to the Watch window, Displays the value of a variable or expression
DATA Causes program to stop when specified expression is TRUE, Deletes specified entry from WATCH window
DATA Deletes all Watch window entries, "-", Highlights statement currently executing
DATA Records statement execution order, "-", Sets/clears breakpoint at cursor location
DATA Removes all breakpoints, Stops execution at first statement in error handler
DATA Indicates next statement to be executed

DATA "-"

DATA Changes display attributes, Sets default search paths, Changes action of right mouse click
DATA Turns editor's syntax checking on or off, Toggles between Easy and Full Menu usage

'*************************************************************************

'END MNSDEMO.BAS



  3 Responses to “Category : BASIC Source Code
Archive   : MNUSYSQB.ZIP
Filename : MNSDEMO.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/