A menu is a FormMenuDefinition with FormName and Items. Each FormMenuItem has Id, Label, Shortcut, Kind, CommandName, BlockName and Children.

FormMenuItemKind is BuiltIn, MenuItemTrigger, CallForm, Separator or Submenu.

Built in commands

Names are not case sensitive.

CommandNameAction
ExecuteQueryRun the query
EnterQueryEnter query mode
Commit, CommitFormCommit
Rollback, RollbackFormRollback
ClearFormCloseFormAsync
NextRecord, PreviousRecord, FirstRecord, LastRecordRecord navigation
CreateRecord, InsertRecordNew record
DeleteRecordDelete record
ExitFormCloseFormAsync

Any other name gives the error "Menu item command 'x' is not a known built-in."

Running and reading menus

IFormMenuManager has RegisterMenu, GetMenu, FindItem and the event MenuChanged. InvokeMenuItemAsync(itemId) runs an item. An unknown id gives "No menu item 'id' is registered." A MenuItemTrigger item fires the WhenMenuItem trigger.

In the WinForms host

FormDefinition.Menu is the design time menu. The WinForms host draws it in a BeepMenuBar exposed as MenuBar, and RefreshMenu() redraws it. MergeMenuIntoShell, UnmergeMenuFromShell and FormMenuShellAdapter support merging into a shell menu.