Changeset 13037


Ignore:
Timestamp:
Oct 17, 2009, 10:09:39 PM (10 years ago)
Author:
gfoy
Message:

mod for syntax-styling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/contrib/foy/window-parking-cm/window-parking.lisp

    r12849 r13037  
    2929(defparameter *window-parker* nil "The window-parker instance.")
    3030(defparameter *window-parking-menu* nil "The window-parking-menu instance.")
     31(defParameter *park-p* t "To park or not to park.")
    3132
    3233;;; ----------------------------------------------------------------------------
     
    246247    (ns:with-ns-rect (r (ps-h-position ps) (ps-v-position ps) (ps-h-dimension ps) (ps-v-dimension ps))
    247248      (#/setFrame:display: window r t))
    248     (#/makeKeyAndOrderFront: window nil)))
     249    (#/makeKeyAndOrderFront: window nil))
     250  (let ((style-screen-function (find-symbol "STYLE-SCREEN" (find-package :sax))))
     251    (when style-screen-function
     252      (let* ((hemlock-view (gui::hemlock-view window))
     253             (text-view (gui::text-pane-text-view (hi::hemlock-view-pane hemlock-view))))
     254        (when text-view
     255          (funcall style-screen-function text-view))))))
    249256
    250257;;; ----------------------------------------------------------------------------
     
    260267
    261268(defMethod park ((wp window-parker) (window parkable-hemlock-frame))
    262   (when (wp-parking-spots wp)
     269  (when (and (wp-parking-spots wp) *park-p*)
    263270    ;; Already parked?
    264271    (let* ((position (position window (wp-parking-spots wp) :key #'ps-tenant))
     
    372379;;; unless the parking-spot is not on screen or the window is already in that location.
    373380(defMethod move-window-to-position ((wp window-parker) window function-key)
    374   (let* ((parking-spot (find function-key (wp-parking-spots wp) :key #'ps-function-key))
    375          (tenant (when parking-spot (ps-tenant parking-spot))))
    376     (cond ((and parking-spot (parking-spot-on-screen-p parking-spot window))
    377            (cond (tenant
    378                   (cond ((eql window tenant)
    379                          (cmenu:echo-msg "Already in parking-spot ~a." function-key))
    380                         (t
    381                          (cond ((modified-p tenant)
    382                                 (cmenu:notify (format nil "First save: ~S. Then try again."
    383                                                       (cmenu:window-path tenant)))
    384                                 (init-parking tenant))
    385                                (t
    386                                 (vacate-current-location wp window)
    387                                 (bump-location-and-set-location-values wp parking-spot window)
    388                                 (#/makeKeyAndOrderFront: window nil)
    389                                 (cmenu:echo-msg "Moved to parking-spot ~a." function-key))))))
    390                  (t
    391                   (vacate-current-location wp window)
    392                   (apply-parking-spot-values parking-spot window)
    393                   (#/makeKeyAndOrderFront: window nil)
    394                   (cmenu:echo-msg "Moved to parking-spot ~a." function-key))))
    395           (t
    396            (if (null parking-spot)
    397              (cmenu:notify (format nil "Parking-spot ~a is not defined." function-key))
    398              (cmenu:notify (format nil "Parking-spot ~a is off screen." function-key)))))))
     381  (when *park-p*
     382    (let* ((parking-spot (find function-key (wp-parking-spots wp) :key #'ps-function-key))
     383           (tenant (when parking-spot (ps-tenant parking-spot))))
     384      (cond ((and parking-spot (parking-spot-on-screen-p parking-spot window))
     385             (cond (tenant
     386                    (cond ((eql window tenant)
     387                           (cmenu:echo-msg "Already in parking-spot ~a." function-key))
     388                          (t
     389                           (cond ((modified-p tenant)
     390                                  (cmenu:notify (format nil "First save: ~S. Then try again."
     391                                                        (cmenu:window-path tenant)))
     392                                  (init-parking tenant))
     393                                 (t
     394                                  (vacate-current-location wp window)
     395                                  (bump-location-and-set-location-values wp parking-spot window)
     396                                  (#/makeKeyAndOrderFront: window nil)
     397                                  (cmenu:echo-msg "Moved to parking-spot ~a." function-key))))))
     398                   (t
     399                    (vacate-current-location wp window)
     400                    (apply-parking-spot-values parking-spot window)
     401                    (#/makeKeyAndOrderFront: window nil)
     402                    (cmenu:echo-msg "Moved to parking-spot ~a." function-key))))
     403            (t
     404             (if (null parking-spot)
     405               (cmenu:notify (format nil "Parking-spot ~a is not defined." function-key))
     406               (cmenu:notify (format nil "Parking-spot ~a is off screen." function-key))))))))
    399407
    400408;;; ----------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.