Changeset 12009


Ignore:
Timestamp:
May 7, 2009, 6:12:21 AM (10 years ago)
Author:
rme
Message:

Custom zoom behavior for editor windows (zoom vertical, then full, then
back to normal). Use the hemlock-editor-window-controller as the window's
delegate (instead of the document object).

File:
1 edited

Legend:

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

    r11971 r12009  
    22742274 
    22752275(defclass hemlock-editor-window-controller (ns:ns-window-controller)
    2276     ()
     2276  ()
    22772277  (:metaclass ns:+ns-object))
     2278
     2279;;; This is borrowed from emacs.  The first click on the zoom button will
     2280;;; zoom vertically.  The second will zoom completely.  The third will
     2281;;; return to the original size.
     2282(objc:defmethod (#/windowWillUseStandardFrame:defaultFrame: #>NSRect)
     2283                ((wc hemlock-editor-window-controller) sender (default-frame #>NSRect))
     2284  (let* ((r (#/frame sender)))
     2285    (if (= (ns:ns-rect-height r) (ns:ns-rect-height default-frame))
     2286      (setf r default-frame)
     2287      (setf (ns:ns-rect-height r) (ns:ns-rect-height default-frame)
     2288            (ns:ns-rect-y r) (ns:ns-rect-y default-frame)))
     2289    r))
    22782290
    22792291(defmethod hemlock-view ((self hemlock-editor-window-controller))
     
    26802692                           'hemlock-editor-window-controller
    26812693                         :with-window window)))
     2694      ;;(#/setDelegate: window self)
     2695      (#/setDelegate: window controller)
    26822696      (#/setDelegate: (text-pane-text-view (slot-value window 'pane)) self)
    26832697      (#/addWindowController: self controller)
Note: See TracChangeset for help on using the changeset viewer.