home *** CD-ROM | disk | FTP | other *** search
- ;;; ------------------------------------------------------------
- ;;; Menus for Scheme (tm)
- ;;; AN EXPERIMENTAL MENU-DRIVEN USER INTERFACE FOR PC SCHEME
- ;;; LOAD MENU
- ;;; $Revision: 1.0 $ $Date: 14 Dec 1987 0:40:28 $
- ;;; ------------------------------------------------------------
- ;;; Copyright (c) 1987 by Morton Goldberg.
- ;;;
- ;;; Permission is granted to make copies of this program text
- ;;; for personal, non-commercial use provided this notice of
- ;;; copyright appears in all copies and derived works. All
- ;;; other rights reserved. In particular, you may not publish
- ;;; or otherwise distribute any copies of this text or any
- ;;; derived works without permission from the copyright holder.
- ;;; ------------------------------------------------------------
- ;;; Implementation Language: Texas Instruments' PC Scheme
- ;;; (Version 3.0)
- ;;; ------------------------------------------------------------
-
- (writeln "Menu-Driven User Interface -- Load Menu")
- (writeln "Copyright (c) 1987 by Morton Goldberg")
- (let ((rev-number "$Revision: 1.0 $"))
- ;; Write the revision number string without the leading
- ;; and trailing dollar-signs (which are needed by the
- ;; version control system).
- (writeln (substring rev-number
- 1
- (sub1 (string-length rev-number)))))
-
- ;;; ------------------------------------------------------------
- ;;; LOAD MENU
- ;;; ------------------------------------------------------------
- ;;; *.Fsl CHOICE
-
- ;;; Force a file to be loaded in the user-initial-environment
- ;;; instead of the current environment.
- (define (menu-load file)
- (eval `(load ,file) user-initial-environment))
-
- ;;; Create a menu of the *.FSL files in the current directory,
- ;;; display it, and load the file selected by the user.
- (define (fast-load-from-menu)
- (define menu
- (files->menu "*.FSL" 20 menu-load *vertical-menu-init*))
- (if menu
- (begin
- (h-justify 'CENTER menu)
- (v-justify 'TOP menu)
- (send menu popup)))
- 'USER-ABORT)
-
- ;;; ------------------------------------------------------------
- ;;; *.S CHOICE
-
- ;;; Create a menu of the *.S files in the current directory,
- ;;; display it, and load the file selected by the user.
- (define (load-from-menu)
- (define menu
- (files->menu "*.S" 20 menu-load *vertical-menu-init*))
- (if menu
- (begin
- (h-justify 'CENTER menu)
- (v-justify 'TOP menu)
- (send menu popup)))
- 'USER-ABORT)
-
- ;;; ------------------------------------------------------------
- ;;; Load a .S or .FSL file from the current directory by
- ;;; choosing from a menu.
-
- ;;; This is the item list for the load menu.
- (define *load-menu-items*
- `(("*.S" #\s ,load-from-menu)
- ("*.Fsl" #\f ,fast-load-from-menu)))
-
- ;;; Create the load menu, which is a vertical menu.
- (define *load-menu*
- (let ((menu (make-vertical-menu *vertical-menu-init*
- *load-menu-items*)))
- (h-justify 'CENTER menu)
- (v-justify 'TOP menu)
- menu))
-
- ;;; Link to the top-level menu.
- (define (load-menu)
- (send *load-menu* popup)
- *the-non-printing-object*)
-
- ;;; ------------------------------------------------------------
-