home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / epmsmp.zip / RESIZE.E < prev    next >
Text File  |  1992-08-26  |  1KB  |  25 lines

  1. ; The following code can be included in MYMAIN.E to size the EPM window
  2. ; according to the largest file in the ring.  There are two calls to
  3. ; windowsize1 included; the one that is used is the general one that
  4. ; will work from any window layout, since it queries whether or not the
  5. ; statusline, messageline and bottom scroll bar are visible and sets the
  6. ; window size accordingle.  The other call (commented out) is more
  7. ; efficient, since it doesn't query the controls at runtime.  Instead,
  8. ; it assumes the standard EPM setup of statusline on, messageline off,
  9. ; scroll bars on.
  10. ;                        Larry Margolis
  11. getfileid startfid
  12. biggest = 0
  13. fid = ''
  14. do while fid <> startfid
  15.    nextfile
  16.    biggest = max(biggest,.last)
  17.    getfileid fid
  18. end
  19. if biggest > 1 & biggest < 20 then
  20. ;; call windowsize1(biggest+1,.windowwidth,0,0,1)  -- Size the window to the biggest file
  21.    call windowsize1(biggest-1 + querycontrol(7) + querycontrol(8) + querycontrol(10),
  22.                     .windowwidth,0,0,1) -- Add 1 ea. for statusline, msgline, horiz. scrollbar
  23. endif
  24.  
  25.