Changeset main,80 for main/widget/textbox.lisp
- Timestamp:
- 12/13/2007 12:47:56 AM (18 years ago)
- branch-nick:
- tui
- revision id:
- dsowen@fugue88.ws-20071213004756-lr4quvaf0hy1zpub
- File:
-
- 1 edited
-
main/widget/textbox.lisp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
main/widget/textbox.lisp
r65 r80 10 10 (defclass textbox (widget scroll insertion-point) 11 11 ((data :initarg :data) 12 (validator :initform 'identity :initarg :validator :reader validator) 12 13 (window :initarg :window) 13 14 (active :type boolean :initform nil))) … … 63 64 64 65 65 (defun create-textbox (parent-window y x data width & key66 (defun create-textbox (parent-window y x data width &rest args &key validator 66 67 (inactive-background '(#\Space 0)) 67 68 (active-background '(#\Space 0))) 69 (declare (ignore validator inactive-background active-background)) 68 70 (let* ((window (tui-window::create-subwindow parent-window 1 width y x)) 69 (inst (make-instance 'textbox 70 :data data 71 :window window 72 :inactive-background inactive-background 73 :active-background active-background))) 71 (inst (apply 'make-instance 'textbox :data data :window window args))) 74 72 (draw inst) 75 73 inst)) … … 123 121 (let ((r (funcall key-callback key))) 124 122 (when r 125 (setf (insertion-point textbox) 0) 126 (return-from activate r))) 123 (let ((q (funcall (validator textbox) (text data)))) 124 (when q 125 (setf (text data) q) 126 (setf (insertion-point textbox) 0) 127 (return-from activate r))))) 127 128 (multiple-value-bind (left right) (split textbox) 128 129 (setf (text data)
Note: See TracChangeset
for help on using the changeset viewer.
