home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 June
/
SIMTEL_0692.cdr
/
msdos
/
turbopas
/
pultp4.arc
/
PULLDOWN.DOC
next >
Wrap
Text File
|
1987-11-22
|
7KB
|
188 lines
PULLDOWN.TPU Version 1.0
November 22, 1987
INTRODUCTION
The set of files contain in this archive consists of a pulldown
menu system, a pop up menu window, and routines to save and
restore the current window and the cursor. These routines were
written with Turbo Pascal Version 4. Compilation with previous
versions is not possible since the pulldown menu system is
written as a Unit.
The Pulldown window system was designed to be generic in the
sense that you can specify up to 10 headers (pulldown menu
titles), and up to 10 submenus under each header. The popup
window can contain as many as entries that will fit on a screen,
with each entry limited to 21 characters total.
PULLDOWN MENU & POPUP MENU WINDOW
The use of the pulldown menu system is simple. You specify the
following:
1) The number of headers in the pulldown menu
2) The column each header should start in
3) The number of entries in each pulldown menu's
submenu
4) The width of each pulldown menu submenu
5) The title (if any) that will appear on the
pulldown header line
6) The starting column for the title
7) The popup menu X and Y starting location
8) The popup menu width
9) The number of entries in the popup menu
The pulldown menu system and the popup menu return three variables:
1) Pulldown_Menu_Number - Identifies which
pulldown menu header
was selected
2) Pulldown_Menu_Selection - Item selected in pulldown
menu's submenu
3) PopUp_Menu_Selection - Item selected in PopUp
menu
These variables are global to your program. By setting up a Case
statement, you can identify which menus were selected and call
your corresponding routines.
In addition, there are several procdures available to your
program.
1) Cursor_Off - Turns off the cursor
2) Cursor_On - Turns the cursor on
3) Save_Window - Saves the current window. Note
that stacked windows are not
supported.
4) Restore_Window - Restores the saved window
5) Make_Menu (col, row, width, num of entries,
MenuArray )
- Col is the starting col for the
popup menu (col is an integer)
- Row is the starting row for the
popup menu (row is an integer)
- Width is the width of the
longest entry's text field
(borders are not counted in the
width. The popup menu border
will be outside the text area,
i.e. starting at col-1, row-1,
etc.)
- Num of entries is just that
- MenuArray is an initialized
array with the text you want
displayed in the popup menu
PULLDOWN MENU SELECTIONS
Selections can be made by moving the cursor to the desired item
and hitting the return key. A short cut method is to hit the key
corresponding to the number or capitalized first letter displayed
in a highlighted color. Once the main pulldown menu displays a
submenu, you can hit the left or right arrow keys to go from one
pulldown menu header to the next, or use the up or down arrow
keys to move within the submenu. If you want to back out of the
submenu, hit the ESC key.
FILES CONTAINED IN THE ARCHIVE
The archive contains four files:
1) Pulldown.Doc - This file
2) Pulldown.TPU - The pulldown Unit file
3) PullTest.Pas - A demo file
4) PullTest.EXE - The compiled demo file
PULLTEST.PAS - DEMO FILE
PullTest.PAS should be examined to see how you should load the
data structures, set up your case statements, etc. I have
provided sample headers and submenus to show the types of program
control that may be set up.
Two areas that showld be examined closly are the case statements
for Pulldown Menu #1, submenu items #1 and #2.
In submenu Item #1 the save and restore screen procedures are
demonstrated. Once a selection is made from the popup menu,
control is returned to the main pulldown menu system.
In submenu #2 a demonstration is provided to show how you
can get a selection from the popup menu, do something, and then
return to the popup menu instead of the main pulldown menu
system.
PULLDOWN MENU INITILAIZATION
An example of how to initialize the main pulldown menu, submenu
and popup menu system is shown in the demo file. You are limited
to 10 headers, 10 submenu entries, and 21 characters on any popup
menu line. You don't have to initialize the unused portions of
the data structures. Make sure that you set DirectVideo to TRUE
in your program so that the screen writes occur as fast as
possible.
Before you call Make_Menu, you must initialize the array that is
passed to the procedure in PULLDOWN.TPU. The initialization
consists of loading the menu entries in the array. I suggest
that you keep the initialization as a callable procdure as shown
in the demo file, rather than initializing in the body of your
code. It's cleaner that way.
THE FREE PART
You can use these routines in programs that are for non-
commercial use only. If you have a commercial application,
contact me to arrange booty. I am cheap, so don't worry.
THE MONEY PART
If you provide me with $20, I'll provide you with the source code
(on disk) in Turbo Pascal Version 4.0 and (when I finish the
conversion) the source code for Turbo C and Microsoft Quick C.
That way you can modify the code to contain more entries, stacked
windows, or what ever you want.
If you're into charities, consider this my "I have to replace the
rugs in my house 'cause my German Shepard has a leaky bladder"
Fund. Donations are not tax deductable, but are highly
appreciated. Its for an old dog.
Regardless, I would like to hear your suggestions for future
releases.
I can be reached at the following locations:
David Sampson
P.O. Box 060573
Palm Bay, FL 32906
Or on-line at the EXEC-PC (415) 964-5160.
At present the EXEC-PC costs $45 per year for access, but it's
well worth it. There are > 23 lines going in, > 1 Gigabit disk
storage, > 8000 public domain files, > 700 entries in the PC Blue
Library, and lots of talented people that use the message system
and are more than glad to help with programming related problems.
REVISION RECORD
PULLDOWN.TPU Version 1.0 - Initial Release