Changeset 891
- Timestamp:
- Oct 6, 2004, 3:44:40 PM (20 years ago)
- Location:
- trunk/ccl/examples
- Files:
-
- 3 edited
-
cocoa-editor.lisp (modified) (2 diffs)
-
cocoa-listener.lisp (modified) (1 diff)
-
cocoa-typeout.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/examples/cocoa-editor.lisp
r878 r891 399 399 (defclass hemlock-text-storage (ns:ns-text-storage) 400 400 ((string :foreign-type :id) 401 (edit-count :foreign-type :int)) 401 (edit-count :foreign-type :int) 402 (append-edits :foreign-type :int)) 402 403 (:metaclass ns:+ns-object)) 403 404 … … 535 536 536 537 (define-objc-method ((:void :replace-characters-in-range (:<NSR>ange r) 537 :with-string string) 538 hemlock-text-storage) 539 (let* ((cache (hemlock-buffer-string-cache (send self 'string))) 540 (buffer (if cache (buffer-cache-buffer cache))) 541 (hi::*buffer-gap-context* (hi::buffer-gap-context buffer)) 542 (location (pref r :<NSR>ange.location)) 543 (length (pref r :<NSR>ange.length)) 544 (mark (hi::buffer-%mark buffer)) 545 (point (hi::buffer-point buffer))) 538 :with-string string) 539 hemlock-text-storage) 540 (let* ((cache (hemlock-buffer-string-cache (send self 'string))) 541 (buffer (if cache (buffer-cache-buffer cache))) 542 (hi::*buffer-gap-context* (hi::buffer-gap-context buffer)) 543 (location (pref r :<NSR>ange.location)) 544 (length (pref r :<NSR>ange.length)) 545 (mark (hi::buffer-%mark buffer)) 546 (point (hi::buffer-point buffer)) 547 input-mark) 548 549 ;; 550 ;; special behavior for listener windows. 551 ;; 552 (if (and (> (slot-value self 'append-edits) 0) 553 (progn 554 (setf input-mark (hi::variable-value 'hemlock::buffer-input-mark :buffer buffer)) 555 (not (hi::same-line-p point input-mark)))) 556 (progn 557 ;; 558 ;; move the point to the end of the buffer 559 ;; 560 (setf (hi::buffer-region-active buffer) nil) 561 (move-hemlock-mark-to-absolute-position point cache (hemlock-buffer-length buffer))) 546 562 (cond ((> length 0) 547 (move-hemlock-mark-to-absolute-position mark cache location)548 (move-hemlock-mark-to-absolute-position point cache (+ location length))549 (hemlock::%buffer-activate-region buffer))550 (t551 (move-hemlock-mark-to-absolute-position point cache location)))552 (hi::insert-string point (lisp-string-from-nsstring string))))563 (move-hemlock-mark-to-absolute-position mark cache location) 564 (move-hemlock-mark-to-absolute-position point cache (+ location length)) 565 (hemlock::%buffer-activate-region buffer)) 566 (t 567 (move-hemlock-mark-to-absolute-position point cache location)))) 568 (hi::insert-string point (lisp-string-from-nsstring string)))) 553 569 554 570 -
trunk/ccl/examples/cocoa-listener.lisp
r866 r891 189 189 "Listener-~d" *cocoa-listener-count*))) 190 190 (buffer (hemlock-document-buffer doc))) 191 (setf (slot-value (slot-value self 'textstorage) 'append-edits) 1) 191 192 (send doc :set-file-name (%make-nsstring listener-name)) 192 193 (setf (hi::buffer-pathname buffer) nil -
trunk/ccl/examples/cocoa-typeout.lisp
r876 r891 77 77 :width 600 78 78 :activate nil))) 79 (rlet ((size :<NSS>ize :width 600.0f0 :height 10000.0f0)) 80 (send panel :set-max-size size) 81 (setf (pref size :<NSS>ize.height) 1.0f0) 82 (send panel :set-min-size size)) 79 83 (slet ((bounds (send (send panel 'content-view) 'bounds))) 80 84 (let* ((view (make-instance 'typeout-view :with-frame bounds)))
Note:
See TracChangeset
for help on using the changeset viewer.
