Menus in Active Documents

If a Visual FoxPro Active Document includes menu code, the menus are merged with the Internet Explorer menus following specific menu merging rules. Once the Active Document menus are merged with those of Internet Explorer, the Active Document menus appear as they would in a traditional Visual FoxPro application.

For forms that provide OLE visual editing through ActiveX controls, you can specify menu negotiation behavior. Enhancements to menu negotiation in Visual FoxPro enable you to specify the placement of Active Document menu items in Internet Explorer menus.

When an Active Document is open in Internet Explorer, it shares menu space Internet Explorer and menus are merged together. Menus from Internet Explorer are merged with menus from the Active Document. The merged menus fall into six groups, and each group is owned by Internet Explorer, the Active Document, or both.

Group Owner
File Group Internet Explorer
EditGroup Active Document
Container Group Internet Explorer
Object Group Active Document
Window Group Internet Explorer
Help Group Active Document or Internet Explorer

Help Menu Merging

The Active Document shares its Help menu with Internet Explorer. If Internet Explorer has a help menu, the Active Document can add its help menu items to the end of Internet Explorer help menu.

Language Enhancements for Menu Negotiation

The DEFINE PAD NEGOTIATE clause has been enhanced to make it possible for you to specify how menu negotiation occurs for menus in an Active Document. A new second option, cObjectPosition, specifies the location of a menu title in the Internet Explorer menu bar.

See DEFINE PAD for more information.

The Prompt Options dialog box in the Menu designer has been enhanced, making it possible for you to specify menu negotiation for menus created in the Menu Designer and included in Active Documents. An Object drop-down has been added; this drop-down specifies how the menu title is negotiated when a Visual FoxPro Active Document is hosted in Internet Explorer.

The menu negotiation information is stored in the Location field of a menu (.mnx) file. The following table lists the values in this field and the type of menu negotiation for each value. See DEFINE PAD for more information about cContainerPosition and cObjectPosition.

Value cContainerPosition cObjectPosition
0 None None
1 Left None
2 Middle None
3 Right None
4 None Left
5 Left Left
6 Middle Left
7 Right Left
8 None Middle
9 Left Middle
10 Middle Middle
11 Right Middle
12 None Right
13 Left Right
14 Middle Right
15 Right Right

In this version of Visual FoxPro, the Resname field has been added for images selected in the Menu Designer. For detail structure information, see structures of tables, including database (.dbc), form (.scx), label (.lbx), project (.pjx), report (.frx), and visual class library (.vcx) tables in Help.

CommandTargetExec and CommandTargetQuery Events

Two Active Document events, CommandTargetExec and CommandTargetQuery, make it possible for you to manage Internet Explorer menu selections (and other Internet Explorer events) from an Active Document. The CommandTargetExec event occurs when Internet Explorer notifies an Active Document of a command (including a menu command) to be executed. The CommandTargetQuery event occurs when Internet Explorer updates its user interface. The CommandTargetExec event is passed a value of 10 when an Active Document is hosted in Internet Explorer 4.0 and you choose Properties from the File menu. Return a value of 0 from the CommandTargetExec event to suppress display of the About Microsoft Visual FoxPro Runtime dialog box or to display your own dialog box. See CommandTargetExec Event and CommandTargetQuery Event for more information about each event.

See Also

Forms in Active Documents | Running Active Documents | Interoperability and the Internet | Active Documents | Prompt Options | Active Document Security | Running an Active Document Sample