[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
SetMEvent()
Set or get the external event codeblock for MENU TO.
------------------------------------------------------------------------------
Syntax:
SetMEvent( [<bEvent>] ) --> <bOldEvent>
Arguments:
<bEvent> is an optional codeblock expression which is EVALuated by the
MENU system when it has processed an event but was not able to utilize
the event. It must RETURN a logical indicating if it was able to use
the event or not.
Returns:
SetMEvent() returns the current event codeblock.
Description:
While the MENU system is in control and an input event happens from the
keyboard or mouse, it tries to act according to the event. Not all
events are automatically handled. In those cases where an event does
not have default behaviour the MENU system will look to the SetMEvent()
function. If there is a behaviour codeblock set the current event
value (LastInkey()) is sent to the codeblock. If the codeblock was
able to use the event it must return a true. In addition to the event
value the WITH expression (if supplied) is passed on to the codeblock.
If the codeblock RETURNs a true (was able to use the event) the MENU TO
is exited.
Example:
#INCLUDE "inkey.ch"
#INCLUDE "CUACLIP.CH"
LOCAL nChoice
LOCAL lMore := .T.
// exit when alt-x
LOCAL bMEvent := { | nKey | IIF( nKey == K_ALT_X, ;
( lMore := .F., .T. ), .F. ) }
SetMEvent( bMEvent )
@ ... PROMPT ... ACTION ...
@ ... PROMPT ... ACTION ...
@ ... PROMPT ... ACTION ...
WHILE lMore
MENU TO nChoice USING LastMenu()
END
Files: Library is CUACLIP.LIB.
See Also:
MENU TO
LastMenu()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson