Shortcut Menus

A standard Windows convention is the ability to right-click on an object to display a shortcut menu of options appropriate for the object. Visual FoxPro provides the basic ability to create shortcut menus. When you create a new menu with the Visual FoxPro Menu Builder, you can choose to create a conventional menu or a shortcut menu. In the RightClick event of a form or control, you can “DO” the shortcut menu that will be displayed when someone right-clicks on the form or control.

Shortcut Menus in VPM Enterprise Apps.

VPM Enterprise facilitates the implementation of shortcut menus in VPM Enterprise applications in the following way:

1. Template Shortcut Menus

VPM Enterprise provides template, or starter, shortcut menus for VPME forms and controls. When you bring up the VPME Menu Builder for an application, you see the template shortcut menus listed. When a user right-clicks on a form or control in your VPME application, the template shortcut menu shown in the VPME Menu Builder is automatically displayed.

Each VPME control has its own shortcut menu with options that are appropriate for the control. You can use the Menu Builder to add whatever options you think are appropriate in your applications.

The menu titled “Window Shortcut” is for forms. It is called “Window Shortcut” instead of “Form Shortcut” because we felt that if users set up menu security for shortcut menus in an application, they may be more likely to think of forms using the term “window” than the term “form”. You can, of course, change the title to anything you want.

2. cRightClick_Menu Property

VPME forms and controls have a cRightClick_Menu property that contains the file name of the shortcut menu to run when the RightClick Event of the form or control is fired (i.e., when the form or control is right-clicked). This property is already filled in for VPME forms and controls. The property contains the appropriate file name shown in the Menu Builder for a form or control.

3. RightClick Event

The RightClick Event event of VPME forms and controls has code that runs the menu referenced in the cRightClick_Menu property when the form or control is right-clicked. The method code for VPME forms is in the Form_ class of the VPMForms class library. The method code for VPME controls is in the control classes in the VPMCtrls class library.

Shortcut Menu Security

You can set up VPME menu security for shortcut menus just like you set it up for the Main menu or other conventional menus.

More:

Report Designer Menu