/[mcclim]/mcclim/input-editing-drei.lisp
ViewVC logotype

Diff of /mcclim/input-editing-drei.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by thenriksen, Wed Nov 8 01:18:22 2006 UTC revision 1.2 by thenriksen, Mon Nov 20 09:00:56 2006 UTC
# Line 190  activated with GESTURE")) Line 190  activated with GESTURE"))
190    
191  (defmethod input-editing-stream-bounding-rectangle ((stream standard-input-editing-stream))  (defmethod input-editing-stream-bounding-rectangle ((stream standard-input-editing-stream))
192    (bounding-rectangle* (drei:drei-instance stream)))    (bounding-rectangle* (drei:drei-instance stream)))
193    
194    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
195    ;;;
196    ;;; Presentation type history support
197    ;;;
198    ;;; Presentation histories are pretty underspecified, so we have to
199    ;;; rely on internal features and implement input-editor support in
200    ;;; CLIM-INTERNALS (Goatee does the same trick).
201    
202    (defun history-yank (stream input-buffer gesture numeric-argument)
203      (let* ((accepting-type *active-history-type*)
204             (history (and accepting-type
205                           (presentation-type-history accepting-type))))
206        (when history
207          (multiple-value-bind (object type)
208              (presentation-history-head history accepting-type)
209            (presentation-replace-input stream object type (stream-default-view stream))))))
210    
211    (defun history-yank-next (stream input-buffer gesture numeric-argument)
212      (let* ((accepting-type *active-history-type*)
213             (history (and accepting-type
214                           (presentation-type-history accepting-type))))
215        (when history
216          (multiple-value-bind (object type)
217              (presentation-history-next history accepting-type)
218            (when type
219              (presentation-replace-input stream object type (stream-default-view stream)))))))
220    
221    (defun history-yank-previous (stream input-buffer gesture numeric-argument)
222      (let* ((accepting-type *active-history-type*)
223             (history (and accepting-type
224                           (presentation-type-history accepting-type))))
225        (when history
226          (multiple-value-bind (object type)
227              (presentation-history-previous history accepting-type)
228            (when type
229              (presentation-replace-input stream object type (stream-default-view stream)))))))
230    
231    (add-input-editor-command '((#\y :control :meta)) 'history-yank)
232    
233    (add-input-editor-command '((#\p :meta)) 'history-yank-next)
234    
235    (add-input-editor-command '((#\n :meta)) 'history-yank-previous)

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.5