Article ID: 131600
Article Last Modified on 8/24/1999
ON KEY LABEL RIGHTMOUSE DO RightPopNote that for this example, when you press the ESC key, the ON KEY LABEL definitions are reset, so this only works for a single pass as it is written. To force the definition for the right mouse button to remain in effect even after the ESC key is pressed, comment out the ON KEY LABEL RIGHTMOUSE command in RelWind procedure.
*------------------------------------------------------------------------*
* Program: RightPop *
* Purpose: Demonstrate how to mimic the behavior of the right mouse *
* button in Visual FoxPro. *
*------------------------------------------------------------------------*
ON KEY LABEL esc DO RelWind IN RightPop
DEFINE WINDOW test FROM 0,0 to 5,12 FLOAT CLOSE NOMINIMIZE
DEFINE POPUP conversion MARGIN RELATIVE SHADOW COLOR SCHEME 4 ;
IN WINDOW test
DEFINE BAR 1 OF conversion PROMPT 'Ar\<ea' KEY CTRL+E, '^E'
DEFINE BAR 2 OF conversion PROMPT '\<Length' ;
KEY CTRL+L, '^L'
DEFINE BAR 3 OF conversion PROMPT 'Ma\<ss' ;
KEY CTRL+S, '^S'
DEFINE BAR 4 OF conversion PROMPT 'Spee\<d' ;
KEY CTRL+D, '^D'
ON SELECTION POPUP conversion;
DO choice IN RightPop WITH PROMPT( ), POPUP( )
ACTI WINDOW test
ACTIVATE POPUP conversion NOWAIT
PROCEDURE choice
PARAMETERS mprompt, mpopup
WAIT WINDOW 'You chose ' + mprompt + ;
' from popup ' + mpopup NOWAIT
PROCEDURE RelWind
On Key Label Esc
On Key Label RightMouse
Release Window Test
*----------------------------< End program code >------------------------*
Additional query words: VFoxWin _SCREEN rightclick
Keywords: kbcode KB131600