Changeset 5885
- Timestamp:
- Feb 10, 2007, 9:30:37 PM (18 years ago)
- Location:
- trunk/ccl/examples
- Files:
-
- 3 edited
-
cocoa-editor.lisp (modified) (11 diffs)
-
cocoa-prefs.lisp (modified) (2 diffs)
-
cocoa-typeout.lisp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/examples/cocoa-editor.lisp
r5732 r5885 521 521 buffer)))) 522 522 523 (define-objc-method ((:id :attributes-at-index (#+apple-objc-2.0 :<NSUI>nteger 524 #-apple-objc-2.0 :unsigned index) 523 (define-objc-method ((:id :attributes-at-index (:<NSUI>nteger index) 525 524 :effective-range ((* :<NSR>ange) rangeptr)) 526 525 hemlock-text-storage) … … 816 815 (- index (mark-absolute-position m2))) 817 816 (return-from HANDLED nil)))))))))))) 818 ( objc-message-send-super-stret r (super) "selectionRangeForProposedRange:granularity:"819 :<NSR>ange proposed820 :<NSS>election<G>ranularity g)817 (send-super/stret r 818 :selection-range-for-proposed-range proposed 819 :granularity g) 821 820 #+debug 822 821 (#_NSLog #@"range = %@, proposed = %@, granularity = %d" … … 1060 1059 (let* ((modeline-width (* (pref modeline-frame 1061 1060 :<NSR>ect.size.width) 1062 0.75 e0)))1063 (declare ( single-float modeline-width))1061 0.75f0))) 1062 (declare (type cg-float single-float modeline-width)) 1064 1063 (setf (pref modeline-frame :<NSR>ect.size.width) 1065 1064 modeline-width 1066 (the single-float1065 (the cg-float 1067 1066 (pref scrollbar-frame :<NSR>ect.size.width)) 1068 (- (the single-float1067 (- (the cg-float 1069 1068 (pref scrollbar-frame :<NSR>ect.size.width)) 1070 1069 modeline-width) 1071 (the single-float1070 (the cg-float 1072 1071 (pref scrollbar-frame :<NSR>ect.origin.x)) 1073 (+ (the single-float1072 (+ (the cg-float 1074 1073 (pref scrollbar-frame :<NSR>ect.origin.x)) 1075 1074 modeline-width)) … … 1132 1131 (send pane :set-box-type #$NSBoxPrimary) 1133 1132 (send pane :set-border-type #$NSNoBorder) 1134 (send pane :set-content-view-margins (ns-make-size *text-pane-margin-width* *text-pane-margin-height*))1133 (send pane :set-content-view-margins (ns-make-size (float *text-pane-margin-width* +cgfloat-zero+) (float *text-pane-margin-height* +cgfloat-zero+))) 1135 1134 (send pane :set-title-position #$NSNoTitle)) 1136 1135 pane)) … … 1138 1137 1139 1138 (defun make-scrolling-text-view-for-textstorage (textstorage x y width height tracks-width color) 1140 (slet ((contentrect (ns-make-rect x y width height))) 1139 (slet ((contentrect (ns-make-rect 1140 (float x +cgfloat-zero+) 1141 (float y +cgfloat-zero+) 1142 (float width +cgfloat-zero+) 1143 (float height +cgfloat-zero+)))) 1141 1144 (let* ((scrollview (send (make-objc-instance 1142 1145 'modeline-scroll-view … … 1250 1253 1251 1254 (defun make-echo-area (hemlock-frame x y width height gap-context color) 1252 (slet ((frame (ns-make-rect x y width height))) 1255 (slet ((frame (ns-make-rect (float x +cgfloat-zero+) 1256 (float y +cgfloat-zero+) 1257 (float width +cgfloat-zero+) 1258 (float height +cgfloat-zero+)))) 1253 1259 (let* ((box (make-objc-instance "NSView" 1254 1260 :with-frame frame))) … … 1462 1468 (let* ((window-content-view (send w 'content-view))) 1463 1469 (slet ((window-frame (send window-content-view 'frame))) 1464 (slet ((pane-rect (ns-make-rect 0.0f01465 reserve-below1470 (slet ((pane-rect (ns-make-rect +cgfloat-zero+ 1471 (float reserve-below +cgfloat-zero+) 1466 1472 (pref window-frame :<NSR>ect.size.width) 1467 1473 (- (pref window-frame :<NSR>ect.size.height) (+ reserve-above reserve-below))))) … … 1810 1816 (width (fceiling (* ncols char-width))) 1811 1817 (scrollview (text-pane-scroll-view pane)) 1812 (window (send scrollview 'window))) 1818 (window (send scrollview 'window)) 1819 (has-horizontal-scroller (send scrollview 'has-horizontal-scroller)) 1820 (has-vertical-scroller (send scrollview 'has-vertical-scroller))) 1821 (format t "~& width = ~s, height = ~s" width height) 1813 1822 (rlet ((tv-size :<NSS>ize :height height 1814 1823 :width (+ width (* 2 (send (send tv 'text-container) 1815 1824 'line-fragment-padding))))) 1816 (when (send scrollview 'has-vertical-scroller) 1825 (#_NSLog #@"\ntv-size = %@\n" :address (#_NSStringFromSize tv-size)) 1826 1827 (when has-vertical-scroller 1817 1828 (send scrollview :set-vertical-line-scroll char-height) 1818 1829 (send scrollview :set-vertical-page-scroll +cgfloat-zero+ #|char-height|#)) 1819 (when (send scrollview 'has-horizontal-scroller)1830 (when has-horizontal-scroller 1820 1831 (send scrollview :set-horizontal-line-scroll char-width) 1821 1832 (send scrollview :set-horizontal-page-scroll +cgfloat-zero+ #|char-width|#)) … … 1823 1834 (send (@class ns-scroll-view) 1824 1835 :frame-size-for-content-size tv-size 1825 :has-horizontal-scroller 1826 (send scrollview 'has-horizontal-scroller) 1827 :has-vertical-scroller 1828 (send scrollview 'has-vertical-scroller) 1836 :has-horizontal-scroller has-horizontal-scroller 1837 :has-vertical-scroller has-vertical-scroller 1829 1838 :border-type (send scrollview 'border-type)))) 1839 (#_NSLog #@"\na: sv-size = %@\n" :address (#_NSStringFromSize sv-size)) 1830 1840 (slet ((pane-frame (send pane 'frame)) 1831 1841 (margins (send pane 'content-view-margins))) … … 1835 1845 (incf (pref sv-size :<NSS>ize.width) 1836 1846 (pref margins :<NSS>ize.width)) 1847 (#_NSLog #@"\nb: sv-size = %@\n" :address (#_NSStringFromSize sv-size)) 1837 1848 (send window :set-content-size sv-size) 1838 1849 (send window :set-resize-increments … … 1862 1873 (defmethod textview-background-color ((doc hemlock-editor-document)) 1863 1874 (send (find-class 'ns:ns-color) 1864 :color-with-calibrated-red *editor-background-red-component* 1865 :green *editor-background-green-component* 1866 :blue *editor-background-blue-component* 1867 :alpha *editor-background-alpha-component*)) 1875 :color-with-calibrated-red (float *editor-background-red-component* 1876 +cgfloat-zero+) 1877 :green (float *editor-background-green-component* +cgfloat-zero+) 1878 :blue (float *editor-background-blue-component* +cgfloat-zero+) 1879 :alpha (float *editor-background-alpha-component* +cgfloat-zero+))) 1868 1880 1869 1881 -
trunk/ccl/examples/cocoa-prefs.lisp
r5731 r5885 148 148 (define-objc-method ((:id :init-with-frame (:<NSR>ect frame)) 149 149 prefs-view) 150 (send-super :init-with-frame frame)150 (send-super :init-with-frame frame) 151 151 (slet ((scroll-frame (ns-make-rect (float 20.0f0 +cgfloat-zero+) 152 152 (float 40.0f0 +cgfloat-zero+) … … 211 211 (let* ((panel (new-cocoa-window :class self 212 212 :title "Preferences" 213 :activate nil))) 214 (slet ((bounds (send (send panel 'content-view) 'bounds))) 213 :activate nil)) 214 (view (send panel 'content-view))) 215 (slet ((bounds (send view 'bounds))) 215 216 (let* ((v (make-instance 'prefs-view :with-frame bounds))) 216 217 (send panel :set-content-view v) -
trunk/ccl/examples/cocoa-typeout.lisp
r1178 r5885 47 47 (slet* ((contentsize (send scrollview 'content-size)) 48 48 (text-frame (ns-make-rect 49 0.0f050 0.0f049 +cgfloat-zero+ 50 +cgfloat-zero+ 51 51 (pref contentsize :<NSS>ize.width) 52 52 (pref contentsize :<NSS>ize.height)))) … … 77 77 :width 600 78 78 :activate nil))) 79 (rlet ((size :<NSS>ize :width 600.0f0 :height 10000.0f0)) 79 (rlet ((size :<NSS>ize 80 :width (float 600.0f0 +cgfloat-zero+) 81 :height (float 10000.0f0 +cgfloat-zero+))) 80 82 (send panel :set-max-size size) 81 (setf (pref size :<NSS>ize.height) 1.0f0)83 (setf (pref size :<NSS>ize.height) (float 1.0f0 +cgfloat-zero+)) 82 84 (send panel :set-min-size size)) 83 85 (slet ((bounds (send (send panel 'content-view) 'bounds)))
Note:
See TracChangeset
for help on using the changeset viewer.
