Ignore:
Timestamp:
Dec 13, 2005, 9:09:43 PM (19 years ago)
Author:
Andreas Schnellbacher
Message:
  • Removed obsolete RING_OPTIONAL.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/netlabs/macros/stdmenu.e

    r1627 r1686  
    55* Copyright (c) Netlabs EPM Distribution Project 2002
    66*
    7 * $Id: stdmenu.e,v 1.25 2005-11-15 17:43:00 aschn Exp $
     7* $Id: stdmenu.e,v 1.26 2005-12-13 20:09:43 aschn Exp $
    88*
    99* ===========================================================================
     
    2424- WANT_DYNAMIC_PROMPTS,
    2525  ALLOW_PROMPTING_AT_TOP, BLOCK_ACTIONBAR_ACCELERATORS, WANT_STACK_CMDS,
    26   RING_OPTIONAL, WANT_STREAM_MODE, WANT_BOOKMARKS, WANT_TAGS
     26  WANT_STREAM_MODE, WANT_BOOKMARKS, WANT_TAGS
    2727  WANT_EPM_SHELL, WANT_TOOLBAR, SPELL_SUPPORT, ENHANCED_PRINT_SUPPORT,
    2828  WANT_DM_BUFFER, WANT_APPLICATION_INI_FILE, SUPPORT_BOOK_ICON
     
    7474 compile if not defined(WANT_STACK_CMDS)
    7575   WANT_STACK_CMDS = 'SWITCH'
    76  compile endif
    77  compile if not defined(RING_OPTIONAL)
    78    RING_OPTIONAL = 1
    7976 compile endif
    8077 compile if not defined(WANT_STREAM_MODE)
     
    163160
    164161defproc add_file_menu(menuname)
    165 compile if RING_OPTIONAL
    166162   universal ring_enabled
    167 compile endif
    168163   buildsubmenu menuname, 2, FILE_BAR__MSG, FILE_BARP__MSG, 0 , mpfrom2short(HP_FILE, 0)
    169164      buildmenuitem menuname, 2, 198, NEW_MENU__MSG,            'NEW'NEW_MENUP__MSG,     0, mpfrom2short(HP_FILE_NEW, 0)
     
    171166      buildmenuitem menuname, 2, 200, OPEN_MENU__MSG\9 || CTRL_KEY__MSG'+O', 'OPENDLG'OPEN_MENUP__MSG,          0, mpfrom2short(HP_FILE_OPEN, 0)
    172167      buildmenuitem menuname, 2, 201, GET_MENU__MSG,            'OPENDLG GET'GET_MENUP__MSG,      0, mpfrom2short(HP_FILE_GET , 0)
    173 compile if RING_OPTIONAL
    174168   if ring_enabled then
    175 compile endif
    176169      buildmenuitem menuname, 2, 202, ADD_MENU__MSG\9'F8', 'OPENDLG EDIT'ADD_MENUP__MSG,     0, mpfrom2short(HP_FILE_EDIT, 0)
    177 compile if RING_OPTIONAL
    178    endif
    179 compile endif
     170   endif
    180171      buildmenuitem menuname, 2, 203, \0,                          '',                 4, 0
    181172      buildmenuitem menuname, 2, 204, RENAME_MENU__MSG\9'F7',   'rename'RENAME_MENUP__MSG,0, mpfrom2short(HP_FILE_NAME, 0)
     
    194185      buildmenuitem menuname, 2, 206, SAVE_MENU__MSG\9'F2',     'SAVE'SAVE_MENUP__MSG,             0, mpfrom2short(HP_FILE_SAVE, 0)
    195186      buildmenuitem menuname, 2, 208, SAVEAS_MENU__MSG,         'SAVEAS_DLG'SAVEAS_MENUP__MSG, 0, mpfrom2short(HP_FILE_SAVEAS, 0)
    196 compile if RING_OPTIONAL
    197187   if ring_enabled then
    198 compile endif         -- Note:  207 used in LaMail; keep ID the same.
     188      -- Note:  207 used in LaMail; keep ID the same.
    199189      buildmenuitem menuname, 2, 207, FILE_MENU__MSG\9'F4',     'FILE'FILE_MENUP__MSG,             0, mpfrom2short(HP_FILE_FILE, 0)
    200 compile if RING_OPTIONAL
    201190   else
    202191      buildmenuitem menuname, 2, 207, SAVECLOSE_MENU__MSG\9'F4',     'FILE'FILE_MENUP__MSG,        0, mpfrom2short(HP_FILE_FILE, 0)
    203192   endif
    204 compile endif
    205193      buildmenuitem menuname, 2, 209, QUIT_MENU__MSG\9'F3',     'QUIT'QUIT_MENUP__MSG,             0, mpfrom2short(HP_FILE_QUIT, 0)
    206194      buildmenuitem menuname, 2, 210, \0,                           '',                 4, 0
     
    396384   RING__ATTRIB   = 0
    397385   STACK__ATTRIB  = 32769
    398 compile elseif RING_OPTIONAL
     386compile elseif 1  -- RING_OPTIONAL
    399387   ENTER__ATTRIB  = 0
    400388   MARK__ATTRIB   = 0
     
    421409
    422410defproc add_options_menu(menuname)
    423 compile if RING_OPTIONAL
    424411   universal ring_enabled
    425 compile endif
    426412   universal font
    427413compile if CHECK_FOR_LEXAM
     
    430416
    431417   buildsubmenu menuname, 4, OPTIONS_BAR__MSG, OPTIONS_BARP__MSG, 0 , mpfrom2short(HP_OPTIONS, 0)
    432 compile if RING_OPTIONAL
    433418   if ring_enabled then
    434 compile endif
    435419      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)
    436420      buildmenuitem menuname, 4, 411, \0,                       '',           4, 0
    437 compile if RING_OPTIONAL
    438    endif
    439 compile endif
     421   endif
    440422compile if SPELL_SUPPORT
    441423 compile if CHECK_FOR_LEXAM
     
    467449         buildmenuitem menuname, 4, 442, STREAMMODE_MENU__MSG,  'stream_toggle'STREAMMODE_MENUP__MSG,  STREAM__ATTRIB, mpfrom2short(HP_OPTIONS_STREAM, NODISMISS)
    468450compile endif
    469 compile if RING_OPTIONAL
    470451         buildmenuitem menuname, 4, 443, RINGENABLED_MENU__MSG,    'ring_toggle'RINGENABLED_MENUP__MSG,  RING__ATTRIB, mpfrom2short(HP_OPTIONS_RINGENABLE, NODISMISS)
    471 compile endif
    472452compile if WANT_STACK_CMDS = 'SWITCH'
    473453         buildmenuitem menuname, 4, 445, STACKCMDS_MENU__MSG,      'stack_toggle'STACKCMDS_MENUP__MSG,  STACK__ATTRIB, mpfrom2short(HP_OPTIONS_STACKCMDS, NODISMISS)
     
    605585--------------------------------------------- Menu id 8 -- Edit -------------------------
    606586defc menuinit_8
    607  compile if WANT_STACK_CMDS
     587compile if WANT_STACK_CMDS
    608588   universal mark_stack, position_stack
    609   compile if WANT_STACK_CMDS = 'SWITCH'
     589 compile if WANT_STACK_CMDS = 'SWITCH'
    610590   universal stack_cmds
    611   compile endif
    612  compile endif  -- WANT_STACK_CMDS
    613       SetMenuAttribute( 816, 16384, isadirtyline())
    614       undoaction 1, PresentState        -- Do to fix range, not for value.
    615       undoaction 6, StateRange               -- query range
    616       parse value staterange with oldeststate neweststate .
    617       SetMenuAttribute( 818, 16384, oldeststate<>neweststate )  -- Set to 1 if different
    618       paste = clipcheck(format) & (format = 1024) & not (browse() | .readonly)
    619       SetMenuAttribute( 810, 16384, paste)
    620       SetMenuAttribute( 811, 16384, paste)
    621       SetMenuAttribute( 812, 16384, paste)
    622       on = marktype()<>''
    623       buf_flag = 0
    624       if not on then                             -- Only check buffer if no mark
    625          bufhndl = buffer(OPENBUF, EPMSHAREDBUFFER)
    626          if bufhndl then                         -- If the buffer exists, check the
    627             buf_flag = itoa(peek(bufhndl,2,2),10)  -- amount of used space in buffer
    628             call buffer(FREEBUF, bufhndl)        -- then free it.
    629          endif
     591 compile endif
     592compile endif  -- WANT_STACK_CMDS
     593   SetMenuAttribute( 816, 16384, isadirtyline())
     594   undoaction 1, PresentState        -- Do to fix range, not for value.
     595   undoaction 6, StateRange               -- query range
     596   parse value staterange with oldeststate neweststate .
     597   SetMenuAttribute( 818, 16384, oldeststate<>neweststate )  -- Set to 1 if different
     598   paste = clipcheck(format) & (format = 1024) & not (browse() | .readonly)
     599   SetMenuAttribute( 810, 16384, paste)
     600   SetMenuAttribute( 811, 16384, paste)
     601   SetMenuAttribute( 812, 16384, paste)
     602   on = marktype()<>''
     603   buf_flag = 0
     604   if not on then                             -- Only check buffer if no mark
     605      bufhndl = buffer(OPENBUF, EPMSHAREDBUFFER)
     606      if bufhndl then                         -- If the buffer exists, check the
     607         buf_flag = itoa(peek(bufhndl,2,2),10)  -- amount of used space in buffer
     608         call buffer(FREEBUF, bufhndl)        -- then free it.
    630609      endif
    631       SetMenuAttribute( 800, 16384, on | buf_flag)  -- Can copy if mark or buffer has data
    632       SetMenuAttribute( 801, 16384, on)
    633       SetMenuAttribute( 802, 16384, on | buf_flag)  -- Ditto for Overlay mark
    634       SetMenuAttribute( 803, 16384, on)
    635       SetMenuAttribute( 805, 16384, on)
    636       SetMenuAttribute( 806, 16384, on)
    637       SetMenuAttribute( 808, 16384, on)
    638       SetMenuAttribute( 809, 16384, on)
    639       SetMenuAttribute( 814, 16384, on)
    640  compile if WANT_STACK_CMDS
    641   compile if WANT_STACK_CMDS = 'SWITCH'
     610   endif
     611   SetMenuAttribute( 800, 16384, on | buf_flag)  -- Can copy if mark or buffer has data
     612   SetMenuAttribute( 801, 16384, on)
     613   SetMenuAttribute( 802, 16384, on | buf_flag)  -- Ditto for Overlay mark
     614   SetMenuAttribute( 803, 16384, on)
     615   SetMenuAttribute( 805, 16384, on)
     616   SetMenuAttribute( 806, 16384, on)
     617   SetMenuAttribute( 808, 16384, on)
     618   SetMenuAttribute( 809, 16384, on)
     619   SetMenuAttribute( 814, 16384, on)
     620compile if WANT_STACK_CMDS
     621 compile if WANT_STACK_CMDS = 'SWITCH'
    642622   if stack_cmds then
    643   compile endif
     623 compile endif
    644624      SetMenuAttribute( 820, 16384, on)
    645625      SetMenuAttribute( 821, 16384, mark_stack<>'')
     
    647627      SetMenuAttribute( 824, 16384, position_stack<>'')
    648628      SetMenuAttribute( 825, 16384, position_stack<>'')
    649   compile if WANT_STACK_CMDS = 'SWITCH'
    650    endif
    651   compile endif
    652  compile endif  -- WANT_STACK_COMMANDS
     629 compile if WANT_STACK_CMDS = 'SWITCH'
     630   endif
     631 compile endif
     632compile endif  -- WANT_STACK_COMMANDS
    653633
    654634--------------------------------------------- Menu id 4 -- Options ---------------------
    655635defc menuinit_4
    656  compile if RING_OPTIONAL
    657636   universal ring_enabled
    658  compile endif
     637compile if CHECK_FOR_LEXAM
     638   universal LEXAM_is_available
     639compile endif
     640   if ring_enabled then
     641      SetMenuAttribute( 410, 16384, filesinring()>1)
     642   endif
     643compile if SPELL_SUPPORT
    659644 compile if CHECK_FOR_LEXAM
    660    universal LEXAM_is_available
    661  compile endif
    662  compile if RING_OPTIONAL
    663       if ring_enabled then
    664  compile endif
    665          SetMenuAttribute( 410, 16384, filesinring()>1)
    666  compile if RING_OPTIONAL
    667       endif
    668  compile endif
    669  compile if SPELL_SUPPORT
    670   compile if CHECK_FOR_LEXAM
    671     if LEXAM_is_available then
    672   compile endif
     645   if LEXAM_is_available then
     646 compile endif
    673647      SetMenuAttribute( 450, 8192, .keyset <> 'SPELL_KEYS')
    674   compile if CHECK_FOR_LEXAM
    675     endif
    676   compile endif
    677  compile endif  -- SPELL_SUPPORT
     648 compile if CHECK_FOR_LEXAM
     649   endif
     650 compile endif
     651compile endif  -- SPELL_SUPPORT
    678652
    679653--------------------------------------------- Menu id 400 -- Options / Preferences -------
     
    681655   universal stack_cmds
    682656   universal CUA_marking_switch
    683   compile if WANT_STREAM_MODE = 'SWITCH'
     657compile if WANT_STREAM_MODE = 'SWITCH'
    684658   universal stream_mode
    685   compile endif
    686   compile if RING_OPTIONAL
     659compile endif
    687660   universal ring_enabled
    688   compile endif
    689   compile if BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
     661compile if BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
    690662   universal CUA_MENU_ACCEL
    691   compile endif
    692       SetMenuAttribute( 441, 8192, CUA_marking_switch)
    693   compile if WANT_STREAM_MODE = 'SWITCH'
    694       SetMenuAttribute( 442, 8192, not stream_mode)
    695   compile endif
    696   compile if RING_OPTIONAL
    697       SetMenuAttribute( 443, 8192, not ring_enabled)
    698   compile endif
    699   compile if WANT_STACK_CMDS = 'SWITCH'
    700       SetMenuAttribute( 445, 8192, not stack_cmds)
    701   compile endif
    702   compile if BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
    703     SetMenuAttribute( 446, 8192, not CUA_MENU_ACCEL)
    704   compile endif
     663compile endif
     664   SetMenuAttribute( 441, 8192, CUA_marking_switch)
     665compile if WANT_STREAM_MODE = 'SWITCH'
     666   SetMenuAttribute( 442, 8192, not stream_mode)
     667compile endif
     668   SetMenuAttribute( 443, 8192, not ring_enabled)
     669compile if WANT_STACK_CMDS = 'SWITCH'
     670   SetMenuAttribute( 445, 8192, not stack_cmds)
     671compile endif
     672compile if BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH'
     673   SetMenuAttribute( 446, 8192, not CUA_MENU_ACCEL)
     674compile endif
    705675
    706676--------------------------------------------- Menu id 425 -- Options / Frame controls  ---
    707677defc menuinit_425
    708678   universal bitmap_present
    709  compile if RING_OPTIONAL
    710       universal ring_enabled
    711  compile endif
    712  compile if WANT_DYNAMIC_PROMPTS
    713       universal menu_prompt
    714  compile endif
    715       SetMenuAttribute( 413, 8192, not queryframecontrol(1) )
    716       SetMenuAttribute( 414, 8192, not queryframecontrol(2) )
    717       SetMenuAttribute( 415, 8192, not queryframecontrol(16))
    718  compile if RING_OPTIONAL
    719       if ring_enabled then
    720  compile endif
    721          SetMenuAttribute( 417, 8192, not queryframecontrol(4))
    722  compile if WANT_TOOLBAR
    723          SetMenuAttribute( 430, 8192, not queryframecontrol(EFRAMEF_TOOLBAR))
    724  compile endif
    725          SetMenuAttribute( 437, 8192, not bitmap_present)
    726  compile if RING_OPTIONAL
    727       else
    728          SetMenuAttribute( 417, 16384, 1)  -- Grey out Rotate Buttons if ring not enabled
    729       endif
    730  compile endif
    731       SetMenuAttribute( 421, 8192, not queryframecontrol(32))
    732  compile if WANT_DYNAMIC_PROMPTS
    733       SetMenuAttribute( 422, 8192, not menu_prompt)
    734  compile endif
     679   universal ring_enabled
     680compile if WANT_DYNAMIC_PROMPTS
     681   universal menu_prompt
     682compile endif
     683   SetMenuAttribute( 413, 8192, not queryframecontrol(1) )
     684   SetMenuAttribute( 414, 8192, not queryframecontrol(2) )
     685   SetMenuAttribute( 415, 8192, not queryframecontrol(16))
     686   if ring_enabled then
     687      SetMenuAttribute( 417, 8192, not queryframecontrol(4))
     688compile if WANT_TOOLBAR
     689      SetMenuAttribute( 430, 8192, not queryframecontrol(EFRAMEF_TOOLBAR))
     690compile endif
     691      SetMenuAttribute( 437, 8192, not bitmap_present)
     692   else
     693      SetMenuAttribute( 417, 16384, 1)  -- Grey out Rotate Buttons if ring not enabled
     694   endif
     695   SetMenuAttribute( 421, 8192, not queryframecontrol(32))
     696compile if WANT_DYNAMIC_PROMPTS
     697   SetMenuAttribute( 422, 8192, not menu_prompt)
     698compile endif
    735699
    736700--------------------------------------------- Menu id 3 -- Search -----------------------
    737701defc menuinit_3
    738       universal lastchangeargs
    739       getsearch strng
    740       parse value strng with . c .       -- blank, 'c', or 'l'
    741       SetMenuAttribute( 302, 16384, c<>'')               -- Find next OK if not blank
    742       SetMenuAttribute( 303, 16384, lastchangeargs<>'')  -- Change next only if 'c'
    743       SetMenuAttribute( 350, 16384, c<>'')               -- Global find next OK if not blank
    744       SetMenuAttribute( 351, 16384, lastchangeargs<>'')  -- Global change next only if 'c'
    745       SetMenuAttribute( 352, 16384, c<>'')               -- Toggle direction OK if not blank
    746 
    747  compile if WANT_BOOKMARKS
     702   universal lastchangeargs
     703   getsearch strng
     704   parse value strng with . c .       -- blank, 'c', or 'l'
     705   SetMenuAttribute( 302, 16384, c<>'')               -- Find next OK if not blank
     706   SetMenuAttribute( 303, 16384, lastchangeargs<>'')  -- Change next only if 'c'
     707   SetMenuAttribute( 350, 16384, c<>'')               -- Global find next OK if not blank
     708   SetMenuAttribute( 351, 16384, lastchangeargs<>'')  -- Global change next only if 'c'
     709   SetMenuAttribute( 352, 16384, c<>'')               -- Toggle direction OK if not blank
     710
     711compile if WANT_BOOKMARKS
    748712--------------------------------------------- Menu id 3 -- Bookmarks --------------------
    749713defc menuinit_305
    750       universal EPM_utility_array_ID
    751       --do_array 3, EPM_utility_array_ID, 'bmi.0', bmcount          -- Index says how many bookmarks there are
    752       rc = get_array_value( EPM_utility_array_ID, 'bmi.0', bmcount )          -- Index says how many bookmarks there are
    753       SetMenuAttribute( 306, 16384, not (browse() | .readonly))  -- Set
    754       SetMenuAttribute( 308, 16384, bmcount>0)   -- List
    755       SetMenuAttribute( 311, 16384, bmcount>0)   -- Next
    756       SetMenuAttribute( 312, 16384, bmcount>0)   -- Prev
    757  compile endif  -- WANT_BOOKMARKS
     714   universal EPM_utility_array_ID
     715   rc = get_array_value( EPM_utility_array_ID, 'bmi.0', bmcount )          -- Index says how many bookmarks there are
     716   SetMenuAttribute( 306, 16384, not (browse() | .readonly))  -- Set
     717   SetMenuAttribute( 308, 16384, bmcount>0)   -- List
     718   SetMenuAttribute( 311, 16384, bmcount>0)   -- Next
     719   SetMenuAttribute( 312, 16384, bmcount>0)   -- Prev
     720compile endif  -- WANT_BOOKMARKS
    758721
    759722; Also will need to handle 204 (Name) on File menu if 5.60 & LaMail...
     
    11131076compile endif
    11141077
    1115 compile if RING_OPTIONAL
    11161078defc ring_toggle
    11171079   universal ring_enabled
     
    11241086   call add_options_menu(defaultmenu, dos_version() >= 1020)
    11251087   call maybe_show_menu()
    1126 compile endif
    11271088
    11281089compile if WANT_STACK_CMDS = 'SWITCH'
Note: See TracChangeset for help on using the changeset viewer.