anchor.diff:    (declare (ignore client gadget-id))
     (invoke-callbacks pane 'scroll-bar-scroll-down-page-callback))
   
  -;; SCROLL-BAR-PANE
  -
  -(defclass scroll-bar-pane (basic-pane scroll-bar)
  -  ((dragged :initform nil))
  +;;;;
  +;;;; SCROLL-BAR-PANE
  +;;;;
  +
  +(defclass scroll-bar-pane (basic-pane scroll-bar 3D-border-mixin)
  +  ((event-state :initform nil)
  +   (drag-dy :initform nil))
     (:default-initargs :value 0
                        :min-value 0
                        :max-value 1
  -                     :orientation :vertical))
  +                     :orientation :vertical
  +                     :border-width 2
  +                     :border-style :inset))
   
   (defmethod compose-space ((sb scroll-bar-pane))
     (if (eq (gadget-orientation sb) :vertical)
  
positive.code: ;;;  (c) copyright 2001 by
  ;;; Lionel Salabartan (salabart@emi.u-bordeaux.fr)
  ;;;  (c) copyright 2001 by Michael McDonald (mikemac@mikemac.com)
  
  ;;; This library is free software; you can redistribute it and/or
  ;;; modify it under the terms of the GNU Library General Public
  
negative.code:      (when armed
         (setf armed nil)
         (disarmed-callback sb (gadget-client sb) (gadget-id sb)))))
  ||#
  
  (defmethod handle-event ((sb scroll-bar-pane) (event pointer-button-press-event))
    (multiple-value-bind (x y) (transform-position (scroll-bar-transformation sb)
                                                   (pointer-event-x event) (pointer-event-y event))
      (with-slots (event-state drag-dy) sb
        (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)
               (repaint-sheet 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)
               (repaint-sheet 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-bed-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
      (case event-state
        (:up-armed (setf event-state nil))
        (:dn-armed (setf event-state nil))
        (otherwise
         (setf event-state nil) )))
    (repaint-sheet 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) sb
        (case event-state
          (:dragging
           (let* ((y-new-thumb-top (- y drag-dy))
                  (ts (* 1/3 (- (gadget-max-value sb) (gadget-min-value sb))))
                  (new-value (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))))
             (drag-callback sb (gadget-client sb) (gadget-id sb)
                            (min (gadget-max-value sb)
                                 (max (gadget-min-value sb)
                                      new-value))) ))))))
  
  ;;; Repaint
  
  (defmethod repaint-sheet ((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))) )))))
  
  ;;
  ;; SLIDER gadget
  