Changeset main,63


Ignore:
Timestamp:
11/17/2007 12:40:30 AM (19 years ago)
Author:
David Owen <dsowen@…>
branch-nick:
tui
revision id:
dsowen@fugue88.ws-20071117004030-ov0o4jfbzl3b9vup
Message:

Allow for other callback-functions on ACTIVATE.

Location:
main
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/form.lisp

    r47 r63  
    226226
    227227
    228 (defmethod activate ((form form) &optional (callback 'nothing))
     228(defmethod activate ((form form) &key (key-callback 'nothing) &allow-other-keys)
    229229  (with-slots (peers) form
    230230    (flet ((callback (key)
    231231             (if (member key '(#\Return #\Newline #\Tab :key-btab))
    232232                 key
    233                  (funcall callback key))))
     233                 (funcall key-callback key))))
    234234      (let ((focus 0)
    235235            (n (length peers)))
     
    237237           (ensure-widget-visible form focus)
    238238           (refresh form)
    239            (let ((key (activate (aref peers focus) #'callback)))
     239           (let ((key (activate (aref peers focus) :key-callback #'callback)))
    240240             (case key
    241241               ((#\Return #\Newline #\Tab)
  • main/widget/generic.lisp

    r46 r63  
    4343(defgeneric draw (widget))
    4444
    45 (defgeneric activate (widget &optional callback))
     45(defgeneric activate (widget &key key-callback &allow-other-keys))
  • main/widget/label.lisp

    r46 r63  
    2929(defmethod destroy ((label label)))
    3030
    31 (defmethod activate ((label label) &optional callback)
    32   (declare (ignore callback))
    33   #\Tab)
     31(defmethod activate ((label label) &key &allow-other-keys)
     32   #\Tab)
  • main/widget/numberbox.lisp

    r46 r63  
    4343
    4444
    45 (defmethod activate :around ((numberbox numberbox)
    46                              &optional (callback 'nothing))
     45(defmethod activate ((numberbox numberbox) &key (key-callback 'nothing)
     46                     &allow-other-keys)
    4747  (with-slots (data) numberbox
    4848    (with-slots (edit) data
    4949      (setf edit t)
    5050      (setf (insertion-point numberbox) :end)
    51       (let ((r (call-next-method numberbox callback)))
     51      (let ((r (call-next-method numberbox key-callback)))
    5252        (setf edit nil)
    5353        (setf (insertion-point numberbox) 0)
  • main/widget/textbox.lisp

    r46 r63  
    8989
    9090
    91 (defmethod activate ((textbox textbox) &optional (callback 'nothing))
     91(defmethod activate ((textbox textbox) &key (key-callback 'nothing)
     92                     &allow-other-keys)
    9293  (with-slots (data window active) textbox
    9394    (setf active t)
     
    119120                   (if (or (keywordp key)
    120121                           (member key '(#\Return #\Newline #\Tab #\Esc)))
    121                        (let ((r (funcall callback key)))
     122                       (let ((r (funcall key-callback key)))
    122123                         (when r
    123124                           (setf (insertion-point textbox) 0)
Note: See TracChangeset for help on using the changeset viewer.