home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / wps / editor / epmtools / epmmac / stdmenu.e < prev    next >
Encoding:
Text File  |  1993-06-17  |  36.4 KB  |  613 lines

  1. compile if not defined(CORE_stuff)
  2. ; This determines whether the CORE-specific commands (DEFINE)
  3. ; are included in the menus.
  4.    const CORE_STUFF=0
  5. compile endif
  6. include 'menuhelp.H'
  7.  
  8. /*
  9. ┌─────────────────────────────────────────────────────────────────────────────┐
  10. │What's it called  : loaddefaultmenu                                          │
  11. │                                                                             │
  12. │What does it do   : used by stdcnf.e to setup default EPM action bar         │
  13. │                    (Note: a menu id of 0 halts the interpreter when         │
  14. │                     selected.)                                              │
  15. │                                                                             │
  16. │Who and When      : Jerry C.     2/25/89                                     │
  17. └─────────────────────────────────────────────────────────────────────────────┘
  18. */
  19.  
  20. defc loaddefaultmenu
  21.    universal activemenu,defaultmenu
  22.  
  23.    parse arg menuname .
  24.    if menuname = '' then                  -- Initialization call
  25.       menuname = 'default'
  26.       defaultmenu = menuname              -- default menu name
  27.       activemenu  = defaultmenu
  28.    endif
  29.  
  30. compile if EPATH='LAMPATH'  -- LaMail sets up a mail menu first.
  31. defc loaddefaultmenu2
  32.    universal activemenu,defaultmenu
  33.    menuname = defaultmenu
  34. compile endif
  35. compile if EVERSION < 5.20  -- 5.20 doesn't run on earlier versions of OS/2; no need to check.
  36.    one_two = dos_version()>=1020
  37. compile endif
  38.    call add_file_menu(menuname)
  39.    call add_edit_menu(menuname)
  40.    call add_search_menu(menuname)
  41. compile if EVERSION < 5.20
  42.    call add_options_menu(menuname, one_two)
  43. compile else
  44.    call add_options_menu(menuname)
  45. compile endif
  46. compile if MENU_LIMIT
  47.    call add_ring_menu(menuname)
  48. compile endif
  49.    call add_command_menu(menuname)
  50. compile if EPATH<>'LAMPATH'  -- LaMail puts a VM menu here, then adds help.
  51.  compile if EVERSION < 5.20
  52.    call add_help_menu(menuname, one_two)
  53.  compile else
  54.    call add_help_menu(menuname)
  55.  compile endif
  56. compile endif
  57. compile if EVERSION >= 5.60
  58.    buildsubmenu  'SYSMENU', 81, '', '', 0 , 0
  59.      buildmenuitem 'SYSMENU', 81, 8100, \0,               '',                 4, 0
  60.      buildmenuitem 'SYSMENU', 81, 8101, CONFIG_MENU__MSG, 'configdlg SYS'CONFIG_MENUP__MSG,  0, mpfrom2short(HP_OPTIONS_CONFIG, 0)
  61.    showmenu 'SYSMENU',2
  62. compile endif
  63.  
  64. defproc add_file_menu(menuname)
  65. compile if RING_OPTIONAL
  66.    universal ring_enabled
  67. compile endif
  68.    buildsubmenu menuname, 2, FILE_BAR__MSG, FILE_BARP__MSG, 0 , mpfrom2short(HP_FILE, 0)
  69.      buildmenuitem menuname, 2, 198, NEW_MENU__MSG,            'NEW'NEW_MENUP__MSG,     0, mpfrom2short(HP_FILE_NEW, 0)
  70.      buildmenuitem menuname, 2, 199, OPEN_NEW_MENU__MSG,       'OPEN'OPEN_NEW_MENUP__MSG,     0, mpfrom2short(HP_FILE_OPEN_NEW, 0)
  71.      buildmenuitem menuname, 2, 200, OPEN_MENU__MSG\9 || CTRL_KEY__MSG'+O', 'OPENDLG'OPEN_MENUP__MSG,          0, mpfrom2short(HP_FILE_OPEN, 0)
  72.      buildmenuitem menuname, 2, 201, GET_MENU__MSG,            'OPENDLG GET'GET_MENUP__MSG,      0, mpfrom2short(HP_FILE_GET , 0)
  73. compile if RING_OPTIONAL
  74.    if ring_enabled then
  75. compile endif
  76.      buildmenuitem menuname, 2, 202, ADD_MENU__MSG\9'F8', 'OPENDLG EDIT'ADD_MENUP__MSG,     0, mpfrom2short(HP_FILE_EDIT, 0)
  77. compile if RING_OPTIONAL
  78.    endif
  79. compile endif
  80.      buildmenuitem menuname, 2, 203, \0,                          '',                 4, 0
  81.      buildmenuitem menuname, 2, 204, RENAME_MENU__MSG\9'F7',   'rename'RENAME_MENUP__MSG,0, mpfrom2short(HP_FILE_NAME, 0)
  82.      buildmenuitem menuname, 2, 205, \0,                          '',                 4, 0
  83.      buildmenuitem menuname, 2, 206, SAVE_MENU__MSG\9'F2',     'SAVE'SAVE_MENUP__MSG,             0, mpfrom2short(HP_FILE_SAVE, 0)
  84. compile if EVERSION >= '5.21'
  85.      buildmenuitem menuname, 2, 208, SAVEAS_MENU__MSG,         'SAVEAS_DLG'SAVEAS_MENUP__MSG, 0, mpfrom2short(HP_FILE_SAVEAS, 0)
  86. compile endif
  87. compile if RING_OPTIONAL
  88.    if ring_enabled then
  89. compile endif         -- Note:  207 used in LaMail; keep ID the same.
  90.      buildmenuitem menuname, 2, 207, FILE_MENU__MSG\9'F4',     'FILE'FILE_MENUP__MSG,             0, mpfrom2short(HP_FILE_FILE, 0)
  91. compile if RING_OPTIONAL
  92.    else
  93.      buildmenuitem menuname, 2, 207, SAVECLOSE_MENU__MSG\9'F4',     'FILE'FILE_MENUP__MSG,        0, mpfrom2short(HP_FILE_FILE, 0)
  94.    endif
  95. compile endif
  96.      buildmenuitem menuname, 2, 209, QUIT_MENU__MSG\9'F3',     'QUIT'QUIT_MENUP__MSG,             0, mpfrom2short(HP_FILE_QUIT, 0)
  97.      buildmenuitem menuname, 2, 210, \0,                           '',                 4, 0
  98. compile if ENHANCED_PRINT_SUPPORT
  99.      buildmenuitem menuname, 2, 211, PRT_FILE_MENU__MSG'...',  'printdlg'ENHPRT_FILE_MENUP__MSG,         0, mpfrom2short(HP_FILE_ENHPRINT, 0)
  100. compile elseif EVERSION < '5.50'
  101.      buildmenuitem menuname, 2, 211, PRT_FILE_MENU__MSG,       'xcom save' default_printer()PRT_FILE_MENUP__MSG,   0, mpfrom2short(HP_FILE_PRINT, 0)
  102. compile else
  103.      buildmenuitem menuname, 2, 211, PRT_FILE_MENU__MSG,       'xcom save /ne' default_printer()PRT_FILE_MENUP__MSG,   0, mpfrom2short(HP_FILE_PRINT, 0)
  104. compile endif
  105.    return
  106.  
  107. define
  108.    PASTE_C_KEY = ''
  109.    PASTE_B_KEY = ''
  110.    PASTE_L_KEY = ''
  111. compile if DEFAULT_PASTE = ''
  112.    PASTE_L_KEY = \9 || SHIFT_KEY__MSG'+'INSERT_KEY__MSG
  113. compile elseif DEFAULT_PASTE = 'B'
  114.    PASTE_B_KEY = \9 || SHIFT_KEY__MSG'+'INSERT_KEY__MSG
  115. compile elseif DEFAULT_PASTE = 'C'
  116.    PASTE_C_KEY = \9 || SHIFT_KEY__MSG'+'INSERT_KEY__MSG
  117. compile else
  118.    * Error:  DEFAULT_PASTE must be '', 'B', or 'C'
  119. compile endif
  120.  
  121. compile if not defined(MAIL_ACCEL__L)  -- LaMail not NLS-translated.
  122.   const MAIL_ACCEL__L = 'M'
  123. compile endif
  124. define  -- Prepare for some conditional tests
  125. compile if EPATH = 'LAMPATH'  -- If LaMail, "Mail" will be on action bar
  126.    maybe_mail_accel = 'MAIL_ACCEL__L <>'
  127. compile else                  -- otherwise, it won't
  128.    maybe_mail_accel = "' ' <"    -- Will be true for any letter
  129. compile endif
  130. compile if MENU_LIMIT
  131.    maybe_ring_accel = 'RING_ACCEL__L <>'
  132. compile else
  133.    maybe_ring_accel = "' ' <"  -- Will be true for any letter
  134. compile endif
  135. compile if defined(ACTIONS_ACCEL__L)  -- For CUSTEPM support
  136.    maybe_actions_accel = 'ACTIONS_ACCEL__L <>'
  137. compile else
  138.    maybe_actions_accel = "' ' <"  -- Will be true for any letter
  139. compile endif
  140.  
  141. defproc add_edit_menu(menuname)
  142.  compile if WANT_STACK_CMDS = 'SWITCH'
  143.    universal stack_cmds
  144.  compile endif
  145.  compile if BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  146.    universal CUA_MENU_ACCEL
  147.  compile endif
  148.  
  149. compile if BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  150.    accel_len = (3+length(ALT_KEY__MSG))*(not CUA_MENU_ACCEL)
  151. compile endif
  152.  
  153.    buildsubmenu  menuname, 8, EDIT_BAR__MSG, ''EDIT_BARP__MSG, 0 , mpfrom2short(HP_EDIT, 0)
  154.      buildmenuitem menuname, 8, 816, UNDO_MENU__MSG\9 || ALT_KEY__MSG'+'BACKSPACE_KEY__MSG,   'UNDO 1'UNDO_MENUP__MSG,    0, mpfrom2short(HP_EDIT_UNDO, 0)
  155. compile if EVERSION > 5.19
  156.      buildmenuitem menuname, 8, 818, UNDO_REDO_MENU__MSG\9 || CTRL_KEY__MSG'+U', 'undodlg'UNDO_REDO_MENUP__MSG,      0, mpfrom2short(HP_EDIT_UNDOREDO, 0)
  157. compile endif
  158. compile if WANT_DM_BUFFER
  159.      buildmenuitem menuname, 8, 817, RECOVER_MARK_MENU__MSG,        'GetDMBuff'RECOVER_MARK_MENUP__MSG,    0, mpfrom2short(HP_EDIT_RECOVER, 0)
  160. compile endif  -- WANT_DM_BUFFER
  161.      buildmenuitem menuname, 8, 807, \0,                               '',          4, 0
  162.      buildmenuitem menuname, 8, 808, CLIP_COPY_MENU__MSG\9 || CTRL_KEY__MSG'+'INSERT_KEY__MSG ,  'Copy2Clip'CLIP_COPY_MENUP__MSG, 0, mpfrom2short(HP_EDIT_COPY, 0)
  163.      buildmenuitem menuname, 8, 809, CUT_MENU__MSG\9 || SHIFT_KEY__MSG'+'DELETE_KEY__MSG, 'Cut'CUT_MENUP__MSG,       0, mpfrom2short(HP_EDIT_CUT, 0)
  164.      buildmenuitem menuname, 8, 810, PASTE_C_MENU__MSG||PASTE_C_KEY,   'Paste C'PASTE_C_MENUP__MSG,   0, mpfrom2short(HP_EDIT_PASTEC, 0)
  165.      buildmenuitem menuname, 8, 811, PASTE_L_MENU__MSG||PASTE_L_KEY,   'Paste'PASTE_L_MENUP__MSG,     0, mpfrom2short(HP_EDIT_PASTE, 0)
  166.      buildmenuitem menuname, 8, 812, PASTE_B_MENU__MSG||PASTE_B_KEY,   'Paste B'PASTE_B_MENUP__MSG,   0, mpfrom2short(HP_EDIT_PASTEB, 0)
  167. compile if EVERSION >= 5.50  -- In 5.50, we have a STYLE attribute
  168.      buildmenuitem menuname, 8, 826, \0,                               '',          4, 0
  169.      buildmenuitem menuname, 8, 827, STYLE_MENU__MSG\9 || CTRL_KEY__MSG'+Y',        'fontlist'STYLE_MENUP__MSG,    0, mpfrom2short(HP_OPTIONS_STYLE, 0)
  170. compile endif
  171.      buildmenuitem menuname, 8, 815, \0,                               '',          4, 0
  172.  
  173. compile if BLOCK_ACTIONBAR_ACCELERATORS=1 | (FILE_ACCEL__L<>'C' & EDIT_ACCEL__L<>'C' & SEARCH_ACCEL__L<>'C' & OPTIONS_ACCEL__L<>'C' & COMMAND_ACCEL__L<>'C' & HELP_ACCEL__L<>'C' & $maybe_mail_accel 'C' & $maybe_ring_accel 'C' & $maybe_actions_accel 'C')
  174.      buildmenuitem menuname, 8, 800, COPY_MARK_MENU__MSG\9 || ALT_KEY__MSG'+C',     'DUPMARK C'COPY_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_COPYMARK, 0)
  175. compile elseif BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  176.      buildmenuitem menuname, 8, 800, COPY_MARK_MENU__MSG||leftstr(\9 || ALT_KEY__MSG'+C', accel_len),     'DUPMARK C'COPY_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_COPYMARK, 0)
  177. compile else
  178.      buildmenuitem menuname, 8, 800, COPY_MARK_MENU__MSG,              'DUPMARK C'COPY_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_COPYMARK, 0)
  179. compile endif
  180. compile if BLOCK_ACTIONBAR_ACCELERATORS=1 | (FILE_ACCEL__L<>'M' & EDIT_ACCEL__L<>'M' & SEARCH_ACCEL__L<>'M' & OPTIONS_ACCEL__L<>'M' & COMMAND_ACCEL__L<>'M' & HELP_ACCEL__L<>'M' & $maybe_mail_accel 'M' & $maybe_ring_accel 'M' & $maybe_actions_accel 'M')
  181.      buildmenuitem menuname, 8, 801, MOVE_MARK_MENU__MSG\9 || ALT_KEY__MSG'+M',     'DUPMARK M'MOVE_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_MOVE, 0)
  182. compile elseif BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  183.      buildmenuitem menuname, 8, 801, MOVE_MARK_MENU__MSG||leftstr(\9 || ALT_KEY__MSG'+M', accel_len),     'DUPMARK M'MOVE_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_MOVE, 0)
  184. compile else
  185.      buildmenuitem menuname, 8, 801, MOVE_MARK_MENU__MSG,     'DUPMARK M'MOVE_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_MOVE, 0)
  186. compile endif
  187. compile if BLOCK_ACTIONBAR_ACCELERATORS=1 | (FILE_ACCEL__L<>'O' & EDIT_ACCEL__L<>'O' & SEARCH_ACCEL__L<>'O' & OPTIONS_ACCEL__L<>'O' & COMMAND_ACCEL__L<>'O' & HELP_ACCEL__L<>'O' & $maybe_mail_accel 'O' & $maybe_ring_accel 'O' & $maybe_actions_accel 'O')
  188.      buildmenuitem menuname, 8, 802, OVERLAY_MARK_MENU__MSG\9 || ALT_KEY__MSG'+O',  'DUPMARK O'OVERLAY_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_OVERLAY, 0)
  189. compile elseif BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  190.      buildmenuitem menuname, 8, 802, OVERLAY_MARK_MENU__MSG||leftstr(\9 || ALT_KEY__MSG'+O', accel_len),  'DUPMARK O'OVERLAY_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_OVERLAY, 0)
  191. compile else
  192.      buildmenuitem menuname, 8, 802, OVERLAY_MARK_MENU__MSG,  'DUPMARK O'OVERLAY_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_OVERLAY, 0)
  193. compile endif
  194. compile if BLOCK_ACTIONBAR_ACCELERATORS=1 | (FILE_ACCEL__L<>'A' & EDIT_ACCEL__L<>'A' & SEARCH_ACCEL__L<>'A' & OPTIONS_ACCEL__L<>'A' & COMMAND_ACCEL__L<>'A' & HELP_ACCEL__L<>'A' & $maybe_mail_accel 'A' & $maybe_ring_accel 'A' & $maybe_actions_accel 'A')
  195.      buildmenuitem menuname, 8, 803, ADJUST_MARK_MENU__MSG\9 || ALT_KEY__MSG'+A',   'DUPMARK A'ADJUST_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_ADJUST, 0)
  196. compile elseif BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  197.      buildmenuitem menuname, 8, 803, ADJUST_MARK_MENU__MSG||leftstr(\9 || ALT_KEY__MSG'+A', accel_len),   'DUPMARK A'ADJUST_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_ADJUST, 0)
  198. compile else
  199.      buildmenuitem menuname, 8, 803, ADJUST_MARK_MENU__MSG,   'DUPMARK A'ADJUST_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_ADJUST, 0)
  200. compile endif
  201.      buildmenuitem menuname, 8, 804, \0,                       '',          4, 0
  202. compile if BLOCK_ACTIONBAR_ACCELERATORS=1 | (FILE_ACCEL__L<>'U' & EDIT_ACCEL__L<>'U' & SEARCH_ACCEL__L<>'U' & OPTIONS_ACCEL__L<>'U' & COMMAND_ACCEL__L<>'U' & HELP_ACCEL__L<>'U' & $maybe_mail_accel 'U' & $maybe_ring_accel 'U' & $maybe_actions_accel 'U')
  203.      buildmenuitem menuname, 8, 805, UNMARK_MARK_MENU__MSG\9 || ALT_KEY__MSG'+U',   'DUPMARK U'UNMARK_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_UNMARK, 0)
  204. compile elseif BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  205.      buildmenuitem menuname, 8, 805, UNMARK_MARK_MENU__MSG||leftstr(\9 || ALT_KEY__MSG'+U', accel_len),   'DUPMARK U'UNMARK_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_UNMARK, 0)
  206. compile else
  207.      buildmenuitem menuname, 8, 805, UNMARK_MARK_MENU__MSG,   'DUPMARK U'UNMARK_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_UNMARK, 0)
  208. compile endif
  209. compile if BLOCK_ACTIONBAR_ACCELERATORS=1 | (FILE_ACCEL__L<>'D' & EDIT_ACCEL__L<>'D' & SEARCH_ACCEL__L<>'D' & OPTIONS_ACCEL__L<>'D' & COMMAND_ACCEL__L<>'D' & HELP_ACCEL__L<>'D' & $maybe_mail_accel 'D' & $maybe_ring_accel 'D' & $maybe_actions_accel 'D')
  210.      buildmenuitem menuname, 8, 806, DELETE_MARK_MENU__MSG\9 || ALT_KEY__MSG'+D',   'DUPMARK D'DELETE_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_DELETE, 0)
  211. compile elseif BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  212.      buildmenuitem menuname, 8, 806, DELETE_MARK_MENU__MSG||leftstr(\9 || ALT_KEY__MSG'+D', accel_len),   'DUPMARK D'DELETE_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_DELETE, 0)
  213. compile else
  214.      buildmenuitem menuname, 8, 806, DELETE_MARK_MENU__MSG,   'DUPMARK D'DELETE_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_DELETE, 0)
  215. compile endif
  216.  
  217. compile if WANT_STACK_CMDS
  218.  compile if WANT_STACK_CMDS = 'SWITCH'
  219.    if stack_cmds then
  220.  compile endif
  221.      buildmenuitem menuname, 8, 819, \0,                               '',          4, 0
  222.      buildmenuitem menuname, 8, 820, PUSH_MARK_MENU__MSG,              'PUSHMARK'PUSH_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_PUSHMARK, 0)
  223.      buildmenuitem menuname, 8, 821, POP_MARK_MENU__MSG,               'POPMARK'POP_MARK_MENUP__MSG,  0, mpfrom2short(HP_EDIT_POPMARK, 16384)
  224.      buildmenuitem menuname, 8, 822, SWAP_MARK_MENU__MSG,              'SWAPMARK'SWAP_MARK_MENUP__MSG,  0, mpfrom2short(HP_EDIT_SWAPMARK, 16384)
  225.      buildmenuitem menuname, 8, 823, PUSH_CURSOR_MENU__MSG,            'PUSHPOS'PUSH_CURSOR_MENUP__MSG,  0, mpfrom2short(HP_EDIT_PUSHPOS, 0)
  226.      buildmenuitem menuname, 8, 824, POP_CURSOR_MENU__MSG,             'POPPOS'POP_CURSOR_MENUP__MSG,   0, mpfrom2short(HP_EDIT_POPPOS, 16384)
  227.      buildmenuitem menuname, 8, 825, SWAP_CURSOR_MENU__MSG,            'SWAPPOS'SWAP_CURSOR_MENUP__MSG,   0, mpfrom2short(HP_EDIT_SWAPPOS, 16384)
  228.  compile if WANT_STACK_CMDS = 'SWITCH'
  229.    endif
  230.  compile endif
  231. compile endif
  232.      buildmenuitem menuname, 8, 813, \0,                               '',          4, 0
  233. compile if ENHANCED_PRINT_SUPPORT
  234.      buildmenuitem menuname, 8, 814, PRT_MARK_MENU__MSG'...',          'PRINTDLG M'ENHPRT_MARK_MENUP__MSG,0, mpfrom2short(HP_EDIT_ENHPRINT, 0)
  235. compile else
  236.      buildmenuitem menuname, 8, 814, PRT_MARK_MENU__MSG,               'DUPMARK P'PRT_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_PRINT, 0)
  237. compile endif
  238.    return
  239.  
  240. defproc add_search_menu(menuname)
  241.    buildsubmenu menuname, 3, SEARCH_BAR__MSG, ''SEARCH_BARP__MSG, 0 , mpfrom2short(HP_SEARCH, 0)
  242.      buildmenuitem menuname, 3, 300, SEARCH_MENU__MSG\9 || CTRL_KEY__MSG'+S',      'SEARCHDLG'SEARCH_MENUP__MSG,   0, mpfrom2short(HP_SEARCH_SEARCH, 0)
  243.      buildmenuitem menuname, 3, 301, \0,                           '',            4, 0
  244.      buildmenuitem menuname, 3, 302, FIND_NEXT_MENU__MSG\9 || CTRL_KEY__MSG'+F',   'SEARCHDLG F'FIND_NEXT_MENUP__MSG, 0, mpfrom2short(HP_SEARCH_FIND, 0)
  245.      buildmenuitem menuname, 3, 303, CHANGE_NEXT_MENU__MSG\9 || CTRL_KEY__MSG'+C', 'SEARCHDLG C'CHANGE_NEXT_MENUP__MSG, 0, mpfrom2short(HP_SEARCH_CHANGE, 0)
  246. compile if WANT_BOOKMARKS
  247.      buildmenuitem menuname, 3, 304, \0,                           '',            4, 0
  248.      buildmenuitem menuname, 3, 305, BOOKMARKS_MENU__MSG,   BOOKMARKS_MENUP__MSG, 17, mpfrom2short(HP_SEARCH_BOOKMARKS, 0)
  249.        buildmenuitem menuname, 3, 306, SET_MARK_MENU__MSG\9 || CTRL_KEY__MSG'+M',  'setmark'SET_MARK_MENUP__MSG, 0, mpfrom2short(HP_SEARCH_BOOKMARKS, 0)
  250.  compile if EVERSION < 5.21  -- 5.21 adds a custom dialog for setting bookmarks
  251.        buildmenuitem menuname, 3, 307, '~Set permanent...', 'setmarkp',       0, 0
  252.  compile endif
  253.        buildmenuitem menuname, 3, 308, LIST_MARK_MENU__MSG\9 || CTRL_KEY__MSG'+B', 'listmark'LIST_MARK_MENUP__MSG,       0, mpfrom2short(HP_SEARCH_BOOKMARKS, 0)
  254.        buildmenuitem menuname, 3, 310, \0,                  '',               4, 0
  255.        buildmenuitem menuname, 3, 311, NEXT_MARK_MENU__MSG\9 || ALT_KEY__MSG'+/',  'nextbookmark'NEXT_MARK_MENUP__MSG, 0, mpfrom2short(HP_SEARCH_BOOKMARKS, 0)
  256.        buildmenuitem menuname, 3, 312, PREV_MARK_MENU__MSG\9 || ALT_KEY__MSG'+\',  'nextbookmark P'PREV_MARK_MENUP__MSG, 32768+1, mpfrom2short(HP_SEARCH_BOOKMARKS, 0)
  257. compile endif
  258. compile if WANT_TAGS
  259.      buildmenuitem menuname, 3, 313, \0,                           '',            4, 0
  260.      buildmenuitem menuname, 3, 314, TAGS_MENU__MSG,   TAGS_MENUP__MSG, 17, mpfrom2short(HP_SEARCH_TAGS, 0)
  261.        buildmenuitem menuname, 3, 315, FIND_TAG_MENU__MSG\9 || SHIFT_KEY__MSG'+F6',  'findtag'FIND_TAG_MENUP__MSG, 0, mpfrom2short(HP_SEARCH_TAGS, 0)
  262.        buildmenuitem menuname, 3, 316, FIND_TAG2_MENU__MSG\9 || SHIFT_KEY__MSG'+F7', 'findtag *'FIND_TAG2_MENUP__MSG, 0, mpfrom2short(HP_SEARCH_TAGS, 0)
  263.        buildmenuitem menuname, 3, 317, \0,                  '',               4, 0
  264.        buildmenuitem menuname, 3, 318, TAGFILE_NAME_MENU__MSG\9 || SHIFT_KEY__MSG'+F8',  'tagsfile'TAGFILE_NAME_MENUP__MSG, 0, mpfrom2short(HP_SEARCH_TAGS, 0)
  265.        buildmenuitem menuname, 3, 317, \0,                  '',               4, 0
  266.        buildmenuitem menuname, 3, 319, MAKE_TAGS_MENU__MSG\9 || SHIFT_KEY__MSG'+F9',  'maketags *'MAKE_TAGS_MENUP__MSG, 32768+1, mpfrom2short(HP_SEARCH_TAGS, 0)
  267. compile endif
  268.    return
  269.  
  270. ; Preferences pull-right can get Set enter, Advanced mark, Stream mode, and
  271. ; Ring enabled, in addition to Configure.  Here we calculate which menu item
  272. ; gets the "end pullright" attribute.
  273. define
  274.     NEED_PREFERENCES = 1  -- Start out assuming this
  275.  compile if BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  276.    ENTER__ATTRIB  = 0
  277.    MARK__ATTRIB   = 0
  278.    STREAM__ATTRIB = 0
  279.    RING__ATTRIB   = 0
  280.    STACK__ATTRIB  = 0
  281.    ACCEL__ATTRIB  = 32769
  282.  compile elseif WANT_STACK_CMDS = 'SWITCH'
  283.    ENTER__ATTRIB  = 0
  284.    MARK__ATTRIB   = 0
  285.    STREAM__ATTRIB = 0
  286.    RING__ATTRIB   = 0
  287.    STACK__ATTRIB  = 32769
  288.  compile elseif RING_OPTIONAL
  289.    ENTER__ATTRIB  = 0
  290.    MARK__ATTRIB   = 0
  291.    STREAM__ATTRIB = 0
  292.    RING__ATTRIB   = 32769
  293.  compile elseif WANT_STREAM_MODE = 'SWITCH'
  294.    ENTER__ATTRIB  = 0
  295.    MARK__ATTRIB   = 0
  296.    STREAM__ATTRIB = 32769
  297.  compile elseif WANT_CUA_MARKING = 'SWITCH'
  298.    ENTER__ATTRIB  = 0
  299.    MARK__ATTRIB   = 32769
  300.  compile elseif ENHANCED_ENTER_KEYS & WANT_STREAM_MODE <> 1 & EVERSION < 5.21  -- 5.21 adds this to config dialog
  301.    ENTER__ATTRIB  = 32769
  302.  compile else
  303.     NEED_PREFERENCES = 0  -- If none of the above, we don't need this after all
  304.  compile endif
  305.  compile if EVERSION < '5.50'
  306.     TOGGLEINFO = 'toggle_info'
  307.  compile elseif EVERSION < '5.53'
  308.     TOGGLEINFO = 'togglecontrol 23'
  309.  compile else
  310.     TOGGLEINFO = 'toggleframe 32'
  311.  compile endif
  312.  
  313. compile if WANT_NODISMISS_MENUS
  314.    define
  315.       NODISMISS = 32
  316. compile else
  317.    define
  318.       NODISMISS = 0
  319. compile endif -- WANT_NODISMISS_MENUS
  320.  
  321. compile if EVERSION < 5.20
  322. defproc add_options_menu(menuname,one_two)
  323. compile else
  324. defproc add_options_menu(menuname)
  325. compile endif
  326. compile if RING_OPTIONAL
  327.    universal ring_enabled
  328. compile endif
  329.    universal font
  330. compile if CHECK_FOR_LEXAM
  331.    universal LEXAM_is_available
  332. compile endif
  333.  
  334.    buildsubmenu menuname, 4, OPTIONS_BAR__MSG, OPTIONS_BARP__MSG, 0 , mpfrom2short(HP_OPTIONS, 0)
  335. compile if MENU_LIMIT = 0
  336.  compile if RING_OPTIONAL
  337.    if ring_enabled then
  338.  compile endif
  339.      buildmenuitem menuname, 4, 410, LIST_FILES_MENU__MSG\9 || CTRL_KEY__MSG'+G',     'Ring_More'LIST_FILES_MENUP__MSG,  0 , mpfrom2short(HP_OPTIONS_LIST, 0)
  340.      buildmenuitem menuname, 4, 411, \0,                       '',           4, 0
  341.  compile if RING_OPTIONAL
  342.    endif
  343.  compile endif
  344. compile endif
  345. compile if IBM_IUO & SPELL_SUPPORT
  346.  compile if CHECK_FOR_LEXAM
  347.    if LEXAM_is_available then
  348.  compile endif
  349.      buildmenuitem menuname, 4, 404, PROOF_MENU__MSG,           'proof'PROOF_MENUP__MSG,     0, mpfrom2short(HP_OPTIONS_PROOF, 0)
  350.      buildmenuitem menuname, 4, 405, PROOF_WORD_MENU__MSG,      'proofword'PROOF_WORD_MENUP__MSG, 0, mpfrom2short(HP_OPTIONS_PROOFW, 0)
  351.      buildmenuitem menuname, 4, 406, SYNONYM_MENU__MSG,         'syn'SYNONYM_MENUP__MSG,       0, mpfrom2short(HP_OPTIONS_SYN, 0)
  352.  compile if CORE_STUFF
  353.      buildmenuitem menuname, 4, 426, DEFINE_WORD_MENU__MSG,     'define'DEFINE_WORD_MENUP__MSG,    0, mpfrom2short(HP_OPTIONS_DEFINE, 0)
  354.  compile endif  -- CORE_STUFF
  355.      buildmenuitem menuname, 4, 407, \0,           '',                       4, 0
  356.  compile if CHECK_FOR_LEXAM
  357.    endif
  358.  compile endif
  359. compile endif
  360. ; If no "Toggle stream mode" or "Toggle advanced marking" or "Enable ring", then
  361. ; place "Configure..." on main Options menu.  Otherwise, put it on a Preferences
  362. ; pull-right with the other stuff.
  363. compile if NEED_PREFERENCES
  364.      buildmenuitem menuname, 4, 400, PREFERENCES_MENU__MSG,    PREFERENCES_MENUP__MSG,  17, mpfrom2short(HP_OPTIONS_PREFERENCES, 0)
  365. compile endif
  366. compile if WANT_APPLICATION_INI_FILE
  367.      buildmenuitem menuname, 4, 440, CONFIG_MENU__MSG,         'configdlg'CONFIG_MENUP__MSG,  0, mpfrom2short(HP_OPTIONS_CONFIG, 0)
  368.  compile if ENHANCED_ENTER_KEYS & WANT_STREAM_MODE <> 1 & EVERSION < 5.21  -- 5.21 adds this to config dialog
  369.      buildmenuitem menuname, 4, 444, SETENTER_MENU__MSG,    'config_enter'SETENTER_MENUP__MSG,  ENTER__ATTRIB, mpfrom2short(HP_OPTIONS_CFGENTER, 0)
  370.  compile endif
  371. compile endif
  372. compile if WANT_CUA_MARKING = 'SWITCH'
  373.      buildmenuitem menuname, 4, 441, ADVANCEDMARK_MENU__MSG,     'CUA_MARK_toggle'ADVANCEDMARK_MENUP__MSG, MARK__ATTRIB, mpfrom2short(HP_OPTIONS_CUATOGGLE, NODISMISS)
  374. compile endif
  375. compile if WANT_STREAM_MODE = 'SWITCH'
  376.      buildmenuitem menuname, 4, 442, STREAMMODE_MENU__MSG,  'stream_toggle'STREAMMODE_MENUP__MSG,  STREAM__ATTRIB, mpfrom2short(HP_OPTIONS_STREAM, NODISMISS)
  377. compile endif
  378. compile if RING_OPTIONAL
  379.      buildmenuitem menuname, 4, 443, RINGENABLED_MENU__MSG,    'ring_toggle'RINGENABLED_MENUP__MSG,  RING__ATTRIB, mpfrom2short(HP_OPTIONS_RINGENABLE, 0)
  380. compile endif
  381. compile if WANT_STACK_CMDS = 'SWITCH'
  382.      buildmenuitem menuname, 4, 445, STACKCMDS_MENU__MSG,      'stack_toggle'STACKCMDS_MENUP__MSG,  STACK__ATTRIB, mpfrom2short(HP_OPTIONS_STACKCMDS, 0)
  383. compile endif
  384. compile if BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  385.      buildmenuitem menuname, 4, 446, CUAACCEL_MENU__MSG,       'accel_toggle'CUAACCEL_MENUP__MSG,  ACCEL__ATTRIB, mpfrom2short(HP_OPTIONS_CUAACCEL, NODISMISS)
  386. compile endif
  387.      buildmenuitem menuname, 4, 401, \0,                       '',           4, 0
  388.      buildmenuitem menuname, 4, 402, AUTOSAVE_MENU__MSG,       'autosave ?'AUTOSAVE_MENUP__MSG, 0, mpfrom2short(HP_OPTIONS_AUTOSAVE, 0)
  389.      buildmenuitem menuname, 4, 403, \0,                       '',           4, 0
  390.      buildmenuitem menuname, 4, 412, MESSAGES_MENU__MSG,       'messagebox'MESSAGES_MENUP__MSG, 0, mpfrom2short(HP_OPTIONS_MESSAGES, 0)
  391.      buildmenuitem menuname, 4, 409, \0,           '',                       4, 0
  392. ;  Note:  408 is referenced by TOGGLEFONT.  If the number changes, update TOGGLEFONT.
  393. compile if EVERSION < 5.50
  394.  compile if EVERSION < 5.20  -- Earlier EPM versions didn't do DEVESCAPE
  395.    if screenxysize('X')>1000 and one_two then  -- BGA and 1.2 or above
  396.  compile else                -- We can assume 1.2 or above; 1.1 no longer supported
  397.    if screenxysize('X')>1000 or dos_version()>=1030 then  -- BGA *or* 1.3 for many fonts
  398.  compile endif
  399. compile endif
  400. compile if EVERSION < 5.21  -- In 5.21, on notebook config control
  401.         buildmenuitem menuname, 4, 408, CHANGE_FONT_MENU__MSG,  'fontlist'CHANGE_FONT_MENUP__MSG,    0, mpfrom2short(HP_OPTIONS_FONT, 0)
  402. compile endif
  403. compile if EVERSION < 5.50
  404.    else
  405.       if font then
  406.         buildmenuitem menuname, 4, 408, SMALL_FONT_MENU__MSG,    'togglefont'SMALL_FONT_MENUP__MSG,  0, mpfrom2short(HP_OPTIONS_FONT, 0)
  407.       else
  408.         buildmenuitem menuname, 4, 408, LARGE_FONT_MENU__MSG,    'togglefont'LARGE_FONT_MENUP__MSG,  0, mpfrom2short(HP_OPTIONS_FONT, 0)
  409.       endif
  410.    endif
  411. compile endif
  412.  
  413. compile if EVERSION > 5.18
  414.      buildmenuitem menuname, 4, 425, FRAME_CTRLS_MENU__MSG, FRAME_CTRLS_MENUP__MSG, 17, mpfrom2short(HP_OPTIONS_FRAME, 0)
  415.  compile if EVERSION < 5.53
  416.         buildmenuitem menuname, 4, 413, STATUS_LINE_MENU__MSG, 'togglecontrol 7'STATUS_LINE_MENUP__MSG, 0, mpfrom2short(HP_FRAME_STATUS, NODISMISS)
  417.         buildmenuitem menuname, 4, 414, MSG_LINE_MENU__MSG,    'togglecontrol 8'MSG_LINE_MENUP__MSG, 0, mpfrom2short(HP_FRAME_MESSAGE, NODISMISS)
  418.  compile else
  419.         buildmenuitem menuname, 4, 413, STATUS_LINE_MENU__MSG, 'toggleframe 1'STATUS_LINE_MENUP__MSG, 0, mpfrom2short(HP_FRAME_STATUS, NODISMISS)
  420.         buildmenuitem menuname, 4, 414, MSG_LINE_MENU__MSG,    'toggleframe 2'MSG_LINE_MENUP__MSG, 0, mpfrom2short(HP_FRAME_MESSAGE, NODISMISS)
  421.  compile endif
  422.         buildmenuitem menuname, 4, 415, SCROLL_BARS_MENU__MSG, 'setscrolls'SCROLL_BARS_MENUP__MSG,      0, mpfrom2short(HP_FRAME_SCROLL, NODISMISS)
  423. ;;      buildmenuitem menuname, 4, 416, 'Partial te~xt',       'togglecontrol 15', 32768+1, 0, 0
  424.  compile if EVERSION < 5.50
  425.         buildmenuitem menuname, 4, 416, FILEICON_MENU__MSG,     'togglecontrol 22'FILEICON_MENUP__MSG, 0, mpfrom2short(HP_FRAME_FILE, NODISMISS)
  426.  compile endif
  427.  compile if EVERSION < 5.53
  428.         buildmenuitem menuname, 4, 417, ROTATEBUTTONS_MENU__MSG,'togglecontrol 20'ROTATEBUTTONS_MENUP__MSG, 0, mpfrom2short(HP_FRAME_ROTATE, NODISMISS)
  429.  compile else
  430.         buildmenuitem menuname, 4, 417, ROTATEBUTTONS_MENU__MSG,'toggleframe 4'ROTATEBUTTONS_MENUP__MSG, 0, mpfrom2short(HP_FRAME_ROTATE, NODISMISS)
  431.  compile endif
  432.  compile if WANT_DYNAMIC_PROMPTS
  433.         buildmenuitem menuname, 4, 421, INFOATTOP_MENU__MSG,   TOGGLEINFO || INFOATTOP_MENUP__MSG,     0, mpfrom2short(HP_FRAME_EXTRAPOS, NODISMISS)
  434.         buildmenuitem menuname, 4, 422, PROMPTING_MENU__MSG,   'toggleprompt'PROMPTING_MENUP__MSG,     32768+1, mpfrom2short(HP_FRAME_PROMPT, NODISMISS)
  435.  compile else
  436.         buildmenuitem menuname, 4, 421, INFOATTOP_MENU__MSG,   TOGGLEINFO || INFOATTOP_MENUP__MSG,     32768+1, mpfrom2short(HP_FRAME_EXTRAPOS, NODISMISS)
  437.  compile endif
  438. compile else
  439.      buildmenuitem menuname, 4, 413, STATUS_LINE_MENU__MSG,    'togglecontrol 7', 0, 0
  440.      buildmenuitem menuname, 4, 414, MSG_LINE_MENU__MSG,  ,    'togglecontrol 8', 0, 0
  441.      buildmenuitem menuname, 4, 415, SCROLL_BARS_MENU__MSG,    'setscrolls',  0, 0
  442. ;;   buildmenuitem menuname, 4, 416, 'Partial te~xt',          'togglecontrol 15', 0, 0
  443. compile endif
  444. compile if WANT_APPLICATION_INI_FILE
  445.      buildmenuitem menuname, 4, 418, SAVE_OPTS_MENU__MSG,      'saveoptions'SAVE_OPTS_MENUP__MSG, 0, mpfrom2short(HP_OPTIONS_SAVE, 0)
  446. compile endif
  447. compile if EPATH = 'LAMPATH'
  448.      buildmenuitem menuname, 4, 419, \0,                       '',           4, 0
  449.      buildmenuitem menuname, 4, 420, TO_DESKTOP_MENU__MSG,     'popbook'TO_DESKTOP_MENUP__MSG, 0, 0
  450. compile elseif SUPPORT_BOOK_ICON
  451.      buildmenuitem menuname, 4, 419, \0,                       '',           4, 0
  452.      buildmenuitem menuname, 4, 420, TO_BOOK_MENU__MSG,        'popbook'TO_BOOK_MENUP__MSG, 0, mpfrom2short(HP_OPTIONS_BOOK, 0)
  453. compile endif
  454.    return
  455.  
  456. compile if MENU_LIMIT
  457. defproc add_ring_menu(menuname)
  458.    buildsubmenu menuname, 5, RING_BAR__MSG, LIST_FILES_MENUP__MSG, 0 , 0
  459.      if .titletext=='' then
  460.         buildmenuitem menuname, 5, 500, .filename, '',0,0
  461.      else
  462.         buildmenuitem menuname, 5, 500, .titletext, '',0,0
  463.      endif
  464.    return
  465. compile endif
  466.  
  467. defproc add_command_menu(menuname)
  468.    buildsubmenu menuname, 1, COMMAND_BAR__MSG, COMMAND_BARP__MSG, 0 , mpfrom2short(HP_COMMAND, 0)
  469.      buildmenuitem menuname, 1, 100, COMMANDLINE_MENU__MSG\9 || CTRL_KEY__MSG'+I', 'commandline'COMMANDLINE_MENUP__MSG,   0, mpfrom2short(HP_COMMAND_CMD, 0)
  470. compile if EVERSION >= 5.50
  471.      buildmenuitem menuname, 1, 65535, HALT_COMMAND_MENU__MSG, '', 0, mpfrom2short(HP_COMMAND_HALT, 0)
  472. compile else
  473.      buildmenuitem menuname, 1, 0, HALT_COMMAND_MENU__MSG, '', 0, mpfrom2short(HP_COMMAND_HALT, 0)
  474. compile endif
  475. compile if WANT_EPM_SHELL = 1
  476.      buildmenuitem menuname, 1, 101, \0,                      '',            4, 0
  477.      buildmenuitem menuname, 1, 102, CREATE_SHELL_MENU__MSG,       'shell'CREATE_SHELL_MENUP__MSG,       0, mpfrom2short(HP_COMMAND_SHELL, 0)
  478.      buildmenuitem menuname, 1, 103, WRITE_SHELL_MENU__MSG,        'shell_write'WRITE_SHELL_MENUP__MSG, 0, mpfrom2short(HP_COMMAND_SHELL, 16384)
  479. ;    buildmenuitem menuname, 1, 104, KILL_SHELL_MENU__MSG,         'shell_kill'KILL_SHELL_MENUP__MSG,  0, mpfrom2short(HP_COMMAND_SHELL, 16384)
  480. compile endif
  481.    return
  482.  
  483. compile if EVERSION < 5.20
  484. defproc add_help_menu(menuname, one_two)
  485.    attrib = 16384 * (not one_two)   -- If OS/2 1.2 then 0; else 16384 (greyed out)
  486. compile else
  487. defproc add_help_menu(menuname)
  488.    attrib = 0
  489. compile endif
  490.    buildsubmenu menuname, HELP_MENU_ID, HELP_BAR__MSG, 'help'HELP_BARP__MSG, /* 512 */  0, mpfrom2short(HP_HELP, 0)
  491.      buildmenuitem menuname, HELP_MENU_ID, 603, HELP_INDEX_MENU__MSG,   'helpmenu 10'/*64044*/HELP_INDEX_MENUP__MSG,   0, mpfrom2short(HP_HELP_INDEX, attrib)
  492.      buildmenuitem menuname, HELP_MENU_ID, 601, EXT_HELP_MENU__MSG,     'helpmenu 4000'EXT_HELP_MENUP__MSG, 0, mpfrom2short(HP_HELP_EXTENDED, attrib)
  493.      buildmenuitem menuname, HELP_MENU_ID, 600, HELP_HELP_MENU__MSG,    'helpmenu 64027'HELP_HELP_MENUP__MSG,    0, mpfrom2short(HP_HELP_HELP, attrib)
  494.      buildmenuitem menuname, HELP_MENU_ID, 602, KEYS_HELP_MENU__MSG,    'helpmenu 1000'KEYS_HELP_MENUP__MSG, 0, mpfrom2short(HP_HELP_KEYS, attrib)
  495. compile if IBM_IUO
  496.      buildmenuitem menuname, HELP_MENU_ID, 604, \0,           '',                        4, 0
  497.      buildmenuitem menuname, HELP_MENU_ID, 605, HELP_BROWSER_MENU__MSG, 'help'HELP_BROWSER_MENUP__MSG,    0, mpfrom2short(HP_HELP_BROWSE, 0)
  498. compile endif
  499.      buildmenuitem menuname, HELP_MENU_ID, 606, \0,           '',                        4, 0
  500. compile if 0
  501.      buildmenuitem menuname, HELP_MENU_ID, 607, '#211'||(3-(screenxysize('X')>1000)), 'IBMmsg'HELP_PROD_MENUP__MSG, 2, mpfrom2short(HP_HELP_IBM, 0)
  502.                          -- Resource # 2112 or 2113 in ERES.DLL
  503. compile else
  504.      buildmenuitem menuname, HELP_MENU_ID, 607, HELP_PROD_MENU__MSG, 'IBMmsg'HELP_PROD_MENUP__MSG, 0, mpfrom2short(HP_HELP_PROD, 0)
  505. compile endif
  506. compile if SUPPORT_USERS_GUIDE | SUPPORT_TECHREF
  507.      buildmenuitem menuname, HELP_MENU_ID, 610, \0,           '',                        4, 0
  508.  compile if SUPPORT_USERS_GUIDE
  509.      buildmenuitem menuname, HELP_MENU_ID, 620, USERS_GUIDE_MENU__MSG,   USERS_GUIDE_MENUP__MSG, 17+64, mpfrom2short(HP_HELP_USERS_GUIDE, 0)
  510.        buildmenuitem menuname, HELP_MENU_ID, 621, VIEW_USERS_MENU__MSG,  'view epmusers'VIEW_USERS_MENUP__MSG, 0, mpfrom2short(HP_HELP_USERS_GUIDE, 0)
  511.        buildmenuitem menuname, HELP_MENU_ID, 622, VIEW_IN_USERS_MENU__MSG,  'viewword epmusers'VIEW_IN_USERS_MENUP__MSG, 32768+1, mpfrom2short(HP_HELP_USERS_GUIDE, 0)
  512.  compile endif
  513.  compile if SUPPORT_TECHREF
  514.      buildmenuitem menuname, HELP_MENU_ID, 630, TECHREF_MENU__MSG,   TECHREF_MENUP__MSG, 17+64, mpfrom2short(HP_HELP_TECHREF, 0)
  515.        buildmenuitem menuname, HELP_MENU_ID, 631, VIEW_TECHREF_MENU__MSG,  'view epmtech'VIEW_TECHREF_MENUP__MSG, 0, mpfrom2short(HP_HELP_TECHREF, 0)
  516.        buildmenuitem menuname, HELP_MENU_ID, 632, VIEW_IN_TECHREF_MENU__MSG,  'viewword epmtech'VIEW_IN_TECHREF_MENUP__MSG, 32768+1, mpfrom2short(HP_HELP_TECHREF, 0)
  517.  compile endif
  518. compile endif
  519.  
  520. defproc readd_help_menu
  521.    universal defaultmenu, activemenu
  522.    call add_help_menu(defaultmenu)
  523.    call maybe_show_menu()
  524.  
  525. defproc maybe_show_menu
  526.    universal defaultmenu, activemenu
  527.    if activemenu=defaultmenu then
  528.       showmenu activemenu  -- show the updated EPM menu
  529. compile if SUPPORT_USERS_GUIDE
  530.       'postme cascade_menu 620'
  531. compile endif
  532. compile if SUPPORT_TECHREF
  533.       'postme cascade_menu 630'
  534. compile endif
  535. compile if defined(CUSTEPM_DEFAULT_SCREEN)
  536.       'postme cascade_menu' 3700 (CUSTEPM_DEFAULT_SCREEN + 3700)
  537. compile elseif defined(HAVE_CUSTEPM)
  538.       'postme cascade_menu' 3700
  539. compile endif
  540.    endif
  541.  
  542. compile if BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  543. define  -- Prepare for some conditional tests
  544.  compile if EPATH = 'LAMPATH'  -- If LaMail, "Mail" will be on action bar
  545.    maybe_mail_accel = 'MAIL_ACCEL__L ='
  546.  compile else                  -- otherwise, it won't
  547.    maybe_mail_accel = "' ' ="    -- Will be false for any letter
  548.  compile endif
  549.  compile if MENU_LIMIT
  550.    maybe_ring_accel = 'RING_ACCEL__L ='
  551.  compile else
  552.    maybe_ring_accel = "' ' ="  -- Will be false for any letter
  553.  compile endif
  554.  compile if defined(ACTIONS_ACCEL__L)  -- For CUSTEPM support
  555.    maybe_actions_accel = 'ACTIONS_ACCEL__L ='
  556.  compile else
  557.    maybe_actions_accel = "' ' ="  -- Will be true for any letter
  558.  compile endif
  559.  
  560. defproc update_edit_menu_text =
  561.    universal CUA_MENU_ACCEL
  562.    accel_len = (3+length(ALT_KEY__MSG))*(not CUA_MENU_ACCEL)
  563.  
  564.  compile if FILE_ACCEL__L = 'C' | EDIT_ACCEL__L = 'C' | SEARCH_ACCEL__L = 'C' | OPTIONS_ACCEL__L = 'C' | COMMAND_ACCEL__L = 'C' | HELP_ACCEL__L = 'C' | $maybe_mail_accel 'C' | $maybe_ring_accel 'C' | $maybe_actions_accel 'C'
  565.    menutext = COPY_MARK_MENU__MSG || leftstr(\9 || ALT_KEY__MSG'+C', accel_len)\0
  566.    call windowmessage(1, getpminfo(EPMINFO_EDITMENUHWND),
  567.                       398,                  -- x18e, MM_SetItemText
  568.                       800 + 65536,
  569.                       ltoa(offset(menutext) || selector(menutext), 10) )
  570.  compile endif
  571.  
  572.  compile if FILE_ACCEL__L = 'M' | EDIT_ACCEL__L = 'M' | SEARCH_ACCEL__L = 'M' | OPTIONS_ACCEL__L = 'M' | COMMAND_ACCEL__L = 'M' | HELP_ACCEL__L = 'M' | $maybe_mail_accel 'M' | $maybe_ring_accel 'M' | $maybe_actions_accel 'M'
  573.    menutext = MOVE_MARK_MENU__MSG || leftstr(\9 || ALT_KEY__MSG'+M', accel_len)\0
  574.    call windowmessage(1, getpminfo(EPMINFO_EDITMENUHWND),
  575.                       398,                  -- x18e, MM_SetItemText
  576.                       801 + 65536,
  577.                       ltoa(offset(menutext) || selector(menutext), 10) )
  578.  compile endif
  579.  
  580.  compile if FILE_ACCEL__L = 'O' | EDIT_ACCEL__L = 'O' | SEARCH_ACCEL__L = 'O' | OPTIONS_ACCEL__L = 'O' | COMMAND_ACCEL__L = 'O' | HELP_ACCEL__L = 'O' | $maybe_mail_accel 'O' | $maybe_ring_accel 'O' | $maybe_actions_accel 'O'
  581.    menutext = OVERLAY_MARK_MENU__MSG || leftstr(\9 || ALT_KEY__MSG'+O', accel_len)\0
  582.    call windowmessage(1, getpminfo(EPMINFO_EDITMENUHWND),
  583.                       398,                  -- x18e, MM_SetItemText
  584.                       802 + 65536,
  585.                       ltoa(offset(menutext) || selector(menutext), 10) )
  586.  compile endif
  587.  
  588.  compile if FILE_ACCEL__L = 'A' | EDIT_ACCEL__L = 'A' | SEARCH_ACCEL__L = 'A' | OPTIONS_ACCEL__L = 'A' | COMMAND_ACCEL__L = 'A' | HELP_ACCEL__L = 'A' | $maybe_mail_accel 'A' | $maybe_ring_accel 'A' | $maybe_actions_accel 'A'
  589.    menutext = ADJUST_MARK_MENU__MSG || leftstr(\9 || ALT_KEY__MSG'+A', accel_len)\0
  590.    call windowmessage(1, getpminfo(EPMINFO_EDITMENUHWND),
  591.                       398,                  -- x18e, MM_SetItemText
  592.                       803 + 65536,
  593.                       ltoa(offset(menutext) || selector(menutext), 10) )
  594.  compile endif
  595.  
  596.  compile if FILE_ACCEL__L = 'U' | EDIT_ACCEL__L = 'U' | SEARCH_ACCEL__L = 'U' | OPTIONS_ACCEL__L = 'U' | COMMAND_ACCEL__L = 'U' | HELP_ACCEL__L = 'U' | $maybe_mail_accel 'U' | $maybe_ring_accel 'U' | $maybe_actions_accel 'U'
  597.    menutext = UNMARK_MARK_MENU__MSG || leftstr(\9 || ALT_KEY__MSG'+U', accel_len)\0
  598.    call windowmessage(1, getpminfo(EPMINFO_EDITMENUHWND),
  599.                       398,                  -- x18e, MM_SetItemText
  600.                       805 + 65536,
  601.                       ltoa(offset(menutext) || selector(menutext), 10) )
  602.  compile endif
  603.  
  604.  compile if FILE_ACCEL__L = 'D' | EDIT_ACCEL__L = 'D' | SEARCH_ACCEL__L = 'D' | OPTIONS_ACCEL__L = 'D' | COMMAND_ACCEL__L = 'D' | HELP_ACCEL__L = 'D' | $maybe_mail_accel 'D' | $maybe_ring_accel 'D' | $maybe_actions_accel 'D'
  605.    menutext = DELETE_MARK_MENU__MSG || leftstr(\9 || ALT_KEY__MSG'+D', accel_len)\0
  606.    call windowmessage(1, getpminfo(EPMINFO_EDITMENUHWND),
  607.                       398,                  -- x18e, MM_SetItemText
  608.                       806 + 65536,
  609.                       ltoa(offset(menutext) || selector(menutext), 10) )
  610.  compile endif
  611.  
  612. compile endif
  613.