home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 17
/
CD_ASCQ_17_101194.iso
/
vrac
/
menusys.zip
/
MENUSYS.DOC
< prev
Wrap
Text File
|
1994-08-07
|
4KB
|
74 lines
MENUSYS - A PULL-DOWN MENU SYSTEM DEMONSTRATION PROGRAM
Module MENUSYS.BAS can be loaded and run as a QuickBasic 4 or MS-DOS QBasic
program. It demonstrates a conventional pull-down menu system with bounce
bar that can be moved by the cursor control keys and menu items with
highlighted keys for quickly accessing a menu item by Alt-key combinations.
F10 plus a highlight letter also accesses the main menu item. Other keys
such as Alt-U for Up, Alt-L for left, Alt-H for home and space bar for
down also move the bounce bar and provides speed in making menu selections.
In general <Enter> accepts an item and <Esc> allows you to back out of a
given menu level or program area.
Menu selections lead to scroll boxes and dialog boxes (if the menu item ends
with " ..." ). A simple block text editor is included, which you can use
not only for editing single fields on one line, but for simple ASCII word
processing without wordwrap.
The program module and menu system routines are designed to allow development
of your program with minimal effort. The main module defines the screen
control and system (hardware, in this case only video adapter) variables.
You may also have file or other program specific TYPE variables. A set-up
routine is called to initialize parameters. In MENUSYS, only the program
color scheme is set. DATA statements define the menu system. Once you gain
experience with the menu variables covered in the DATA statements and have
an overall program map or structure defined, you can literally define a menu
system for your program in minutes.
If you have a VGA, you can define some more appealing color combinations
using PALETTE statements. However, using default colors, included in the
SetUpPgm routine are good combinations for Monochrome (MDA), CGA, EGA, and
VGA adapters. Since your program can't see past the adapter to what monitor
is attached, there is provision for user input of a monochrome monitor
attached to a CGA through VGA adapter. You can experiment with different
color combinations by altering statements in SetUpPgm. If you would like to
have QuickBasic routines to read the command line and determine system
hardware directly, see the file SUPPRT.ZIP in this MS Basic Library. For
testing, note that portables and laptops with monochrome versions of color
adapters, and especially LCD displays, present challenges to have effective
color schemes for your program.
The primary action of your program occurs in routine MainCalc which shows
how to convert menu selections into redirection to proper areas of your
program. Examples are included. You can actually start from a copy of
MENUSYS and modify to your program action and save under a new program
name. MENUSYS remains as a template for future programs. The menu routines
can be used as is without changing. In addition to BlkEdit, which is the
simple text editor, BoxDisplay and BoxDraw will be especially useful for a
number of programming chores. KeyPress should be used for all user input,
since you have complete control over what action to take given the return
variable KeyCode.
DialogBox is the most complicated routine, but is a very powerful and
flexible tool for setting up controlled user input. Study the provided
examples. It is designed to allow original program defaults, defaults
stored in startup files, and resetting to earlier session variables if the
user changes his mine or makes a mistake. That is the reason for the
multiple string parameter list and execution code variable (DBCode).
Remember in any testing of your program, try all sorts of keyboard input to
see if you can hang up your program.
Feel free to modify MENUSYS to better meet your programming requirements. I
hope this helps simplify development for you. For QuickBasic programmers
who can access CALL INTERRUPT, integrating mouse routines with MENUSYS can
be done. This is not trivial since MENUSYS was written originally for
convenient keyboard input in a rodent-free world. If you want mouse aware
menu systems, more speed, and more capabilities, such as constructing input
screens, there are a number of such programs available in this library.
If you have questions or comments, I would appreciate hearing from you.
Brian Dinsmoor
76675,1606
August 7, 1994