Article ID: 193626
Article Last Modified on 7/1/2004
LOCAL lcFileName
* Name a temporary text file.
lcFileName = SYS(3)+'.txt'
* Store its contents to the clipboard.
_CLIPTEXT = "Line 1"+CHR(13)+"Line 2"+CHR(13)
KEYBOARD '{ctrl+v}{ctrl+w}'
* Paste the contents into the file, then save and close the file.
MODIFY FILE (lcFileName)
* Set the RIGHTMOUSE behavior to the WAIT command to remove right-click.
ON KEY LABEL RIGHTMOUSE WAIT ""
MODIFY FILE (lcFileName)
DELETE FILE (lcFileName)
* Reset the default RIGHTMOUSE behavior
ON KEY LABEL RIGHTMOUSE
LOCAL lcFileName
* Name a temporary text file.
lcFileName = SYS(3)+'.txt'
* Store its contents to the clipboard.
_CLIPTEXT = "Line 1"+CHR(13)+"Line 2"+CHR(13)
KEYB '{ctrl+v}{ctrl+w}'
* Paste the contents into the file, then save and close it.
MODIFY FILE (lcFileName)
* Set the RIGHTMOUSE behavior.
ON KEY LABEL RIGHTMOUSE MenuFunction()
MODIFY FILE (lcFileName)
DELETE FILE (lcFileName)
* Reset the default RIGHTMOUSE behavior.
ON KEY LABEL RIGHTMOUSE
FUNCTION MenuFunction()
WAIT "" && This removes the right-click.
IF POPUP('shortcut')
* Let's make sure we don't display the menu twice.
DEACTIVATE POPUP shortcut
ELSE
DEFINE POPUP shortcut shortcut RELATIVE
DEFINE BAR _MED_UNDO OF shortcut PROMPT "\<Undo" ;
MESSAGE "Undoes the last command or action"
DEFINE BAR _MED_REDO OF shortcut PROMPT "Re\<do" ;
MESSAGE "Repeats the last command or action"
DEFINE BAR 3 OF shortcut PROMPT "\-"
DEFINE BAR _MED_COPY OF shortcut PROMPT "\<Copy" ;
MESSAGE "Copies the selection onto the Clipboard"
DEFINE BAR _MED_PASTE OF shortcut PROMPT "\<Paste" ;
MESSAGE "Pastes the contents of the Clipboard"
DEFINE BAR _MED_CUT OF shortcut PROMPT "Cu\<t" ;
MESSAGE "Removes the selection and places it on the Clipboard"
DEFINE BAR _MED_SLCTA OF shortcut PROMPT "Se\<lect All" ;
MESSAGE "Selects all text or items in the current window"
ENDIF
* Activate it where we clicked.
ACTIVATE POPUP shortcut AT MROW(),MCOL()
* Deactivate it after we click outside of the menu.
DEACTIVATE POPUP shortcut
RETURN
ENDFUNC
Additional query words: kbvfp500 kbvfp500a kbvfp600
Keywords: kbhowto kbcode KB193626