home *** CD-ROM | disk | FTP | other *** search
- (in-package :oou)
- (oou-provide :disable-dim)
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; disable-dim.Lisp
- ;;
- ;; Copyright ⌐ 1992 Northwestern University Institute for the Learning Sciences
- ;; All Rights Reserved
- ;;
- ;; author: Michael S. Engber
- ;;
- ;; Dialog item mixin for graying out disabled dialog items.
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (oou-dependencies
- :QuickDraw-u
- :simple-view-ce)
-
- (export '(disable-dim))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (defclass disable-dim ()
- ((dim-pnMode :initarg :dim-pnMode
- :accessor dim-pnMode)
- (dim-pnPat :initarg :dim-pnPat
- :accessor dim-pnPat))
- (:default-initargs :dim-pnMode #.#$patBic :dim-pnPat *gray-pattern*))
-
- (defmethod view-draw-contents :after ((di disable-dim))
- (unless (dialog-item-enabled-p di)
- (with-pen-state (:pnMode (dim-pnMode di)
- :pnPat (dim-pnPat di))
- (multiple-value-bind (topLeft botRight) (view-corners di)
- (rlet ((r :Rect :topLeft topLeft :bottomRight botRight))
- (#_PaintRect r))))))
-
-
- ;;;Hacks to fix enable/disable erase problem
-
- (defmethod dialog-item-enable :before ((di disable-dim))
- (erase-view di))
-
- (defmethod dialog-item-disable :before ((di disable-dim))
- (erase-view di))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-