Dec 222017
 
Mouse driven windowing routines. GREAT!!. Requires ADVBAS.EXE.
File MICE.ZIP from The Programmer’s Corner in
Category BASIC Language
Mouse driven windowing routines. GREAT!!. Requires ADVBAS.EXE.
File Name File Size Zip Size Zip Type
CHARCODE.BAS 1628 507 deflated
INKEY.BAS 2185 762 deflated
INKEY.HLP 2326 893 deflated
INKEY.SUB 7685 2416 deflated
MICES.DOC 10535 3135 deflated
MMENU123.BAS 1872 896 deflated
MMENU123.SUB 5279 1690 deflated
MOUSEMNU.BAS 1366 694 deflated
MOUSEMNU.SUB 3966 1406 deflated
POPMOUSE.BAS 2141 876 deflated
POPMOUSE.SUB 4093 1477 deflated
TPCREAD.ME 199 165 deflated

Download File MICE.ZIP Here

Contents of the MICES.DOC file







MICES









Inspired by menu routines from BWTOOLS by Dave Evers amd input routines
by Nelson Ford and using mouse and screen handling routines from ADVBAS
by Thomas Hanlin III, POPMOUSE, MOUSEMNU, MMENU123 and INKEY are hereby
placed in the Public Domain.

These subroutines were tested with ADVBAS.LIB v9A, 12/13/87
BC.EXE v4.0, 10/08/87

Ray Schwarz 76012,133

Version 2.0 04/16/88

POPMOUSE

Purpose: Used to select options from several popup menu windows using
the cursor keys or the mouse to move a 'select bar'.
Selection is made by the Enter key or the left mouse button.

CALL POPMOUSE(PROMPTS$(SET%),L%(SET%),SET%,ITEMS$(),FRAME%,FORE%,
BACK%,HFORE%,HBACK%,QUADRANT$,SHADOW%,CHOICE%)

Passed:

PROMPTS$ - A string array holding the Menu Headings which you wish to
place in the header position (top row) of the window. The
length of this string will determine the width of the menu
window unless a choice description in array ITEMS$() below
is longer.

L%(SET%) - An integer array with the number of choices in the menu set.

SET% - Used to select which menu to display

