Update of /project/mcclim/cvsroot/mcclim
In directory cl-net:/tmp/cvs-serv11274
Modified Files:
panes.lisp graph-formatting.lisp table-formatting.lisp
Log Message:
Fit space requirements to output history bounding rectangle automatically
after redisplay and drawing of graphs/tables.
--- /project/mcclim/cvsroot/mcclim/panes.lisp 2008/08/21 22:34:29 1.191
+++ /project/mcclim/cvsroot/mcclim/panes.lisp 2008/11/09 19:58:26 1.192
@@ -27,7 +27,7 @@
;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;;; Boston, MA 02111-1307 USA.
-;;; $Id: panes.lisp,v 1.191 2008/08/21 22:34:29 ahefner Exp $
+;;; $Id: panes.lisp,v 1.192 2008/11/09 19:58:26 ahefner Exp $
(in-package :clim-internals)
@@ -2472,7 +2472,8 @@
(pane pane-display-mixin)
&key force-p)
(declare (ignore force-p))
- (invoke-display-function frame pane))
+ (invoke-display-function frame pane)
+ (fit-pane-to-output pane))
(defgeneric pane-double-buffering (pane))
@@ -2965,3 +2966,15 @@
(warn "Are you sure you want to use schedule-timer-event? It probably doesn't work.")
(schedule-event pane (make-instance 'timer-event :token token :sheet pane) delay))
+(defgeneric fit-pane-to-output (pane)
+ (:method (pane) (declare (ignore pane))))
+
+(defmethod fit-pane-to-output ((stream clim-stream-pane))
+ (when (sheet-mirror stream)
+ (let* ((output (stream-output-history stream))
+ (width (bounding-rectangle-max-x output))
+ (height (bounding-rectangle-max-y output)))
+ (change-space-requirements stream
+ :min-width width :min-height height
+ ;;:max-width width :max-height height
+ :width width :height height))))
\ No newline at end of file
--- /project/mcclim/cvsroot/mcclim/graph-formatting.lisp 2007/09/17 19:20:49 1.22
+++ /project/mcclim/cvsroot/mcclim/graph-formatting.lisp 2008/11/09 19:58:26 1.23
@@ -3,7 +3,7 @@
;;; Title: Graph Formatting
;;; Created: 2002-08-13
;;; License: LGPL (See file COPYING for details).
-;;; $Id: graph-formatting.lisp,v 1.22 2007/09/17 19:20:49 crhodes Exp $
+;;; $Id: graph-formatting.lisp,v 1.23 2008/11/09 19:58:26 ahefner Exp $
;;; ---------------------------------------------------------------------------
;;; (c) copyright 2002 by Gilbert Baumann
@@ -188,6 +188,7 @@
(setf (stream-cursor-position stream)
(values (bounding-rectangle-max-x graph-output-record)
(bounding-rectangle-max-y graph-output-record))))
+ (fit-pane-to-output stream)
graph-output-record))))
;;;; Graph Output Records
--- /project/mcclim/cvsroot/mcclim/table-formatting.lisp 2007/07/21 14:17:15 1.40
+++ /project/mcclim/cvsroot/mcclim/table-formatting.lisp 2008/11/09 19:58:26 1.41
@@ -336,7 +336,8 @@
(values (bounding-rectangle-max-x table)
(bounding-rectangle-max-y table)))
(setf (stream-cursor-position stream)
- (values cursor-old-x cursor-old-y))))))
+ (values cursor-old-x cursor-old-y)))))
+ (fit-pane-to-output stream))
;;; Think about rewriting this using a common superclass for row and
;;; column records.