home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a075 / 1.img / TOOLKIT1.EXE / SST67.PRG < prev    next >
Encoding:
Text File  |  1989-10-03  |  4.5 KB  |  169 lines

  1. ********************
  2.  
  3. FUNCTION Show_tree
  4.  
  5.    PARAMETERS _qrow, _qcol, _pdrive, _ppath
  6.  
  7.    PRIVATE _row, _col, _qption, _screen, _x, 
  8.    PRIVATE _base, _y, _show, _search, _qaz, _oldcolor, 
  9.    PRIVATE _poprow, _popcol, _dfile, _return, _panning
  10.  
  11.    * _row, _col, _base, _y, _x, _qaz, _poprow, and _popcol are all
  12.    * screen counters to show the information.
  13.    *
  14.    * _oldcolor contatins the old screen color before the tree is shown
  15.    * down, up are NOT declared PRIVATE because they need to be manipulated
  16.    * by two separate proceudres: Pan_up and Pan_down
  17.    *
  18.    * _screen saves the current screen and all of the rest should be
  19.    * self explanatory
  20.  
  21.    _oldcolor = SETCOLOR()
  22.  
  23.    IF TYPE("_qrow") = "C"
  24.       IF _qrow$"SHOW"
  25.          RETURN("")
  26.       ENDIF
  27.       * This was activated via the SETKEYON procedure
  28.       _qrow = ROW()
  29.       _qcol = COL()
  30.       IF _qrow > 10 .OR. _qcol > 21
  31.          _qrow = 1
  32.          _qcol = 1
  33.       ENDIF
  34.       SETCOLOR(IF((ISCOLOR() .AND. !(IF(TYPE("scrmono")="U", .T., scrmono))), "W/B", SETCOLOR()))
  35.       IF TYPE("scrprog") != "C"
  36.          _pdrive = "C:"
  37.       ELSE
  38.          _pdrive = SUBSTR(scrprog, 1, 2)
  39.       ENDIF
  40.    ELSE
  41.       IF PCOUNT() < 2
  42.          RETURN("")
  43.       ELSEIF PCOUNT() = 2
  44.          IF TYPE("scrprog") != "C"
  45.             _pdrive = "C:"
  46.          ELSE
  47.             _pdrive = SUBSTR(scrprog, 1, 2)
  48.          ENDIF
  49.          _ppath = ""
  50.       ELSEIF PCOUNT() = 3
  51.          IF LEN(_pdrive) != 2
  52.             IF TYPE("scrprog") != "C"
  53.                _pdrive = "C:"
  54.             ELSE
  55.                _pdrive = SUBSTR(scrprog, 1, 2)
  56.             ENDIF
  57.          ENDIF
  58.          _ppath = ""
  59.       ELSE
  60.          IF TYPE("scrprog") != "C"
  61.             _pdrive = "C:"
  62.          ELSE
  63.             _pdrive = SUBSTR(scrprog, 1, 2)
  64.          ENDIF
  65.       ENDIF
  66.    ENDIF
  67.  
  68.    _pdrive = IF((LEN(_pdrive) != 2), "C:", _pdrive)
  69.    _ppath  = IF((TYPE("_ppath") = "U"), "", _ppath)
  70.    DECLARE _tarray[NOSUBDR(_pdrive)]
  71.    IF LEN(_tarray) = 0   && Otherwise, an error has occured
  72.       RETURN("NODRIVE")
  73.    ENDIF
  74.    DRNAMES(_tarray, _pdrive)
  75.    _return = ""
  76.    ASORT(_tarray)
  77.    WINDOWPUSH(_qrow, _qcol, _qrow + 18, _qcol + 60)
  78.  
  79.    @ _qrow, _qcol+2 SAY " Select Sub-Directory or ESC to Quit "
  80.  
  81.    EXTERNAL Pan_down, Pan_up
  82.  
  83.    SET KEY 3 TO Pan_down
  84.    SET KEY 18 TO Pan_up
  85.  
  86.    STORE _qrow + 1 TO _row
  87.    STORE _qcol + 3  TO _col
  88.    STORE .F. TO down, up
  89.    STORE 1 TO _qption, _screen, _x
  90.    scrwdown = IF((TYPE("scrwdown") = "U"), 17, scrwdown)
  91.    _panning = IF( TYPE("scrwdown") != "U", (2 * scrwdown)-3, 29)
  92.    DO WHILE .T.
  93.       _base = _x
  94.       FOR _y = _x TO _x + _panning
  95.          IF _y < 1
  96.             _y = 1
  97.             _x = 1
  98.          ENDIF
  99.          _show = _tarray[_y]
  100.          IF !EMPTY(_ppath)
  101.             _show = IF( (_show$_ppath) ," PATH => ", "         ") + _show
  102.          ENDIF
  103.          _show = SUBSTR(_show, 1, 28)
  104.          @ _row,  _col PROMPT _show
  105.          IF _y + 1 > LEN(_tarray)
  106.             EXIT
  107.          ENDIF
  108.          _row = _row + 1
  109.          IF _row > _qrow + IF( TYPE("scrwdown") = "U", 16, scrwdown)
  110.             _row = _qrow + 1
  111.             _col = _qcol + 33
  112.          ENDIF
  113.          _show = ""
  114.       NEXT
  115.       IF _x != 1
  116.          @ _qrow + scrwdown, _qcol + 32 SAY "Page Up for Previous..."
  117.       ENDIF
  118.       IF _y > LEN(_tarray) 
  119.       ELSE
  120.          IF _y+1 > LEN(_tarray)
  121.          ELSE
  122.             IF !EMPTY(_tarray[_y+1])
  123.                @ _qrow + scrwdown, _qcol + 32 SAY "Page Down for More..."
  124.             ENDIF
  125.          ENDIF
  126.       ENDIF
  127.       MENU TO _qption
  128.       IF _qption = 0
  129.          DO CASE
  130.          CASE up
  131.             up = .F.
  132.             _x = _x - _panning
  133.             IF _x < 0
  134.                _x = _x + _panning
  135.             ENDIF
  136.          CASE down
  137.             down = .F.
  138.             _x = _x + _panning
  139.             IF _x > LEN(_tarray)
  140.                _x = _x - _panning
  141.             ENDIF
  142.          OTHERWISE
  143.             EXIT
  144.          ENDCASE
  145.       ELSE
  146.          CLEAR_AREA()
  147.          WSAYGET(3,2,"You selected ...")
  148.          WSAYGET(5,2, _tarray[(_base + _qption) - 1])
  149.          WSAYGET(7,2,"Is this O.k.? ")
  150.          IF PROMPT()
  151.             _qption = (_base + _qption) - 1
  152.             _return = STRTRAN(_tarray[_qption] + "\", "\\", "\")
  153.             EXIT
  154.          ELSE
  155.          ENDIF
  156.       ENDIF
  157.       Clear_area()
  158.       STORE _qrow + 1 TO _row
  159.       STORE _qcol + 3 TO _col
  160.    ENDDO
  161.    SET KEY 3 TO 
  162.    SET KEY 18 TO 
  163.    SET KEY 27 TO
  164.    WINDOWPOP()
  165.    RETURN(_return)
  166.  
  167. * End of File
  168.  
  169.