ITEMS$(,) - A two-dimensional array (i.e. ITEMS$(1,1) holding the
actual menu item strings. The first dimension holds the
menu number, and the second holds the item number within a
menu. Thus, ITEMS$(1,1) would be the first item in Menu #1;
and ITEMS$(5,10) would be the 10th item in Menu #5.

NOTE: In order for the highlighted 'select bar' to be of
constant length for each menu, the length of the
menu item descriptions for each set must be equal.
This can easily be done by adding spaces to the
end of each description as necessary.

FRAME% - An integer defining the type of frame style for the window
as follows:

0 - No frame. Just a border of spaces
of the background color.

1 - A single line frame.

2 - A double line frame.

3 - A single horizontal line,
double vertical line frame.

4 - A double horizontal line,
single vertical line frame.

FORE% - The foreground color; ranging from 0 (BLACK) to 15
(BRIGHT WHITE). This will be the color of the frame.

BACK% - The background color (the color of the window). Can range
from 0 (BLACK) to 7 (WHITE).

POPMOUSE

HFORE% - The foreground color of the Header.

HBACK% - The background color of the Header.

QUADRANT$ - A string which defines where on the screen the window will
be placed; used as follows:

---------------------------
| . |
| 1 . 2 |
| . |
|.............0.............|
| . |
| . |
| 4 . 3 |
| . |
---------------------------


"0" - In the exact center of the screen; centered
according to menu size.

"1" - Upper Left Quadrant.

"2" - Upper Right Quadrant.

"3" - Lower Right Quadrant.

"4" - Lower Left Quadrant.

"rr:cc" - Specifies exact coordinates of upper left corner of
window to be row rr and column cc (two digits
each).



SHADOW% - A switch to determine if menu window will have a black
shadow underneath. 1 will produce shadow, 0 will not.

Returns:

CHOICE% - An integer with the number of the item selected. This can be
used in an ON SELECT% GOSUB .... statement to route program
flow to the desired section. If [ESC] is pressed, SELECT%
will be 0.


Other files:

POPMOUSE.BAS - QuickBasic program to demo POPMOUSE
MOUSEMNU

Purpose: Produces a display similar to the editing screen of
QuickBASIC with a bar across the top and uses the mouse to
Pull-down 1-6 menus. When the mouse is 'clicked' at a Menu
Bar, a Pull-Down menu is displayed as long as the mouse
button is held. A highlighted bar follows the mouse cursor
to indicate items to be selected.

SUB MOUSEMNU(MLINE$(1),MENUFG%,MENUBG%,BLKSIZE%,BLKNUM%,MAXSIZE%(1),
MAXITEMS%(1),ITEMS$(2),MENUSLCT%,ITEMSLCT%) STATIC

Passed:

MLINE$ - A string array holding the Menu Headings that will be placed
on the second screen line (to allow or a screen border if
desired).

MENUFG% - An integer holding the foreground color of the Menu line.

MENUBG% - An integer holding the background color of the Menu line.

BLKSIZE% - The Menu line is divided into BLOCKS of fixed size, which
will be highlighted as each is selected and the appropriate
menu 'drops down' beneath it. This integer sets the size of
these blocks.

BLKNUM% - The number if fixed blocks of BLKSIZE% that are present in
array MLINE$.

MAXSIZE%() - An integer array with one element for each menu that will
appear (i.e., BLKNUM%). This array element holds the
maximum length of the items contained in the corresponding
menu. MOUSEMNU will pad with two additional spaces.

MAXITEMS%() - An integer array also with one element per menu holding the
number of items in each corresponding menu.

ITEMS$( , ) - A two-dimensional array (i.e. ITEMS$(1,1) holding the actual
menu item strings. The first dimension holds the menu
number, and the second holds the item number within a menu.
Thus, ITEMS$(1,1) would be the first item in Menu #1; and
ITEMS$(5,10) would be the 10th item in Menu #5. A string of
bar characters (CHR$(196)) will show a dividing line between
sections: ITEMS$(4,2)=STRING$(MAXSIZE%(MENU)+2,196)

MOUSEMNU

Returns:

MENUSLCT% - An integer holding the menu number of the selection made.

ITEMSLCT% - An integer holding the item number within the menu selected.

For example, if item 10 in menu #5 were selected, MENUSLCT%
would be 5 and ITEMSLCT% would be 10.



Other files:

MOUSEMNU.BAS - QuickBasic program to demo MOUSEMNU
MMENU123

Purpose: An imitation of the Lotus 1-2-3 user interface. A menu bar
string is passed to the routine for the various selections
to be displayed. An array of descriptions for each menu
choice is also passed to be shown on the line below. A
highlighted block defines the current selection. The block
is moved by the left and right cursor keys or the mouse.
Selection is made via the Enter key or left mouse button.
The Escape key or right mouse button is used for no select.

CALL MMENU123(MENULINE$,MENUROW%,MENUFG%,MENUBG%,ITEMDESC$(),
CHOICE%)

Passed:

MENULINE$ - A string holding the top menu line; from which selection is
made. The individual names in the MENULINE$ string must be
separated by one space.

MENUROW% - An integer holding the screen row on which the menu is to
appear. This allows you to place the menu on either the top
or bottom of the screen.

MENUFG% - The foreground color of the MENULINE and the Description
Line under it.

MENUBG% - The background color of the MENULINE and the Description
Line under it.

ITEMDESC$() - A string array holding the descriptions of the selections
made in the MENULINE.

Returns:

CHOICE% - An integer holding the number of the selection made.

Other files:

MMENU123.BAS - QuickBasic program to demo MMENU123
INKEY

Purpose: Controlled input string.

CALL INKEY(ROW%,COL%,AC%,CHAR.CODE%,FL%,PROMPT$,CONTROL$,IN$,MOVE.IT%,KY%)

Passed:

ROW%,COL% - Cursor position.

AC% - Automatic capitalization of leading character.
0=no, -1=yes

AR.CODE% - Input Control - Sum of:
1: Allow blanks
2: Allow numbers
4: Allow Alpha
8: Force upper case
16: Allow symbols
.... See CHARCODE.BAS for a simple program to calculate ...

FL% - Input field length.

PROMPT$ - Default response.

CONTROL$ - Input control: U=upper case, #=number

Returns:
IN$ - Containing data.

MOVE.IT% - = 1 if a special key has been pressed.

KY% - Contains last key code pressed.

Other files:

INKEY.BAS - QuickBasic program to demo INKEY
INKEY.HLP - Include file to customize help screen.


 December 22, 2017  Add comments

Leave a Reply