W$MENU
The W$MENU library routine provides a number of functions to manage menus.
Note - Every call to W$MENU performed before the first WMENU-SHOW is buffered and doesn’t update the video. Every call to W$MENU performed after the first WMENU-SHOW immediately updates the video and therefore it might affect performance.
Syntax:
 CALL "W$MENU" USING opCode
                     parameters
              GIVING returnCode
Parameters:
opCode
Function to be executed. Valid values, defined in isgui.def, are:
 
 
Add an item to an existing menu
 
Display a bitmap in front of a menu item
 
Inhibits the user from using the menu menu
 
Modify a menu item
 
Modify the bitmap shown in front of a menu item
 
Show a check mark beside a menu item
 
Delete a menu item
 
Delete a bitmap displayed in front of a menu item
 
Destroy a menu and remove it from the screen
 
Mark a menu, so that it will be destroyed later
 
Disable a menu item
 
Enable a menu item previously disabled
 
Expands the necessary menus in order to show a given menu item
 
Gets the menu blocking count
 
Get the handle of the current menu
 
Create a new menu bar
 
Create a new hamburger menu
 
Create a new pop-up menu
 
Create a new tray icon with menu
 
Display a pop-up menu
 
Logically destroy the current menu, without updating the screen
 
Sets attributes for the menu bar
 
Sets the menu blocking count
 
Display a menu on the screen
 
Re-enables the user to use the menu menu
 
Remove a check mark shown beside a menu item
parameters
Parameters depend on the opcode.
Return code:
returnCode definition and meaning depend on the opcode.
Examples:
Example - Building a whole menu with options, sub-options and icons to some sub-options
77  h-img                   pic s9(9comp-4.
 
78  mnu-new                 value 101.
78  mnu-open                value 102.
78  mnu-save                value 103.
78  mnu-cut                 value 201.
78  mnu-copy                value 202.
78  mnu-paste               value 203.
 
procedure division.
main.
  perform build-menu
  ...
 
build-menu.
  call "w$bitmap" using wbitmap-load, "files/icone-menu.gif",
                          giving h-img
 
  call "w$menu" using wmenu-new giving menu-handle
 
  call "w$menu" using wmenu-new giving sub-handle-1
           
  call "w$menu" using wmenu-add, menu-handle, 00,
                               "&File"0, sub-handle-1
  call "w$menu" using wmenu-add, sub-handle-1, 00,
                               "&New", mnu-new
  call "w$menu" using wmenu-add-bitmap 
                               menu-handle mnu-new h-img 3 24
  call "w$menu" using wmenu-add, sub-handle-1, 00,
                               "&Open", mnu-open
  call "w$menu" using wmenu-add-bitmap 
                               menu-handle mnu-open h-img 2 24
  call "w$menu" using wmenu-add, sub-handle-1, 00,
                               "&Save", mnu-save
  call "w$menu" using wmenu-add-bitmap 
                               menu-handle mnu-save h-img 5 24
  call "w$menu" using wmenu-add, sub-handle-1, 0, w-separator
           call "w$menu" using wmenu-add, sub-handle-1, 00,
  "E&xit"27
 
 
  call "w$menu" using wmenu-new giving sub-handle-2
 
  call "w$menu" using wmenu-add, menu-handle, 00,
                               "&Edit"0, sub-handle-2
  call "w$menu" using wmenu-add, sub-handle-2, 00,
                               "&Cut", mnu-cut
  call "w$menu" using wmenu-add-bitmap 
                               menu-handle mnu-cut h-img 1 24
  call "w$menu" using wmenu-add, sub-handle-2, 00,
                               "&Copy", mnu-copy
  call "w$menu" using wmenu-add-bitmap 
                               menu-handle mnu-copy h-img 4 24
  call "w$menu" using wmenu-add, sub-handle-2, 00,
                               "&Paste", mnu-paste
  call "w$menu" using wmenu-add-bitmap 
                               menu-handle mnu-paste h-img 6 24
  call "w$menu" using wmenu-add, sub-handle-2, 0, w-separator
  call "w$menu" using wmenu-add, sub-handle-2, 0, w-disabled,
                               " w-disabled"70
  call "w$menu" using wmenu-add, sub-handle-2, 0, w-checked,
                               " w-checked"80
  .