Changeset 811
- Timestamp:
- May 2, 2004, 12:28:06 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/ccl/examples/cocoa-editor.lisp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/examples/cocoa-editor.lisp
r793 r811 538 538 (send-super :set-background-color color)) 539 539 540 ;;; Maybe cause 1 character in the textview to blink (by setting/clearing a541 ;;; temporary attribute) in synch with the insertion point.540 ;;; Maybe cause 1 character in the textview to blink (by drawing an empty 541 ;;; character rectangle) in synch with the insertion point. 542 542 543 543 (define-objc-method ((:void :draw-insertion-point-in-rect (:<NSR>ect r) … … 558 558 (ns-make-range (text-view-blink-location self) 1) 559 559 :actual-character-range (%null-ptr)))) 560 #+debug (#_NSLog #@"Flag = %d " :<BOOL> (if flag #$YES #$NO))560 #+debug (#_NSLog #@"Flag = %d, location = %d" :<BOOL> (if flag #$YES #$NO) :int (text-view-blink-location self)) 561 561 (if flag 562 562 (slet ((rect (send layout … … 576 576 (when (eql (text-view-blink-enabled self) #$YES) 577 577 (setf (text-view-blink-enabled self) #$NO) 578 (let* ((layout (send self 'layout-manager))) 579 (slet ((glyph-range (send layout 580 :glyph-range-for-character-range 581 (ns-make-range (text-view-blink-location self) 582 1) 583 :actual-character-range (%null-ptr)))) 584 (send layout 585 :draw-glyphs-for-glyph-range glyph-range 586 :at-point (send self 'text-container-origin)))))) 578 (unwind-protect 579 (progn 580 (send self 'lock-focus) 581 (let* ((layout (send self 'layout-manager))) 582 (slet ((glyph-range (send layout 583 :glyph-range-for-character-range 584 (ns-make-range (text-view-blink-location self) 585 1) 586 :actual-character-range (%null-ptr)))) 587 (send layout 588 :draw-glyphs-for-glyph-range glyph-range 589 :at-point (send self 'text-container-origin))))) 590 (send self 'unlock-focus)))) 587 591 588 592 (defmethod update-blink ((self hemlock-textstorage-text-view)) … … 601 605 #+debug (#_NSLog #@"enable blink, forward") 602 606 (setf (text-view-blink-location self) 603 ( mark-absolute-position temp)607 (1- (mark-absolute-position temp)) 604 608 (text-view-blink-enabled self) #$YES)))) 605 609 ((eql (hi::previous-character point) #\)) … … 1818 1822 1819 1823 1824 (defun hi::open-document () 1825 (send (send (find-class 'ns:ns-document-controller) 1826 'shared-document-controller) 1827 :perform-selector-on-main-thread (@selector "openDocument:") 1828 :with-object (%null-ptr) 1829 :wait-until-done t)) 1830 1820 1831 (defmethod hi::save-hemlock-document ((self hemlock-editor-document)) 1821 (send self :save-document (%null-ptr))) 1832 (send self 1833 :perform-selector-on-main-thread (@selector "saveDocument:") 1834 :with-object (%null-ptr) 1835 :wait-until-done t)) 1836 1837 1838 (defmethod hi::save-hemlock-document ((self hemlock-editor-document)) 1839 (send self 1840 :perform-selector-on-main-thread (@selector "saveDocumentAs:") 1841 :with-object (%null-ptr) 1842 :wait-until-done t)) 1822 1843 1823 1844 ;;; This needs to run on the main thread.
Note:
See TracChangeset
for help on using the changeset viewer.
