home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
xbase
/
library
/
clipper
/
keyboard
/
hotget
/
hotmenu.doc
< prev
next >
Wrap
Text File
|
1992-01-25
|
2KB
|
39 lines
HOTMENU.PRG
Author: Glenn Alcott
86-22 60th Road
Elmhurst, NY 11373
CompuServe: 76044,747
HOTMENU.PRG is an enhancement for PROMPT and MENU which allows hot keys to be
displayed in a different color from the rest of the prompt, and to be something
other than the first letter of the prompt. It redefines PROMPT and MENU TO
through user-defined commands, so that the syntax of your program doesn't have
to change except to add the HOTKEY option to any prompt where the hot key is
not the first letter. This option is a number indicating the position in
the prompt string of the hot key letter, i.e. :
@ 1,1 PROMPT "Edit File" HOTKEY 6
This would make "F" the hot key, as it is the 6th character in the prompt.
The color for the hotkeys is not defined in the prompt, but is set to be the
last (5th) setting of the current SETCOLOR() string - the same color used for
unselected GETs. You're therefore limited to the same hot key color for all
the choices in a menu, but I've never really wanted to do them in different
colors! It would be easy enough to change the program to accomodate individual
colors for the hot keys, and for the prompts themselves, but this should only
be done if your users love loud and garish screens.
To give credit where it's due, I got the idea for this program from the
Nantucket Forum User Library, which contains replacements for PROMPT/MENU TO
called FT_PROMPT and FT_MENUTO, written by Ted Means. These are more powerful
and do support such things as individual colors for each prompt and hot key.
However, although they are written in a combination of Clipper and assembler,
they were too slow to be useful! There was a noticeable delay in the display
of every menu even on a very fast PC. Apparently the Clipper portion of the
code has to do a tremendous amount of work to convert Clipper color codes into
numbers to be passed to the assembler routine, and this took too much time.
Feel free to use and change this program in any way you like, and to send a
small ($10 or so) contribution to the author if you find it useful.