Changeset main,60
- Timestamp:
- 11/16/2007 09:23:48 PM (19 years ago)
- branch-nick:
- tui
- revision id:
- dsowen@fugue88.ws-20071116212348-g0y85h0so1fralzf
- Location:
- main
- Files:
-
- 5 added
- 3 edited
-
grid/column-formats.lisp (added)
-
grid/column-padding.lisp (added)
-
grid/hash-data.lisp (added)
-
grid/nice-header.lisp (added)
-
grid/row-selectable.lisp (added)
-
grid/package.lisp (modified) (1 diff)
-
grid/test.lisp (modified) (3 diffs)
-
tui.asd (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
main/grid/package.lisp
r57 r60 1 1 (defpackage #:grid 2 2 (:use #:cl #:dso-util #:tui-display-string #:tui-output #:tui-window) 3 (:export #:rows #:header-rows #:columns #:header-columns #:column-width 4 #:item #:uses-display-strings #:row-scroll #:column-scroll 5 #:make-grid #:draw)) 3 (:export 4 5 ;; Model 6 #:rows #:header-rows #:columns #:header-columns #:column-width #:item 7 #:uses-display-strings 8 9 ;; Display 10 #:row-scroll #:column-scroll #:make-grid #:draw 11 12 ;; Extra 13 #:hash-per-row-grid-data 14 #:parse-format-specs #:column-formats 15 #:column-padding #:padding 16 #:nice-header 17 #:row-selectable #:selected-row)) -
main/grid/test.lisp
r57 r60 7 7 8 8 9 (defclass test () ()) 9 (defclass test (nice-header row-selectable column-padding column-formats) 10 ()) 10 11 11 12 (defmethod rows ((gd test)) 10) 12 13 (defmethod header-rows ((gd test))14 1)15 13 16 14 (defmethod columns ((gd test)) 10) … … 19 17 1) 20 18 21 (defmethod column-width ((gd test) column)22 5)23 24 19 (defmethod item ((gd test) row column) 25 20 (assert (and (<= 0 row 9) 26 21 (<= 0 column 9))) 27 (cond 28 ((= row 0) 29 (concatenate 'string "`B`U " (string (aref "*ABCDEFGHI" column)) " `u`b")) 30 ((= column 0) 31 (format nil " `B~A`b " row)) 32 (t 33 (format nil (if (= row column 2) "`R~A,~A`r" "~A,~A") row column)))) 34 35 (defmethod uses-display-strings ((gd test) row column) 36 t) 22 (* (1+ row) (1+ column))) 37 23 38 24 … … 42 28 (refresh screen)) 43 29 30 (defconstant +format+ (first (parse-format-specs '(:number 3)))) 31 (defconstant +formats+ (make-sequence 'vector 10 :initial-element +format+)) 32 44 33 (defun test-draw () 45 (let ((data (make-instance 'test))) 34 (let ((data (make-instance 'test 35 :format-specs +formats+ 36 :column-heads #(" *" " A" " B" " C" " D" 37 " E" " F" " G" " H" 38 " I")))) 39 (setf (selected-row data) 1) 46 40 (with-screen (screen) 47 41 (clear screen) -
main/tui.asd
r54 r60 43 43 (:file "hash-data" 44 44 :depends-on ("model")) 45 (:file "formatted-data" 45 (:file "nice-header" 46 :depends-on ("model")) 47 (:file "row-selectable" 48 :depends-on ("model")) 49 (:file "column-formats" 50 :depends-on ("model")) 51 (:file "column-padding" 46 52 :depends-on ("model")) 47 53 (:file "display"
Note: See TracChangeset
for help on using the changeset viewer.
