[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Function: MouseMenu()
This function is a remplacement of the PROMPT and MENU TO
commands of Clipper. The enhancement is that it supports
the Mouse, and it now allows the use of MESSAGEs by means
of a Code-Block. Another feature is that it supports the
handling of keyboard exceptions by means of a MouseTrap.
IMPORTANT: The MouseMenu() function definition has
changed from the similar function in the Expand library
for Clipper summer '87. If you upgrade from there, please
be sure to modify all references to MouseMenu() (as I'm
sure you also need to modify a lot of other stuff, it
shouldn't be too much trouble), to reflect the new
syntax.
Syntax: MouseMenu(aMenu[[,nDefault][,bMouseTrap])
Arguments: aMenu is a two dimensional array, containing the
definitions for every Menu choice. The first index
represents the Menu choices, the second index should have
3 values: { nRow, nCol, cPrompt[,bMsg] }, which indicates
where the Menu item should be placed, and what it is.
bMsg can be submitted, and is evaluated every time that
specific choice is highlighted. Using this, one can put
messages, but really do anything you want.
nDefault indicates which choice is currrent, 1 when Omitted.
bMouseTrap is code block that can handle keyboard
exceptions, more on that in the MouseTraps section. When
the trap is omitted, a default is used internally.
Returns: 0 when the user pressed ESC or clicked right when
confronted with the menus, any positive number when the
user selected an option using the Arrows, Home, End or
the first character, or.. when the user clicked on a menu
choice with the mouse's left button. The MouseMenu()
function, of course, handles all the i/o of the Menu when
called.
Usage: * - This is an ASK function that could be
* used anywhere in your Clipper programs.
Function Ask(S)
Local x
Local A := { { 23, 35, " No " } ,;
{ 23, 40, " Yes " } }
@ 21,0 clear to 24,79
@ 21,0 to 24,79
center(22,s)
x := MouseMenu(A)
/* break out one ESCAPE */
if x = 0
break
endif
Return (x==2)
See Also:
MouseTrap
MouseEdit()
MouseChoice()
MouseBrowse()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson