home *** CD-ROM | disk | FTP | other *** search
- ********************
-
- FUNCTION Show_tree
-
- PARAMETERS _qrow, _qcol, _pdrive, _ppath
-
- PRIVATE _row, _col, _qption, _screen, _x,
- PRIVATE _base, _y, _show, _search, _qaz, _oldcolor,
- PRIVATE _poprow, _popcol, _dfile, _return, _panning
-
- * _row, _col, _base, _y, _x, _qaz, _poprow, and _popcol are all
- * screen counters to show the information.
- *
- * _oldcolor contatins the old screen color before the tree is shown
- * down, up are NOT declared PRIVATE because they need to be manipulated
- * by two separate proceudres: Pan_up and Pan_down
- *
- * _screen saves the current screen and all of the rest should be
- * self explanatory
-
- _oldcolor = SETCOLOR()
-
- IF TYPE("_qrow") = "C"
- IF _qrow$"SHOW"
- RETURN("")
- ENDIF
- * This was activated via the SETKEYON procedure
- _qrow = ROW()
- _qcol = COL()
- IF _qrow > 10 .OR. _qcol > 21
- _qrow = 1
- _qcol = 1
- ENDIF
- SETCOLOR(IF((ISCOLOR() .AND. !(IF(TYPE("scrmono")="U", .T., scrmono))), "W/B", SETCOLOR()))
- IF TYPE("scrprog") != "C"
- _pdrive = "C:"
- ELSE
- _pdrive = SUBSTR(scrprog, 1, 2)
- ENDIF
- ELSE
- IF PCOUNT() < 2
- RETURN("")
- ELSEIF PCOUNT() = 2
- IF TYPE("scrprog") != "C"
- _pdrive = "C:"
- ELSE
- _pdrive = SUBSTR(scrprog, 1, 2)
- ENDIF
- _ppath = ""
- ELSEIF PCOUNT() = 3
- IF LEN(_pdrive) != 2
- IF TYPE("scrprog") != "C"
- _pdrive = "C:"
- ELSE
- _pdrive = SUBSTR(scrprog, 1, 2)
- ENDIF
- ENDIF
- _ppath = ""
- ELSE
- IF TYPE("scrprog") != "C"
- _pdrive = "C:"
- ELSE
- _pdrive = SUBSTR(scrprog, 1, 2)
- ENDIF
- ENDIF
- ENDIF
-
- _pdrive = IF((LEN(_pdrive) != 2), "C:", _pdrive)
- _ppath = IF((TYPE("_ppath") = "U"), "", _ppath)
- DECLARE _tarray[NOSUBDR(_pdrive)]
- IF LEN(_tarray) = 0 && Otherwise, an error has occured
- RETURN("NODRIVE")
- ENDIF
- DRNAMES(_tarray, _pdrive)
- _return = ""
- ASORT(_tarray)
- WINDOWPUSH(_qrow, _qcol, _qrow + 18, _qcol + 60)
-
- @ _qrow, _qcol+2 SAY " Select Sub-Directory or ESC to Quit "
-
- EXTERNAL Pan_down, Pan_up
-
- SET KEY 3 TO Pan_down
- SET KEY 18 TO Pan_up
-
- STORE _qrow + 1 TO _row
- STORE _qcol + 3 TO _col
- STORE .F. TO down, up
- STORE 1 TO _qption, _screen, _x
- scrwdown = IF((TYPE("scrwdown") = "U"), 17, scrwdown)
- _panning = IF( TYPE("scrwdown") != "U", (2 * scrwdown)-3, 29)
- DO WHILE .T.
- _base = _x
- FOR _y = _x TO _x + _panning
- IF _y < 1
- _y = 1
- _x = 1
- ENDIF
- _show = _tarray[_y]
- IF !EMPTY(_ppath)
- _show = IF( (_show$_ppath) ," PATH => ", " ") + _show
- ENDIF
- _show = SUBSTR(_show, 1, 28)
- @ _row, _col PROMPT _show
- IF _y + 1 > LEN(_tarray)
- EXIT
- ENDIF
- _row = _row + 1
- IF _row > _qrow + IF( TYPE("scrwdown") = "U", 16, scrwdown)
- _row = _qrow + 1
- _col = _qcol + 33
- ENDIF
- _show = ""
- NEXT
- IF _x != 1
- @ _qrow + scrwdown, _qcol + 32 SAY "Page Up for Previous..."
- ENDIF
- IF _y > LEN(_tarray)
- ELSE
- IF _y+1 > LEN(_tarray)
- ELSE
- IF !EMPTY(_tarray[_y+1])
- @ _qrow + scrwdown, _qcol + 32 SAY "Page Down for More..."
- ENDIF
- ENDIF
- ENDIF
- MENU TO _qption
- IF _qption = 0
- DO CASE
- CASE up
- up = .F.
- _x = _x - _panning
- IF _x < 0
- _x = _x + _panning
- ENDIF
- CASE down
- down = .F.
- _x = _x + _panning
- IF _x > LEN(_tarray)
- _x = _x - _panning
- ENDIF
- OTHERWISE
- EXIT
- ENDCASE
- ELSE
- CLEAR_AREA()
- WSAYGET(3,2,"You selected ...")
- WSAYGET(5,2, _tarray[(_base + _qption) - 1])
- WSAYGET(7,2,"Is this O.k.? ")
- IF PROMPT()
- _qption = (_base + _qption) - 1
- _return = STRTRAN(_tarray[_qption] + "\", "\\", "\")
- EXIT
- ELSE
- ENDIF
- ENDIF
- Clear_area()
- STORE _qrow + 1 TO _row
- STORE _qcol + 3 TO _col
- ENDDO
- SET KEY 3 TO
- SET KEY 18 TO
- SET KEY 27 TO
- WINDOWPOP()
- RETURN(_return)
-
- * End of File
-