Changeset 7489


Ignore:
Timestamp:
Oct 22, 2007, 4:28:11 AM (14 years ago)
Author:
rme
Message:

Revise behavior of command-L shortcut.

When no listener is open, command-L will create one.

If a listener window is not key, command-L will bring the closest
listener (in window z-order) to the front and make it key.

If a listener window is already key, command-L will cycle between
other open listeners. If there are no other open listeners, it
will just beep.

Location:
trunk/ccl/cocoa-ide
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/cocoa-ide/Clozure CL.app/Contents/Resources/English.lproj/MainMenu.nib/classes.nib

    r7478 r7489  
    3939                                <key>restarts</key>
    4040                                <string>id</string>
     41                                <key>showListener</key>
     42                                <string>id</string>
    4143                                <key>showProcessesWindow</key>
    4244                                <string>id</string>
  • trunk/ccl/cocoa-ide/Clozure CL.app/Contents/Resources/English.lproj/MainMenu.nib/info.nib

    r7478 r7489  
    99        <key>IBOpenObjects</key>
    1010        <array>
    11                 <integer>405</integer>
     11                <integer>24</integer>
    1212        </array>
    1313        <key>IBSystem Version</key>
  • trunk/ccl/cocoa-ide/cocoa-listener.lisp

    r7348 r7489  
    450450          ((eql action (@selector #/revertDocumentToSaved:))
    451451           (values t nil))
    452           ((eql action (@selector #/makeKeyAndOrderFront:))
    453            (let* ((target (#/target item))
    454                   (window (cocoa-listener-process-window process)))
    455              (if (eql target window)
    456                (progn
    457                  (#/setKeyEquivalent: item #@"L")
    458                  (#/setKeyEquivalentModifierMask: item #$NSCommandKeyMask))
    459                (#/setKeyEquivalent: item #@""))
    460              (values t t)))
    461452          ((eql action (@selector #/interrupt:)) (values t t))
    462453          ((eql action (@selector #/continue:))
     
    552543        (hi::send-string-to-listener-process target-listener string :package package :path path)))))
    553544
    554 ;;; Give the windows menu item for the top listener a command-key
    555 ;;; equivalent of cmd-L.  Remove command-key equivalents from other windows.
    556 ;;; (There are probably other ways of doing this.)
    557 (objc:defmethod (#/validateMenuItem: :<BOOL>) ((self hemlock-listener-frame)
    558                                                item)
    559   (let* ((action (#/action item)))
    560     (when (eql action (@selector #/makeKeyAndOrderFront:))
    561       (let* ((target (#/target item)))
    562         (when (eql target self)
    563           (let* ((top-doc (#/topListener hemlock-listener-document))
    564                  (our-doc (#/document (#/windowController self))))
    565             (if (eql our-doc top-doc)
    566               (progn
    567                 (#/setKeyEquivalent: item #@"l")
    568                 (#/setKeyEquivalentModifierMask: item #$NSCommandKeyMask))
    569               (#/setKeyEquivalent: item #@"")))))))
    570   (call-next-method item))
    571 
    572 
    573 
    574545
    575546       
  • trunk/ccl/cocoa-ide/cocoa.lisp

    r7483 r7489  
    8787   t))
    8888
     89(objc:defmethod (#/showListener: :void) ((self lisp-application-delegate)
     90                                        sender)
     91  (declare (ignore sender))
     92  (let* ((all-windows (#/orderedWindows *NSApp*))
     93         (key-window (#/keyWindow *NSApp*))
     94         (listener-windows ())
     95         (top-listener nil))
     96    (dotimes (i (#/count all-windows))
     97      (let* ((w (#/objectAtIndex: all-windows i))
     98             (wc (#/windowController w)))
     99        (when (eql (#/class wc) hemlock-listener-window-controller)
     100          (push w listener-windows))))
     101    (setq listener-windows (nreverse listener-windows))
     102    (setq top-listener (car listener-windows))
     103    (cond
     104     ((null listener-windows)
     105      (#/newListener: self +null-ptr+))
     106     ((eql key-window top-listener)
     107      ;; The current window is a listener.  If there is more than
     108      ;; one listener, bring the rear-most forward.
     109      (let* ((w (car (last listener-windows))))
     110        (if (eql top-listener w)
     111          (#_NSBeep)
     112          (#/makeKeyAndOrderFront: w +null-ptr+))))
     113     (t
     114      (#/makeKeyAndOrderFront: (car listener-windows) +null-ptr+)))))
     115 
    89116(defloadvar *processes-window-controller* nil)
    90117
Note: See TracChangeset for help on using the changeset viewer.