Dec 162017
 
Basic windowing routines for Quick Basic 4.0 and 4.5.
File EZW1V30A.ZIP from The Programmer’s Corner in
Category BASIC Language
Basic windowing routines for Quick Basic 4.0 and 4.5.
File Name File Size Zip Size Zip Type
EZDEMO1.EXE 61622 59735 deflated
EZPDS.LIB 25675 12228 deflated
EZPDS.QLB 21221 11154 deflated
EZQB.LIB 25161 11731 deflated
EZQB.QLB 19749 9758 deflated
EZWINDO.DOC 19575 5978 deflated
PDDEMO.BAS 8046 2788 deflated
PDDEMO.EXE 35164 33797 deflated
QB.BI 1968 558 deflated
REGISTER.DOC 4563 830 deflated
SHARWARE.DOC 4133 1828 deflated
TPCREAD.ME 199 165 deflated

Download File EZW1V30A.ZIP Here

Contents of the EZWINDO.DOC file




Welcome to


EZ-WINDOWS Pulldown Menu System

Version 3.0

A complete mouseable Pulldown Menu System



For...

Microsoft QuickBASIC 4.5

Microsoft Professional Development
System 7.0



StrongSoft Engineering

3155 SW 178th Ave
Aloha, OR 97006
(503) 649-7251

Documentation written and prepared
by John C. Strong








A few customer comments --

"Terrific, a beautiful piece of programming!" - Duiven, Holland

"I am very impressed with EZ-WINDOWS. It is exactly what
I was looking for..." - Ontario, Canada

"It's incredible, I just love your routines to death...I'm going
to impress the hell out of those smart 'C' programmers..."
- Houston, Texas



OVERVIEW

This routine is intended to allow a programmer to present the user
with options in an organized and esthetic way. The PullDown Menu System was
indeed modeled after the very pulldown menu used in the QuickBASIC 4.x
environment.

I wrote this routine out of frustration, actually. I didn't want to
take the time to write a pulldown menu routine, yet none of the commercially
available libraries offered the options that I needed. So I just sat down
one day and wrote it (over several days), and here it is.

The Pulldown Menu System is very easy to integrate in a QB program,
yet offers all the options someone might expect in a commercial software
package. To use this routine in a program, all that is required is a few
arrays containing formatting information for the pulldown menu and an array
containing the actual text used. Then a simple CALL statement will take care
of the rest! Don't worry -- loading the arrays required for the routine is
very straightforward and uncomplicated, and the results are definitely worth
it!

The advantages of using this routine are both numerous and obvious, but
there is one disadvantage: the code size is rather large. But the programs
that need such a pulldown menu routine are the ones that need to present a
multitude of options to the user -- such a program will naturally be large
anyway, so the relative code size of the Pulldown Menu System shouldn't make
a big difference.


REQUIREMENTS

The Pulldown Menu System requires QuickBASIC 4.5 compiler. It will also
work with QB40, but you'll need to purchase & recompile the source code in
QB40. I think the better investment would be to buy QB45! But I don't
know if it will work with versions eariler than 4.0. I believe earlier
versions of QuickBASIC modify the stack a bit differently when passing
parameters to assembler routines, which would definitely cause problems. So
if you don't have version 4.0 or later, you would be doing yourself a great
favor by upgrading if for no other reason than to enjoy the benefits of a
superior programming environment provided by QB45 or PDS 7.0.

You can use this routine inside the QB environment or in a compiled
.EXE file. Two Quick Libraries are provided for program development inside
QB and two libraries are provided for compiled programs.


USING THE PULLDOWN MENU SYSTEM

Using this routine requires the dimensioning and loading of several
arrays and the actual call to the routine. When calling the routine, several
conventions must be observed:

1) All non-string variable arguments must be the integer type,
denoted by the percent sign %, i.e., ITEMSLCT%. Alternativ-
ely, the DEFINT statement can be used at the beginning of
your program which will take care of this automatically. You
can also pass literals instead of integer variables, but only
for arguments that are not modified by the routine. The best
thing to do is just pass variables, which requires less stack
space than literals.

2) The arguments passed must be in proper order or the routine
will not work, possibly locking up your system.

3) All arguments must be present or the routine will not work,
possibly locking up your system.


SPECIFYING COLORS AS ATTRIBUTES

The Pulldown Menu System requires that colors be passed
as attributes instead of foreground and background colors. This
not only contributes to consistency between the routines internal
to the library but also reduces the number of arguments needing to
be passed.

So what is an attribute? An attribute is a single byte,
containing a number between 0 and 255, that tells DOS
what foreground and background color to use. Every character
on the screen has its own attribute byte in addition to the
character byte, and the attribute and character byte sit together
in video memory. This is why it is fast and efficient to use
attributes.

