Menu exampleΒΆ
This example shows a typical menu. The underlined letters in the menu item labels are the hotkeys for those options. The Exit item has not been given a hotkey.
The Find option in the main menu bar has been selected. This option opens up a submenu for the user to choose from. The option Find by Ref has been highlighted in this submenu. A left-click with the mouse will select this option.
The arrow to the right of the Find by Name option indicates that the option is itself a menu. Selecting this option will open a further submenu.
The Find by Fax option in the submenu and the Delete option in the main menu are currently disabled and cannot be selected.
The line between the Find by Tel and Find by Fax options is created by the menuline clause.
The code which would produce this menu is shown below.
+window wintask at 1,1 {
max_width = 55
max_height = 10
title = "EXAMPLE MENU PROGRAM"
menu NAMenu {
menuitem NA_Find {
label = "&Find"
menuitem NA_FindName {
label = "Find by &Name"
menuitem NA_FirstName {
label = "&First Name"
select = FindFName
}
menuitem NA_SurName {
label = "&Surname"
select = FindSName
}
}
menuitem NA_FindAdd {
label = "Find by &Address"
select = FindAdd
}
menuitem NA_FindRef {
label = "Find by &Ref"
select = FindRef
}
menuitem NA_FindTel{
label = "Find by &Tel"
select = FindTel
}
menuline
menuitem NA_FindFax {
label = "Find by &Fax"
style = WS_DISABLED
select = FindFax
}
menuitem NA_FindDate {
label = "Find by &Date"
select = FindDate
}
}
menuitem NA_Next {
label = "&Next"
select = NextRec
}
...
menuitem NA_Del {
label = "&Delete"
style = WS_DISABLED
select = Delrec
}
menuitem NA_Exit {
label = "Exit"
select = ExitProg
}
}
RELATED TOPICS |