Changeset 12133


Ignore:
Timestamp:
May 27, 2009, 7:19:59 AM (10 years ago)
Author:
rme
Message:

Ensure search files dialog is key when it is first selected (ticket:491).
Save window position of initial search files dialog. Cascade additional
search files dialogs from the topmost one.

Location:
trunk/source/cocoa-ide
Files:
2 edited

Legend:

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

    r12025 r12133  
    111111            (null (setf w (first-window-with-controller-type 'search-files-window-controller))))
    112112      (let* ((wc (make-instance 'search-files-window-controller)))
    113         (setf w (#/window wc)))
     113        (#/showWindow: wc self))
    114114      (#/makeKeyAndOrderFront: w self))))
    115115
  • trunk/source/cocoa-ide/search-files.lisp

    r11973 r12133  
    147147
    148148(objc:defmethod #/init ((self search-files-window-controller))
    149   (#/initWithWindowNibName: self #@"SearchFiles"))
     149  (prog1
     150      (#/initWithWindowNibName: self #@"SearchFiles")
     151    (#/setShouldCascadeWindows: self nil)))
     152
     153(defloadvar *search-files-cascade-point* (ns:make-ns-point 0 0))
     154
     155(objc:defmethod (#/windowDidLoad :void) ((wc search-files-window-controller))
     156  ;; Cascade window from the top left point of the topmost search files window.
     157  (flet ((good-window-p (w)
     158           (and (not (eql w (#/window wc)))
     159                (eql (#/class (#/windowController w))
     160                     (find-class 'search-files-window-controller)))))
     161    (let* ((dialogs (remove-if-not #'good-window-p (gui::windows)))
     162           (top-dialog (car dialogs)))
     163      (if top-dialog
     164        (ns:with-ns-point (zp 0 0)
     165          (setq *search-files-cascade-point*
     166                (#/cascadeTopLeftFromPoint: top-dialog zp))))))
     167  (#/cascadeTopLeftFromPoint: (#/window wc) *search-files-cascade-point*))
    150168
    151169(objc:defmethod (#/awakeFromNib :void) ((wc search-files-window-controller))
Note: See TracChangeset for help on using the changeset viewer.