Changeset 12417


Ignore:
Timestamp:
Jul 16, 2009, 6:48:21 PM (10 years ago)
Author:
rme
Message:

In sequence windows (like "Definitions of..."), the return key now
acts as if the user double-clicked the selected row. (ticket:547)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/cocoa-ide/cocoa-utils.lisp

    r12364 r12417  
    99    (dotimes (i c) (setf result (push (#/objectAtIndex: nsa i) result)))
    1010    (reverse result)))
     11
     12(defclass key-select-table-view (ns:ns-table-view)
     13  ()
     14  (:metaclass ns:+ns-object))
     15
     16(objc:defmethod (#/keyDown: :void) ((self key-select-table-view) event)
     17  (let* ((code (#/keyCode event)))
     18    (if (and (>= (#/selectedRow self) 0)
     19             (= code 36)) ; return key
     20      (#/sendAction:to:from: *NSApp* (#/doubleAction self) (#/target self) self)
     21      (call-next-method event))))
    1122
    1223(defclass sequence-window-controller (ns:ns-window-controller)
     
    3647                                        #$NSViewHeightSizable))
    3748    (#/setAutoresizesSubviews: (#/contentView scrollview) t)
    38     (let* ((table-view (make-instance 'ns:ns-table-view)))
     49    (let* ((table-view (make-instance 'key-select-table-view)))
    3950      (#/setDocumentView: scrollview table-view)
    4051      (#/release table-view)
     
    7081(objc:defmethod (#/sequenceDoubleClick: :void)
    7182    ((self sequence-window-controller) sender)
    72   (let* ((n (#/clickedRow sender)))
     83  (let* ((n (#/selectedRow sender)))
    7384    (when (>= n 0)
    7485      (with-slots (sequence result-callback) self
Note: See TracChangeset for help on using the changeset viewer.