anchor.diff:        (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+))
  +             (scroll-bar/update-display sb))
               ((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+))
  +             (scroll-bar/update-display sb))
  +            ;;
               ((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-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))
  +                (new-value
  +                 (min (gadget-max-value sb)
  +                      (max (gadget-min-value sb)
  +                           (scroll-bar/map-coordinate-to-value sb y-new-thumb-top)))) )
  +           ;; ### when dragging value shouldn't be immediately updated
  +           (setf (gadget-value sb #|:invoke-callback nil|#)
  +                 new-value)
  +           (drag-callback sb (gadget-client sb) (gadget-id sb) new-value)) )))))
   
   (defmethod handle-event ((sb scroll-bar-pane) (event pointer-button-release-event))
     (with-slots (event-state) sb
  
positive.code: 			      :min-width (* 3 *scrollbar-thickness*)
  			      :width (* 4 *scrollbar-thickness*))))
  
  ;;; The thumb of a scroll bar
  
  ;; work in progress --GB
  
  #||
  (defclass scroll-bar-thumb-pane (arm/disarm-repaint-mixin
                                   basic-gadget)
    ((tr :initform nil)
     (allowed-region :initarg :allowed-region))
    (:default-initargs
        :background *3d-normal-color*))
  
  (defmethod handle-event ((pane scroll-bar-thumb-pane) (event pointer-enter-event))
    (declare (ignoreable event))
    (with-slots (armed) pane
      (arm-gadget pane (adjoin :have-mouse armed))))
  
  (defmethod handle-event ((pane scroll-bar-thumb-pane) (event pointer-exit-event))
    (declare (ignoreable event))
    (with-slots (armed) pane
      (arm-gadget pane (remove :have-mouse armed))))
  
  (defmethod handle-event ((pane scroll-bar-thumb-pane) (event pointer-button-press-event))
    (with-slots (tr armed) pane
      (arm-gadget pane (adjoin :dragging armed))
      (setf tr (compose-transformations
                (make-scaling-transformation 1 1)
                (compose-transformations
                (compose-transformations
                 (make-translation-transformation (- (pointer-event-x event)) (- (pointer-event-y event)))
                 (invert-transformation (sheet-delta-transformation (sheet-parent pane) (graft pane))))
                (invert-transformation (sheet-native-transformation (graft pane)))))) ))
  
  (defmethod handle-event ((pane scroll-bar-thumb-pane) (event pointer-button-release-event))
    (with-slots (tr armed) pane
      (arm-gadget pane (remove :dragging armed))
      (setf tr nil)) )
  
  (defmethod handle-event ((pane scroll-bar-thumb-pane) (event pointer-motion-event))
    (with-slots (tr allowed-region) pane
      (when tr
        (multiple-value-bind (nx ny) (transform-position tr
                                                         (pointer-event-native-graft-x event)
                                                         (pointer-event-native-graft-y event))
          (with-bounding-rectangle* (x1 y1 x2 y2) allowed-region
            (move-sheet pane
                        (clamp nx x1 x2)
                        (clamp ny y1 y2)))))))
  
  (defmethod handle-repaint ((pane scroll-bar-thumb-pane) region)
    (with-bounding-rectangle* (x1 y1 x2 y2) pane
      (draw-rectangle* pane x1 y1 x2 y2 :ink (effective-gadget-background pane))
      (draw-bordered-polygon pane
                             (polygon-points (make-rectangle* x1 y1 x2 y2))
                             :style :outset
                             :border-width 2)
      (let ((y (/ (+ y1 y2) 2)))
        (draw-bordered-polygon pane
                               (polygon-points (make-rectangle* (+ x1 3) (- y 1) (- x2 3) (+ y 1)))
                               :style :inset
                               :border-width 1)
        (draw-bordered-polygon pane
                               (polygon-points (make-rectangle* (+ x1 3) (- y 4) (- x2 3) (- y 2)))
                               :style :inset
                               :border-width 1)
        (draw-bordered-polygon pane
                               (polygon-points (make-rectangle* (+ x1 3) (+ y 4) (- x2 3) (+ y 2)))
                               :style :inset
                               :border-width 1))))
  
  ;;;
  
  (defmethod sheet-adopt-child :after (sheet (scroll-bar scroll-bar-pane))
    ;; create a sheet for the thumb
    '(with-slots (thumb) scroll-bar
      (setf thumb (make-pane 'scroll-bar-thumb-pane
                             :allowed-region (make-rectangle* 2 15 14 340)
                             ))
      (setf (sheet-region thumb)
            (make-rectangle* 0 0 12 50))
      (setf (sheet-transformation thumb)
            (compose-transformations
             (make-transformation 1 0 0 1 0 0)
             (make-translation-transformation 2 0)))
      (sheet-adopt-child scroll-bar thumb)))
  
  ||#
  
  ;;; Utilities
  
  ;; We think all scroll bars as vertically oriented, therefore we have
  ;; SCROLL-BAR-TRANSFORMATION, which should make every scroll bar
  
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
  