Changeset main,26
- Timestamp:
- 11/03/2007 05:27:59 PM (19 years ago)
- branch-nick:
- tui
- revision id:
- dsowen@fugue88.ws-20071103172759-aacwcew0kzliob1n
- Location:
- main/grid
- Files:
-
- 4 edited
-
display.lisp (modified) (1 diff)
-
model.lisp (modified) (1 diff)
-
package.lisp (modified) (1 diff)
-
test.lisp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
main/grid/display.lisp
r22 r26 81 81 82 82 (defun draw-cell (grid row column y x) 83 (with-slots (window) grid 84 (cdk::move-and-add-string window y x (item grid row column)))) 83 (with-slots (data window) grid 84 (let ((text (item data row column))) 85 (unless (uses-display-strings data row column) 86 (setf text (enquote text))) 87 (render text window y x)))) 85 88 86 89 (defun draw-column (grid column x) -
main/grid/model.lisp
r22 r26 36 36 column COLUMN. ROW and COLUMN refer to data rows and columns, not 37 37 character or text rows and columns. Rows and columns are zero-based.")) 38 39 (defgeneric uses-display-strings (grid-data row column) 40 (:documentation 41 "Returns T if the item uses display-strings, or at least has 42 already been properly escaped.") 43 (:method (grid-data row column))) -
main/grid/package.lisp
r22 r26 1 1 (defpackage #:grid 2 (:use #:cl #:d so-util)3 (:export #:rows #:columns #:item #: row-scroll #:column-scroll #:make-grid4 #: draw))2 (:use #:cl #:display-string #:dso-util) 3 (:export #:rows #:columns #:item #:uses-display-strings #:row-scroll 4 #:column-scroll #:make-grid #:draw)) -
main/grid/test.lisp
r22 r26 18 18 (cond 19 19 ((= row 0) 20 ( string (aref "*ABCDEFGHI" column)))20 (concatenate 'string "`B`U " (string (aref "*ABCDEFGHI" column)) " `u`b")) 21 21 ((= column 0) 22 (format nil " ~A" row))22 (format nil " `B~A`b " row)) 23 23 (t 24 (format nil "~A,~A" row column)))) 24 (format nil (if (= row column 2) "`R~A,~A`r" "~A,~A") row column)))) 25 26 (defmethod uses-display-strings ((gd test) row column) 27 t) 25 28 26 29 … … 35 38 (with-screen (screen) 36 39 (clear screen) 37 (with-der-window (window screen 5 1 70 0)40 (with-der-window (window screen 5 16 0 0) 38 41 (let ((grid (make-grid window data widths :header-columns 1 :header-rows 1))) 39 42 (flet ((try (i)
Note: See TracChangeset
for help on using the changeset viewer.
