WinXNewMenu


hMenu = WinXNewMenu (STRING menu, firstID, isPopup)

Generates anew menu.

Parameter Description
STRING menu A string listing the menu items in the order they appear in the final menu
firstID The id of the first menu item
isPopup $$TRUE if this is a popup menu, $$FALSE if it is the main menu for a window.

Returns

The handle to the menu (which is a standard windows menu handle), or 0 on fail

Remarks

This command does not allow you to add sub menus. To add sub menus: call this function to generate each of the sub menus, then use WinXMenu_Attach function to attach the sub menus to the appropriate menu items.

The menu parameter is a list of menu items, seperated by commas. To add a seperator, use two commas with only whitespace inside them. If you prefix a character with the ampersand (&), that character will be underlined when the user presses alt. The user can then press the approprite key to jump to that menu item. To include literal ampersands, use &&.

WinXNewMenu assigns ids to the menus items sequentially. The first item gets the id firstID, the second gets firstID+1 etc. When a menu item is clicked, the onCommand callback is invoked (assuming it has been properly registered). The id parameter will be the id of the menu item.

Examples

'define ids for the menu items
$$ID_FILE =100
$$ID_EDIT = 101
$$ID_VIEW = 102
$$ID_HELP =103

WinXNewMenu ("&File, &Edit, &View, &Help", $$ID_FILE)

Related Links

WinXMenu_Attach