[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sequence-dialog-items that scroll properly
- To: kaye@linc.cis.upenn.edu
- Subject: Re: sequence-dialog-items that scroll properly
- From: "Tod Casasent" <tcasasent@diamond.kbsi.com>
- Date: 1 Mar 1993 8:46:16 CST
- Cc: info-mcl@cambridge.apple.com
- Organization: Knowledge Based Systems, Inc.
- Priority: normal
- Reply-to: tcasasent@diamond.kbsi.com
We defined a window-scroller as below:
(defclass window-scroller (ccl::scroller ai3-window-pane)
((max-x :initform nil :accessor max-scroll-x :initarg :max-x)
(max-y :initform nil :accessor max-scroll-y :initarg :max-y)))
Then in an initialize instance for that type:
(defmethod initialize-instance
((self window-scroller) &rest initargs &key
view-container
(draw-scroller-outline t)
(track-thumb-p t)
(scroll-bar-class 'ccl::scroll-bar-dialog-item))
(declare (dynamic-extent initargs))
(setf (ccl::v-scroller self) nil) ; fix start-up transient.
(setf (ccl::h-scroller self) nil)
; delay the set-view-container
(apply #'call-next-method self :view-container nil initargs)
(let* ((v-scroll (make-instance scroll-bar-class
:scrollee self
:direction :vertical
;;; set jump of scroll here
:scroll-size 25
:track-thumb-p track-thumb-p))
(h-scroll (make-instance scroll-bar-class
:scrollee self
:direction :horizontal
;;; set jump of scroll here
:scroll-size 25
:track-thumb-p track-thumb-p))
(outline (if draw-scroller-outline
(make-instance 'ccl::box-dialog-item))))
(setf (ccl::scroll-bar-correction self) (make-point (if v-scroll 17 2)
(if h-scroll 17 2)))
(setf (ccl::v-scroller self) v-scroll)
(setf (ccl::h-scroller self) h-scroll)
(setf (ccl::scroller-outline self) outline)
(if (and (view-position self) (view-size self))
(ccl::update-scroll-bars self :length t :position t))
(when view-container
(set-view-container self view-container))))
This should fix your problem. I don't know for sure if there is a better
way or not, since I haven't had time to look at this. This code was written
by my predicessor.
-Tod
========================================================================
Ford Prefect - Have you been listening to me?
Arthur Dent - Yes, but I don't think it's helped any.
========================================================================
"Truth then. Yes, that's it. It must be Truth. Above all. For when a
man lies he murders some part of the world. You should know that."
- Merlin to Arthur in "Excalibur"
========================================================================
Jean - Henna neko da ne... == Hobbes - Do you believe in God?
Nadia - Raiyon yo! == Calvin - Well, Somebody's out to get me.
========================================================================
The opinions and statements herein expressed are not those of KBSI and,
if attributable to anyone, are mine.
========================================================================