home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / source / oodleutl.cpt / oodles-of-utils / mixin-madness / simple-view-mixins / frame-3D-svm.lisp < prev    next >
Encoding:
Text File  |  1992-02-17  |  2.1 KB  |  63 lines

  1. (in-package :oou)
  2. (oou-provide :frame-3D-svm)
  3. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  4. ;; frame-3D-svm.Lisp
  5. ;;
  6. ;; Copyright ⌐ 1991 Northwestern University Institute for the Learning Sciences
  7. ;; All Rights Reserved
  8. ;;
  9. ;; author: Michael S. Engber
  10. ;;
  11. ;; Simple view mixin for 3D framing the view.
  12. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  13.  
  14. (oou-dependencies
  15.  :frame-svm
  16.  :QuickDraw-u)
  17.  
  18. (export '(frame-3D-svm))
  19.  
  20. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  21.  
  22. (defclass frame-3D-svm (frame-svm)
  23.   ((shadow-position :initarg :shadow-position))
  24.   (:default-initargs
  25.     :frame-width 2
  26.     :shadow-position :botRight))
  27.  
  28. (defmethod draw-frame ((sv frame-3D-svm) rect)
  29. ;;Frames a view with a 3D looking frame.
  30. ;;Note: this effect only looks right over grayish backgrounds.
  31.   (with-back-color (getf (part-color-list sv) :frame-lite *white-color*)
  32.     (frame-rect-3D rect (frame-width sv) (slot-value sv 'shadow-position))))
  33.  
  34. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  35.  
  36. #|
  37.  
  38. ;;; a modest example - adding a frame to static text dialog items
  39.  
  40. (defclass sttxt-3D (static-text-dialog-item frame-3D-svm) ())
  41.  
  42. (progn
  43.   (setf *test-w*
  44.         (make-instance 'dialog
  45.                        :window-type :document
  46.                        :view-position :centered
  47.                        :view-size #@(200 100)
  48.                        :window-title "3D frame demo"
  49.                        ))
  50.   (with-focused-view *test-w* (#_BackPat *gray-pattern*))
  51.   (invalidate-view *test-w* t)
  52.   (add-subviews *test-w* (make-dialog-item 'sttxt-3D
  53.                                            #@(20 20)
  54.                                            #@(163 18)
  55.                                            "I'm static text + a mixin"
  56.                                            #'(lambda (item) (declare (ignore item)) (ed-beep))
  57.                                            
  58.                                            :view-nick-name :butt
  59.                                            )))
  60.  
  61. ;(setf (frame-width (view-named :butt *test-w*)) 4)
  62.  
  63. |#