Changeset 632


Ignore:
Timestamp:
Mar 6, 2004, 11:55:15 PM (21 years ago)
Author:
Gary Byers
Message:

Echo areas on windows. Start the UI here when asked to. Scroll windows.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/examples/cocoa-editor.lisp

    r617 r632  
    685685
    686686
     687(defclass echo-area-view (ns:ns-text-view)
     688    ()
     689  (:metaclass ns:+ns-object))
     690
     691
     692(defun make-echo-area-for-window (w)
     693  (let* ((content-view (send w 'content-view)))
     694    (slet ((bounds (send content-view 'bounds)))
     695      (slet ((frame (ns-make-rect 5.0 5.0 (- (pref bounds :<NSR>ect.size.width) 24.0) 15.0)))
     696        (let* ((echo-area (make-objc-instance 'echo-area-view :with-frame frame)))
     697          (send echo-area :set-autoresizing-mask #$NSViewWidthSizable)
     698          (send content-view :add-subview echo-area)
     699          echo-area)))))
     700               
     701       
    687702(defmethod hemlock-frame-command-info ((w ns:ns-window))
    688703  nil)
     
    690705
    691706(defclass hemlock-frame (ns:ns-window)
    692     ((command-info :initform (hi::make-command-interpreter-info)
     707    ((echo-area-view :foreign-type :id)
     708     (command-info :initform (hi::make-command-interpreter-info)
    693709                   :accessor hemlock-frame-command-info))
    694710  (:metaclass ns:+ns-object))
     
    764780            (get-cocoa-window-flag w :auto-display)
    765781            auto-display)
     782      (setf (slot-value w 'echo-area-view)
     783            (make-echo-area-for-window w))
    766784      (when activate (activate-window w))
    767785      (values w (add-pane-to-window w :reserve-below 20.0)))))
     
    11851203
    11861204
     1205(defun initialize-user-interface ()
     1206  (update-cocoa-defaults)
     1207  (make-editor-style-map))
     1208
     1209(defun hi::scroll-window (textpane n)
     1210  (let* ((textview (text-pane-text-view textpane)))
     1211    (unless (%null-ptr-p textview)
     1212      (if (> n 0)
     1213        (send textview :page-down nil)
     1214        (send textview :page-up nil)))))
     1215
     1216     
     1217
    11871218(provide "COCOA-EDITOR")
Note: See TracChangeset for help on using the changeset viewer.