home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / fpc / source / sedwind.seq < prev    next >
Text File  |  1989-05-24  |  4KB  |  99 lines

  1. \ SEDWIND.SEQ   Editor window adjustment words
  2.  
  3. editor definitions
  4.  
  5. headerless
  6.  
  7.  0 value zoomed?
  8.  
  9. : adjust-window ( --- )
  10.         begin
  11.                 savescr
  12.                 20  6 58 10 box&fill
  13.                 ."  Adjust window size..  \r ESC \0 = done"
  14.                 bcr bcr
  15.                 ."  =Smaller window   =Bigger window "
  16.                 cursor-off key dup 27 <>
  17.                 restscr
  18.         while   dup 200 =       \ UP arrow      SMALLER WINDOW
  19.                 if      first.textcol 0=
  20.                     if        1 =: first.textcol
  21.                         cols 2- =: last.textcol
  22.                     else
  23.                         first.textline 2 <
  24.                         if      incr> first.textline
  25.                                 0 recoverline
  26.                                 incr> screenline
  27.                         else    last.textline 1- first.textline 2+ max
  28.                                 =: last.textline
  29.                         then
  30.                     then
  31.                 then
  32.                     208 =       \ DOWN arrow    BIGGER WINDOW
  33.                 if      first.textline 1 =
  34.                     if     0    =: first.textcol
  35.                         cols 1- =: last.textcol
  36.                     else
  37.                         last.textline rows 2- =
  38.                         if      first.textline 1- 1 max =: first.textline
  39.                                 decr> screenline
  40.                         else    last.textline 1+
  41.                                 rows 2- min =: last.textline
  42.                         then
  43.                     then
  44.                 then    scrshow on> ?border showstat
  45.                 last.textline rows 1- <
  46.                 if      last.textline 2+ recoverline then
  47.         repeat  drop
  48.         off> zoomed?                    \ next zoom goes to big window
  49.         tscrn   scrshow                 \ move cursor to top of screen
  50.         on> ?border showstat
  51.         cursor-on ?cursor showcur ;
  52.  
  53. ' adjust-window is adjwind
  54.  
  55.  1 value first.textline.saved
  56. 24 value last.textline.saved
  57.  0 value first.textcol.saved
  58. 80 value last.textcol.saved
  59.  
  60. : zoom-window   ( --- )     \ Zoom the window from current size to full size.
  61.                 zoomed? dup 0= =: zoomed?
  62.                 if      \ IF we are already ZOOMed then zoom to small window
  63.                         first.textline.saved =: first.textline
  64.                         last.textline.saved  =: last.textline
  65.                         first.textcol.saved  =: first.textcol
  66.                         last.textcol.saved   =: last.textcol
  67.                         screenline first.textline max
  68.                                    last.textline  min =: screenline
  69.                         0 recoverline
  70.                         scrshow on> ?border showstat
  71.                         last.textline rows 2- <
  72.                         if      rows    last.textline 2+
  73.                                 ?do     i recoverline
  74.                                 loop
  75.                         then
  76.                 else    \ ELSE zoom to big window
  77.                         first.textline =: first.textline.saved
  78.                         last.textline  =: last.textline.saved
  79.                         first.textcol  =: first.textcol.saved
  80.                         last.textcol   =: last.textcol.saved
  81.  
  82.                                     1  =: first.textline
  83.                                rows 1- =: last.textline
  84.                                     0  =: first.textcol
  85.                                cols 1- =: last.textcol
  86.                         first.textline.saved screenline =
  87.                         if      first.textline =: screenline
  88.                         then
  89.                         on> ?border showstat
  90.                         scrshow
  91.                 then    ;
  92.  
  93. ' zoom-window is zoomwind
  94.  
  95. headers
  96.  
  97. forth definitions
  98.  
  99.