Changeset 12024


Ignore:
Timestamp:
May 9, 2009, 6:15:53 AM (10 years ago)
Author:
rme
Message:

Clever window cascading for xinspector windows.

File:
1 edited

Legend:

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

    r12006 r12024  
    2929      (with-slots (row-objects) wc
    3030        (setf row-objects (make-instance 'ns:ns-mutable-array))))
     31    ;; We implement custom cascading.
     32    (#/setShouldCascadeWindows: wc nil)
    3133    self))
    3234
     
    4143(objc:defmethod (#/windowDidLoad :void) ((wc xinspector-window-controller))
    4244  (#/setDoubleAction: (table-view wc) (ccl::@selector #/inspect:))
    43   (setq *inspector-cascade-point*
    44         (#/cascadeTopLeftFromPoint: (#/window wc) *inspector-cascade-point*)))
     45  ;; Cascade window from the top left point of the topmost inspector window.
     46  (flet ((good-window-p (w)
     47           (and (not (eql w (#/window wc)))
     48                (eql (#/class (#/windowController w))
     49                     (find-class 'xinspector-window-controller)))))
     50    (let* ((inspectors (remove-if-not #'good-window-p (gui::windows)))
     51           (top-inspector (car inspectors)))
     52      (if top-inspector
     53        (ns:with-ns-point (zp 0 0)
     54          (setq *inspector-cascade-point*
     55                (#/cascadeTopLeftFromPoint: top-inspector zp))))))
     56  (#/cascadeTopLeftFromPoint: (#/window wc) *inspector-cascade-point*))
     57
    4558
    4659(objc:defmethod (#/windowWillClose: :void) ((wc xinspector-window-controller) notification)
Note: See TracChangeset for help on using the changeset viewer.