home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / epmmac.zip / OVSHMENU.E < prev    next >
Text File  |  1996-02-08  |  45KB  |  755 lines

  1. ; This is an example of providing an alternate to STDMENU.E.  The name of the
  2. ; alternate menu must be defined in MYCNF.E:  STD_MENU_NAME = 'ovshmenu.e'
  3. ; The alternate menu must provide the following commands, which are called
  4. ; from the other macro files:
  5. ;   LoadDefaultMenu - Called to build the default action bar.  Must set universals
  6. ;                     Activemenu and Defaultmenu.
  7. ;   Readd_help_menu - Called to readd the help menu, after someone deleted it to add their own menu(s).
  8. ;   Maybe_show_menu - Called to reshow the menu iff activemenu = defaultmenu.
  9. ;   Showmenu_activemenu - Called to reshow the menu.  Updates cascaded menus if necessary.
  10. ;   Build_menu_accelerators - Called from Loadaccel() to build the menu-related accelerators.
  11. ;   Update_edit_menu_text - Called to update the edit menu text after CUA Accelerators is toggled.
  12. ;   Menuinit_nnn - Define once for each pulldown or pullright menu ID <nnn> which
  13. ;                  needs to grey, check, etc. its submenu when its menu is activated.
  14.  
  15.  
  16. /*
  17. ┌─────────────────────────────────────────────────────────────────────────────┐
  18. │What's it called  : loaddefaultmenu                                          │
  19. │                                                                             │
  20. │What does it do   : used by stdcnf.e to setup default EPM action bar         │
  21. │                    (Note: a menu id of 0 halts the interpreter when         │
  22. │                     selected.)                                              │
  23. │                                                                             │
  24. │Who and When      : Jerry C.     2/25/89                                     │
  25. └─────────────────────────────────────────────────────────────────────────────┘
  26. */
  27.  
  28. defc loaddefaultmenu
  29.    universal activemenu,defaultmenu
  30.  
  31.    parse arg menuname .
  32.    if menuname = '' then                  -- Initialization call
  33.       menuname = 'default'
  34.       defaultmenu = menuname              -- default menu name
  35.       activemenu  = defaultmenu
  36.    endif
  37.  
  38.    call add_file_menu(menuname)
  39.    call add_view_menu(menuname)
  40.    call add_selected_menu(menuname)
  41. compile if MENU_LIMIT
  42.    call add_ring_menu(menuname)
  43. compile endif
  44.    call add_help_menu(menuname)
  45.  
  46. defproc add_file_menu(menuname)
  47. compile if RING_OPTIONAL
  48.    universal ring_enabled
  49. compile endif
  50. compile if CHECK_FOR_LEXAM
  51.    universal LEXAM_is_available
  52. compile endif
  53.    buildsubmenu menuname, 1, FILE_BAR__MSG, FILE_BARP__MSG, 0 , mpfrom2short(HP_FILE, 0)
  54. compile if RING_OPTIONAL
  55.    if ring_enabled then
  56. compile endif
  57.      buildmenuitem menuname, 1, 100, OPENAS_MENU__MSG,           OPENAS_MENUP__MSG,     17+64, mpfrom2short(HP_FILE_OPENAS, 0)
  58.        buildmenuitem menuname, 1, 101, NEWWIN_MENU__MSG\9 || CTRL_KEY__MSG'+O', 'OPENDLG'OPEN_MENUP__MSG,  0, mpfrom2short(HP_FILE_NEWWIN, 0)
  59.        buildmenuitem menuname, 1, 102, SAMEWIN_MENU__MSG\9'F8', 'OPENDLG EDIT'ADD_MENUP__MSG,     0, mpfrom2short(HP_FILE_SAMEWIN, 0)
  60.        buildmenuitem menuname, 1, 103, COMMAND_SHELL_MENU__MSG,  'shell'CREATE_SHELL_MENUP__MSG,   32769, mpfrom2short(HP_COMMAND_SHELL, 0)
  61. compile if RING_OPTIONAL
  62.    else
  63.       buildmenuitem menuname, 1, 100, NEWWIN_MENU__MSG\9 || CTRL_KEY__MSG'+O', 'OPENDLG'OPEN_MENUP__MSG,  0, mpfrom2short(HP_FILE_NEWWIN, 0)
  64.    endif
  65. compile endif
  66. ;compile if WANT_APPLICATION_INI_FILE
  67.      buildmenuitem menuname, 1, 105, CONFIG_MENU__MSG,         'configdlg'CONFIG_MENUP__MSG,  0, mpfrom2short(HP_OPTIONS_CONFIG, 0)
  68.      buildmenuitem menuname, 1, 107, \0,                           '',                 4, 0
  69. ;compile endif
  70.      buildmenuitem menuname, 1, 110, SAVE_MENU__MSG\9'F2',     'SAVE'SAVE_MENUP__MSG,             0, mpfrom2short(HP_FILE_SAVE, 0)
  71.      buildmenuitem menuname, 1, 120, SAVEAS_MENU__MSG,         'SAVEAS_DLG'SAVEAS_MENUP__MSG, 0, mpfrom2short(HP_FILE_SAVEAS, 0)
  72. compile if RING_OPTIONAL
  73.    if ring_enabled then
  74. compile endif
  75.      buildmenuitem menuname, 1, 130, FILE_MENU__MSG\9'F4',     'FILE'FILE_MENUP__MSG,             0, mpfrom2short(HP_FILE_FILE, 0)
  76.      buildmenuitem menuname, 1, 140, QUIT_MENU__MSG\9'F3',     'QUIT'QUIT_MENUP__MSG,             0, mpfrom2short(HP_FILE_QUIT, 0)
  77. compile if RING_OPTIONAL
  78.    else
  79.      buildmenuitem menuname, 1, 140, SAVECLOSE_MENU__MSG\9'F4',     'FILE'FILE_MENUP__MSG,        0, mpfrom2short(HP_FILE_FILE, 0)
  80.    endif
  81. compile endif
  82.      buildmenuitem menuname, 1, 145, \0,                           '',                 4, 0
  83.      buildmenuitem menuname, 1, 150, COMMAND_BAR__MSG, COMMAND_BARP__MSG, 17+64, mpfrom2short(HP_COMMAND, 0)
  84.        buildmenuitem menuname, 1, 151, COMMANDLINE_MENU__MSG\9 || CTRL_KEY__MSG'+I', 'commandline'COMMANDLINE_MENUP__MSG,   0, mpfrom2short(HP_COMMAND_CMD, 0)
  85. compile if WANT_EPM_SHELL = 1
  86.        buildmenuitem menuname, 1, 65535, HALT_COMMAND_MENU__MSG, '', 0, mpfrom2short(HP_COMMAND_HALT, 0)
  87.  compile if EPM32 & not POWERPC
  88.        buildmenuitem menuname, 1, 152, WRITE_SHELL_MENU__MSG,        'shell_write'WRITE_SHELL_MENUP__MSG, 0, mpfrom2short(HP_COMMAND_WRITE, 16384)
  89.        buildmenuitem menuname, 1, 153, SHELL_BREAK_MENU__MSG,        'shell_break'SHELL_BREAK_MENUP__MSG,  32769, mpfrom2short(HP_COMMAND_BREAK, 16384)
  90.  compile else
  91.        buildmenuitem menuname, 1, 152, WRITE_SHELL_MENU__MSG,        'shell_write'WRITE_SHELL_MENUP__MSG, 32769, mpfrom2short(HP_COMMAND_WRITE, 16384)
  92.  compile endif
  93. compile else
  94.        buildmenuitem menuname, 1, 65535, HALT_COMMAND_MENU__MSG, '', 32769, mpfrom2short(HP_COMMAND_HALT, 0)
  95. compile endif
  96.      buildmenuitem menuname, 1, 155, GET_MENU__MSG,            'OPENDLG GET'GET_MENUP__MSG,      0, mpfrom2short(HP_FILE_GET , 0)
  97.      buildmenuitem menuname, 1, 158, \0,                           '',                 4, 0
  98. compile if ENHANCED_PRINT_SUPPORT
  99.      buildmenuitem menuname, 1, 160, PRINT_MENU__MSG'...',  'printdlg'ENHPRT_FILE_MENUP__MSG,         0, mpfrom2short(HP_FILE_ENHPRINT, 0)
  100. compile else
  101.      buildmenuitem menuname, 1, 160, PRINT_MENU__MSG,       'xcom save /s /ne' default_printer()PRT_FILE_MENUP__MSG,   0, mpfrom2short(HP_FILE_PRINT, 0)
  102. compile endif
  103.  compile if CHECK_FOR_LEXAM
  104.    if LEXAM_is_available then
  105.  compile endif
  106.      buildmenuitem menuname, 1, 165, \0,           '',                       4, 0
  107.      buildmenuitem menuname, 1, 170, PROOF_MENU__MSG,           'proof'PROOF_MENUP__MSG,     0, mpfrom2short(HP_OPTIONS_PROOF, 0)
  108.  compile if CHECK_FOR_LEXAM
  109.    endif
  110.  compile endif
  111.  
  112.  
  113.  
  114. defproc add_view_menu(menuname)
  115. compile if RING_OPTIONAL
  116.    universal ring_enabled
  117. compile endif
  118. compile if CHECK_FOR_LEXAM
  119.    universal LEXAM_is_available
  120. compile endif
  121. compile if WANT_STACK_CMDS = 'SWITCH'
  122.    universal stack_cmds
  123. compile endif
  124.    buildsubmenu  menuname, 2, VIEW_BAR__MSG, VIEW_BARP__MSG, 0 , mpfrom2short(HP_VIEW, 0)
  125.      buildmenuitem menuname, 2, 200, SEARCH_BAR__MSG, SEARCH_BARP__MSG, 17+64, mpfrom2short(HP_SEARCH, 0)
  126.      buildmenuitem menuname, 2, 201, SEARCH_MENU__MSG\9 || CTRL_KEY__MSG'+S',      'SEARCHDLG'SEARCH_MENUP__MSG,   0, mpfrom2short(HP_SEARCH_SEARCH, 0)
  127.      buildmenuitem menuname, 2, 202, \0,                           '',            4, 0
  128.      buildmenuitem menuname, 2, 203, FIND_NEXT_MENU__MSG\9 || CTRL_KEY__MSG'+F',   'SEARCHDLG F'FIND_NEXT_MENUP__MSG, 0, mpfrom2short(HP_SEARCH_FIND, 0)
  129.      buildmenuitem menuname, 2, 204, CHANGE_NEXT_MENU__MSG\9 || CTRL_KEY__MSG'+C', 'SEARCHDLG C'CHANGE_NEXT_MENUP__MSG, 32769, mpfrom2short(HP_SEARCH_CHANGE, 0)
  130. compile if WANT_TAGS
  131.      buildmenuitem menuname, 2, 210, TAGS_MENU__MSG,   TAGS_MENUP__MSG, 17+64, mpfrom2short(HP_SEARCH_TAGS, 0)
  132.  compile if EPM32
  133.        buildmenuitem menuname, 2, 211, TAGSDLG_MENU__MSG\9, 'poptagsdlg'TAGSDLG_MENUP__MSG, 0, mpfrom2short(HP_SEARCH_TAGS, 0)
  134.        buildmenuitem menuname, 2, 212, \0,                  '',               4, 0
  135.  compile endif
  136.        buildmenuitem menuname, 2, 213, FIND_TAG_MENU__MSG\9 || SHIFT_KEY__MSG'+F6',  'findtag'FIND_TAG_MENUP__MSG, 0, mpfrom2short(HP_SEARCH_TAGS, 0)
  137.        buildmenuitem menuname, 2, 214, FIND_TAG2_MENU__MSG\9 || SHIFT_KEY__MSG'+F7', 'findtag *'FIND_TAG2_MENUP__MSG, 0, mpfrom2short(HP_SEARCH_TAGS, 0)
  138.  compile if not EPM32
  139.        buildmenuitem menuname, 2, 215, \0,                  '',               4, 0
  140.        buildmenuitem menuname, 2, 216, TAGFILE_NAME_MENU__MSG\9 || SHIFT_KEY__MSG'+F8',  'tagsfile'TAGFILE_NAME_MENUP__MSG, 0, mpfrom2short(HP_SEARCH_TAGS, 0)
  141.        buildmenuitem menuname, 2, 217, \0,                  '',               4, 0
  142.        buildmenuitem menuname, 2, 218, MAKE_TAGS_MENU__MSG\9 || SHIFT_KEY__MSG'+F9',  'maketags *'MAKE_TAGS_MENUP__MSG, 0, mpfrom2short(HP_SEARCH_TAGS, 0)
  143.  compile endif
  144.        buildmenuitem menuname, 2, 219, \0,                               '',          4, 0
  145.        buildmenuitem menuname, 2, 220, SCAN_TAGS_MENU__MSG,  'tagscan'SCAN_TAGS_MENUP__MSG, 32769, mpfrom2short(HP_SEARCH_TAGS, 0)
  146. compile endif
  147. compile if WANT_BOOKMARKS
  148.      buildmenuitem menuname, 2, 223, BOOKMARKS_MENU__MSG,   BOOKMARKS_MENUP__MSG, 17 + 64, mpfrom2short(HP_SEARCH_BOOKMARKS, 0)
  149.        buildmenuitem menuname, 2, 224, SET_MARK_MENU__MSG\9 || CTRL_KEY__MSG'+M',  'setmark'SET_MARK_MENUP__MSG, 0, mpfrom2short(HP_SEARCH_BOOKMARKS, 0)
  150.        buildmenuitem menuname, 2, 225, LIST_MARK_MENU__MSG\9 || CTRL_KEY__MSG'+B', 'listmark'LIST_MARK_MENUP__MSG,       0, mpfrom2short(HP_SEARCH_BOOKMARKS, 0)
  151.        buildmenuitem menuname, 2, 226, \0,                  '',               4, 0
  152.        buildmenuitem menuname, 2, 227, NEXT_MARK_MENU__MSG\9 || ALT_KEY__MSG'+/',  'nextbookmark'NEXT_MARK_MENUP__MSG, 0, mpfrom2short(HP_SEARCH_BOOKMARKS, 0)
  153.        buildmenuitem menuname, 2, 228, PREV_MARK_MENU__MSG\9 || ALT_KEY__MSG'+\',  'nextbookmark P'PREV_MARK_MENUP__MSG, 32768+1, mpfrom2short(HP_SEARCH_BOOKMARKS, 0)
  154. compile endif
  155.      buildmenuitem menuname, 2, 229, \0,                               '',          4, 0
  156. compile if CHECK_FOR_LEXAM
  157.    if LEXAM_is_available then
  158. compile endif
  159.      buildmenuitem menuname, 2, 230, PROOF_WORD_MENU__MSG,      'proofword'PROOF_WORD_MENUP__MSG, 0, mpfrom2short(HP_OPTIONS_PROOFW, 0)
  160.      buildmenuitem menuname, 2, 231, SYNONYM_MENU__MSG,         'syn'SYNONYM_MENUP__MSG,       0, mpfrom2short(HP_OPTIONS_SYN, 0)
  161.      buildmenuitem menuname, 2, 232, DYNASPELL_MENU__MSG,        'dynaspell'DYNASPELL_MENUP__MSG,       0, mpfrom2short(HP_OPTIONS_DYNASPELL, 0)
  162.      buildmenuitem menuname, 2, 239, \0,                               '',          4, 0
  163. compile if CHECK_FOR_LEXAM
  164.    endif
  165. compile endif
  166. compile if MENU_LIMIT = 0
  167.  compile if RING_OPTIONAL
  168.    if ring_enabled then
  169.  compile endif
  170.      buildmenuitem menuname, 2, 240, LIST_FILES_MENU__MSG\9 || CTRL_KEY__MSG'+G',     'Ring_More'LIST_FILES_MENUP__MSG,  0 , mpfrom2short(HP_OPTIONS_LIST, 0)
  171.  compile if RING_OPTIONAL
  172.    endif
  173.  compile endif
  174. compile endif
  175.      buildmenuitem menuname, 2, 241, MESSAGES_MENU__MSG,       'messagebox'MESSAGES_MENUP__MSG, 0, mpfrom2short(HP_OPTIONS_MESSAGES, 0)
  176. compile if WANT_STACK_CMDS
  177.  compile if WANT_STACK_CMDS = 'SWITCH'
  178.    if stack_cmds then
  179.  compile endif
  180.      buildmenuitem menuname, 2, 242, \0,                               '',          4, 0
  181.      buildmenuitem menuname, 2, 243, PUSH_CURSOR_MENU__MSG\9 || CTRL_KEY__MSG'+'DOWN_KEY__MSG, 'PUSHPOS'PUSH_CURSOR_MENUP__MSG,  0, mpfrom2short(HP_EDIT_PUSHPOS, 0)
  182.      buildmenuitem menuname, 2, 244, POP_CURSOR_MENU__MSG\9 || CTRL_KEY__MSG'+'UP_KEY__MSG, 'POPPOS'POP_CURSOR_MENUP__MSG,   0, mpfrom2short(HP_EDIT_POPPOS, 16384)
  183.      buildmenuitem menuname, 2, 245, SWAP_CURSOR_MENU__MSG\9 || CTRL_KEY__MSG'+=', 'SWAPPOS'SWAP_CURSOR_MENUP__MSG,   0, mpfrom2short(HP_EDIT_SWAPPOS, 16384)
  184.  compile if WANT_STACK_CMDS = 'SWITCH'
  185.    endif
  186.  compile endif
  187. compile endif
  188.  
  189. define
  190.  compile if not defined(ALTERNATE_PASTE)
  191.   compile if DEFAULT_PASTE = ''
  192.    ALTERNATE_PASTE = 'C'
  193.   compile else
  194.    ALTERNATE_PASTE = ''
  195.   compile endif
  196.  compile endif
  197.    PASTE_C_KEY = ''
  198.    PASTE_B_KEY = ''
  199.    PASTE_L_KEY = ''
  200. compile if ALTERNATE_PASTE = ''
  201.    PASTE_L_KEY = \9 || CTRL_KEY__MSG'+'SHIFT_KEY__MSG'+'INSERT_KEY__MSG
  202. compile elseif ALTERNATE_PASTE = 'B'
  203.    PASTE_B_KEY = \9 || CTRL_KEY__MSG'+'SHIFT_KEY__MSG'+'INSERT_KEY__MSG
  204. compile elseif ALTERNATE_PASTE = 'C'
  205.    PASTE_C_KEY = \9 || CTRL_KEY__MSG'+'SHIFT_KEY__MSG'+'INSERT_KEY__MSG
  206. compile else
  207.    * Error:  ALTERNATE_PASTE must be '', 'B', or 'C'
  208. compile endif
  209. compile if DEFAULT_PASTE = ''
  210.    PASTE_L_KEY = \9 || SHIFT_KEY__MSG'+'INSERT_KEY__MSG
  211. compile elseif DEFAULT_PASTE = 'B'
  212.    PASTE_B_KEY = \9 || SHIFT_KEY__MSG'+'INSERT_KEY__MSG
  213. compile elseif DEFAULT_PASTE = 'C'
  214.    PASTE_C_KEY = \9 || SHIFT_KEY__MSG'+'INSERT_KEY__MSG
  215. compile else
  216.    * Error:  DEFAULT_PASTE must be '', 'B', or 'C'
  217. compile endif
  218.  
  219. define  -- Prepare for some conditional tests
  220. compile if MENU_LIMIT
  221.    maybe_ring_accel = 'RING_ACCEL__L <>'
  222. compile else
  223.    maybe_ring_accel = "' ' <"  -- Will be true for any letter
  224. compile endif
  225. compile if defined(ACTIONS_ACCEL__L)  -- For CUSTEPM support
  226.    maybe_actions_accel = 'ACTIONS_ACCEL__L <>'
  227. compile else
  228.    maybe_actions_accel = "' ' <"  -- Will be true for any letter
  229. compile endif
  230.  
  231. defproc add_selected_menu(menuname)
  232.  compile if BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  233.    universal CUA_MENU_ACCEL
  234.  compile endif
  235.  compile if WANT_STACK_CMDS = 'SWITCH'
  236.    universal stack_cmds
  237.  compile endif
  238.    buildsubmenu  menuname, 3, SELECTED_BAR__MSG, SELECTED_BARP__MSG, 0 , mpfrom2short(HP_SELECTED, 0)
  239.      buildmenuitem menuname, 3, 300, UNDO__MENU__MSG,   UNDO__MENUP__MSG,    17+64, mpfrom2short(HP_EDIT_UNDO2, 0)
  240.        buildmenuitem menuname, 3, 301, UNDO_MENU__MSG\9 || ALT_KEY__MSG'+'BACKSPACE_KEY__MSG,   'UNDO 1'UNDO_MENUP__MSG,    0, mpfrom2short(HP_EDIT_UNDO, 0)
  241. compile if WANT_DM_BUFFER
  242.        buildmenuitem menuname, 3, 302, UNDO_REDO_MENU__MSG\9 || CTRL_KEY__MSG'+U', 'undodlg'UNDO_REDO_MENUP__MSG,      0, mpfrom2short(HP_EDIT_UNDOREDO, 0)
  243.        buildmenuitem menuname, 3, 303, RECOVER_MARK_MENU__MSG,        'GetDMBuff'RECOVER_MARK_MENUP__MSG,    32769, mpfrom2short(HP_EDIT_RECOVER, 0)
  244. compile else
  245.        buildmenuitem menuname, 3, 302, UNDO_REDO_MENU__MSG\9 || CTRL_KEY__MSG'+U', 'undodlg'UNDO_REDO_MENUP__MSG,      32769, mpfrom2short(HP_EDIT_UNDOREDO, 0)
  246. compile endif  -- WANT_DM_BUFFER
  247.      buildmenuitem menuname, 3, 305, \0,                               '',          4, 0
  248.      buildmenuitem menuname, 3, 310, CLIP_COPY_MENU__MSG\9 || CTRL_KEY__MSG'+'INSERT_KEY__MSG ,  'Copy2Clip'CLIP_COPY_MENUP__MSG, 0, mpfrom2short(HP_EDIT_COPY, 0)
  249.      buildmenuitem menuname, 3, 320, CUT_MENU__MSG\9 || SHIFT_KEY__MSG'+'DELETE_KEY__MSG, 'Cut'CUT_MENUP__MSG,       0, mpfrom2short(HP_EDIT_CUT, 0)
  250.      buildmenuitem menuname, 3, 330, PASTE_C_MENU__MSG,   PASTE_C_MENUP__MSG,   17+64, mpfrom2short(HP_EDIT_PASTEMENU, 0)
  251.        buildmenuitem menuname, 3, 331, PASTE_C_MENU__MSG||PASTE_C_KEY,   'Paste C'PASTE_C_MENUP__MSG,   0, mpfrom2short(HP_EDIT_PASTEC, 0)
  252.        buildmenuitem menuname, 3, 332, PASTE_L_MENU__MSG||PASTE_L_KEY,   'Paste'PASTE_L_MENUP__MSG,     0, mpfrom2short(HP_EDIT_PASTE, 0)
  253.        buildmenuitem menuname, 3, 333, PASTE_B_MENU__MSG||PASTE_B_KEY,   'Paste B'PASTE_B_MENUP__MSG,   32769, mpfrom2short(HP_EDIT_PASTEB, 0)
  254. compile if BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  255.    accel_len = (3+length(ALT_KEY__MSG))*(not CUA_MENU_ACCEL)
  256. compile endif
  257.      buildmenuitem menuname, 3, 334, \0,                               '',          4, 0
  258.      buildmenuitem menuname, 3, 335, SELECT_ALL_MENU__MSG\9 || CTRL_KEY__MSG'+/',     'select_all'SELECT_ALL_MENUP__MSG, 0, mpfrom2short(HP_EDIT_SELECTALL, 0)
  259. compile if BLOCK_ACTIONBAR_ACCELERATORS=1 | (FILE_ACCEL__L<>'U' & VIEW_ACCEL__L<>'U' & SELECTED_ACCEL__L<>'U' & HELP_ACCEL__L<>'U' & $maybe_ring_accel 'U' & $maybe_actions_accel 'U')
  260.      buildmenuitem menuname, 3, 336, UNMARK_MARK_MENU__MSG\9 || ALT_KEY__MSG'+U',   'DUPMARK U'UNMARK_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_UNMARK, 0)
  261. compile elseif BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  262.      buildmenuitem menuname, 3, 336, UNMARK_MARK_MENU__MSG||leftstr(\9 || ALT_KEY__MSG'+U', accel_len),   'DUPMARK U'UNMARK_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_UNMARK, 0)
  263. compile else
  264.      buildmenuitem menuname, 3, 336, UNMARK_MARK_MENU__MSG,   'DUPMARK U'UNMARK_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_UNMARK, 0)
  265. compile endif
  266. compile if BLOCK_ACTIONBAR_ACCELERATORS=1 | (FILE_ACCEL__L<>'D' & VIEW_ACCEL__L<>'D' & SELECTED_ACCEL__L<>'D' & HELP_ACCEL__L<>'D' & $maybe_ring_accel 'D' & $maybe_actions_accel 'D')
  267.      buildmenuitem menuname, 3, 340, DELETE_MARK_MENU__MSG\9 || ALT_KEY__MSG'+D',   'DUPMARK D'DELETE_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_DELETE, 0)
  268. compile elseif BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  269.      buildmenuitem menuname, 3, 340, DELETE_MARK_MENU__MSG||leftstr(\9 || ALT_KEY__MSG'+D', accel_len),   'DUPMARK D'DELETE_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_DELETE, 0)
  270. compile else
  271.      buildmenuitem menuname, 3, 340, DELETE_MARK_MENU__MSG,   'DUPMARK D'DELETE_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_DELETE, 0)
  272. compile endif
  273.      buildmenuitem menuname, 3, 345, \0,                               '',          4, 0
  274. compile if BLOCK_ACTIONBAR_ACCELERATORS=1 | (FILE_ACCEL__L<>'C' & VIEW_ACCEL__L<>'C' & SELECTED_ACCEL__L<>'C' & HELP_ACCEL__L<>'C' & $maybe_ring_accel 'C' & $maybe_actions_accel 'C')
  275.      buildmenuitem menuname, 3, 350, COPY_MARK_MENU__MSG\9 || ALT_KEY__MSG'+C',     'DUPMARK C'COPY_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_COPYMARK, 0)
  276. compile elseif BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  277.      buildmenuitem menuname, 3, 350, COPY_MARK_MENU__MSG||leftstr(\9 || ALT_KEY__MSG'+C', accel_len),     'DUPMARK C'COPY_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_COPYMARK, 0)
  278. compile else
  279.      buildmenuitem menuname, 3, 350, COPY_MARK_MENU__MSG,              'DUPMARK C'COPY_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_COPYMARK, 0)
  280. compile endif
  281. compile if BLOCK_ACTIONBAR_ACCELERATORS=1 | (FILE_ACCEL__L<>'M' & VIEW_ACCEL__L<>'M' & SELECTED_ACCEL__L<>'M' & HELP_ACCEL__L<>'M' & $maybe_ring_accel 'M' & $maybe_actions_accel 'M')
  282.      buildmenuitem menuname, 3, 360, MOVE_MARK_MENU__MSG\9 || ALT_KEY__MSG'+M',     'DUPMARK M'MOVE_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_MOVE, 0)
  283. compile elseif BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  284.      buildmenuitem menuname, 3, 360, MOVE_MARK_MENU__MSG||leftstr(\9 || ALT_KEY__MSG'+M', accel_len),     'DUPMARK M'MOVE_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_MOVE, 0)
  285. compile else
  286.      buildmenuitem menuname, 3, 360, MOVE_MARK_MENU__MSG,     'DUPMARK M'MOVE_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_MOVE, 0)
  287. compile endif
  288. compile if BLOCK_ACTIONBAR_ACCELERATORS=1 | (FILE_ACCEL__L<>'O' & VIEW_ACCEL__L<>'O' & SELECTED_ACCEL__L<>'O' & HELP_ACCEL__L<>'O' & $maybe_ring_accel 'O' & $maybe_actions_accel 'O')
  289.      buildmenuitem menuname, 3, 370, OVERLAY_MARK_MENU__MSG\9 || ALT_KEY__MSG'+O',  'DUPMARK O'OVERLAY_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_OVERLAY, 0)
  290. compile elseif BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  291.      buildmenuitem menuname, 3, 370, OVERLAY_MARK_MENU__MSG||leftstr(\9 || ALT_KEY__MSG'+O', accel_len),  'DUPMARK O'OVERLAY_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_OVERLAY, 0)
  292. compile else
  293.      buildmenuitem menuname, 3, 370, OVERLAY_MARK_MENU__MSG,  'DUPMARK O'OVERLAY_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_OVERLAY, 0)
  294. compile endif
  295. compile if BLOCK_ACTIONBAR_ACCELERATORS=1 | (FILE_ACCEL__L<>'A' & VIEW_ACCEL__L<>'A' & SELECTED_ACCEL__L<>'A' & HELP_ACCEL__L<>'A' & $maybe_ring_accel 'A' & $maybe_actions_accel 'A')
  296.      buildmenuitem menuname, 3, 380, ADJUST_MARK_MENU__MSG\9 || ALT_KEY__MSG'+A',   'DUPMARK A'ADJUST_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_ADJUST, 0)
  297. compile elseif BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  298.      buildmenuitem menuname, 3, 380, ADJUST_MARK_MENU__MSG||leftstr(\9 || ALT_KEY__MSG'+A', accel_len),   'DUPMARK A'ADJUST_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_ADJUST, 0)
  299. compile else
  300.      buildmenuitem menuname, 3, 380, ADJUST_MARK_MENU__MSG,   'DUPMARK A'ADJUST_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_ADJUST, 0)
  301. compile endif
  302.      buildmenuitem menuname, 3, 390, STYLE_MENU__MSG\9 || CTRL_KEY__MSG'+Y',        'fontlist'STYLE_MENUP__MSG,    0, mpfrom2short(HP_OPTIONS_STYLE, 0)
  303.      buildmenuitem menuname, 3, 395, \0,                       '',          4, 0
  304. compile if WANT_STACK_CMDS
  305.  compile if WANT_STACK_CMDS = 'SWITCH'
  306.    if stack_cmds then
  307.  compile endif
  308.      buildmenuitem menuname, 3, 396, PUSH_MARK_MENU__MSG\9 || CTRL_KEY__MSG'+'SHIFT_KEY__MSG'+'DOWN_KEY__MSG, 'PUSHMARK'PUSH_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_PUSHMARK, 0)
  309.      buildmenuitem menuname, 3, 397, POP_MARK_MENU__MSG\9 || CTRL_KEY__MSG'+'SHIFT_KEY__MSG'+'UP_KEY__MSG, 'POPMARK'POP_MARK_MENUP__MSG,  0, mpfrom2short(HP_EDIT_POPMARK, 16384)
  310.      buildmenuitem menuname, 3, 398, SWAP_MARK_MENU__MSG\9 || CTRL_KEY__MSG'+'SHIFT_KEY__MSG'+=', 'SWAPMARK'SWAP_MARK_MENUP__MSG,  0, mpfrom2short(HP_EDIT_SWAPMARK, 16384)
  311.  compile if WANT_STACK_CMDS = 'SWITCH'
  312.    endif
  313.  compile endif
  314. compile endif
  315. compile if ENHANCED_PRINT_SUPPORT
  316.      buildmenuitem menuname, 3, 399, PRINT_MENU__MSG'...',          'PRINTDLG M'ENHPRT_MARK_MENUP__MSG,0, mpfrom2short(HP_EDIT_ENHPRINT, 0)
  317. compile else
  318.      buildmenuitem menuname, 3, 399, PRINT_MENU__MSG,               'DUPMARK P'PRT_MARK_MENUP__MSG, 0, mpfrom2short(HP_EDIT_PRINT, 0)
  319. compile endif
  320.  
  321.  
  322. compile if MENU_LIMIT
  323. defproc add_ring_menu(menuname)
  324.    buildsubmenu menuname, 5, RING_BAR__MSG, LIST_FILES_MENUP__MSG, 0 , 0
  325.      if .titletext=='' then
  326.         buildmenuitem menuname, 5, 500, .filename, '',0,0
  327.      else
  328.         buildmenuitem menuname, 5, 500, .titletext, '',0,0
  329.      endif
  330.    return
  331. compile endif
  332.  
  333.  
  334. defproc add_help_menu(menuname)
  335.    buildsubmenu menuname, HELP_MENU_ID, HELP_BAR__MSG, 'help'HELP_BARP__MSG, /* 512 */  0, mpfrom2short(HP_HELP, 0)
  336.      buildmenuitem menuname, HELP_MENU_ID, 600, HELP_INDEX_MENU__MSG,   'helpmenu 10'/*64044*/HELP_INDEX_MENUP__MSG,   0, mpfrom2short(HP_HELP_INDEX, 0)
  337.      buildmenuitem menuname, HELP_MENU_ID, 601, EXT_HELP_MENU__MSG,     'helpmenu 4000'EXT_HELP_MENUP__MSG, 0, mpfrom2short(HP_HELP_EXTENDED, 0)
  338.      buildmenuitem menuname, HELP_MENU_ID, 602, HELP_HELP_MENU__MSG,    'helpmenu 64027'HELP_HELP_MENUP__MSG,    0, mpfrom2short(HP_HELP_HELP, 0)
  339.      buildmenuitem menuname, HELP_MENU_ID, 603, KEYS_HELP_MENU__MSG,    'helpmenu 1000'KEYS_HELP_MENUP__MSG, 0, mpfrom2short(HP_HELP_KEYS, 0)
  340.      buildmenuitem menuname, HELP_MENU_ID, 604, COMMANDS_HELP_MENU__MSG,'helpmenu 2000'COMMANDS_HELP_MENUP__MSG, 0, mpfrom2short(HP_HELP_COMMANDS, 0)
  341.      buildmenuitem menuname, HELP_MENU_ID, 605, \0,           '',                        4, 0
  342.      buildmenuitem menuname, HELP_MENU_ID, 606, HELP_BROWSER_MENU__MSG, 'help'HELP_BROWSER_MENUP__MSG,    0, mpfrom2short(HP_HELP_BROWSE, 0)
  343.      buildmenuitem menuname, HELP_MENU_ID, 607, \0,           '',                        4, 0
  344. compile if 0
  345.      buildmenuitem menuname, HELP_MENU_ID, 608, '#211'||(3-(screenxysize('X')>1000)), 'IBMmsg'HELP_PROD_MENUP__MSG, 2, mpfrom2short(HP_HELP_IBM, 0)
  346.                          -- Resource # 2112 or 2113 in ERES.DLL
  347. compile else
  348.      buildmenuitem menuname, HELP_MENU_ID, 608, HELP_PROD_MENU__MSG, 'IBMmsg'HELP_PROD_MENUP__MSG, 0, mpfrom2short(HP_HELP_PROD, 0)
  349. compile endif
  350. compile if SUPPORT_USERS_GUIDE | SUPPORT_TECHREF
  351.      buildmenuitem menuname, HELP_MENU_ID, 610, \0,           '',                        4, 0
  352.  compile if SUPPORT_USERS_GUIDE
  353.      buildmenuitem menuname, HELP_MENU_ID, 620, USERS_GUIDE_MENU__MSG,   USERS_GUIDE_MENUP__MSG, 17+64, mpfrom2short(HP_HELP_USERS_GUIDE, 0)
  354.        buildmenuitem menuname, HELP_MENU_ID, 621, VIEW_USERS_MENU__MSG,  'view epmusers'VIEW_USERS_MENUP__MSG, 0, mpfrom2short(HP_HELP_USERS_GUIDE, 0)
  355.        buildmenuitem menuname, HELP_MENU_ID, 622, VIEW_IN_USERS_MENU__MSG,  'viewword epmusers'VIEW_IN_USERS_MENUP__MSG, 0, mpfrom2short(HP_HELP_USERS_GUIDE, 0)
  356.        buildmenuitem menuname, HELP_MENU_ID, 623, VIEW_USERS_SUMMARY_MENU__MSG,  'view epmusers Summary'VIEW_USERS_SUMMARY_MENUP__MSG, 32768+1, mpfrom2short(HP_HELP_USERS_GUIDE, 0)
  357.  compile endif
  358.  compile if SUPPORT_TECHREF
  359.      buildmenuitem menuname, HELP_MENU_ID, 630, TECHREF_MENU__MSG,   TECHREF_MENUP__MSG, 17+64, mpfrom2short(HP_HELP_TECHREF, 0)
  360.        buildmenuitem menuname, HELP_MENU_ID, 631, VIEW_TECHREF_MENU__MSG,  'view epmtech'VIEW_TECHREF_MENUP__MSG, 0, mpfrom2short(HP_HELP_TECHREF, 0)
  361.        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)
  362.  compile endif
  363. compile endif
  364.  
  365. defproc readd_help_menu
  366.    universal defaultmenu, activemenu
  367.    call add_help_menu(defaultmenu)
  368.    call maybe_show_menu()
  369.  
  370. defproc maybe_show_menu
  371.    universal defaultmenu, activemenu
  372.    if activemenu=defaultmenu then
  373.       call showmenu_activemenu()  -- show the updated EPM menu
  374.    endif
  375.  
  376. defproc showmenu_activemenu()
  377.    universal activemenu
  378.    showmenu activemenu  -- show the updated EPM menu
  379.    'postme add_cascade_menus'
  380.  
  381. defc add_cascade_menus
  382. compile if RING_OPTIONAL
  383.    universal ring_enabled
  384. compile endif
  385. compile if RING_OPTIONAL
  386.    if ring_enabled then
  387. compile endif
  388.       'cascade_menu 100 102' -- If ring is enabled, the default is Open as Same Window
  389. compile if RING_OPTIONAL
  390.    else
  391.       'cascade_menu 100 101' -- If ring is not enabled, the default is Open as New Window
  392.    endif
  393. compile endif
  394.    'cascade_menu 150 151'  -- Command cascade; default is Command Dialog
  395.    'cascade_menu 200 201'  -- Search cascade; default is Search Dialog
  396. compile if WANT_TAGS
  397.  compile if EPM32
  398.    'cascade_menu 210 211'  -- Tags cascade; default is Tags Dialog
  399.  compile else
  400.    'cascade_menu 210 213'  -- Tags cascade; default is Find Current Procedure
  401.  compile endif
  402. compile endif
  403. compile if WANT_BOOKMARKS
  404.    'cascade_menu 223 227'  -- Bookmarks cascade; default is Next Bookmark
  405. compile endif
  406.    'cascade_menu 300 302'  -- Undo cascade; default is Undo Dialog
  407.    'cascade_menu 330 331'  -- Paste cascade; default is Paste (character mark)
  408. compile if SUPPORT_USERS_GUIDE
  409.    'cascade_menu 620'
  410. compile endif
  411. compile if SUPPORT_TECHREF
  412.    'cascade_menu 630'
  413. compile endif
  414. compile if defined(CUSTEPM_DEFAULT_SCREEN)
  415.    'cascade_menu' 3700 (CUSTEPM_DEFAULT_SCREEN + 3700)
  416. compile elseif defined(HAVE_CUSTEPM)
  417.    'cascade_menu' 3700
  418. compile endif
  419.  
  420. defproc build_menu_accelerators(activeaccel)
  421. compile if BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  422.    universal CUA_MENU_ACCEL
  423. compile endif
  424. compile if WANT_STACK_CMDS = 'SWITCH'
  425.    universal stack_cmds
  426. compile endif
  427.                        -- Build keys on File menu
  428.    buildacceltable activeaccel, 'dokey F8',  AF_VIRTUALKEY,                VK_F8, 1101  -- F8
  429.    buildacceltable activeaccel, 'dokey c+O', AF_CHAR+AF_CONTROL,              79, 1102  -- c+O
  430.    buildacceltable activeaccel, 'dokey c+O', AF_CHAR+AF_CONTROL,             111, 1103  -- c+o
  431.    buildacceltable activeaccel, 'dokey F7',  AF_VIRTUALKEY,                VK_F7, 1104  -- F7
  432.    buildacceltable activeaccel, 'dokey F2',  AF_VIRTUALKEY,                VK_F2, 1105  -- F2
  433.    buildacceltable activeaccel, 'dokey F3',  AF_VIRTUALKEY,                VK_F3, 1106  -- F3
  434.    buildacceltable activeaccel, 'dokey F4',  AF_VIRTUALKEY,                VK_F4, 1107  -- F4
  435.  
  436.                        -- Build keys on Edit menu  ('C' & 'O' appear under Action bar keys for English)
  437.   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_ring_accel 'C' & $maybe_actions_accel 'C'
  438.    buildacceltable activeaccel, 'dokey a+C', AF_CHAR+AF_ALT,                  67, 1201  -- a+C
  439.    buildacceltable activeaccel, 'dokey a+C', AF_CHAR+AF_ALT,                  99, 1202  -- a+c
  440.   compile endif
  441.   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_ring_accel 'M' & $maybe_actions_accel 'M'
  442.    buildacceltable activeaccel, 'dokey a+M', AF_CHAR+AF_ALT,                  77, 1203  -- a+M
  443.    buildacceltable activeaccel, 'dokey a+M', AF_CHAR+AF_ALT,                 109, 1204  -- a+m
  444.   compile endif
  445.   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_ring_accel 'O' & $maybe_actions_accel 'O'
  446.    buildacceltable activeaccel, 'dokey a+O', AF_CHAR+AF_ALT,                  79, 1205  -- a+O
  447.    buildacceltable activeaccel, 'dokey a+O', AF_CHAR+AF_ALT,                 111, 1206  -- a+o
  448.   compile endif
  449.   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_ring_accel 'A' & $maybe_actions_accel 'A'
  450.    buildacceltable activeaccel, 'dokey a+A', AF_CHAR+AF_ALT,                  65, 1207  -- a+A
  451.    buildacceltable activeaccel, 'dokey a+A', AF_CHAR+AF_ALT,                  97, 1208  -- a+a
  452.   compile endif
  453.   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_ring_accel 'U' & $maybe_actions_accel 'U'
  454.    buildacceltable activeaccel, 'dokey a+U', AF_CHAR+AF_ALT,                  85, 1209  -- a+U
  455.    buildacceltable activeaccel, 'dokey a+U', AF_CHAR+AF_ALT,                 117, 1210  -- a+u
  456.   compile endif
  457.   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_ring_accel 'D' & $maybe_actions_accel 'D'
  458.    buildacceltable activeaccel, 'dokey a+D', AF_CHAR+AF_ALT,                  68, 1211  -- a+D
  459.    buildacceltable activeaccel, 'dokey a+D', AF_CHAR+AF_ALT,                 100, 1212  -- a+d
  460.   compile endif
  461.    buildacceltable activeaccel, 'copy2clip', AF_VIRTUALKEY+AF_CONTROL, VK_INSERT, 1213  -- c+Insert
  462.    buildacceltable activeaccel, 'cut',       AF_VIRTUALKEY+AF_SHIFT,   VK_DELETE, 1214  -- s+Delete
  463.    buildacceltable activeaccel, 'paste' DEFAULT_PASTE, AF_VIRTUALKEY+AF_SHIFT,   VK_INSERT, 1215  -- s+Insert
  464.    buildacceltable activeaccel, 'paste' ALTERNATE_PASTE, AF_VIRTUALKEY+AF_SHIFT+AF_CONTROL,   VK_INSERT, 1221  -- c+s+Insert
  465.    buildacceltable activeaccel, 'dokey F9',  AF_VIRTUALKEY,                VK_F9, 1216  -- F9
  466.   compile if EVERSION >= 5.50
  467.    buildacceltable activeaccel, 'dokey c+Y', AF_CHAR+AF_CONTROL,              89, 1217  -- c+Y
  468.    buildacceltable activeaccel, 'dokey c+Y', AF_CHAR+AF_CONTROL,             121, 1218  -- c+y
  469.   compile endif
  470.    buildacceltable activeaccel, 'select_all',AF_CHAR+AF_CONTROL,              47, 1219  -- c+/
  471.    buildacceltable activeaccel, 'DUPMARK U', AF_CHAR+AF_CONTROL,              92, 1220  -- c+\
  472.  
  473. compile if WANT_STACK_CMDS
  474.  compile if WANT_STACK_CMDS = 'SWITCH'
  475.    if stack_cmds then
  476.  compile endif
  477.    buildacceltable activeaccel, 'dokey c+down', AF_VIRTUALKEY+AF_CONTROL,   VK_DOWN, 1222  -- c+Down
  478.    buildacceltable activeaccel, 'dokey c+Up',   AF_VIRTUALKEY+AF_CONTROL,     VK_UP, 1223  -- c+Up
  479.  compile if WANT_STACK_CMDS = 'SWITCH'
  480.    endif
  481.  compile endif
  482.    buildacceltable activeaccel, 'swappos',  AF_CHAR+AF_CONTROL,                     61, 1224  -- c+=
  483.    buildacceltable activeaccel, 'pushmark', AF_VIRTUALKEY+AF_CONTROL+AF_SHIFT, VK_DOWN, 1225  -- c+s+Down
  484.    buildacceltable activeaccel, 'popmark',  AF_VIRTUALKEY+AF_CONTROL+AF_SHIFT,   VK_UP, 1226  -- c+s+Up
  485.    buildacceltable activeaccel, 'swapmark', AF_CHAR+AF_CONTROL+AF_SHIFT,            61, 1227  -- c+s+=
  486.    buildacceltable activeaccel, 'swapmark', AF_CHAR+AF_CONTROL+AF_SHIFT,            43, 1228  -- c+s++
  487. compile endif
  488.  
  489.                        -- Build keys on Search menu
  490.    buildacceltable activeaccel, 'dokey c+S', AF_CHAR+AF_CONTROL,              83, 1301  -- c+S
  491.    buildacceltable activeaccel, 'dokey c+S', AF_CHAR+AF_CONTROL,             115, 1302  -- c+s
  492.    buildacceltable activeaccel, 'dokey c+F', AF_CHAR+AF_CONTROL,              70, 1303  -- c+F
  493.    buildacceltable activeaccel, 'dokey c+F', AF_CHAR+AF_CONTROL,             102, 1304  -- c+f
  494.    buildacceltable activeaccel, 'dokey c+C', AF_CHAR+AF_CONTROL,              67, 1305  -- c+C
  495.    buildacceltable activeaccel, 'dokey c+C', AF_CHAR+AF_CONTROL,              99, 1306  -- c+c
  496.                        -- Build keys on Bookmark submenu
  497.   compile if WANT_BOOKMARKS
  498.    buildacceltable activeaccel, 'dokey c+B', AF_CHAR+AF_CONTROL,              66, 1331  -- c+B
  499.    buildacceltable activeaccel, 'dokey c+B', AF_CHAR+AF_CONTROL,              98, 1332  -- c+b
  500.    buildacceltable activeaccel, 'dokey c+M', AF_CHAR+AF_CONTROL,              77, 1333  -- c+M
  501.    buildacceltable activeaccel, 'dokey c+M', AF_CHAR+AF_CONTROL,             109, 1334  -- c+m
  502.    buildacceltable activeaccel, 'nextbookmark',  AF_CHAR+AF_ALT,              47, 1335  -- a+/
  503.    buildacceltable activeaccel, 'nextbookmark P',AF_CHAR+AF_ALT,              92, 1336  -- a+\
  504.   compile endif
  505.                        -- Build keys on Tags submenu
  506.   compile if WANT_TAGS
  507.    buildacceltable activeaccel, 'dokey s+F6', AF_VIRTUALKEY+AF_SHIFT,      VK_F6, 1361  -- s+F6
  508.    buildacceltable activeaccel, 'dokey s+F7', AF_VIRTUALKEY+AF_SHIFT,      VK_F7, 1362  -- s+F7
  509.    buildacceltable activeaccel, 'dokey s+F8', AF_VIRTUALKEY+AF_SHIFT,      VK_F8, 1363  -- s+F8
  510.    buildacceltable activeaccel, 'dokey s+F9', AF_VIRTUALKEY+AF_SHIFT,      VK_F9, 1364  -- s+F9
  511.   compile endif
  512.  
  513.                        -- Build keys on Options menu
  514.    buildacceltable activeaccel, 'dokey c+G', AF_CHAR+AF_CONTROL,              71, 1401  -- c+G
  515.    buildacceltable activeaccel, 'dokey c+G', AF_CHAR+AF_CONTROL,             103, 1402  -- c+g
  516.  
  517.                        -- Build keys on Command menu
  518.    buildacceltable activeaccel, 'dokey c+I', AF_CHAR+AF_CONTROL,              73, 1501  -- c+I
  519.    buildacceltable activeaccel, 'dokey c+I', AF_CHAR+AF_CONTROL,             105, 1502  -- c+i
  520.  
  521.                        -- Block action bar accelerator keys (English)
  522.   compile if BLOCK_ACTIONBAR_ACCELERATORS
  523.    compile if BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  524.    if not CUA_MENU_ACCEL then
  525.    compile endif
  526.    buildacceltable activeaccel, 'dokey a+'FILE_ACCEL__L,    AF_CHAR+AF_ALT, FILE_ACCEL__A1   , 1001  -- a+F
  527.    buildacceltable activeaccel, 'dokey a+'FILE_ACCEL__L,    AF_CHAR+AF_ALT, FILE_ACCEL__A2   , 1002  -- a+f
  528.    buildacceltable activeaccel, 'dokey a+'VIEW_ACCEL__L,    AF_CHAR+AF_ALT, VIEW_ACCEL__A1   , 1003  -- a+V
  529.    buildacceltable activeaccel, 'dokey a+'VIEW_ACCEL__L,    AF_CHAR+AF_ALT, VIEW_ACCEL__A2   , 1004  -- a+v
  530.    buildacceltable activeaccel, 'dokey a+'SELECTED_ACCEL__L,AF_CHAR+AF_ALT, SELECTED_ACCEL__A1,1005  -- a+S
  531.    buildacceltable activeaccel, 'dokey a+'SELECTED_ACCEL__L,AF_CHAR+AF_ALT, SELECTED_ACCEL__A2,1006  -- a+s
  532.    buildacceltable activeaccel, 'dokey a+'HELP_ACCEL__L,    AF_CHAR+AF_ALT, HELP_ACCEL__A1   , 1011  -- a+H
  533.    buildacceltable activeaccel, 'dokey a+'HELP_ACCEL__L,    AF_CHAR+AF_ALT, HELP_ACCEL__A2   , 1012  -- a+h
  534.    compile if MENU_LIMIT
  535.    buildacceltable activeaccel, 'dokey a+'RING_ACCEL__L,    AF_CHAR+AF_ALT, RING_ACCEL__A1   , 1013  -- a+R
  536.    buildacceltable activeaccel, 'dokey a+'RING_ACCEL__L,    AF_CHAR+AF_ALT, RING_ACCEL__A2   , 1014  -- a+r
  537.    compile endif
  538.    compile if defined(ACTIONS_ACCEL__L)  -- For CUSTEPM support
  539.    buildacceltable activeaccel, 'dokey a+'ACTIONS_ACCEL__L, AF_CHAR+AF_ALT, ACTIONS_ACCEL__A1, 1017  -- a+A
  540.    buildacceltable activeaccel, 'dokey a+'ACTIONS_ACCEL__L, AF_CHAR+AF_ALT, ACTIONS_ACCEL__A2, 1018  -- a+a
  541.    compile endif
  542.    compile if BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  543.    endif -- CUA_MENU_ACCEL
  544.    compile endif
  545.   compile endif -- BLOCK_ACTIONBAR_ACCELERATORS
  546.  
  547. compile if BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
  548. define  -- Prepare for some conditional tests
  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 false for any letter
  558.  compile endif
  559.  
  560. defproc update_edit_menu_text =  -- Actually, Selected menu, but we'll keep the name...
  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' | VIEW_ACCEL__L = 'C' | SELECTED_ACCEL__L = 'C' | HELP_ACCEL__L = '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.                       350 + 65536,
  569.                       ltoa(offset(menutext) || selector(menutext), 10) )
  570.  compile endif
  571.  
  572.  compile if FILE_ACCEL__L = 'M' | VIEW_ACCEL__L = 'M' | SELECTED_ACCEL__L = 'M' | HELP_ACCEL__L = '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.                       360 + 65536,
  577.                       ltoa(offset(menutext) || selector(menutext), 10) )
  578.  compile endif
  579.  
  580.  compile if FILE_ACCEL__L = 'O' | VIEW_ACCEL__L = 'O' | SELECTED_ACCEL__L = 'O' | HELP_ACCEL__L = '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.                       370 + 65536,
  585.                       ltoa(offset(menutext) || selector(menutext), 10) )
  586.  compile endif
  587.  
  588.  compile if FILE_ACCEL__L = 'A' | VIEW_ACCEL__L = 'A' | SELECTED_ACCEL__L = 'A' | HELP_ACCEL__L = '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.                       380 + 65536,
  593.                       ltoa(offset(menutext) || selector(menutext), 10) )
  594.  compile endif
  595.  
  596.  compile if FILE_ACCEL__L = 'U' | VIEW_ACCEL__L = 'U' | SELECTED_ACCEL__L = 'U' | HELP_ACCEL__L = '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.                       334 + 65536,
  601.                       ltoa(offset(menutext) || selector(menutext), 10) )
  602.  compile endif
  603.  
  604.  compile if FILE_ACCEL__L = 'D' | VIEW_ACCEL__L = 'D' | SELECTED_ACCEL__L = 'D' | HELP_ACCEL__L = '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.                       340 + 65536,
  609.                       ltoa(offset(menutext) || selector(menutext), 10) )
  610.  compile endif
  611.  
  612. compile endif
  613.  
  614.  
  615.  
  616. defc menuinit_2                  ------------- Menu id 2 -- View -------------------------
  617.  compile if WANT_STACK_CMDS
  618.    universal position_stack
  619.   compile if WANT_STACK_CMDS = 'SWITCH'
  620.    universal stack_cmds
  621.   compile endif
  622.  compile endif
  623.  compile if RING_OPTIONAL
  624.    universal ring_enabled
  625.  compile endif
  626.  compile if CHECK_FOR_LEXAM
  627.    universal LEXAM_is_available
  628.  compile endif
  629.  compile if SPELL_SUPPORT
  630.   compile if CHECK_FOR_LEXAM
  631.     if LEXAM_is_available then
  632.   compile endif
  633.       SetMenuAttribute( 232, 8192, .keyset <> 'SPELL_KEYS')  -- Dynamic spell checking
  634.   compile if CHECK_FOR_LEXAM
  635.     endif
  636.   compile endif
  637.  compile endif  -- SPELL_SUPPORT
  638.  compile if RING_OPTIONAL
  639.    if ring_enabled then
  640.  compile endif
  641.       SetMenuAttribute( 240, 16384, filesinring()>1)  -- List ring
  642.  compile if RING_OPTIONAL
  643.    endif
  644.  compile endif
  645.  compile if WANT_STACK_CMDS
  646.   compile if WANT_STACK_CMDS = 'SWITCH'
  647.    if stack_cmds then
  648.   compile endif
  649.       SetMenuAttribute( 244, 16384, position_stack<>'')  -- Pop cursor
  650.       SetMenuAttribute( 245, 16384, position_stack<>'')  -- Swap cursor
  651.   compile if WANT_STACK_CMDS = 'SWITCH'
  652.    endif
  653.   compile endif
  654.  compile endif
  655.  
  656.  
  657.  
  658. defc menuinit_200               ------------- Menu id 200 -- Search -----------------------
  659.       universal lastchangeargs
  660.       getsearch strng
  661.       parse value strng with . c .       -- blank, 'c', or 'l'
  662.       SetMenuAttribute( 203, 16384, c<>'')  -- Find Next OK if not blank
  663.       SetMenuAttribute( 204, 16384, lastchangeargs<>'')  -- Change Next only if 'c'
  664.  
  665.  
  666.  
  667. compile if WANT_BOOKMARKS
  668. defc menuinit_220                ------------- Menu id 220 -- Bookmarks --------------------
  669.       universal EPM_utility_array_ID
  670.       do_array 3, EPM_utility_array_ID, 'bmi.0', bmcount          -- Index says how many bookmarks there are
  671.  compile if EVERSION >= '6.03'
  672.       SetMenuAttribute( 224, 16384, not(browse() | .readonly))  -- Set
  673.  compile else
  674.       SetMenuAttribute( 224, 16384, browse()=0)  -- Set
  675.  compile endif
  676.       SetMenuAttribute( 225, 16384, bmcount>0)   -- List
  677.       SetMenuAttribute( 227, 16384, bmcount>0)   -- Next
  678.       SetMenuAttribute( 228, 16384, bmcount>0)   -- Prev
  679. compile endif  -- WANT_BOOKMARKS
  680.  
  681.  
  682. defc menuinit_3                  ------------- Menu id 3 -- Selected ---------------------
  683.  compile if WANT_STACK_CMDS
  684.    universal mark_stack
  685.   compile if WANT_STACK_CMDS = 'SWITCH'
  686.    universal stack_cmds
  687.   compile endif
  688.  compile endif
  689.    undoaction 1, PresentState        -- Do to fix range, not for value.
  690.    undoaction 6, StateRange               -- query range
  691.    parse value staterange with oldeststate neweststate .
  692.    SetMenuAttribute( 300, 16384, oldeststate<>neweststate )  -- Set to 1 if different
  693.  compile if EVERSION >= '6.03'
  694.    paste = clipcheck(format) & (format=1024) & not (browse() | .readonly)
  695.  compile elseif EPM32
  696.    paste = clipcheck(format) & (format=1024) & browse()=0
  697.  compile else
  698.    paste = clipcheck(format) & (format=256) & browse()=0
  699.  compile endif  -- EPM32
  700.    SetMenuAttribute( 330, 16384, paste)
  701.    on = marktype()<>''
  702.    buf_flag = 0
  703.    if not on then                             -- Only check buffer if no mark
  704.       bufhndl = buffer(OPENBUF, EPMSHAREDBUFFER)
  705.       if bufhndl then                         -- If the buffer exists, check the
  706.          buf_flag=itoa(peek(bufhndl,2,2),10)  -- amount of used space in buffer
  707.          call buffer(FREEBUF, bufhndl)        -- then free it.
  708.       endif
  709.    endif
  710.    SetMenuAttribute( 310, 16384, on)      -- Copy to clipboard
  711.    SetMenuAttribute( 320, 16384, on)      -- Cut
  712.    SetMenuAttribute( 336, 16384, on)      -- Unmark
  713.    SetMenuAttribute( 340, 16384, on)      -- Delete mark
  714.    SetMenuAttribute( 350, 16384, on | buf_flag)  -- Can Copy if mark or buffer has data
  715.    SetMenuAttribute( 360, 16384, on)      -- Move mark
  716.    SetMenuAttribute( 370, 16384, on | buf_flag)  -- Ditto for Overlay mark
  717.    SetMenuAttribute( 380, 16384, on)      -- Adjust mark
  718.    SetMenuAttribute( 390, 16384, on)      -- Style dialog
  719.  compile if WANT_STACK_CMDS
  720.   compile if WANT_STACK_CMDS = 'SWITCH'
  721.    if stack_cmds then
  722.   compile endif
  723.       SetMenuAttribute( 396, 16384, on)                  -- Push mark
  724.       SetMenuAttribute( 397, 16384, mark_stack<>'')      -- Pop mark
  725.       SetMenuAttribute( 398, 16384, on & mark_stack<>'') -- Swap mark
  726.   compile if WANT_STACK_CMDS = 'SWITCH'
  727.    endif
  728.   compile endif
  729.  compile endif
  730.    SetMenuAttribute( 399, 16384, on)      -- Print marked text
  731.  
  732.  
  733.  
  734. defc menuinit_300                ------------- Menu id 300 -- Undo ---------------------
  735.    SetMenuAttribute( 301, 16384, isadirtyline())
  736.    undoaction 1, PresentState        -- Do to fix range, not for value.
  737.    undoaction 6, StateRange               -- query range
  738.    parse value staterange with oldeststate neweststate .
  739.    SetMenuAttribute( 302, 16384, oldeststate<>neweststate )  -- Set to 1 if different
  740.  
  741.  
  742.  
  743. defc menuinit_330                ------------- Menu id 330 -- Paste ---------------------
  744. compile if EVERSION >= '6.03'
  745.    paste = clipcheck(format) & (format=1024) & not (browse() | .readonly)
  746. compile elseif EPM32
  747.    paste = clipcheck(format) & (format=1024) & browse()=0
  748. compile else
  749.    paste = clipcheck(format) & (format=256) & browse()=0
  750. compile endif  -- EPM32
  751.    SetMenuAttribute( 331, 16384, paste)
  752.    SetMenuAttribute( 332, 16384, paste)
  753.    SetMenuAttribute( 333, 16384, paste)
  754.  
  755.