An attribute is the background color, multiplied by sixteen,
plus the foreground color. In hexadecimal, the background is the
high nibble and the foreground is the low nibble. To simplify
things, here is a table that yields the attribute for a given
background color and foreground color. Note that background colors
go from black to white. You can use higher numbered colors
for a background but the text will be flashing.

BACKGROUND COLOR

black blue green cyan red magenta brown white
0 1 2 3 4 5 6 7
|-----|------|------|------|------|------|------|------|
black 0 | 0 | 16 | 32 | 48 | 64 | 80 | 96 | 112 |
|-----|------|------|------|------|------|------|------|
blue 1 | 1 | 17 | 33 | 49 | 65 | 81 | 97 | 113 |
|-----|------|------|------|------|------|------|------|
green 2 | 2 | 18 | 34 | 50 | 66 | 82 | 98 | 114 |
F |-----|------|------|------|------|------|------|------|
O cyan 3 | 3 | 19 | 35 | 51 | 67 | 83 | 99 | 115 |
R |-----|------|------|------|------|------|------|------|
E red 4 | 4 | 20 | 36 | 52 | 68 | 84 | 100 | 116 |
G |-----|------|------|------|------|------|------|------|
R magenta 5 | 5 | 21 | 37 | 53 | 69 | 85 | 101 | 117 |
O |-----|------|------|------|------|------|------|------|
U brown 6 | 6 | 22 | 38 | 54 | 70 | 86 | 102 | 118 |
N |-----|------|------|------|------|------|------|------|
D white 7 | 7 | 23 | 39 | 55 | 71 | 87 | 103 | 119 |
|-----|------|------|------|------|------|------|------|
C gray 8 | 8 | 24 | 40 | 56 | 72 | 88 | 104 | 120 |
O |-----|------|------|------|------|------|------|------|
L lblue 9 | 9 | 25 | 41 | 57 | 73 | 89 | 105 | 121 |
O |-----|------|------|------|------|------|------|------|
R lgreen 10 | 10 | 26 | 42 | 58 | 74 | 90 | 106 | 122 |
|-----|------|------|------|------|------|------|------|
lcyan 11 | 11 | 27 | 43 | 59 | 75 | 91 | 107 | 123 |
|-----|------|------|------|------|------|------|------|
lred 12 | 12 | 28 | 44 | 60 | 76 | 92 | 108 | 124 |
|-----|------|------|------|------|------|------|------|
lmagenta 13 | 13 | 29 | 45 | 61 | 77 | 93 | 109 | 125 |
|-----|------|------|------|------|------|------|------|
yellow 14 | 14 | 30 | 46 | 62 | 78 | 94 | 110 | 126 |
|-----|------|------|------|------|------|------|------|
bwhite 15 | 15 | 31 | 47 | 63 | 79 | 95 | 111 | 127 |
|-----|------|------|------|------|------|------|------|



CALLING THE ROUTINE

This is the required format for calling this routine:


CALL PULLDOWN(MENUBAR$,MenuRow%,MenuCol%,Menuattr%,Hotattr%,
HiBarattr%,NVattr%,HiPos1%(),HiPos2%(),
MaxSize%(),MaxItems%(),item$(),valid%(),toggle%(),ms%,
Clearafter%,Seed%,SoundOn%,MenuSlct%,ItemSlct%)


Arguments: MENUBAR$ - A string variable holding each pulldown menu
name. The number of menus is determined by
the number of names is this string, which
must be separated by at least one space on
each side. A space character must be the last
character in the string.

MenuRow% - The row on which the menu bar will be
displayed.

MenuCol% - The column of the leftmost character in the
menu bar. For a full length menu bar, this
would be set to one (1).

Menuattr% - The color attribute of the menubar and menus

Hotattr% - The color attribute of the "hot" letters

Hiattr% - The color attribute of the text selected by
the highlight bar.

NVattr% - The color attribute of the "grayed out"
non-valid selecions.

HiPos1%() - The integer array, dimensioned to the number of
menus, holding the position of the 'hot'
letter in each menu name in the MENUBAR$
variable. These letters will be hilited with
the color specified in the HiliteFG% variable.

HiPos2%() - A 2-dimensional integer array holding the
position of the 'hot' letter in each menu item
for each menu. It's first dimension is the
number of the menu, the second is the
number of the selection in the menu.
Dimension it for the number of menus and the
number of items in the largest menu. For
example,
DIM HiPos2%(menu%,slct%)

MaxSize%() - An integer array holding the length of the
longest item in each menu.

MaxItems%() - An integer array holding the number of items in
each menu.

Item$() - A 2-dimensional array holding the items for
selection for each menu. It is dimensioned
like HiPos2%(),
DIM Item$(menu%,slct%)

