Author: junrue Date: Tue Nov 7 16:02:04 2006 New Revision: 392
Modified: trunk/docs/manual/gfw-symbols.xml trunk/src/uitoolkit/widgets/control.lisp trunk/src/uitoolkit/widgets/label.lisp trunk/src/uitoolkit/widgets/widget-generics.lisp trunk/src/uitoolkit/widgets/widget-utils.lisp Log: text-baseline tweaked such that default is mid-point instead of height
Modified: trunk/docs/manual/gfw-symbols.xml ============================================================================== --- trunk/docs/manual/gfw-symbols.xml (original) +++ trunk/docs/manual/gfw-symbols.xml Tue Nov 7 16:02:04 2006 @@ -2789,7 +2789,7 @@ that correlates to the baseline of the text of the control, if any. For controls in which a text baseline is not meaningful, such as a <reftopic>gfw:label</reftopic> with a <reftopic>gfg:image</reftopic>, - this function returns the control's height. + this function returns half of the control's height. </para> <para role="normal"> By default, Graphic-Forms does not implement this function for
Modified: trunk/src/uitoolkit/widgets/control.lisp ============================================================================== --- trunk/src/uitoolkit/widgets/control.lisp (original) +++ trunk/src/uitoolkit/widgets/control.lisp Tue Nov 7 16:02:04 2006 @@ -210,7 +210,7 @@ (format stream "text baseline: ~a" (text-baseline self))))
(defmethod text-baseline ((self control)) - (gfs:size-height (size self))) + (floor (gfs:size-height (size self)) 2))
(defmethod update-native-style ((self control) flags) (let ((hwnd (gfs:handle self)))
Modified: trunk/src/uitoolkit/widgets/label.lisp ============================================================================== --- trunk/src/uitoolkit/widgets/label.lisp (original) +++ trunk/src/uitoolkit/widgets/label.lisp Tue Nov 7 16:02:04 2006 @@ -195,5 +195,5 @@ (let ((image (image self))) (if image (+ (gfs:size-height (gfg:size image)) b-width) - b-width)) + (floor b-width 2))) (widget-text-baseline self 0))))
Modified: trunk/src/uitoolkit/widgets/widget-generics.lisp ============================================================================== --- trunk/src/uitoolkit/widgets/widget-generics.lisp (original) +++ trunk/src/uitoolkit/widgets/widget-generics.lisp Tue Nov 7 16:02:04 2006 @@ -412,7 +412,7 @@ (:documentation "Sets self's text."))
(defgeneric text-baseline (self) - (:documentation "Returns the y coordinate of the object's text component, if any.")) + (:documentation "Returns the y coordinate of the baseline of self's text component, if any."))
(defgeneric text-for-pasting-p (self) (:documentation "Returns T if the clipboard has data in text format; nil otherwise."))
Modified: trunk/src/uitoolkit/widgets/widget-utils.lisp ============================================================================== --- trunk/src/uitoolkit/widgets/widget-utils.lisp (original) +++ trunk/src/uitoolkit/widgets/widget-utils.lisp Tue Nov 7 16:02:04 2006 @@ -209,17 +209,15 @@ (defun widget-text-baseline (widget top-margin) (let ((size (gfw:size widget)) (b-width (border-width widget)) - (font (gfg:font widget)) - (baseline 0)) + (font (gfg:font widget))) (with-graphics-context (gc widget) (let ((metrics (gfg:metrics gc font))) - (setf baseline (+ b-width - top-margin - (gfg:ascent metrics) - (floor (- (gfs:size-height size) - (+ (gfg:ascent metrics) (gfg:descent metrics))) - 2))))) - baseline)) + (+ b-width + top-margin + (gfg:ascent metrics) + (floor (- (gfs:size-height size) + (+ (gfg:ascent metrics) (gfg:descent metrics))) + 2))))))
(defun check-box-size () (if *check-box-size*
graphic-forms-cvs@common-lisp.net