Changeset 12168
- Timestamp:
- Jun 1, 2009, 2:20:47 AM (12 years ago)
- Location:
- trunk/source/cocoa-ide
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/cocoa-ide/cocoa-editor.lisp
r12151 r12168 1262 1262 (setq s (lisp-string-from-nsstring s)) 1263 1263 (ui-object-eval-selection *NSApp* (list package-name pathname s)))))) 1264 1265 (objc:defmethod (#/evalAll: :void) ((self hemlock-text-view) sender) 1266 (declare (ignore sender)) 1267 (let* ((buffer (hemlock-buffer self)) 1268 (package-name (hi::variable-value 'hemlock::current-package :buffer buffer)) 1269 (pathname (hi::buffer-pathname buffer)) 1270 (s (lisp-string-from-nsstring (#/string self)))) 1271 (ui-object-eval-selection *NSApp* (list package-name pathname s)))) 1264 1272 1265 1273 (objc:defmethod (#/loadBuffer: :void) ((self hemlock-text-view) sender) … … 1553 1561 (funcall (hi::modeline-field-function field) buffer)) 1554 1562 (hi::buffer-modeline-fields buffer))))) 1555 (#/drawAtPoint:withAttributes: ( %make-nsstring string)1563 (#/drawAtPoint:withAttributes: (#/autorelease (%make-nsstring string)) 1556 1564 (ns:make-ns-point 5 1) 1557 1565 text-attributes)))))) 1558 1566 1559 ;;; Draw the underlying buffer's modeline string on a white background1560 ;;; with a bezeled border around it.1561 1567 (objc:defmethod (#/drawRect: :void) ((self modeline-view) (rect :<NSR>ect)) 1562 1568 (declare (ignorable rect)) … … 1567 1573 (#_NSRectFill bounds) 1568 1574 (#/set (#/colorWithCalibratedWhite:alpha: ns:ns-color 0.3333 1.0)) 1575 ;; Draw borders on top and bottom. 1569 1576 (ns:with-ns-rect (r 0 0.5 (ns:ns-rect-width bounds) 0.5) 1570 1577 (#_NSRectFill r)) … … 1580 1587 1581 1588 1582 1583 ;;; Modeline-scroll-view1584 1585 ;;; This is just an NSScrollView that draws a "placard" view (the modeline)1586 ;;; in the horizontal scrollbar. The modeline's arbitrarily given the1587 ;;; leftmost 75% of the available real estate.1588 (defclass modeline-scroll-view (ns:ns-scroll-view)1589 ((modeline :foreign-type :id :accessor scroll-view-modeline)1590 (pane :foreign-type :id :accessor scroll-view-pane))1591 (:metaclass ns:+ns-object))1592 1593 ;;; Making an instance of a modeline scroll view instantiates the1594 ;;; modeline view, as well.1595 1596 (objc:defmethod #/initWithFrame: ((self modeline-scroll-view) (frame :<NSR>ect))1597 (let* ((v (call-next-method frame)))1598 (when v1599 (let* ((modeline (make-instance 'modeline-view)))1600 (#/addSubview: v modeline)1601 (setf (scroll-view-modeline v) modeline)))1602 v))1603 1604 ;;; Scroll views use the "tile" method to lay out their subviews.1605 ;;; After the next-method has done so, steal some room in the horizontal1606 ;;; scroll bar and place the modeline view there.1607 1608 (objc:defmethod (#/tile :void) ((self modeline-scroll-view))1609 (call-next-method)1610 (let* ((modeline (scroll-view-modeline self)))1611 (when (and (#/hasHorizontalScroller self)1612 (not (%null-ptr-p modeline)))1613 (let* ((hscroll (#/horizontalScroller self))1614 (scrollbar-frame (#/frame hscroll))1615 (modeline-frame (#/frame hscroll)) ; sic1616 (modeline-width (* (pref modeline-frame1617 :<NSR>ect.size.width)1618 0.75f0)))1619 (declare (type ns:cgfloat modeline-width))1620 (setf (pref modeline-frame :<NSR>ect.size.width)1621 modeline-width1622 (the ns:cgfloat1623 (pref scrollbar-frame :<NSR>ect.size.width))1624 (- (the ns:cgfloat1625 (pref scrollbar-frame :<NSR>ect.size.width))1626 modeline-width)1627 (the ns:cgfloat1628 (pref scrollbar-frame :<NSR>ect.origin.x))1629 (+ (the ns:cgfloat1630 (pref scrollbar-frame :<NSR>ect.origin.x))1631 modeline-width))1632 (#/setFrame: hscroll scrollbar-frame)1633 (#/setFrame: modeline modeline-frame)))))1634 1635 1636 1637 1589 1638 1590 ;;; A clip view subclass, which exists mostly so that we can track origin changes. … … 2386 2338 ((eql action (@selector #/evalSelection:)) 2387 2339 (not (eql 0 (ns:ns-range-length (#/selectedRange self))))) 2340 ((eql action (@selector #/evalAll:)) 2341 (let* ((doc (#/document (#/windowController (#/window self))))) 2342 (and (not (%null-ptr-p doc)) 2343 (eq (type-of doc) 'hemlock-editor-document)))) 2388 2344 ;; if this hemlock-text-view is in an editor windowm and its buffer has 2389 2345 ;; an associated pathname, then activate the Load Buffer item -
trunk/source/cocoa-ide/ide-contents/Resources/English.lproj/MainMenu.nib/classes.nib
r12014 r12168 32 32 <string>id</string> 33 33 <key>continue</key> 34 <string>id</string> 35 <key>evalAll</key> 34 36 <string>id</string> 35 37 <key>evalSelection</key> -
trunk/source/cocoa-ide/ide-contents/Resources/English.lproj/MainMenu.nib/info.nib
r12014 r12168 12 12 </array> 13 13 <key>IBSystem Version</key> 14 <string>9 G55</string>14 <string>9J61</string> 15 15 <key>targetFramework</key> 16 16 <string>IBCocoaFramework</string>
Note: See TracChangeset
for help on using the changeset viewer.