I wonder if anyone checks over the sample apps like I do. There is a nice example of shortcut menus there by both hand coding them and using the menu designer to create one. Does anybody use the #PREPOP generative directive? Instead of explaining I'll just paste the sample app help for one of the shortcuts menus here. Kinda long but hope it contributes to the thread.
Display Shortcut Menus
File: ...\Samples\Vfp98\Solution\Menus\Shortcut.scx
This sample illustrates displaying shortcut menus when a user "right-clicks" an object. When you have created a shortcut menu in the Menu Designer, the code in the form to activate the menu is very simple. The following code is associated with the
RightClick event of the form:
DO frmshort.mpr
WITH THIS
The following code is associated with the
RightClick event of the edit boxes on the form:
DO edtshort.mpr
WITH THIS
The FRMSHORT Menu
The FRMSHORT menu was designed to take an object parameter. The following code is included in the
menu's setup code:
PARAMETER oREF
#PREPOP
The #PREPOP generative directive causes the code in the menu's cleanup to be generated before the ACTIVATE POPUP command.
This allows you to disable or enable menu items at run time, as well as display check marks beside menu items.
The code associated with the menu items sets properties of the object that was passed to the .mpr as a parameter. For example, the Always on top item sets the AlwaysOnTop property of the form.
[sig]<p>John Durbin<br><a href=mailto: john@johndurbin.com> john@johndurbin.com</a><br><a href=
</a><br>MCP Visual FoxPro<br>
ICQ VFP ActiveList #73897253[/sig]