Ignore:
Timestamp:
11/15/2007 09:11:06 PM (19 years ago)
Author:
David Owen <dsowen@…>
branch-nick:
tui
revision id:
dsowen@fugue88.ws-20071115211106-ix3zpfhce07h8wg8
Message:

Updated grid.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/grid/display.lisp

    r39 r53  
    1616  (make-instance 'grid
    1717                 :data data
    18                  :column-widths column-widths
     18                 :column-widths (coerce column-widths 'vector)
    1919                 :header-rows header-rows
    2020                 :header-columns header-columns
     
    6262    (let ((text (item grid row column))
    6363          (x (column-offset grid column)))
    64       (cdk::move-and-add-string main-window row x text))))
     64      (move-and-add-string main-window row x text))))
    6565
    6666(defun draw-header-top-item (grid row column)
     
    6868    (let ((text (item grid row column))
    6969          (x (column-offset grid column)))
    70       (cdk::move-and-add-string main-window row x text))))
     70      (move-and-add-string main-window row x text))))
    7171
    7272(defun draw-item (grid row column)
     
    7676          (y (+ row y-scroll)))
    7777      (let ((x (+ column-offset x-scroll)))
    78         (cdk::move-and-add-string window y x text)))))
     78        (move-and-add-string window y x text)))))
    7979
    8080;;;; ------------------------------------------------- ;;;;
     
    9191    (dotimes (i header-rows)
    9292      (draw-cell grid i column i x))
    93     (dotimes (i (- (cdk::getmaxy window) header-rows))
     93    (dotimes (i (- (size window) header-rows))
    9494      (let* ((y (+ i header-rows))
    9595             (row (+ y row-scroll)))
     
    100100(defun draw (grid)
    101101  (with-slots (data column-widths header-columns window column-scroll) grid
    102     (cdk::c-erase-window window)
     102    (erase window)
    103103    (let ((x 0))
    104104      (dotimes (i header-columns)
     
    107107      (do ((i (+ header-columns column-scroll) (incf i)))
    108108          ((or (>= i (columns data))
    109                (> x (cdk::getmaxx window))))
     109               (> x (nth-value 1 (size window)))))
    110110        (draw-column grid i x)
    111111        (incf x (svref column-widths i))))))
     
    115115(defmethod max-row-scroll ((grid grid))
    116116  (with-slots (data header-rows window) grid
    117     (max 0 (- (rows data) (cdk::getmaxy window)))))
     117    (max 0 (- (rows data) (size window)))))
    118118
    119119(defmethod (setf row-scroll) :around (i (grid grid))
Note: See TracChangeset for help on using the changeset viewer.