anchor.diff:        (:dn-armed (setf event-state nil))
         (otherwise
          (setf event-state nil) )))
  -  (dispatch-repaint sb +everywhere+) )
  -
  -(defmethod handle-event ((sb scroll-bar-pane) (event pointer-motion-event))
  -  (multiple-value-bind (x y) (transform-position (scroll-bar-transformation sb)
  -                                                 (pointer-event-x event) (pointer-event-y event))
  -    (declare (ignore x))
  -    (with-slots (event-state drag-dy inhibit-redraw-p) sb
  -      (case event-state
  -        (:dragging
  -         (let* ((y-new-thumb-top (- y drag-dy))
  -                (ts (scroll-bar-thumb-size sb))
  -                (new-value (min (gadget-max-value sb)
  -                                (max (gadget-min-value sb)
  -                                     (translate-range-value y-new-thumb-top
  -                                                            (bounding-rectangle-min-y (scroll-bar-thumb-bed-region sb))
  -                                                            (bounding-rectangle-max-y (scroll-bar-thumb-bed-region sb))
  -                                                            (gadget-min-value sb)
  -                                                            (+ (gadget-max-value sb) ts))))))
  -           ;; Blitter hack:
  -           #-nil
  -           (with-drawing-options (sb :transformation (scroll-bar-transformation sb))
  -             (with-bounding-rectangle* (ox1 oy1 ox2 oy2) (scroll-bar-thumb-region sb)
  -               (setf (gadget-value sb) new-value)
  -               (with-bounding-rectangle* (nx1 ny1 nx2 ny2) (scroll-bar-thumb-region sb)
  -		 (declare (ignore nx2))
  -                 (copy-area sb ox1 oy1 (- ox2 ox1) (- oy2 oy1) nx1 ny1)
  -                 (if (< oy1 ny1)
  -                     (draw-rectangle* sb ox1 oy1 ox2 ny1 :ink *3d-normal-color*)
  -                     (draw-rectangle* sb ox1 oy2 ox2 ny2 :ink *3d-normal-color*)))))
  -           #+nil
  -           (dispatch-repaint sb +everywhere+)
  -           (unwind-protect
  -                (progn
  -                  (setf inhibit-redraw-p t)
  -                  (setf (gadget-value sb) new-value)
  -                  (drag-callback sb (gadget-client sb) (gadget-id sb)
  -                                 new-value))
  -             (setf inhibit-redraw-p nil))
  -           ))))))
  -
  -;;; Repaint
  -
  -(defmethod handle-repaint ((sb scroll-bar-pane) region)
  -  (declare (ignore region))
  -  (with-special-choices (sb)
  -    (let ((tr (scroll-bar-transformation sb)))
  -      (with-bounding-rectangle* (minx miny maxx maxy) (transform-region tr (sheet-region sb))
  -        (with-drawing-options (sb :transformation tr)
  -          (draw-rectangle* sb minx miny maxx maxy :filled t
  -                           :ink *3d-normal-color*)
  -          ;; draw up arrow
  -          (with-bounding-rectangle* (x1 y1 x2 y2) (scroll-bar-up-region sb)
  -            (let ((pg (list (make-point (/ (+ x1 x2) 2) y1)
  -                            (make-point x1 y2)
  -                            (make-point x2 y2))))
  -              (case (slot-value sb  'event-state)
  -                (:up-armed
  -                 (draw-polygon sb pg :ink *3d-inner-color*)
  -                 (draw-bordered-polygon sb pg :style :inset :border-width 2))
  -                (otherwise
  -                 (draw-polygon sb pg :ink *3d-normal-color*)
  -                 (draw-bordered-polygon sb pg :style :outset :border-width 2) ))))
  -
  -          ;; draw down arrow
  -          (with-bounding-rectangle* (x1 y1 x2 y2) (scroll-bar-down-region sb)
  -            (let ((pg (list (make-point (/ (+ x1 x2) 2) y2)
  -                            (make-point x1 y1)
  -                            (make-point x2 y1))))
  -              (case (slot-value sb 'event-state)
  -                (:dn-armed
  -                 (draw-polygon sb pg :ink *3d-inner-color*)
  -                 (draw-bordered-polygon sb pg :style :inset :border-width 2))
  -                (otherwise
  -                 (draw-polygon sb pg :ink *3d-normal-color*)
  -                 (draw-bordered-polygon sb pg :style :outset :border-width 2)))))
  -          ;; draw thumb
  -          (with-bounding-rectangle* (x1 y1 x2 y2) (scroll-bar-thumb-region sb)
  -            (draw-rectangle* sb x1 y1 x2 y2 :ink *3d-normal-color*)
  -            (draw-bordered-polygon sb
  -                                   (polygon-points (make-rectangle* x1 y1 x2 y2))
  -                                   :style :outset
  -                                   :border-width 2)
  -            (let ((y (/ (+ y1 y2) 2)))
  -              (draw-bordered-polygon sb
  -                                     (polygon-points (make-rectangle* (+ x1 3) (- y 1) (- x2 3) (+ y 1)))
  -                                     :style :inset
  -                                     :border-width 1)
  -              (draw-bordered-polygon sb
  -                                     (polygon-points (make-rectangle* (+ x1 3) (- y 4) (- x2 3) (- y 2)))
  -                                     :style :inset
  -                                     :border-width 1)
  -              (draw-bordered-polygon sb
  -                                     (polygon-points (make-rectangle* (+ x1 3) (+ y 4) (- x2 3) (+ y 2)))
  -                                     :style :inset
  -                                     :border-width 1))) )))))
  -
  +  (scroll-bar/update-display sb) )
  +
  +(defmethod handle-repaint ((pane scroll-bar-pane) region)
  +  (with-slots (all-new-p) pane
  +    (setf all-new-p t)
  +    (scroll-bar/update-display pane)))
   
   ;;; ------------------------------------------------------------------------------------------
   ;;;  30.4.5 The concrete slider Gadget
  
positive.code:       (cond ((region-contains-position-p (scroll-bar-up-region sb) x y)
               (scroll-up-line-callback sb (gadget-client sb) (gadget-id sb))
               (setf event-state :up-armed)
               (dispatch-repaint sb +everywhere+))
              ((region-contains-position-p (scroll-bar-down-region sb) x y)
               (scroll-down-line-callback sb (gadget-client sb) (gadget-id sb))
               (setf event-state :dn-armed)
               (dispatch-repaint sb +everywhere+))
              ((region-contains-position-p (scroll-bar-thumb-region sb) x y)
               (setf event-state :dragging
                     drag-dy (- y (bounding-rectangle-min-y (scroll-bar-thumb-region sb)))))
              ((region-contains-position-p (scroll-bar-thumb-bed-region sb) x y)
               (if (< y (bounding-rectangle-min-y (scroll-bar-thumb-region sb)))
                   (scroll-up-page-callback sb (gadget-client sb) (gadget-id sb))
                   (scroll-down-page-callback sb (gadget-client sb) (gadget-id sb))))
              (t
               nil)))))
  
  (defmethod handle-event ((sb scroll-bar-pane) (event pointer-button-release-event))
    (with-slots (event-state) sb
  
negative.code: ;;; ------------------------------------------------------------------------------------------
  ;;;  30.4.4 The concrete scroll-bar Gadget
  
  (defclass scroll-bar-pane (3D-border-mixin
                             scroll-bar)
    ((event-state :initform nil)
     (drag-dy :initform nil)
     ;;; poor man's incremental redisplay
     ;; drawn state
     (up-state :initform nil)
     (dn-state :initform nil)
     (tb-state :initform nil)
     (tb-y1    :initform nil)
     (tb-y2    :initform nil)
     ;; old drawn state
     (old-up-state :initform nil)
     (old-dn-state :initform nil)
     (old-tb-state :initform nil)
     (old-tb-y1    :initform nil)
     (old-tb-y2    :initform nil)
     ;;
     (all-new-p    :initform t) )
    (:default-initargs :value 0
                       :min-value 0
                       :max-value 1
  