home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / e / epmmac2.zip / LOAD.E < prev    next >
Text File  |  1993-01-07  |  3KB  |  78 lines

  1. ;  LOAD.E                                                Bryan Lewis 1/2/89
  2. ;
  3. ;  This event is triggered immediately after a file is loaded.  It will be
  4. ;  invoked after loading an existing file from disk, or opening a new file,
  5. ;  but not after an error such as "Not enough memory".
  6. ;  In other words, a new file must be entered into the ring.
  7. ;
  8. ;  This is the place to select a keyset (like c_keys for .C files) since
  9. ;  keysets now stay bound to a file once assigned.
  10. ;  This is also a good place to do other one-time processing like returning to
  11. ;  a saved bookmark.
  12. ;
  13. ;  No argument is passed.  Check .filename if you want the name of the file.
  14. ;  Use the function filetype() for the filetype.
  15. ;  1993/01/07:  put the result of filetype() in a universal so others needn't call it.
  16. defload
  17.    universal load_ext
  18. compile if WANT_EBOOKIE = 'DYNALINK'
  19.    universal bkm_avail
  20. compile endif
  21. compile if EPM
  22.    universal vDEFAULT_TABS, vDEFAULT_MARGINS, vDEFAULT_AUTOSAVE, load_var
  23.  compile if EVERSION >= '5.50'
  24.    universal default_font
  25.  compile endif
  26.  compile if WANT_LONGNAMES='SWITCH'
  27.    universal SHOW_LONGNAMES
  28.  compile endif
  29.  
  30.    load_var = 0
  31.    load_ext = filetype()
  32.  
  33.    .tabs     = vDEFAULT_TABS
  34.    .margins  = vDEFAULT_MARGINS
  35.    .autosave = vDEFAULT_AUTOSAVE
  36.  compile if EVERSION < 5.21
  37.    .statusline=STATUS_TEMPLATE
  38.  compile endif
  39.  compile if WANT_LONGNAMES
  40.   compile if WANT_LONGNAMES='SWITCH'
  41.    if SHOW_LONGNAMES then
  42.   compile endif
  43.    longname = get_EAT_ASCII_value('.LONGNAME')
  44.    if longname<>'' then
  45.       filepath = leftstr(.filename, lastpos('\',.filename))
  46.       .titletext = filepath || longname
  47.    endif
  48.   compile if WANT_LONGNAMES='SWITCH'
  49.    endif
  50.   compile endif
  51.  compile endif
  52. compile else
  53.    .tabs     = DEFAULT_TABS
  54.    .margins  = DEFAULT_MARGINS
  55.    .autosave = DEFAULT_AUTOSAVE
  56. compile endif
  57.    keys edit_keys    -- defaults for non-special filetypes
  58. compile if EVERSION >= '5.50'
  59.    if .font < 2 then    -- If being called from a NAME, and font was set, don't change it.
  60.       .font = default_font
  61.    endif
  62. compile endif
  63. compile if WANT_BOOKMARKS
  64.    if .levelofattributesupport < 2 then  -- If not already set (e.g., NAME does a DEFLOAD)
  65.       'loadattributes'
  66.    endif
  67. compile endif
  68. compile if WANT_EBOOKIE
  69.  compile if WANT_EBOOKIE = 'DYNALINK'
  70.    if bkm_avail <> '' then
  71.  compile endif
  72.       if bkm_defload()<>0 then keys bkm_keys; endif
  73.  compile if WANT_EBOOKIE = 'DYNALINK'
  74.    endif
  75.  compile endif
  76. compile endif  -- WANT_EBOOKIE
  77. -- sayerror 'DEFLOAD occurred for file '.filename'.'  -- for testing
  78.