--- a/Label.st Wed Jul 17 14:23:24 1996 +0200
+++ b/Label.st Wed Jul 17 16:04:12 1996 +0200
@@ -19,7 +19,7 @@
category:'Views-Layout'
!
-!Label class methodsFor:'documentation'!
+!Label class methodsFor:'documentation'!
copyright
"
@@ -778,7 +778,7 @@
"
! !
-!Label class methodsFor:'instance creation'!
+!Label class methodsFor:'instance creation'!
form:aForm
"return a new Label showing a form.
@@ -794,7 +794,7 @@
^ (self in:aView) form:aForm
! !
-!Label class methodsFor:'defaults'!
+!Label class methodsFor:'defaults'!
defaultExtent
"return the default extent of my instances.
@@ -1314,7 +1314,7 @@
computeLabelSize
"compute the extent needed to hold the label; aForm or aString"
- |numberOfLines textHeight textWidth b|
+ |numberOfLines textHeight textWidth b max|
logo isNil ifTrue:[^ self].
@@ -1362,13 +1362,23 @@
] ifFalse:[
"/ a StringCollection
textHeight := font height * numberOfLines.
- textWidth := font widthOf:logo.
+"/ textWidth := font widthOf:logo.
+
+ textWidth := 0.
+ logo do:[:line |
+ |this|
+
+ line notNil ifTrue:[
+ this := line asString widthOn:self.
+ (this > textWidth) ifTrue:[textWidth := this]
+ ]
+ ].
].
labelWidth := textWidth + (hSpace * 2).
labelHeight := textHeight + (vSpace * 2)
- "Modified: 5.6.1996 / 20:34:52 / cg"
+ "Modified: 17.7.1996 / 14:33:10 / cg"
!
getLabelFromModel
@@ -1595,8 +1605,8 @@
]
! !
-!Label class methodsFor:'documentation'!
+!Label class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/Label.st,v 1.65 1996-06-05 18:36:09 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/Label.st,v 1.66 1996-07-17 14:04:12 cg Exp $'
! !