[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
making dialog items invisible
- Subject: making dialog items invisible
- From: "Mark A. Tapia" <markt@dgp.toronto.edu>
- Date: Mon, 24 May 1993 13:29:21 -0400
Mea culpa, in my response to marsella@athos.rutgers.edu, I should
have mentioned that oodles-of-utils contains the following code
in the low-class-extensions folder in the simple-view-ce.lisp
(this is a stripped version of the actual file):
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; simple-view-ce.Lisp
;;
;; Copyright 1992 Northwestern University Institute for the Learning Sciences
;; All Rights Reserved
;;
;; author: Michael S. Engber
;;
;; methods for the view class
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(export '(offset-view-position
view-hide view-show view-shown-p view-shown-position
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(eval-when (:compile-toplevel :load-toplevel :execute)
(defconstant $di-hidden-const 8192)
(defconstant $di-hide-h-offset 16384)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defmethod offset-view-position ((sv simple-view) dh &optional dv)
(set-view-position sv (add-points (view-position sv) (make-point dh dv))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; hiding views (as per HideDItem & ShowDItem IM IV p.59)
(defmethod view-hide ((sv simple-view))
(when (view-shown-p sv)
(offset-view-position sv #.(make-point $di-hide-h-offset 0))))
(defmethod view-show ((sv simple-view))
(unless (view-shown-p sv)
(offset-view-position sv #.(make-point (- $di-hide-h-offset) 0))))
(defmethod view-shown-p ((sv simple-view))
(< (point-h (view-position sv)) #.$di-hidden-const))
(defmethod view-shown-position ((sv simple-view))
(if (view-shown-p sv)
(view-position sv)
(subtract-points (view-position sv) #.(make-point $di-hide-h-offset 0))))