Valid%() - A 2-dimensional flag array that determines if
an item is valid for selection or not. A value
of 1 is valid; 0 means not valid, and the item
is grayed-out. It is dimensioned like
HiPos2%().

Toggle%() - A 2-dimension flag array that determines the
toggling status of each item in each menu.

2 - exclusive toggle, on
1 - inclusive toggle, on
0 - no toggling
-1 - inclusive toggle, off
-2 - exclusive toggle, off

If toggling is used in a menu, it must all be
of one type, either all exclusive or all
inclusive. Otherwise, it won't work properly.
Toggle%() is dimensioned like HiPos2%().

ms% - Flag to indicate mouse support. If ms%=0, the
routine ignores the mouse if one is present.
ms%=1 tells the routine to use the mouse.

ClearAfter% - If ClearAfter%=1, the menu will be erased after
a selection is made. A value of zero will
inhibit the erasing of the menu.

Seed% - When PULLDOWN is first called, the menu name
corresponding to the number in this variable
is hilited for selection.

SoundOn% - If set to zero (0), the routine will not make
any sound.

Itemslct% - If set to -1 prior to CALLing PULLDOWN, the
item selected will blink after it has been
picked

Returned: MenuSlct% - The number of the menu containing the item that
was selected.

ItemSlct% - The number of the item selected.


In addition, you can tell PULLDOWN to put in a dividing line with a
simple command. All you do is insert a certain character into your
ITEM$() array. For example, to put a dividing line in your first menu after
the third item, your program should define ITEM$(1,4) as:

ITEM$(1,4) = "~"

The tilde "~" tells PULLDOWN to create a dividing line.

The source code for PDDEMO is well documented and will provide a little
more clarity on the function of each of these variable. I encourage you to
play around will PDDEMO a bit - get a feel for it by modifying it and seeing
what it does. Be sure to observe the calling conventions, though.


COMPILING

To create an .EXE file, follow these steps:

1) During development, use the EZQB.QLB (or EZPDS.QLB) Quick
Library inside the QB environment.

2) When you're ready to compile the finished program, first
decide if you want a stand-alone program or one that needs the
BRUNxx.exe file to run. Then go to the DOS prompt in your QB
directory and use this syntax to compile your program:

BC PROGRAMNAME [/O],,nul

where PROGRAMNAME is the name of your basic program (no
extension), and the [/O] option tells QB to compile a stand-
alone program. You may leave this option off if you want,
which will result in an executable file that needs the
BRUNxx.EXE file. For example, to compile PDDEMO.BAS for
stand-alone program, type

BC PDDEMO /O

3) Now is when you link in the EZQB.LIB (or EZPDS.LIB) library
to the object code produced by the compiler. From the DOS
prompt use this syntax to link your program:

LINK [/E] PROGRAMNAME,,,EZQB

The [/E] is the EXEPACK option which produces a
smaller executable file and should be used for most every
program that you may write.

4) You should now have an executable version of your QB program
in the QBxx directory. Remember, if you didn't use the [/O]
option, the BRUNxx.EXE must be present.



HELP A BUDDING ENGINEER!

If you think this pulldown menu routine will be useful to you, I would
greatly appreciate a little donation to get me through graduate
engineering school. A $5.00 registration fee is all that's needed to get on
the mailing list and receive updates to PULLDOWN plus customer support.
If you decide to register the full library (see below), the $5.00
registration is waived.


MORE ROUTINES!!

If you run the EZDEMO1.EXE program on your disk, you will see a collection
of my favorite routines that I would like to make available to you. This is
Volume 1 of the EZ-WINDOWS library. I use these routines extensively in my
programs, which not only saves a lot of time but also results in a professional
looking program. EZDEMO1.EXE has several command line parameters. Type
EZDEMO1 /? for a list of options.

Here is what you get when you register the full library: 1) the complete
library of routines with full documentation; 2) free updates when they become
available; 3) customer support. Included in customer support is E-mail,
phone support, and the "wish list". If you have an idea for a routine, and I
get enough suggestions from others for the same type of routine, I will write
it up and send it out with the next update. In addition, I will be
periodically updating my personal library with new routines which will be
included in the next volume. Each new volume can be obtained by registered
users at a discount.

I know a lot of you will want my source code, and I can understand that.
I'm a little reluctant to give it out, but I will release it with the library
for an extra fee. For ordering info, see the REGISTER.DOC file.


E-MAIL

You may reach me by phone (503) 649-7251 until August 1991, or through
E-mail at any time. You can reach me at the following addresses:

ProdigyDVDT90A
PC-LinkJohnny Sky
GEnie J.STRONG6


AND LASTLY...

Have a ball!



 December 16, 2017  Add comments

Leave a Reply