[mcclim-cvs] CVS mcclim/Drei

thenriksen thenriksen at common-lisp.net
Mon Aug 6 13:19:04 UTC 2007


Update of /project/mcclim/cvsroot/mcclim/Drei
In directory clnet:/tmp/cvs-serv13603/Drei

Modified Files:
	drei-redisplay.lisp drei-clim.lisp 
Log Message:
Fixed the "wandering Drei" input-editor redisplay bug by enforcing the
original coordinates of the Drei instance.


--- /project/mcclim/cvsroot/mcclim/Drei/drei-redisplay.lisp	2007/01/24 10:57:24	1.6
+++ /project/mcclim/cvsroot/mcclim/Drei/drei-redisplay.lisp	2007/08/06 13:19:03	1.7
@@ -79,7 +79,7 @@
 ;; very beginning of the output.
 (defmethod display-drei-contents :before ((stream extended-output-stream) (drei drei-area) syntax)
   (with-new-output-record (stream 'standard-sequence-output-record record)
-    (setf (output-record-position record) (stream-cursor-position stream))))
+    (setf (output-record-position record) (values-list (input-editor-position drei)))))
 
 (defgeneric display-drei-cursor (stream drei cursor syntax)
   (:documentation "The purpose of this function is to display a
@@ -289,7 +289,7 @@
             (cursors drei))
     (with-output-recording-options (stream :record t :draw nil)
       (letf (((stream-current-output-record stream) drei)
-             ((stream-cursor-position stream) (output-record-position drei)))
+             ((stream-cursor-position stream) (values-list (input-editor-position drei))))
         (display-drei-contents stream drei (syntax (buffer drei)))))))
 
 (defmethod replay-output-record :after ((drei drei-area) (stream extended-output-stream) &optional
@@ -315,9 +315,7 @@
   "Adjust the returned offset with the position of the Drei area
 on display."
   (multiple-value-bind (x y height style-width) (call-next-method)
-    (multiple-value-bind (drei-x drei-y) (output-record-position drei)
-      (declare (ignore drei-y))
-      (values (+ x drei-x) y height style-width))))
+    (values (+ x (first (input-editor-position drei))) y height style-width)))
 
 (defun display-drei-area (drei)
   (with-accessors ((stream editor-pane)) drei
--- /project/mcclim/cvsroot/mcclim/Drei/drei-clim.lisp	2007/02/07 12:44:20	1.17
+++ /project/mcclim/cvsroot/mcclim/Drei/drei-clim.lisp	2007/08/06 13:19:03	1.18
@@ -341,13 +341,21 @@
                :documentation "The minimum width of the Drei
 editable area. Should be an integer >= 0 or T, meaning that it
 will extend to the end of the viewport, if the Drei area is in a
-scrolling arrangement."))
+scrolling arrangement.")
+   (%drei-position :accessor input-editor-position
+                   :initarg :input-editor-position
+                   :documentation "The position of the Drei
+editing area in the coordinate system of the encapsulated
+stream. An (X,Y) list, not necessarily the same as the position
+of the associated output record."))
   (:default-initargs :command-executor 'execute-drei-command)
   (:documentation "A Drei editable area implemented as an output
 record."))
 
 (defmethod initialize-instance :after ((area drei-area)
 				       &key)
+  (setf (input-editor-position area)
+        (multiple-value-list (stream-cursor-position (editor-pane area))))
   (tree-recompute-extent area))
 
 (defmethod display-drei ((drei drei-area))




More information about the Mcclim-cvs mailing list