[mcclim-cvs] CVS mcclim

thenriksen thenriksen at common-lisp.net
Wed Dec 20 22:58:20 UTC 2006


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

Modified Files:
	text-editor-gadget.lisp 
Log Message:
Fixed the `compose-space' method for Drei-based text-editor-panes to
suck less and be more correct. The :nlines value will still not work
properly due to McCLIM layouting brokenness.

Also changed the `text-editor' gadget to use a completely standard
Drei gadget-pane, without minibuffer, scrollbars and anything
else. This is necessary because we need to return the actual pane
object from the function, so we can't wrap it in nice things like
borders, scrollbars or a minibuffer. Use the :drei gadget for the nice
version.


--- /project/mcclim/cvsroot/mcclim/text-editor-gadget.lisp	2006/12/19 04:02:14	1.6
+++ /project/mcclim/cvsroot/mcclim/text-editor-gadget.lisp	2006/12/20 22:58:20	1.7
@@ -97,24 +97,24 @@
          args))
 
 (defmethod compose-space ((pane text-editor-pane) &key width height)
-  (declare (ignore width height))
   (with-sheet-medium (medium pane)
     (let* ((text-style (medium-text-style medium))
-           (tr-height (text-style-height text-style medium))
-           (tr-width (text-style-width text-style medium))
-           (padding (- (bounding-rectangle-width pane)
-                       (stream-text-margin pane))))
+           (line-height (+ (text-style-height text-style medium)
+                           (stream-vertical-spacing pane)))
+           (column-width (text-style-width text-style medium)))
       (with-accessors ((ncolumns text-editor-ncolumns)
                        (nlines text-editor-nlines)) pane
-        (apply #'make-space-requirement
-               (append (when ncolumns
-                         (let ((width (max (+ (* ncolumns tr-width))
-                                           (bounding-rectangle-width (stream-current-output-record  pane)))))
-                           (list :width width :max-width width :min-width width)))
-                       (when nlines
-                         (let ((height (+ (* nlines tr-height) (* 2 padding)
-                                          (stream-vertical-spacing pane))))
-                           (list :height height :max-height height :min-height height)))))))))
+        (apply #'space-requirement-combine* #'(lambda (req1 req2)
+                                                (or req2 req1))
+               (call-next-method)
+               (let ((width (if ncolumns
+                                (+ (* ncolumns column-width))
+                                width))
+                     (height (if nlines
+                                 (+ (* nlines line-height))
+                                 height)))
+                 (list :width width :max-width width :min-width width
+                       :height height :max-height height :min-height height)))))))
 
 (defmethod allocate-space ((pane text-editor-pane) w h)
   (resize-sheet pane w h))
@@ -289,7 +289,4 @@
                                    &rest args &key)
   (if *use-goatee*
       (apply #'make-pane-1 fm frame 'goatee-text-editor-pane args)
-      (apply #'make-pane-1 fm frame :drei
-             :drei-class 'text-editor-pane
-             :minibuffer t
-             args)))
+      (apply #'make-pane-1 fm frame 'text-editor-pane args)))




More information about the Mcclim-cvs mailing list