anchor.diff:                                                    content)))
                                            contents))))
   
  - (defclass xbox-pane (composite-pane
  + (defclass xbox-pane (box-layout-mixin
  +                      composite-pane
                         permanent-medium-sheet-output-mixin ;arg!
                         )
      ()
  -   (:documentation ""))
  -
  -
  - (defmethod content-sr* ((box xbox-pane) (content fill-content))
  -   (declare (ignorable box content))
  -   (make-space-requirement
  -    :major 0
  -    :min-major 0
  -    :max-major +fill+
  -    :minor 0
  -    :min-minor 0
  -    :max-minor 0))
  -
  - (defmethod content-sr* ((box xbox-pane) (content constant-content))
  -   (declare (ignorable box content))
  -   (let ((x (constant-content-amount content))
  -         (sr (and (content-pane content)
  -                  (compose-space (content-pane content)))))
  -     (make-space-requirement
  -      :major     x
  -      :min-major x
  -      :max-major x
  -      :minor     (if sr (space-requirement-minor sr) 0)
  -      :min-minor (if sr (space-requirement-min-minor sr) 0)
  -      :max-minor (if sr (space-requirement-max-minor sr) 0))))
  -
  - (defmethod content-sr* ((box xbox-pane) (content proportional-content))
  -   (compose-space (content-pane content)))
  -
  - (defmethod content-sr* ((box xbox-pane) (content plain-content))
  -   (compose-space (content-pane content)))
  -
  - (defmethod compose-space ((box xbox-pane))
  -   (with-slots (contents major-spacing) box
  -     (loop
  -         for content in contents
  -         for sr = (content-sr* box content)
  -         sum (space-requirement-major sr) into major
  -         sum (space-requirement-min-major sr) into min-major
  -         sum (space-requirement-max-major sr) into max-major
  -         maximize (space-requirement-minor sr) into minor
  -         maximize (space-requirement-min-minor sr) into min-minor
  -         minimize (space-requirement-max-minor sr) into max-minor
  -         finally
  -           (return
  -             (space-requirement+*
  -              (make-space-requirement
  -               :major major
  -               :min-major (min min-major major)
  -               :max-major (max max-major major)
  -               :minor minor
  -               :min-minor (min min-minor minor)
  -               :max-minor (max max-minor minor))
  -              :min-major (* (1- (length contents)) major-spacing)
  -              :max-major (* (1- (length contents)) major-spacing)
  -              :major (* (1- (length contents)) major-spacing)
  -              :min-minor 0
  -              :max-minor 0
  -              :minor 0)))))
  -
  - (defmethod allocate-space-aux ((box xbox-pane) width height)
  -   (with-slots (contents major-spacing) box
  -     (let* ((content-srs (mapcar #'(lambda (c) (content-sr* box c)) contents))
  -            (allot       (mapcar #'ceiling (mapcar #'space-requirement-major content-srs)))
  -            (wanted      (reduce #'+ allot))
  -            (excess      (- major wanted
  -                            (* (1- (length contents)) major-spacing))))
  -       #+NIL
  -       (progn
  -         (format T "~&;; ALLOCATE-SPACE-AUX ~S~%" box)
  -         (format T "~&;;   major = ~D, wanted = ~D, excess = ~D, allot = ~D.~%"
  -                 major wanted excess allot))
  -
  -       (let ((qvector
  -              (mapcar (lambda (c)
  -                        (typecase c
  -                          (fill-content
  -                           (vector 1 0 0))
  -                          (proportional-content
  -                           (vector 0 (content-proportion c) 0))
  -                          (t
  -                           (vector 0 0 (abs (- (if (> excess 0)
  -                                                   (space-requirement-max-major (content-sr* box c))
  -                                                   (space-requirement-min-major (content-sr* box c)))
  -                                               (space-requirement-major (content-sr* box c))))))))
  -                      contents)))
  -         ;;
  -         #+NIL
  -         (progn
  -           (format T "~&;;   old allotment = ~S.~%" allot)
  -           (format T "~&;;   qvector 0 = ~S.~%" (mapcar #'(lambda (x) (elt x 0)) qvector))
  -           (format T "~&;;   qvector 1 = ~S.~%" (mapcar #'(lambda (x) (elt x 1)) qvector))
  -           (format T "~&;;   qvector 2 = ~S.~%" (mapcar #'(lambda (x) (elt x 2)) qvector)))
  -         ;;
  -         (dotimes (j 3)
  -           (let ((sum (reduce #'+ (mapcar (lambda (x) (elt x j)) qvector))))
  -             (unless (zerop sum)
  -               (setf allot
  -                 (mapcar (lambda (allot content q)
  -                           (let ((q (elt q j)))
  -                             (let ((delta (ceiling (if (zerop sum) 0 (/ (* excess q) sum)))))
  -                               (decf excess delta)
  -                               (decf sum q)
  -                               (+ allot delta))))
  -                         allot contents qvector))
  -               #+NIL
  -               (format T "~&;;   new excess = ~F, allotment = ~S.~%" excess allot)
  -               )))
  -         ;;
  -         #+NIL (format T "~&;;   excess = ~F.~%" excess)
  -         #+NIL (format T "~&;;   new allotment = ~S.~%" allot)
  -
  -         (values allot
  -                 (mapcar #'ceiling (mapcar #'space-requirement-minor content-srs))) ))))
  -
  - (defmethod allocate-space ((box xbox-pane) width height)
  -   (declare (ignore minor))
  -   (with-slots (contents major-spacing) box
  -     (multiple-value-bind (majors minors) (allocate-space-aux box width height)
  -       ;; now actually layout the children
  -       (let ((x 0))
  -         (loop
  -             for content in contents
  -             for major in majors
  -             for minor in minors
  -             do
  -               (let ((child (content-pane content)))
  -                 (when child
  -                   #+NIL
  -                   (format T "~&;;   child ~S at 0, ~D ~D x ~D~%"
  -                           child x width height)
  -                   (move-sheet child
  -                               ((lambda (major minor) height width) x 0)
  -                               ((lambda (major minor) width height) x 0))
  -                   (allocate-space child
  -                                   width height)
  -                   )
  -                 (incf x major)
  -                 (incf x major-spacing)))))))
  -
  - (defclass xrack-pane (xbox-pane) ())
  -
  - (defmethod allocate-space-aux :around ((box xrack-pane) width height)
  -   (multiple-value-bind (majors minors) (call-next-method)
  -     (values majors
  -             (mapcar (lambda (x) x minor) minors))))
  +   (:documentation "")
  +   (:default-initargs
  +       :box-layout-orientation :xical))
  +
  + (defmethod initialize-instance :after ((pane xbox-pane) &key contents &allow-other-keys)
  +   (let ((children (mapcar (lambda (content)
  +                   (cond ((panep content)
  +                          content)
  +                         ;;
  +                         ((or (eql content +fill+) (eql content '+fill+))
  +                          (let ((child (make-instance 'null-pane)))
  +                            (setf (constraint-slot pane child 'fill-p) t)
  +                            child))
  +                         ;;
  +                         ;; what about something like (30 :mm) ?
  +                         ;;
  +                         ((and (realp content) (>= content 0))
  +                          (let ((child (make-instance 'null-pane)))
  +                            (setf (constraint-slot pane child 'fixed-size) content)
  +                            child))
  +                         ;;
  +                         ;; match (<n> <pane>)
  +                         ;;
  +                         ((and (consp content)
  +                               (realp (car content))
  +                               (>= (car content) 0)
  +                               (consp (cdr content))
  +                               (panep (cadr content))
  +                               (null (cddr content)))
  +                          (let ((number (car content))
  +                                (child  (cadr content)))
  +                            (if (< number 1)
  +                                (setf (constraint-slot pane child 'proportion) number)
  +                                (setf (constraint-slot pane child 'fixed-size) number))
  +                            child))
  +                         (t
  +                          (error "~S is not a valid element in the ~S option of ~S."
  +                                 content :contents pane)) ))
  +                 contents)))
  +     (mapc (curry #'sheet-adopt-child pane) children)
  +     (reorder-sheets pane children)))
  +
  + (defclass xrack-pane (rack-layout-mixin xbox-pane)
  +   ()
  +   (:default-initargs
  +       :box-layout-orientation :xical))
    )
   
   ;;; TABLE PANE
   
   (defclass table-pane (composite-pane)
  -  (array)
  -  (:documentation "The table layout implies that each colums has the same width
  - and each lines has the same height - same rules for max and min -")
  -  )
  -
  -(defclass table-content (content)
  -  ((row :initarg :row :reader table-content-row)
  -   (col :initarg :col :reader table-content-col)
  -   ))
  -
  -(defmethod parse-contents ((pane table-pane) contents)
  -  (loop
  -      for row in contents
  -      for i from 0
  -      nconc (loop
  -                for col in row
  -                for j from 0
  -                collect (make-instance 'table-content
  -                          :pane col
  -                          :row i
  -                          :col j))))
  -
  -(defmethod initialize-instance :after ((pane table-pane) &key &allow-other-keys)
  -  (with-slots (contents array) pane
  -    (let ((nrows (1+ (loop for c in contents maximize (table-content-row c))))
  -          (ncols (1+ (loop for c in contents maximize (table-content-col c)))))
  -      (setf array (make-array (list nrows ncols) :initial-element nil))
  -      (dolist (c contents)
  -        (setf (aref array (table-content-row c) (table-content-col c)) c)))))
  +  ((array
  +    :documentation "Two-dimensional array holding the child panes as they are to be arranged."))
  +  ;;
  +  (:documentation
  +   "The table layout implies that each colums has the same width
  +    and each lines has the same height - same rules for max and min -") )
  +
  +(defmethod initialize-instance :after ((pane table-pane) &key contents &allow-other-keys)
  +  ;; check the format: contents should be list of lists of panes
  +  (unless (and (listp contents)
  +               (every (lambda (x)
  +                        (and (listp x)
  +                             (every #'panep x)))
  +                      contents))
  +    (error "~S option to ~S has bad format; should be a list of lists of panes.~%But its value is ~S."
  +           :contents pane contents))
  +  ;; shovel child panes into the array and adopt them
  +  (let ((nrows (length contents))
  +        (ncols (reduce #'max (mapcar #'length contents)
  +                       :initial-value 0)))
  +    (with-slots (array) pane
  +      (setf array (make-array (list nrows ncols)
  +                              :initial-element nil))
  +      (loop for row in contents 
  +            for i from 0 do
  +         (loop for cell in row
  +               for j from 0 do
  +            (setf (aref array i j) cell)
  +            (sheet-adopt-child pane cell))))))
   
   (dada ((xically horizontally vertically)
          (major   width height)
  
positive.code: ;;
  ;; - RAISED-PANE, where form? --GB
  ;;
  
  ;;; GENERIC FUNCTIONS
  
  
negative.code: 			 standard-extended-input-stream)
    () )
  
  ;;;
  ;;; Utilities 
  ;;;
  
  ;; Since, I hate to duplicate code for HBOX and VBOX, I define this
  ;; evil macro:
  
  