home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 2: PC
/
frozenfish_august_1995.bin
/
bbs
/
d03xx
/
d0368.lha
/
PopMenu
/
README
< prev
next >
Wrap
Text File
|
1990-08-15
|
2KB
|
48 lines
PopMenu Package
07/04/90
(c) 1990 by Paul Miller
The PopMenu Package (popmenu_pak) is a useful package of simple functions
for quick and easy programming of window-dependent pop-up menus.
The package gives simple initialization, handling, and freeing of Macintosh-
like pop-up menus. These consist of a box with text in it that, when clicked
on, opens into a menu of items, that can be selected while the mouse is held
down. Releasing the button selects the item under the mouse. There are two
ways to handle these pop-up menus. One kind can display a constant title or
other information and, when clicked on, open the menu for selection. The
other kind can be a list of commands or modes, where the name of the selected
item is displayed in the box after it is selected.
This package is ideal for programs that need very window-specific menu items,
but don't need to take up extra space in the menu bar that is useless unless
that window is being worked with.
Programs interface with the PopMenu Package via a PMenu structure, which
is based on the normal Menu structure, and the PMenuItem structure, which
is based on the normal MenuItem structure. After varifying which PopMenu
was selected by the user, your application sends the PopMenu Handler a copy
of the PMenu that was selected, and the handler returns the item number
that was selected, or 0 if none was selected. Depending on the type of menu,
it will also update the menu select box text.
Please note that the PopMenu Package doesn't use SwapBitsRastPortClipRect()
to render the menu. It just copies the window BitMap where the menu is to be
drawn into a backup BitMap area, then the menu is rendered directly into the
window. Also, no layer locking is performed, so be sure there is no
asynchronus graphics rendering in the window during PopMenu handling. I
didn't want to take the time to figure out the SwapBits... and layer locking,
so I did a simple compromise. If someone fixes this, please let me know.
Don't forget to include the "popmenu_pak.h" file in your programs.
Refer to "popmenu_pak.doc" for more info.
See the included "Test" program for an example of setting up a PopMenu.
Feel free to use these functions or the object module in your programs. If
you end up just linking in the popmenu_pak.o object module, kindly mention
me in your credits, eh? -Enjoy.